GeoXmlLayer 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.

A layer that loads and renders geospatial XML data on the map.

Constructor

GeoXmlLayer(dataSource?: string or ArrayBuffer, isUrl?: boolean, options?: GeoXmlLayerOptions)

Properties

Name Type Description
metadata object Optional property to store any additional metadata for this layer.

Methods

Name Return Type Description
clear() Removes all the data in the layer.
dispose() Cleans up any resources this object is consuming.
getDataSource() string or ArrayBuffer Returns the data source used by the layer.
getDataSet() GeoXmlDataSet Returns the data set that ws extracted from the data source.
getOptions() GeoXmlLayerOptions Returns the options used by the GeoXmlLayer.
getVisible() boolean Gets a value indicating whether the layer is visible or not.
setDataSource(dataSource: string *or* ArrayBuffer, isUrl: boolean) Sets the data source to render in the GeoXmlLayer.
setOptions(options: GeoXmlLayerOptions) Sets the options used for loading and rendering data into the GeoXmlLayer.
setVisible(value: boolean) Sets whether the layer is visible or not.

Events

The GeoXmlLayer class allows you to add events which are triggered when interacting with the IPimitive shapes that are in the layer. The benefit of this is that you only need to add the event on the layer and not on each individual shape. This results in less memory being used by the application and slightly faster response times by the events. Events are not added to Ground or Screen Overlays.

Name Arguments Description
click MouseEventArgs Occurs when the mouse is used to click the map or when a touch end event occurs on an IPrimitive shape in the layer.
dblclick MouseEventArgs Occurs when the mouse is used to double click the map or when a touch end event occurs on an IPrimitive shape in the layer.
mousedown MouseEventArgs Occurs when the left mouse button is pressed or a touch start event occurs on an IPrimitive shape in the layer.
mouseover MouseEventArgs Occurs when the mouse cursor moves over top of the area covered by an IPrimitive shape in the layer.
mouseout MouseEventArgs Occurs when the mouse cursor moves out of the area covered by an IPrimitive shape in the layer.
mouseup MouseEventArgs Occurs when the left mouse button is lifted up or when the touch end event occurs on an IPrimitive shape 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 an IPrimitive shape in the layer.