BufferPointCollection

Collection of points 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.BufferPointCollection(options)

Name Type Description
options object
Name Type Default Description
primitiveCountMax number BufferPrimitiveCollection.DEFAULT_CAPACITY optional
show boolean true optional
debugShowBoundingVolume boolean false optional
Example:
const collection = new BufferPointCollection({primitiveCountMax: 1024});

const point = new BufferPoint();

// Create a new point, temporarily bound to 'point' local variable.
collection.add({
  position: new Cartesian3(0.0, 0.0, 0.0),
  color: Color.WHITE,
}, point);

// Iterate over all points in collection, temporarily binding 'point'
// local variable to each, and updating point color.
for (let i = 0; i < collection.primitiveCount; i++) {
  collection.get(i, point);
  point.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 point to the collection, with the specified options. A BufferPoint instance is linked to the new point, using the 'result' argument if given, or a new instance if not. For repeated calls, prefer to reuse a single BufferPoint instance rather than allocating a new instance on each call.
Name Type Description
options BufferPointOptions
result BufferPoint
Returns:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.