BufferPolylineCollection

Collection of polylines held in ArrayBuffer storage for performance and memory optimization.

Default buffer memory allocation is arbitrary, and collections cannot be resized, so specific per-buffer capacities should be provided in the collection constructor when available.

new Cesium.BufferPolylineCollection()

Example:
const collection = new BufferPolylineCollection({
  primitiveCountMax: 1024,
  vertexCountMax: 4096,
});

const polyline = new BufferPolyline();

// Create a new polyline, temporarily bound to 'polyline' local variable.
collection.add({
  positions: new Float64Array([ ... ]),
  color: Color.WHITE,
}, polyline);

// Iterate over all polylines in collection, temporarily binding 'polyline'
// local variable to each, and updating polyline color.
for (let i = 0; i < collection.primitiveCount; i++) {
  collection.get(i, polyline);
  polyline.setColor(Color.RED);
}
Experimental

This feature is not final and is subject to change without Cesium's standard deprecation policy.

See:

Extends

Methods

Adds a new polyline to the collection, with the specified options. A BufferPolyline instance is linked to the new polyline, using the 'result' argument if given, or a new instance if not. For repeated calls, prefer to reuse a single BufferPolyline instance rather than allocating a new instance on each call.
Name Type Description
options BufferPolylineOptions
result BufferPolyline
Returns:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.