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

使用示例:
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.

参考:

继承

方法

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.
参数名称 类型 描述信息
options BufferPolylineOptions
result BufferPolyline
返回值: