PointPrimitiveCollection
A renderable collection of points.
Points are added and removed from the collection using PointPrimitiveCollection.add and PointPrimitiveCollection.remove.
// Create a pointPrimitive collection with two points
const points = scene.primitives.add(new PointPrimitiveCollection());
points.add({
position : new Cartesian3(1.0, 2.0, 3.0),
color : Color.YELLOW
});
points.add({
position : new Cartesian3(4.0, 5.0, 6.0),
color : Color.CYAN
});
See also
Properties
The point blending option. The default is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent, setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
This property is for debugging only; it is not for production use nor is it optimized.
Returns the number of points in this collection. This is commonly used with PointPrimitiveCollection.get to iterate over all the points in the collection.
The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates. When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates. Local reference frames can be used by providing a different transformation matrix, like that returned by Transforms.eastNorthUpToFixedFrame.
Functions
Creates and adds a point with the specified initial properties to the collection. The added point is returned so it can be modified or removed from the collection later.
Check whether this collection contains a given point.
Returns the point in the collection at the specified index. Indices are zero-based and increase as points are added. Removing a point shifts all points after it to the left, changing their indices. This function is commonly used with PointPrimitiveCollection.length to iterate over all the points in the collection.
Returns true if this object was destroyed; otherwise, false.
Removes a point from the collection.