Map Control API Reference

Bing
 

The Bing Maps V8 web control uses the Microsoft.Maps namespace to expose its API. This namespace has the following static properties and methods:

NameTypeDescription
CredentialsstringThe Bing Maps key specified in the map API script URL or used to load the map.
NameReturn TypeDescription
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.

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

TypeDescription
AnimatedTileLayer ClassProvides a layer which can smoothly animate through an array of tile layer sources.
AnimatedTileLayerOptions ObjectAn object that defines the options for an AnimatedTileLayer Class .
AnimatedFrameEventArgs ObjectThe event arguments for when a layer frame is being loaded in an AnimatedTileLayerOptions Object.
Color ClassUtility structure for working with colors across various Map objects.
CustomOverlay ClassA 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 ObjectObject used to define the settings of a CustomOverlay.
Events ClassA 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 ClassA 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 EnumerationStandard compass headings; north, south, east, west.
Infobox ClassDescribes the operation of a pop-up user interface.
InfoboxActions ObjectObject used to define callback actions for an Infobox.
InfoboxEventArgs ObjectAn object that contains information about an infobox event.
InfoboxOptions ObjectObject used to define default settings and options for an Infobox.
IPrimitive ClassAn interface in which pushpins, polylines and polygons are derived from.
IPrimitiveChangedEventArgs ObjectAn object that is returned when a changed event occurs on an IPrimitive shape.
LabelOverlay EnumerationDefines how map labels are displayed.
Layer ClassAn overlay of image-based data on a map.
LayerCollection ClassA 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 ClassRepresents a geographic location.
LocationRect ClassRepresents a rectangular geographic area.
Map ClassMain object for manipulating a view of a map on a page.
MapOptions ObjectInitial options for configuring a map.
MapTypeEventArgs ObjectAn object is returned by the map event handler when using the maptypechanged event.
MapTypeId EnumerationsVarious options for configuring the base map visuals.
ModuleOptions ObjectOptions used for instantiating a module.
MouseEventArgs ObjectAn object that is returned to event handlers when a mouse event is attached to a map, pushpin, polyline, or polygon.
NavigationBarMode EnumerationUsed to customize the layout and style of the navigation bar.
NavigationBarOrientation EnumerationDefine how the navigation bar controls are laid out.
OverviewMapMode EnumerationDescribes how an overview map mode is displayed on a Streetside-based view.
PanoramaInfo ObjectAn object tthat contains information about a streetside scene.
PixelReference EnumerationDescribes what a pixel-based reference is relative to on the screen.
Point ObjectRepresents a pixel coordinate.
PointCompression ClassA 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 ClassAn enclosed geographic area on a map.
PolygonOptions ObjectInitial options for creating a map polygon.
Polyline ClassA line across geographic points on a map.
PolylineOptions ObjectInitial options for creating a map polyline.
Pushpin ClassA graphical/text representation of a geographic point on a map.
PushpinOptions ObjectA set of options that define a pushpin on a map.
PyramidTileId ClassAdditional information about a tile during a TileSource-related operation.
Range ObjectUsed to specify a min and max value range.
StreetsideOptions ObjectInitial options for configuring a Streetside view.
StylesOptions ObjectOptions for configuring a bulk set of polylines and polygons.
TestDataGenerator ClassA 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 ClassRepresents an overlay of image-based data on a map.
TileLayerOptions ObjectOptions for configuring a tile layer overlay for a map.
TileSource ClassRepresents a source of URLs for a tile layer.
TileSourceOptions ObjectOptions for configuring the source of URLs used to supply a tile layer overlay on a map.
ViewOptions ObjectOptions for configuring a view of the map.
Show: