Using the Core Map Control
You are not viewing the latest version of the AJAX control. Bing Maps AJAX V7 is the recommended JavaScript control for Bing Maps. If you need this documentation, it is available in as a CHM or PDF download.
If you do not need enhanced map features, you can improve the performance of your application by using the core version of the map control. This topic includes information about how to load the core map control as well as the map control APIs that are supported in the core version.
Loading the Core Map Control
To load the core map control, set the v parameter of the map control to 6.3c. Your script tag in the header of your web page now looks like this:
<script charset="UTF-8" type="text/javascript" src="https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3c&mkt=en-us"></script>
Core Map Control API
The following APIs are supported in the core version of Bing Maps AJAX Control 6.3. If you need geocoding or search functionality, you can use the Bing Maps REST Services in conjunction with the core map control as described in the Using the REST Services with the Core Map Control topic.
Note
The core version of the map control is only supported on the following browsers: Internet Explorer 7, Internet Explorer 8, Firefox 3.5, Firefox 3.6, Safari 4, and Google Chrome.
Supported Types
Type | Supported Members |
---|---|
All members are supported. |
|
All members are supported. |
|
All members are supported. |
|
All members are supported. |
|
Supported members are listed in the VEMap member tables below. |
|
All members are supported. |
|
All members are supported. |
|
All members are supported. |
|
All members are supported. |
|
Supported members are listed in the VEShape member tables below. |
|
Supported members are listed in the VEShapeLayer member tables below. |
|
VEShapeType.Pushpin |
|
All members are supported. |
Supported VEMap Members
The following members of the VEMap Class are supported in the core version of the map control.
Public Constructor
Name | Description | |
---|---|---|
Initializes a new instance of the VEMap Class. |
Public Events
Name | Description |
---|---|
Occurs when a key is pressed and released. |
|
Occurs when a key is pressed (but before it is released). |
|
Occurs when a key is released. |
|
Occurs when a left or right mouse button is single-clicked. |
|
Occurs when a left mouse button is double-clicked. |
|
Occurs when a mouse button (left, right, or middle) is clicked (but before it is released). |
|
Occurs when the mouse cursor moves. |
|
Occurs when the mouse cursor moves away from a VEShape object. |
|
Occurs when the mouse cursor moves over a VEShape Class object. |
|
Occurs when a mouse button (left, right, or middle) is released. |
|
Occurs when the mouse wheel is moved. |
|
Occurs when the map style changes. |
|
Occurs whenever the map view changes. |
|
Occurs when the map control makes a request to the Bing Maps servers and the credentials that were set using the VEMap.SetCredentials Method are invalid. |
|
Occurs when the map control makes a request to the Bing Maps servers and the credentials that were set using the VEMap.SetCredentials Method are valid. |
|
Occurs when a pan of the map ends. |
|
Occurs when the map zoom ends. |
|
Occurs when there is a map control error. |
|
Occurs after the map mode changes and the map has reloaded. |
|
Occurs when the map is resized. |
|
Occurs when a pan of the map begins. |
|
Occurs when the map zoom begins. |
Public Methods
Name | Description |
---|---|
Adds a custom control to the map. |
|
Adds a custom layer to the map. |
|
Adds an existing VEShape Class object, as specified by the shape parameter, to the base layer. The core version of this method does not support adding shape arrays. Also note that the core version of the map control only supports VEShape objects that are of type VEShapeType.Pushpin. |
|
Adds the specified shape layer to the map. |
|
Adds a tile layer to the map, and if the visibleOnLoad parameter is true, it also shows it on the map. |
|
Attaches a Map Control event to a specified function. |
|
Removes all shapes, shape layers, and search results on the map. Also removes the route from the map, if one is displayed. |
|
Clears out all of the default Bing Maps info box CSS styles. |
|
Clears the traffic map. |
|
Removes the specified control from the map. |
|
Deletes all shapes in all layers, leaving empty layers behind. |
|
Deletes all shape layers, along with any shapes within the layers. |
|
Deletes a VEShape Class object from any layer, including the base map layer. |
|
Deletes the specified shape layer from the map. |
|
Deletes a tile layer from view. |
|
Detaches the specified map control event so that it no longer calls the specified function. |
|
Deletes the VEMap object and releases any associated resources |
|
Stops the continuous map panning initiated by a call to the VEMap.StartContinuousPan Method. |
|
Returns a VELatLong Class object that represents the location of the center of the current map view. |
|
Returns the pixel value of the left edge of the map control. |
|
Returns the current map style. |
|
Returns the current map view object as a VELatLongRectangle Class object. |
|
Gets the reference to a VEShape Class object based on its internal identifier. |
|
Gets the reference to a VEShapeLayer Class object based on its index. |
|
Gets the total number of shape layers on the map. |
|
Gets a tile layer based upon its identifier. |
|
Gets a tile layer based upon an index value. |
|
Gets the number of tile layers. |
|
Returns the pixel value of the top edge of the map control. |
|
Returns the current version of the map control. |
|
Returns the current zoom level of the map. |
|
Hides the base tile layer of the map. |
|
Hides the specified control from view. |
|
Hides the default user interface for controlling the map (the compass and the zoom control). |
|
Hides a shape's custom or default info box. |
|
Hides the scale bar from the map. |
|
Hides all of the shape layers on the map. |
|
Hides a tile layer from view. |
|
Hides the traffic legend. |
|
Changes the map view so that it includes both the specified VELatLong Class point and the center point of the current map. |
|
Converts an array of VELatLong Class objects (latitude/longitude pair) to an array of VEPixel Class objects. |
|
Loads the specified map. All parameters are optional. |
|
Loads the traffic map. |
|
Moves the map the specified amount. |
|
Pans the map to a specific latitude and longitude. |
|
Converts a pixel (a point on the map) to a VELatLong Class object (latitude/longitude pair). |
|
Removes a custom layer from the map. |
|
Resizes the map based on the specified width and height. |
|
Centers the map to a specific latitude and longitude. |
|
Centers the map to a specific latitude and longitude and sets the zoom level. |
|
Sets the credentials to use to authenticate map service requests. |
|
Sets the info box CSS styles back to their original classes. |
|
Sets the style of the map. |
|
Sets the map view to include all of the points, lines, or polygons specified in the provided array, or to the view defined by a VEMapViewSpecification Class object. |
|
Specifies whether to zoom to the center of the screen or to the cursor position on the screen. |
|
Sets the distance unit (kilometers or miles) for the map scale. |
|
Sets the number of "rings" of map tiles that should be loaded outside of the visible mapview area. |
|
Specifies the text shown with the traffic legend, if visible. |
|
Sets the view of the map to the specified zoom level. |
|
Shows all shape layers on the map. |
|
Shows the base tile layer of the map. |
|
Makes the specified control visible. This method only affects control elements that have been hidden from view using the VEMap.HideControl Method. |
|
Shows the default user interface for controlling the map (the compass-and-zoom control). By default, this control is shown. |
|
Shows a shape's custom or default info box. |
|
Displays the specified message in a dialog box on the map. |
|
Displays the scale bar on the map. |
|
Shows a tile layer from view. |
|
Displays the traffic legend. |
|
Moves the map in the specified direction until the VEMap.EndContinuousPan Method is called. |
|
Increases the map zoom level by 1. |
|
Decreases the map zoom level by 1. |
Public Properties
Name | Description |
---|---|
Specifies the function to call when the map is first loaded. |
Supported VEShape Members
The following members of the VEShape Class are supported in the core version of the map control.
Note
The core version of the map control only supports VEShape objects that are of type VEShapeType.Pushpin.
Public Constructor
Name | Description | |
---|---|---|
Initializes a new instance of the VEShape Class. |
Public Events
Name | Description |
---|---|
Occurs when a shape is being dragged across the map. |
|
Occurs when a shape drag has stopped. |
|
Occurs when the user starts dragging the shape. |
Public Methods
Name | Description |
---|---|
Gets the VEShape object's custom icon. |
|
Gets the description of the VEShape object. |
|
Gets a VELatLong Class object representing the shape's custom icon anchor point. |
|
Gets the internal identifier of the VEShape object. |
|
Gets the maximum zoom level at which the shape is visible. |
|
Gets the minimum zoom level at which the shape is visible. |
|
Returns an array of VELatLong Class objects representing the points that make up the pushpin. |
|
Gets the reference to the layer containing the specified VEShape object. |
|
Gets the title of the VEShape object. |
|
Gets the type of the VEShape object. |
|
Gets the z-index of a pushpin shape. |
|
Hides the specified VEShape object from view. |
|
Sets the VEShape object's custom icon. |
|
Sets the description of the VEShape object. |
|
Sets the info box anchor of the VEShape object. |
|
Sets the maximum zoom level at which the shape is visible. |
|
Sets the minimum zoom level at which the shape is visible. |
|
Sets the points of the VEShape object. |
|
Sets the title of the VEShape object. |
|
Sets the z-index value for a shape. |
|
Makes the specified VEShape object visible. |
Public Properties
Name | Description |
---|---|
A Boolean value indicating whether the VEShape icon on the map can be dragged using the mouse. |
Supported VEShapeLayer Members
The following members of the VEShapeLayer Class are supported in the core version of the map control.
Public Constructor
Name | Description | |
---|---|---|
Initializes a new instance of the VEShapeLayer Class. |
Public Methods
Name | Description |
---|---|
Adds an existing VEShape Class object to the layer based on the specified VEShape reference. The core version of this method does not support adding shape arrays. Also note that the core version of the map control only supports VEShape objects that are of type VEShapeType.Pushpin. |
|
Deletes all VEShape objects from the layer. |
|
Deletes a VEShape object from the current layer. |
|
Returns a best-fit VELatLongRectangle Class object based on the shapes currently present in the layer. |
|
Retrieves a reference to a VEShape object contained in this layer based on the specified ID. |
|
Retrieves a reference to a VEShape object contained in this layer based on the specified index. |
|
Returns the total number of shapes in the current layer. |
|
Returns whether the layer is visible. |
|
Hides the layer from view on the map. |
|
Shows the layer on the map. |