收集在 ArrayBuffer 存储中保存的多线,用于性能和内存优化.

Default buffer memory allocation is arbitrary, and collections cannot be resized, 因此,收集中应提供具体的每缓冲能力 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

add(options, result)BufferPolyline

在收藏中添加一条新的多线,并附带指定的选项。 A级 BufferPolyline instance is linked to the new polyline, using 如果给出了“ 结果” 参数, 或者没有给出新实例 。 对重复 调用,更喜欢重用单个缓冲Polyline实例而不是 每次通话都分配一个新实例.
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.