Skip to content

Latest commit

 

History

History
51 lines (42 loc) · 3.77 KB

File metadata and controls

51 lines (42 loc) · 3.77 KB
title description ms.custom ms.date ms.reviewer ms.suite ms.tgt_pltfrm ms.topic ms.assetid caps.latest.revision author ms.author manager ms.service
ClusterLayer Class | Microsoft Docs
Describes the ClusterLayer class, which controls clustering functionality, and provides a description for its constructor, methods, and events.
02/28/2018
article
219249aa-4e2e-45cf-b8fe-e4af9530369f
7
rbrundritt
richbrun
stevelom
bing-maps

ClusterLayer Class

This is the main class that provides the clustering functionality.

Constructor

ClusterLayer(pushpins: Pushpin[], options?: ClusterLayerOptions)

Methods

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.

Events

Name Arguments Description
click MouseEventArgs 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 MouseEventArgs 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 MouseEventArgs Occurs when the left mouse button is pressed or a touch start event occurs on a pushpin or cluster in the layer.
mouseover MouseEventArgs Occurs when the mouse cursor moves over top of the area covered by a pushpin or cluster in the layer.
mouseout MouseEventArgs Occurs when the mouse cursor moves out of the area covered by a pushpin or cluster in the layer.
mouseup MouseEventArgs 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 MouseEventArgs 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.