Migrating from Bing Maps AJAX Control 6.3 to 7.0

 

This topic contains information to help you migrate your Bing Maps AJAX Control 6.3 code to Bing Maps AJAX Control 7.0.

6.3 to 7.0 API Migration Tables

All Types

The table below lists every type found in the Bing Maps AJAX Control 6.3 API and provides the corresponding Bing Maps AJAX Control 7.0 type or functionality to use.

Bing Maps AJAX Control 6.3 6.3 Type

Corresponding Bing Maps AJAX Control 7.0 Functionality

VEAltitudeMode Enumeration

AltitudeReference Enumeration

VEBirdseyeScene Class

To set the map type to bird’s eye, use the birdseye member of the MapTypeId Enumeration.

VEClusteringOptions Class

Pushpin clustering it not supported.

VEClusteringType Enumeration

Pushpin clustering it not supported.

VEClusterSpecification Class

Pushpin clustering it not supported.

VEColor Class

Color Class

VECustomIconSpecification Class

Use the icon property of the PushpinOptions Object to customize your pushpin icon.

VEDashboardSize Enumeration

Use the showDashboard and showMapTypeSelector options of the MapOptions Object to customize the map navigation control.

VEDataType Enumeration

Data import is not supported in 7.0.

VEDistanceUnit Enumeration

Both miles and kilometers are displayed on the map control. Meters are used for API measurements.

VEException Class

An error message is returned.

VEFailedShapeRequest Enumeration

Due to implementation differences, there is not a need for a corresponding type.

VEFindResult Class

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEFindType Enumeration

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEGeocodeLocation Class

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEGeocodeOptions Class

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEImageryMetadata Class

Use the Bing Maps REST Services to retrieve imagery metadata as described in the Get Imagery Metadata topic.

VEImageryMetadataOptions Class

Use the Bing Maps REST Services to retrieve imagery metadata as described in the Get Imagery Metadata topic.

VELatLong Class

Location Class

VELatLongRectangle Class

LocationRect Class

VELocationPrecision Enumeration

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEMap Class

Map Class

VEMapMode Enumeration

3D is not supported. All available map types are found in the MapTypeId Enumeration.

VEMapOptions Class

MapOptions Object

VEMapStyle Enumeration

MapTypeId Enumeration

VEMapViewSpecification Class

ViewOptions Object

VEMatchCode Enumeration

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEMatchConfidence Enumeration

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEMiniMapSize Enumeration

The mini map, also known as the overview map, is not supported. Add a second smaller map to your HTML page to simulate the overview map.

VEModelFormat Enumeration

Models are not supported.

VEModelOrientation Class

Models are not supported.

VEModelScale Class

Models are not supported.

VEModelScaleUnit Enumeration

Models are not supported.

VEModelSourceSpecification Class

Models are not supported.

VEModelStatusCode Enumeration

Models are not supported.

VEOrientation Enumeration

Use the heading property of the ViewOptions Object.

VEPixel Class

Point Class

VEPlace Class

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEPrintOptions Class

Printing is fully supported.

VERoute Class

Route Class

VERouteDistanceUnit Enumeration

DistanceUnit Enumeration

VERouteHint Class

Use the postIntersectionHint and preIntersectionHint properties of the DirectionsStep Class.

VERouteItinerary Class

Use the itineraryItems property of the RouteLeg Class.

VERouteItineraryItem Class

DirectionsStep Class

VERouteLeg Class

RouteLeg Class

VERouteLocation Class

Use the address or location property of the WaypointOptions Object.

VERouteMode Enumeration

RouteMode Enumeration

VERouteOptimize Enumeration

RouteOptimization Enumeration

VERouteOptions Class

DirectionsRequestOptions Object or DirectionsRenderOptions Object

VERouteSegment Class

RouteLeg Class

VERouteType Enumeration

RouteOptimization Enumeration

VERouteWarning Class

Use the warnings property of the DirectionsStep Class.

VERouteWarningSeverity Enumeration

Use the warnings property of the DirectionsStep Class.

VESearchOptions Class

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEShape Class

Pushpin Class, Polygon Class, Polyline Class

VEShapeLayer Class

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection.

VEShapeAccuracy Enumeration

Due to implementation differences, there is not a need for a corresponding type.

VEShapeSourceSpecification Class

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection.

VEShapeType Enumeration

Shapes can be either a pushpin, polygon, or a polyline.

VETileSourceSpecification Class

TileSource Class

VEMap Methods

The table below lists every method found in the VEMap Class of the Bing Maps AJAX Control 6.3 and provides the corresponding Bing Maps AJAX Control 7.0 functionality to use.

VEMap Class Method

Corresponding Bing Maps AJAX Control 7.0 Functionality

VEMap.AddControl Method

Use the getRootElement method of the Map Class to retrieve the map div and add your own control.

VEMap.AddCustomLayer Method

Custom layers are not supported.

VEMap.AddShape Method

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection. Use the push or insert method of the EntityCollection Class to add a shape to the map.

VEMap.AddShapeLayer Method

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection.

VEMap.AddTileLayer Method

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection. Use the push or insert method of the EntityCollection Class to add a TileLayer Class to the map.

VEMap.AttachEvent Method

Use the addHandler or addThrottledHandler methods of the Events Object.

VEMap.Clear Method

Objects on the map are items in the entities collection of the Map Class. Use the clear method of the EntityCollection Class to clear the map.

VEMap.ClearInfoBoxStyles Method

Customize your own info box using the htmlContent property of the InfoboxOptions Object. Set your options using the setOptions method of the Infobox Class.

VEMap.ClearTraffic Method

Use the hide method of the TrafficLayer Class (deprecated).

VEMap.DeleteAllShapeLayers Method

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection. Use the clear method of the EntityCollection Class to delete all shapes on the map.

VEMap.DeleteAllShapes Method

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection. Use the clear method of the EntityCollection Class to delete all shapes on the map.

VEMap.DeleteControl Method

Use the getRootElement method of the Map Class to retrieve the map div to delete the control you added.

VEMap.DeleteRoute Method

Use the clearDisplay or resetDirections methods of the DirectionsManager Class.

VEMap.DeleteShape Method

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection. Use the remove method of the EntityCollection Class to remove a shape from the map.

VEMap.DeleteShapeLayer Method

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection.

VEMap.DeleteTileLayer Method

Tile layers and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection. Use the remove method of the EntityCollection Class to remove a tile layer from the map.

VEMap.DetachEvent Method

Use the removeHandler method of the Events Object.

VEMap.Dispose Method

Use the dispose method of the Map Class.

VEMap.EnableShapeDisplayThreshold Method

Shape display threshold is not supported.

VEMap.EndContinuousPan Method

Use the Java Script setTimeout method and the setView method of the Map Class. Example code is found in the Appendix section at the end of this topic.

VEMap.Find Method

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEMap.FindLocations Method

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEMap.Geocode Method

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEMap.GetAltitude Method

Use the getCenter method of the Map Class to return a Location Class, from which you can retrieve the altitude.

VEMap.GetBirdseyeScene Method

If the MapTypeId is birdseye, use the methods of the Map Class to get information about the map view.

VEMap.GetCenter Method

Use the getCenter method of the Map Class.

VEMap.GetDirections Method

Use the calculateDirections method of the DirectionsManager Class.

VEMap.GetHeading Method

Use the getHeading method of the Map Class.

VEMap.GetImageryMetadata Method

Use the Bing Maps REST Services to retrieve imagery metadata as described in the Get Imagery Metadata topic.

VEMap.GetLeft Method

Use the getPageX method of the Map Class.

VEMap.GetMapMode Method

3D is not supported. All available map types are found in the MapTypeId Enumeration.

VEMap.GetMapStyle Method

Use the getMapTypeId method of the Map Class.

VEMap.GetMapView Method

Use the methods of the Map Class to return information about the current or target map view.

VEMap.GetPitch Method

3D is not supported.

VEMap.GetRoute Method

Use the calculateDirections method of the DirectionsManager Class.

VEMap.GetShapeByID Method

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection.

VEMap.GetShapeLayerByIndex Method

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection. Use the get method of the EntityCollection Class to return a shape by its index.

VEMap.GetShapeLayerCount Method

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection. Use the getLength method of the EntityCollection Class to return the number of items in the collection.

VEMap.GetTileLayerByID Method

Tile layers and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection.

VEMap.GetTileLayerByIndex Method

Tile layers and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection. Use the get method of the EntityCollection Class to return a tile layer by its index.

VEMap.GetTileLayerCount Method

Tile layers and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection. Use the getLength method of the EntityCollection Class to return the number of items in the collection.

VEMap.GetTop Method

Use the getPageY method of the Map Class.

VEMap.GetVersion Method

Use the getVersion static method of the Map Class.

VEMap.GetZoomLevel Method

Use the getZoom method of the Map Class.

VEMap.Hide3DNavigationControl Method

3D is not supported.

VEMap.HideAllShapeLayers Method

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection. Set the visible property of the EntityCollectionOptions Object to false using the setOptions method of the EntityCollection Class to hide all shapes.

VEMap.HideBaseTileLayer Method

Use the setView method of the Map Class to set the mapTypeId property of the ViewOptions Object to mercator.

VEMap.HideControl Method

Use the getRootElement method of the Map Class to retrieve the map div to hide the control you added.

VEMap.HideDashboard Method

Use the showDashboard and showMapTypeSelector options of the MapOptions Object to customize the map navigation control.

VEMap.HideFindControl Method

The find control is not supported.

VEMap.HideInfoBox Method

Set the visible property of the InfoboxOptions Object to false using the setOptions method of the Infobox Class to hide an info box.

VEMap.HideMiniMap Method

The mini map, also known as the overview map, is not supported. Add a second smaller map to your HTML page to simulate the overview map.

VEMap.HideScalebar Method

The scale bar cannot be hidden.

VEMap.HideTileLayer Method

Set the visible property of the TileLayerOptions Object to false using the setOptions method of the TileLayer Class to hide a tile layer.

VEMap.HideTrafficLegend Method

There is no traffic legend, but you can use the hide method of the TrafficLayer Class (deprecated) to hide traffic.

VEMap.Import3DModel Method

Models are not supported.

VEMap.ImportShapeLayerData Method

Data import is not supported.

VEMap.IncludePointInView Method

Use the setView method of the Map Class to set the bounds of the map view to include a point.

map.setView({center: pointToInclude, bounds: new Microsoft.Maps.LocationRect.fromLocation(map.getCenter())})

VEMap.IsBirdseyeAvailable Method

This functionality is not supported.

VEMap.LatLongToPixel Method

Use the tryLocationToPixel method of the Map Class.

VEMap.LoadMap Method

Initialize a Map Class.

VEMap.LoadTraffic Method

Use the show method of the TrafficLayer Class (deprecated).

VEMap.Pan Method

Use the setView method of the Map Class to set the centerOffset property of the ViewOptions Object.

map.setView({center: map.getCenter(), centerOffset: new Microsoft.Maps.Point(10,10)});

VEMap.PanToLatLong Method

Use the setView method of the Map Class to set the center property of the ViewOptions Object.

VEMap.PixelToLatLong Method

Use the tryPixelToLocation method of the Map Class.

VEMap.RemoveCustomLayer Method

Custom layers are not supported.

VEMap.Resize Method

Set the height and width properties of the MapOptions Object using the setOptions method of the Map Class.

VEMap.Search Method

Find a location by address, point, or query using the Bing Maps REST Services and display it on the map as described in Geocoding a Location.

VEMap.SetAltitude Method

Set map view properties using the setView method of the Map Class.

VEMap.SetBirdseyeOrientation Method

Set map view properties using the setView method of the Map Class.

VEMap.SetBirdseyeScene Method

Set map view properties using the setView method of the Map Class.

VEMap.SetCenter Method

Use the setView method of the Map Class to set the center property of the ViewOptions Object.

VEMap.SetCenterAndZoom Method

Use the setView method of the Map Class to set the center and zoom properties of the ViewOptions Object.

VEMap.SetClientToken Method

Client tokens are not supported.

VEMap.SetCredentials Method

Use the credentials property of the MapOptions Object to set the map credentials. Your credentials are your Bing Maps Key. Information about getting a key is described in Getting a Bing Maps Key.

VEMap.SetDashboardSize Method

Dashboard size modification is not supported.

VEMap.SetDefaultInfoBoxStyles Method

Create a basic info box using the Infobox Class.

VEMap.SetFailedShapeRequest Method

Due to implementation differences, there is not a need for corresponding functionality.

VEMap.SetHeading Method

Use the setView method of the Map Class to set the heading property of the ViewOptions Object.

VEMap.SetMapMode Method

3D is not supported. All available map types are found in the MapTypeId Enumeration.

VEMap.SetMapStyle Method

Use the setView method of the Map Class to set the mapTypeId property of the ViewOptions Object.

VEMap.SetMapView Method

Use the setView method of the Map Class to set map view properties of the ViewOptions Object.

VEMap.SetMouseWheelZoomToCenter Method

The mouse wheel always zooms to the cursor position on the screen.

VEMap.SetPitch Method

3D is not supported.

VEMap.SetPrintOptions Method

Printing is fully supported.

VEMap.SetScaleBarDistanceUnit Method

Scale bar modification is not supported.

VEMap.SetShapesAccuracy Method

Due to implementation differences, there is not a need for corresponding functionality.

VEMap.SetShapesAccuracyRequestLimit Method

Due to implementation differences, there is not a need for corresponding functionality.

VEMap.SetTileBuffer Method

Use the setOptions method of the Map Class to set the tileBuffer property of the MapOptions Object.

VEMap.SetTrafficLegendText Method

There is no traffic legend, but use the show method of the TrafficLayer Class (deprecated) to display traffic.

VEMap.SetZoomLevel Method

Use the setView method of the Map Class to set the zoom property of the ViewOptions Object.

VEMap.Show3DBirdseye Method

Use the setView method of the Map Classto set the mapTypeId property of the ViewOptions Object to birdseye.

VEMap.Show3DNavigationControl Method

3D is not supported.

VEMap.ShowAllShapeLayers Method

Shapes and other objects on the map are items in the entities collection of the Map Class, which is an EntityCollection. Set the visible property of the EntityCollectionOptions Object to true using the setOptions method of the EntityCollection Class to show all shapes.

VEMap.ShowBaseTileLayer Method

By default the base tile layer is shown. If you have set the mapTypeId of the ViewOptions Object to mercator to hide the base tiles, set the mapTypeId to another map type to show the base tiles again.

VEMap.ShowControl Method

Use the getRootElement method of the Map Class to retrieve the map div to show a control you added.

VEMap.ShowDashboard Method

Use the showDashboard, showBreadcrumb, and showMapTypeSelector options of the MapOptions Object to customize the map navigation control.

VEMap.ShowDisambiguationDialog Method

The disambiguation dialog is not supported.

VEMap.ShowFindControl Method

The find control is not supported.

VEMap.ShowInfoBox Method

Add an info box to the map using the Infobox Class.

VEMap.ShowMessage Method

Add a div to your HTML page to show a message.

VEMap.ShowMiniMap Method

The mini map, also known as the overview map, is not supported. Add a second smaller map to your HTML page to simulate the overview map.

VEMap.ShowScalebar Method

Scale bar modification is not supported.

VEMap.ShowTileLayer Method

Add a tile layer to the map using the TileLayer Class.

VEMap.ShowTrafficLegend Method

There is no traffic legend, but use the show method of the TrafficLayer Class (deprecated) to display traffic.

VEMap.StartContinuousPan Method

Use the Java Script setTimeout method and the setView method of the Map Class. Example code is found in the Appendix section at the end of this topic.

VEMap.ZoomIn Method

Use the setView method of the Map Class to set the zoom property of the ViewOptions Object.

VEMap.ZoomOut Method

Use the setView method of the Map Class to set the zoom property of the ViewOptions Object.

Appendix

The following code shows how to simulate continuous pan in Bing Maps AJAX Control 7.0.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
   <head>
      <title></title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

      <script type="text/javascript" src="https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>

      <script type="text/javascript">

         var map = null;
         var t = null;
         var isPanning = false;

         function GetMap()
         {
            // Initialize the map
            map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), {credentials:"Bing Maps Key"}); 

         }

         function StartPan()
         {
            if (!isPanning)
            {
                PanMap();
                isPanning = true;
            }
         }

         function PanMap()
         {

            map.setView({center: map.getCenter(), centerOffset: new Microsoft.Maps.Point(-10,0)});

            t = setTimeout(PanMap, 200);

         }

         function EndPan()
         {
            clearTimeout(t);
            isPanning = false;
         }

      </script>
   </head>
   <body onload="GetMap();">
      <div id='mapDiv' style="position:relative; width:400px; height:400px;"></div>     
      <input type="button" value="Pan Map" onclick="StartPan()"/>  
      <input type="button" value="Stop Pan" onclick="EndPan()"/>
   </body>
</html>

See Also

Bing Maps AJAX Control, Version 6.3
Bing Maps AJAX Control, Version 7.0