ClusterLayer Class
Bing
This is the main class that provides the clustering functionality.
ClusterLayer(pushpins: Pushpin[], options?: ClusterLayerOptions)
| Name | Return Type | Description |
|---|---|---|
clear() | Clears all the data in the cluster layer. | |
getDisplayedPushpins() | Pushpin[] | Gets the pushpins that are in the current map view. If clustering is disabled, all pushpins in the clustering layer are returned. |
getOptions() | ClusterLayerOptions | Gets the current options used by the cluster layer. |
getPushpins() | Pushpin[] | Gets all pushpins that are in the layers. |
getClusterPushpinByGridKey(gridKey:number) | ClusterPushpin or Pushpin | Gets the pushpin in the specified cluster grid cell which can be either a ClusterPushpin if there are multiple pushpins in a cell or a single Pushpin. |
getVisible() | boolean | Returns a boolean indicating if the cluster layer is visible or not. |
setOptions(options: ClusterLayerOptions) | Sets the clustering options to use in the layer. | |
setPushpins(pushpins: Pushpin[]) | Sets the array of pushpins that are used in the clustering layer. | |
setVisible(visible: boolean) | Sets the visibility of the cluster layer. |
| Name | Arguments | Description |
|---|---|---|
click | LayerMouseEventArgs | Occurs when the mouse is used to click the map or when a touch end event occurs on a pushpin or cluster in the layer. |
dblclick | LayerMouseEventArgs | Occurs when the mouse is used to double click the map or when a touch end event occurs on a pushpin or cluster in the layer. |
mousedown | LayerMouseEventArgs | Occurs when the left mouse button is pressed or a touch start event occurs on a pushpin or cluster in the layer. |
mouseover | LayerMouseEventArgs | Occurs when the mouse cursor moves over top of the area covered by a pushpin or cluster in the layer. |
mouseout | LayerMouseEventArgs | Occurs when the mouse cursor moves out of the area covered by a pushpin or cluster in the layer. |
mouseup | LayerMouseEventArgs | Occurs when the left mouse button is lifted up or when the touch end event occurs on a pushpin or cluster in the layer. |
rightclick | LayerMouseEventArgs | Occurs when the right mouse button is used to click the map or when a long touch press occurs on a pushpin or cluster in the layer. |
Show: