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(options)

Name Type Description
options object optional
Name Type Default Description
modelMatrix Matrix4 Matrix4.IDENTITY optional Transforms geometry from model to world coordinates.
primitiveCountMax number BufferPrimitiveCollection.DEFAULT_CAPACITY optional
vertexCountMax number BufferPrimitiveCollection.DEFAULT_CAPACITY optional
show boolean true optional
positionDatatype ComponentDatatype ComponentDatatype.DOUBLE optional
positionNormalized boolean false optional
allowPicking boolean false optional When true, primitives are pickable with Scene#pick. When false, memory and initialization cost are lower.
boundingVolume BoundingSphere optional Bounding volume, in world space, for the collection.
debugShowBoundingVolume boolean false optional
blendOption BlendOption BlendOption.TRANSLUCENT optional Determines how primitives in the collection are blended with the scene. Must be BlendOption.OPAQUE or BlendOption.TRANSLUCENT; BlendOption.OPAQUE_AND_TRANSLUCENT is not supported.
heightReference HeightReference HeightReference.NONE optional
widthUnits "pixels" | "meters" "pixels" optional Unit of polyline widths in this collection: "pixels" on the screen, or "meters" in world space. A clamped HeightReference measures those meters on the ellipsoid surface, so elevation and terrain slope stretch the drawn width. Widths in meters have an upper limit to reduce discontinuities across tile seams.
Example:
const collection = new BufferPolylineCollection({
  primitiveCountMax: 1024,
  vertexCountMax: 4096,
});

const polyline = new BufferPolyline();
const material = new BufferPolylineMaterial({color: Color.WHITE});

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

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

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

See:

Extends

Members

readonly widthUnits : "pixels"|"meters"

Unit of polyline widths in this collection: "pixels" on the screen, or "meters" in world space, measured on the ellipsoid surface when clamped.

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:

setPositions(positions, primitiveOffset, primitiveCount)

Updates vertex positions over the specified range of primitives. For position-only updates to many primitives, `setPositions()` is more efficient than updating each primitive individually. Argument `positions` must contain the same total number of vertices as the target primitive range; vertices cannot be added/removed by this method.
Name Type Description
positions TypedArray
primitiveOffset number
primitiveCount number
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.