PointPrimitive

internal constructor new Cesium.PointPrimitive()

点通过调用 PointPrimitiveCollection#add 创建并设置其初始属性。请勿直接调用构造函数。
A graphical point positioned in the 3D scene, that is created and rendered using a PointPrimitiveCollection.
Performance:

Reading a property, e.g., PointPrimitive#show, is constant time. Assigning to a property is constant time but results in CPU to GPU traffic when PointPrimitiveCollection#update is called. The per-pointPrimitive traffic is the same regardless of how many properties were updated. If most pointPrimitives in a collection need to be updated, it may be more efficient to clear the collection with PointPrimitiveCollection#removeAll and add new pointPrimitives instead of modifying each one.

Throws:
  • DeveloperError : scaleByDistance.far 必须大于 scaleByDistance.near
  • DeveloperError : translucencyByDistance.far 必须大于 translucencyByDistance.near
  • DeveloperError : distanceDisplayCondition.far 必须大于 distanceDisplayCondition.near
Demo:
See:

Members

获取或设置点的内部颜色。 其中 red、green、blue 和 alpha 分量由 valueredgreenbluealpha 属性表示,如示例 1 所示。这些分量的取值范围为 0.0 (无强度)到 1.0(满强度)。
Examples:
// Example 1. Assign yellow.
p.color = Cesium.Color.YELLOW;
// Example 2. Make a pointPrimitive 50% translucent.
p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);

disableDepthTestDistance : number

获取或设置距相机多远时禁用深度测试,例如用于防止与地形发生裁剪。 当设置为 0 时,始终应用深度测试;当设置为 Number.POSITIVE_INFINITY 时,从不应用深度测试。
Default Value: 0.0
获取或设置控制该点在距相机多远处显示的条件。
Default Value: undefined
获取或设置当点被拾取时返回的用户自定义值。
获取或设置点的轮廓颜色。
获取或设置以像素为单位的轮廓宽度。该宽度会叠加到 pixelSize 上, 从而增大点的总尺寸。
获取或设置以像素为单位的点的内部尺寸。
获取或设置此点的笛卡尔坐标位置。
获取或设置基于点距相机距离计算的近、远缩放属性。 当相机距离落在指定的 NearFarScalar#nearNearFarScalar#far 上下界之间时,点的缩放将在 NearFarScalar#nearValueNearFarScalar#farValue 之间插值。 超出这些范围时,点的缩放将保持在最接近的边界值。该缩放 会乘以 pixelSize 和 outlineWidth 以影响点的总尺寸。如果未定义, scaleByDistance 将被禁用。
Examples:
// Example 1.
// Set a pointPrimitive's scaleByDistance to scale to 15 when the
// camera is 1500 meters from the pointPrimitive and disappear as
// the camera distance approaches 8.0e6 meters.
p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0);
// Example 2.
// disable scaling by distance
p.scaleByDistance = undefined;
确定该点是否显示。使用此属性来隐藏或显示点, 而不是将其从集合中移除后再重新添加。
要应用于此点的 SplitDirection
Default Value: SplitDirection.NONE
获取或设置基于点距相机距离计算的近、远半透明属性。 当相机距离落在指定的 NearFarScalar#nearNearFarScalar#far 上下界之间时,点的半透明度将在 NearFarScalar#nearValueNearFarScalar#farValue 之间插值。 超出这些范围时,点的半透明度将保持在最接近的边界值。如果未定义, translucencyByDistance 将被禁用。
Examples:
// Example 1.
// Set a point's translucency to 1.0 when the
// camera is 1500 meters from the point and disappear as
// the camera distance approaches 8.0e6 meters.
p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
// Example 2.
// disable translucency by distance
p.translucencyByDistance = undefined;

Methods

computeScreenSpacePosition(scene, result)Cartesian2

计算该点原点的屏幕空间位置。 屏幕空间原点为画布的左上角;x 从左向右递增, y 从上向下递增。
Name Type Description
scene Scene 场景。
result Cartesian2 optional 用于存储结果的对象。
Returns:
该点的屏幕空间位置。
Throws:
Example:
console.log(p.computeScreenSpacePosition(scene).toString());

equals(other)boolean

确定该点是否与另一个点相等。如果所有属性均相等,则两点相等。 位于不同集合中的点也可以相等。
Name Type Description
other PointPrimitive optional 用于比较是否相等的点。
Returns:
如果两点相等则返回 true,否则返回 false
需要帮助?获取答案的最快方式是在 Cesium 论坛 上向社区和团队提问。