English中文

BufferPolylineCollection

ArrayBuffer 存储中保存的折线集合,用于性能和内存优化。 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()

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

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

// Create a new polyline, temporarily bound to 'polyline' local variable.
collection.add({
  positions: new Float64Array([ ... ]),
  material,
}, polyline);

// Iterate over all polylines in collection, temporarily binding 'polyline'
// local variable to each, and updating polyline material.
for (let i = 0; i < collection.primitiveCount; i++) {
  collection.get(i, polyline);
  polyline.setMaterial(material);
}
实验性 Experimental

此功能不是最终版本,可能会在没有 Cesium 标准弃用政策的情况下进行更改。 This feature is not final and is subject to change without Cesium's standard deprecation policy.

另见: See:

继承 Extends

方法 Methods

使用指定的选项将新的折线添加到集合中。一个 Adds a new polyline to the collection, with the specified options. A BufferPolyline 实例链接到新的折线,如果给定则使用“结果”参数,如果没有则使用新实例。对于重复调用,最好重用单个 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.
名称 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.