ContourLayer 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 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 ContourLayer class takes an array of ContourLine and organizes them and creates non-overlapping polygon to represent each contour area.

Constructor

ContourLayer(contourLines: ContourLine[], options?: ContourLayerOptions)

Methods

Name Return Type Description
clear() Clears all data on the contour layer.
getContourLines() ContourLine[] Gets the contour lines of this layer.
getContourPolygons() Polygon[] Gets the polygons that were generated from the contour lines in this layer.
getOptions() ContourLayerOptions Retrieves the options of this contour layer.
getVisible() boolean Gets a boolean that indicates if the layer is visible or not.
getZIndex() number Gets the zIndex of the layer.
setContourLines(contourLines: ContourLine[]) Sets the contour lines used to calculate the polygon areas of this layer.
setOptions(options: ContourLayerOptions) Sets the options of the contour layer.
setVisible(show: boolean) Sets the visibility of the layer.
setZIndex(idx: number) Sets the zIndex of the layer. See also: zIndexing in Bing Maps V8

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 contour line 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 contour line in the layer.
mousedown MouseEventArgs Occurs when the left mouse button is pressed or a touch start event occurs on a contour line in the layer.
mouseover MouseEventArgs Occurs when the mouse cursor moves over top of the area covered by a contour line in the layer.
mouseout MouseEventArgs Occurs when the mouse cursor moves out of the area covered by a contour line in the layer.
mouseup MouseEventArgs Occurs when the left mouse button is lifted up or when the touch end event occurs on a contour line 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 contour line in the layer.