EntityCluster

new Cesium.EntityCluster(options)

定义如何聚集屏幕空间对象(公告牌、点、标签)。
Name Type Description
options Object optional 具有以下属性的对象:
Name Type Default Description
enabled Boolean false optional 是否启用群集。
pixelRange Number 80 optional 扩展屏幕空间边界框的像素范围。
minimumClusterSize Number 2 optional 可群集的屏幕空间对象的最小数量。
clusterBillboards Boolean true optional 是否将一个实体的广告牌聚集在一起。
clusterLabels Boolean true optional 是否为一个实体的一个标签。
clusterPoints Boolean true optional 是否聚集实体的点。
Demo:

Members

clusterBillboards : Boolean

获取或设置是否启用群集公告牌实体。
获取将在显示新群集时引发的事件。事件侦听器的签名是EntityCluster.newClusterCallback

clusterLabels : Boolean

获取或设置是否启用群集标签实体。

clusterPoints : Boolean

获取或设置是否启用群集点实体。
获取或设置是否启用群集。

minimumClusterSize : Number

获取或设置可群集的屏幕空间对象的最小数目。

pixelRange : Number

获取或设置用于扩展屏幕空间边框的像素范围。

Methods

销毁此对象持有的WebGL资源。销毁一个对象允许确定性 释放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

Cesium.EntityCluster.newClusterCallback(clusteredEntities, cluster)

用于设置群集样式的事件侦听器函数。
Name Type Description
clusteredEntities Array.<Entity> 集群中包含的实体数组。
cluster Object 包含公告牌、标签和点属性的对象。值与 billboard、label和point实体,但必须是ConstantProperty的值。
Example:
// The default cluster values.
dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {
    cluster.label.show = true;
    cluster.label.text = entities.length.toLocaleString();
});