定义屏幕空间对象(广告牌、点、标签)如何聚集。 Defines how screen space objects (billboards, points, labels) are clustered.
| 名称 Name | 类型 Type | 说明 Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
可选 optional
具有以下属性的对象: An object with the following properties:
|
演示: Demo:
成员 Members
获取或设置是否启用集群广告牌实体。 Gets or sets whether clustering billboard entities is enabled.
clusterEvent : Event.<EntityCluster.newClusterCallback>
获取显示新集群时将引发的事件。事件监听器的签名是 Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is
EntityCluster.newClusterCallback.
获取或设置是否启用聚类标签实体。 Gets or sets whether clustering labels entities is enabled.
获取或设置是否启用聚类点实体。 Gets or sets whether clustering point entities is enabled.
获取或设置是否启用集群。 Gets or sets whether clustering is enabled.
获取或设置可以聚集的屏幕空间对象的最小数量。 Gets or sets the minimum number of screen space objects that can be clustered.
获取或设置像素范围以扩展屏幕空间边界框。 Gets or sets the pixel range to extend the screen space bounding box.
确定是否显示此集合中的实体。 Determines if entities in this collection will be shown.
-
默认值: Default Value:
true
方法 Methods
销毁该对象持有的 WebGL 资源。销毁对象可以确定性地释放 WebGL 资源,而不是依赖垃圾收集器来销毁该对象。 Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.
与使用 WebGL 资源的其他对象不同,该对象可以重复使用。例如,如果从数据源集合中删除数据源并将其添加到另一个数据源集合中。 Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed from a data source collection and added to another.
类型定义 Type Definitions
用于设置集群样式的事件侦听器函数。 A event listener function used to style clusters.
| 名称 Name | 类型 Type | 说明 Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
clusteredEntities |
Array.<Entity> | 集群中包含的实体数组。 An array of the entities contained in the cluster. | ||||||||||||
cluster |
object |
包含代表该实体簇的 Billboard、Label 和 Point 原语的对象。 An object containing the Billboard, Label, and Point primitives that represent this cluster of entities.
|
示例: Example:
// The default cluster values.
dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {
cluster.label.show = true;
cluster.label.text = entities.length.toLocaleString();
});
