new Cesium.EntityCluster(options)

定义屏幕空间物体(纸板、点、标签)的组合方式.
Name Type Description
options object optional 具有下列属性的天体:
Name Type Default Description
enabled boolean false optional Whether or not to enable clustering.
pixelRange number 80 optional
minimumClusterSize number 2 optional The minimum number of screen space objects that can be clustered.
clusterBillboards boolean true optional Whether or not to cluster the billboards of an entity.
clusterLabels boolean true optional Whether or not to cluster the labels of an entity.
clusterPoints boolean true optional Whether or not to cluster the points of an entity.
show boolean true optional Determines if the entities in the cluster will be shown.
Demo:

Members

clusterBillboards : boolean

获取或设定是否启用集成公告牌实体 .
Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is EntityCluster.newClusterCallback.

clusterLabels : boolean

获取或设定是否启用集群标签实体 .

clusterPoints : boolean

获取或设定是否启用集群点实体 .

enabled : boolean

获取或设定是否启用集群 .

minimumClusterSize : number

获取或设定可以集群的屏幕空间物体的最小数量.

pixelRange : number

获取或设置像素范围以扩展屏幕空间边框.

show : boolean

确定是否显示此收藏中的实体 .
Default Value: true

Methods

destroy()

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic 释放 WebGL 资源,而不是依赖垃圾收集器来摧毁此对象.

与其他使用 WebGL 资源的对象不同,此对象可以重用. 例如,如果数据源被删除 从一个数据源收集并添加到另一个数据源中.

Type Definitions

Cesium.EntityCluster.newClusterCallback(clusteredEntities, cluster)

用于样式集群的事件倾听器函数 .
Name Type Description
clusteredEntities Array.<Entity> 组内包含的一系列实体.
cluster object 包含 Billboard、 标签和点的天体 代表这组实体的原始人.
Name Type Description
billboard Billboard
label Label
point PointPrimitive
Example:
// The default cluster values.
dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {
    cluster.label.show = true;
    cluster.label.text = entities.length.toLocaleString();
});
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.