使用示例:
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.
参考:
继承
方法
add(options, result) → BufferPolyline
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 |
