Jaa


Map Control API Reference for the V8 Web Control

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 Bing Maps V8 web control uses the Microsoft.Maps namespace to expose its API. This namespace has the following static properties and methods:

Static Properties

Name Type Description
ConfigurableMap ConfigurableMap Generate a map using a configuration file. See Configuration Driven Maps framework for more details.
Credentials string The Bing Maps key specified in the map API script URL or used to load the map.

Static Methods

Name Return Type Description
getIsBirdseyeAvailable(loc: Location, heading: Heading or number, callback: function(isAvailable: boolean)) Checks to see if Birdseye imagery is available at a specified location and heading.
loadModule(moduleKey: string or string[], options?: ModuleOptions or function()) Loads the specified registered module, making its functionality available. You can provide the name of a single module or an array of names in. Options or a callback function that is called when the module is loaded can be specified.

To register a custom module, use the registerModule method before calling the loadModule method.
moduleLoaded(moduleKey: string) Signals that the specified module has been loaded and if specified, calls the callback function in loadModule. Call this method at the end of your custom module script.
registerModule(moduleKey: string, scriptURL: string, options: { styleURLs:string[] }) Registers a module with the map control. The name of the module is specified in moduleKey, the module script is defined in scriptURL, and the options provides the location of a *.css file to load with the module.

Tip: To minimize possible conflicts with other custom modules, choose a unique module name (defined in moduleKey). For example, you can use your company name in the name of the module.

Once you have registered a module, you can make its functionality available by loading it using loadModule.

API Components

The following is a list of the core components in the Bing Maps V8 web control. Additional functionalities are also available as modules.

Type Description
AnimatedTileLayer Class Provides a layer which can smoothly animate through an array of tile layer sources.
AnimatedTileLayerOptions Object An object that defines the options for an AnimatedTileLayer Class .
AnimatedFrameEventArgs Object The event arguments for when a layer frame is being loaded in an AnimatedTileLayerOptions Object.
Color Class Utility structure for working with colors across various Map objects.
CustomOverlay Class A class that can be used to create custom rendering layers on the map. These can be static overlays such as custom navigation bars, or dynamic overlays such as custom visualization layers.
CustomOverlayOptions Object Object used to define the settings of a CustomOverlay.
Events Class A static class exposed through the Microsoft.Maps namespace that provides an interface for attaching events to the map, pushpins, polylines, polygons, layers and modules.
GroundOverlay Class A map overlay that binds an image to a bounding box area on the map.
GroundOverlayOptions Object The options that specify how to render a ground overlay on the map.
Heading Enumeration Standard compass headings; north, south, east, west.
Infobox Class Describes the operation of a pop-up user interface.
InfoboxActions Object Object used to define callback actions for an Infobox.
InfoboxEventArgs Object An object that contains information about an infobox event.
InfoboxOptions Object Object used to define default settings and options for an Infobox.
IPrimitive Class An interface in which pushpins, polylines and polygons are derived from.
IPrimitiveChangedEventArgs Object An object that is returned when a changed event occurs on an IPrimitive shape.
LabelOverlay Enumeration Defines how map labels are displayed.
Layer Class An overlay of image-based data on a map.
LayerCollection Class A static class that is exposed through the map.layers property and allows you to add layers such as; data, heat map, and tile layers.
Location Class Represents a geographic location.
LocationRect Class Represents a rectangular geographic area.
Map Class Main object for manipulating a view of a map on a page.
MapOptions Object Initial options for configuring a map.
MapTypeEventArgs Object An object is returned by the map event handler when using the maptypechanged event.
MapTypeId Enumerations Various options for configuring the base map visuals.
ModuleOptions Object Options used for instantiating a module.
MouseEventArgs Object An object that is returned to event handlers when a mouse event is attached to a map, pushpin, polyline, or polygon.
NavigationBarMode Enumeration Used to customize the layout and style of the navigation bar.
NavigationBarOrientation Enumeration Define how the navigation bar controls are laid out.
OverviewMapMode Enumeration Describes how an overview map mode is displayed on a Streetside-based view.
PanoramaInfo Object An object tthat contains information about a streetside scene.
PixelReference Enumeration Describes what a pixel-based reference is relative to on the screen.
Point Object Represents a pixel coordinate.
PointCompression Class A static class that provides a compression algorithm to encodes/decodes a collection of Location objects into a string and back. This algorithm is used for generating a compressed collection of locations for use with the Bing Maps REST Elevation Service. This algorithm is also used for decoding the compressed coordinates returned by the GeoData API.
Polygon Class An enclosed geographic area on a map.
PolygonOptions Object Initial options for creating a map polygon.
Polyline Class A line across geographic points on a map.
PolylineOptions Object Initial options for creating a map polyline.
Pushpin Class A graphical/text representation of a geographic point on a map.
PushpinOptions Object A set of options that define a pushpin on a map.
PyramidTileId Class Additional information about a tile during a TileSource-related operation.
Range Object Used to specify a min and max value range.
StreetsideOptions Object Initial options for configuring a Streetside view.
StylesOptions Object Options for configuring a bulk set of polylines and polygons.
TestDataGenerator Class A static class that makes it easy to generate random test data in the form of colors, locations, pushpins, plylines, polygons, and polygons with holes.
TileLayer Class Represents an overlay of image-based data on a map.
TileLayerOptions Object Options for configuring a tile layer overlay for a map.
TileSource Class Represents a source of URLs for a tile layer.
TileSourceOptions Object Options for configuring the source of URLs used to supply a tile layer overlay on a map.
ViewOptions Object Options for configuring a view of the map.