Defines how screen space objects (billboards, points, labels) are clustered.
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
optional
An object with the following properties:
|
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
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.
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 |
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();
});