ClusterLayerOptions Object

Note

Bing Maps Web Control SDK retirement

Bing Maps Web Control SDK is deprecated and will be retired. Free (Basic) account customers can continue to use Bing Maps Web Control SDK until June 30th, 2025. Enterprise account customers can continue to use Bing Maps Web Control SDK until June 30th, 2028. To avoid service disruptions, all implementations using Bing Maps Web Control SDK will need to be updated to use Azure Maps Web SDK by the retirement date that applies to your Bing Maps for Enterprise account type. For detailed migration guidance, see Migrate from Bing Maps Web Control SDK and Migrate Bing Maps Enterprise applications to Azure Maps with GitHub Copilot.

Azure Maps is Microsoft's next-generation maps and geospatial services for developers. Azure Maps has many of the same features as Bing Maps for Enterprise, and more. To get started with Azure Maps, create a free Azure subscription and an Azure Maps account. For more information about azure Maps, see Azure Maps Documentation. For migration guidance, see Bing Maps Migration Overview.

The following is a list of properties that are available in the ClusterLayerOptions object.

Name Type Description
callback function() A callback function that is fired after the clustering for a map view has completed. This is useful if you want to generate a list of locations based on what is in the current view.
clusteredPinCallback function(pin: ClusterPushpin) A callback function that allows you to process a clustered pushpin before it is added to a layer. This is useful if you want to add events or set style options on the clustered pushpin.
clusteringEnabled boolean Indicates if the layer should cluster the locations or not. Default: true
clusterPlacementType ClusterPlacementType Defines how clusters are positioned on the map. Default: MeanAverage
gridSize number The width and height of the gird cells used for clustering in pixels. Default: 45
layerOffset Point Offsets the placement of clustered pushpins by a set number of pixels. This option is only available when the placement type is set to GridCenter. This is useful if you have multiple cluster layers on the map and you want to offset the clustered pushpins between the layers so that they are visible, otherwise the clusters from the different layers would overlap completely.
visible boolean A boolean indicating if the layer is visible or not.
zIndex number The z-index of the layer. See also: zIndexing in Bing Maps V8