BufferPolylineCollection

存储在 ArrayBuffer 中的折线集合,用于性能和内存优化。

默认缓冲内存分配是任意的,且集合无法调整大小, 因此在可用时应在集合构造函数中提供特定的每缓冲容量。

new Cesium.BufferPolylineCollection()

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

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

// 创建新折线,临时绑定到 'polyline' 局部变量。
collection.add({
  positions: new Float64Array([ ... ]),
  material,
}, polyline);

// 遍历集合中的所有折线,将 'polyline' 局部变量临时绑定到每条折线,
// 并更新折线材质。
for (let i = 0; i < collection.primitiveCount; i++) {
  collection.get(i, polyline);
  polyline.setMaterial(material);
}
Experimental

此功能尚未最终确定,可能会在不遵循 Cesium 标准弃用政策的情况下进行更改。

See:

Extends

Methods

向集合添加新折线,并指定选项。 BufferPolyline 实例链接到新折线,使用 'result' 参数(如果提供), 否则使用新实例。对于重复调用,建议重用单个 BufferPolyline 实例, 而不是在每次调用时分配新实例。
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.