PolylineCollection
A renderable collection of polylines.
Polylines are added and removed from the collection using PolylineCollection.add and PolylineCollection.remove.
// Create a polyline collection with two polylines
const polylines = new PolylineCollection();
polylines.add({
positions : Cartesian3.fromDegreesArray([
-75.10, 39.57,
-77.02, 38.53,
-80.50, 35.14,
-80.12, 25.46]),
width : 2
});
polylines.add({
positions : Cartesian3.fromDegreesArray([
-73.10, 37.57,
-75.02, 36.53,
-78.50, 33.14,
-78.12, 23.46]),
width : 4
});
See also
Properties
This property is for debugging only; it is not for production use nor is it optimized.
Returns the number of polylines in this collection. This is commonly used with PolylineCollection.get to iterate over all the polylines in the collection.
The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates. When this is the identity matrix, the polylines 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
Returns the polyline in the collection at the specified index. Indices are zero-based and increase as polylines are added. Removing a polyline shifts all polylines after it to the left, changing their indices. This function is commonly used with PolylineCollection.length to iterate over all the polylines in the collection.
Returns true if this object was destroyed; otherwise, false.
Called when Viewer or CesiumWidget render the scene to get the draw commands needed to render this primitive.