main.cesium.EntityCluster.kt Maven / Gradle / Ivy
// Automatically generated - do not modify!
@file:Suppress(
"NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE",
)
package cesium
/**
* Defines how screen space objects (billboards, points, labels) are clustered.
* @see Online Documentation
*/
@JsName("\$cesium__EntityCluster")
external class EntityCluster {
/**
* Determines if entities in this collection will be shown.
* @see Online Documentation
*/
var show: Boolean
/**
* Gets or sets whether clustering is enabled.
* @see Online Documentation
*/
var enabled: Boolean
/**
* Gets or sets the pixel range to extend the screen space bounding box.
* @see Online Documentation
*/
var pixelRange: Int
/**
* Gets or sets the minimum number of screen space objects that can be clustered.
* @see Online Documentation
*/
var minimumClusterSize: Int
/**
* Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is [EntityCluster.newClusterCallback].
* @see Online Documentation
*/
var clusterEvent: Event
/**
* Gets or sets whether clustering billboard entities is enabled.
* @see Online Documentation
*/
var clusterBillboards: Boolean
/**
* Gets or sets whether clustering labels entities is enabled.
* @see Online Documentation
*/
var clusterLabels: Boolean
/**
* Gets or sets whether clustering point entities is enabled.
* @see Online Documentation
*/
var clusterPoints: Boolean
/**
* 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.
* @see Online Documentation
*/
fun destroy()
}
/**
* A event listener function used to style clusters.
* ```
* // The default cluster values.
* dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {
* cluster.label.show = true;
* cluster.label.text = entities.length.toLocaleString();
* });
* ```
* @param [clusteredEntities] An array of the entities contained in the cluster.
* @param [cluster] An object containing billboard, label, and point properties. The values are the same as
* billboard, label and point entities, but must be the values of the ConstantProperty.
* @see Online Documentation
*/
typealias newClusterCallback = (clusteredEntities: Array, cluster: Any) -> Unit