EntityCluster

new Cesium.EntityCluster(options)

Defines how screen space objects (billboards, points, labels) are clustered.
参数名称 类型 描述信息
options object 可选 An object with the following properties:
参数名称 类型 默认值 描述信息
enabled boolean false 可选 Whether or not to enable clustering.
pixelRange number 80 可选 The pixel range to extend the screen space bounding box.
minimumClusterSize number 2 可选 The minimum number of screen space objects that can be clustered.
clusterBillboards boolean true 可选 Whether or not to cluster the billboards of an entity.
clusterLabels boolean true 可选 Whether or not to cluster the labels of an entity.
clusterPoints boolean true 可选 Whether or not to cluster the points of an entity.
show boolean true 可选 Determines if the entities in the cluster will be shown.
Demo:

成员(属性)

Gets or sets whether clustering billboard entities is enabled.
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.
默认值: true

方法

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.

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.

定义的类型

Cesium.EntityCluster.newClusterCallback(clusteredEntities, cluster)

A event listener function used to style clusters.
参数名称 类型 描述信息
clusteredEntities Array.<Entity> An array of the entities contained in the cluster.
cluster object An object containing the Billboard, Label, and Point primitives that represent this cluster of entities.
参数名称 类型 描述信息
billboard Billboard
label Label
point PointPrimitive
使用示例:
// The default cluster values.
dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {
    cluster.label.show = true;
    cluster.label.text = entities.length.toLocaleString();
});