RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Virtual Earth—What's New in the Latest Release : Page 3

Microsoft's web-based mapping application has an upgraded user interface, better compatibility, and improved functionality, so it's an ideal time to get started with the platform or upgrade your existing application. Find out what's new and what's changed in the latest release.

Localization, First Steps
Microsoft must address a number of different areas to fully localize Virtual Earth. These include the control text, the map tiles themselves, and the web service results. Version 6 provides the first steps towards localization by providing localized direction information for routing. It takes two changes to enable localized results. First, you add a locale query parameter to the Virtual Earth script URL. For example, to localize to French (fr-fr), you would write:

   <script type="text/javascript"
Table 1 gives the complete list of supported locales.

Table 1: A complete list of supported locales.



English, Canada


English, Great Britain


English, United States


Japanese, Japan


Czech, Czech Republic


Danish, Denmark


Dutch, Netherlands


Finnish, Finland


French, France


German, Germany


Italian, Italy


Norwegian, Norway


Portuguese, Portugal


Spanish, Spain


Swedish, Sweden


Chinese, China


Second, to enable the localized directions, set the property UseMWS to true in the GetDirections method as follows:

   var myRouteOptions = new VERouteOptions();
   myRouteOptions.UseMWS = true;
Improved Geocoding and Confidence Data
Geocoding is the process of assigning latitude and longitude values to data such as street addresses. To position anything on the Virtual Earth map, you need the location as a VELatLong class. Clearly, it is unlikely you'd actually know the coordinates unless you're getting the data from a GPS device or it's previously been geocoded. Therefore, Virtual Earth provides geocoding within its routing and, importantly, through the VEMap.Find() method.

The VEMap.Find() method is responsible for geocoding a user-submitted location. This process makes a best guess, based on the text supplied. The method returns an array of VEPlace objects, which contains:

  • VEPlace.LatLong: Gets a VELatLong Class object that represents the location of the found result.
  • VEPlace.Name: Gets the String object that represents Virtual Earth's unambiguous name for the location.
  • VEPlace.MatchCode: A VEMatchCode enumeration value specifying the match code from the geocoder.
  • VEPlace.MatchConfidence: A VEMatchConfidence enumeration value specifying the match confidence from the geocoder. Values are High, Medium, or Low confidence.
The VEMatchCode enumeration contains these values:

  • None: No match was found.
  • Good: A successful match was found.
  • Ambiguous: A number of possible locations match.
  • UpHierarchy: The match was found by a broader search.
  • Modified: The match was found, but in a modified place.
These classes give you the detailed information you'll need to customize the results for your application and required accuracy.

Virtual Earth now supports "Roof Top Geocoding" in the United States. Rather than simply marking the location of the address on the road, this process marks the actual house or building at that address. Again, this is a very important feature for real estate applications.

Usage Tracking and Client Identification with Tokens
The Virtual Earth platform now supports a mechanism to track individual usage. Essentially, your web server requests a specific token identifier using a secure web service for each instance of a Virtual Earth map you serve. This token, specific to your application, gets set within the JavaScript Virtual Earth control before the map is loaded:

   var map = new VEMap("mymap");
As JavaScript executes on the client, this token is public. For this reason the token is generated uniquely for each map, specific to your application.

Microsoft has added two new Virtual Earth events to support possible errors with tokens. You can attach to ontokenerror to receive notification if the token is not valid. Second, as the tokens themselves have a configurable lifespan, you attach to ontokenexpire to receive a notification when the token expires.

The usage statistics are then available for review on the Virtual Earth Platform Customer Services site alongside your MapPoint web service usage.

Author's Note: Microsoft recommends that all commercial applications implement the new tracking system. It will be a requirement of the Service Level Agreement (SLA) offered to commercial customers.

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date