DataBinningLayer Class

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 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 DataBinningLayer class which makes it easy to create data bins from arrays of pushpins. The generated data bins extend from the polygon class and support all polygon options and events.

Constructor

DataBinningLayer(pushpins?: Pushpin[], options?: DataBinningOptions

Methods

Name Return Type Description
clear() Removes all the data in the layer.
dispose() Cleans up any resources this object is consuming.
getOptions() DataBinningOptions Retrieves the options used by the data binning layer.
getPushpins() Pushpin[] Retrieves all the pushpins that have been passed into the data binning layer.
getPrimitives() DataBinPolygon[] Returns an array containing all the data bin polygons.
getVisible() boolean Gets a value indicating whether the layer is visible or not.
getZIndex() number Gets the zIndex of the layer.
setOptions(options: DataBinningOptions) Sets the options used for calculating and rendering the data bins.
setPushpins(pushpins: Pushpin[]) Sets the array of pushpins that are used to generate the data bins.
setVisible(value: boolean) Sets whether the layer is visible or not.
setZIndex(zIndex: number) Sets the zIndex of the layer. See zIndexing in Bing Maps V8.

Events

The DataBinningLayer extends from the Layer class and allows supports all the same 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 data bin 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 data bin in the layer.
mousedown MouseEventArgs Occurs when the left mouse button is pressed or a touch start event occurs on a data bin in the layer.
mouseover MouseEventArgs Occurs when the mouse cursor moves over top of the area covered by a data bin in the layer.
mouseout MouseEventArgs Occurs when the mouse cursor moves out of the area covered by a data bin in the layer.
mouseup MouseEventArgs Occurs when the left mouse button is lifted up or when the touch end event occurs on a data bin 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 data bin in the layer.