Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Virtual Earth—What's New in the Latest Release

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.


advertisement
ow in its sixth major release, Virtual Earth offers an entire world of opportunities for innovative web-based mapping. Whether you sell real estate, track assets, need a store locator, or simply have some data you want to map, Microsoft Virtual Earth is ready to provide a stable, high-performance, accurate, and engaging web-based experience for your clients.

The Virtual Earth (VE) platform combines a JavaScript library, a rich set of mapping data and imagery, a set of web services, and a powerful 3D control. Getting started with the platform is trivial; a simple HTML web page is all you need to access VE's powerful AJAX mapping features. Listing 1 shows a basic "Hello world" 2D example.

The power of the 2D interface comes from JavaScript manipulating the HTML DOM and making AJAX calls directly to Microsoft's web servers. The interface requires no plug-ins and, in version 6, supports Internet Explorer 6, 7, Firefox 2, and Safari 2. The 3D control installs on demand, supports Internet Explorer and Firefox on Windows-based machines with adequate 3D hardware, and provides users with a seamless "in-browser" experience.

Virtual Earth code development is not tied to any server side technology. As demonstrated in Listing 1, the control relies only on HTML and JavaScript, so you can develop in your favorite editor. Although one obvious IDE/language choice is Microsoft Visual Studio and the ASP.NET AJAX extensions, you can achieve identical results using PHP and other AJAX frameworks—the choice is yours.

New Navigation with a New Default Dashboard
The new navigation dashboard (see Figure 1) provides all the default navigation functionality, including zooming, panning, and changing map styles and map modes. Revamped in nearly every version so far, the latest control has a minimalist look and a smaller download footprint. Users can minimize the control if they need more screen real estate for their current map application.

 
Figure 1. The Default Virtual Earth Dashboard: The default dashboard provides basic navigation functions.
VE has three built-in dashboards you can choose from. You can also turn off VE's dashboards completely and create your own. To change to a different built-in dashboard, you set the dashboard before you load the map as follows:

map = new VEMap('myMap'); map.SetDashboardSize(VEDashboardSize.Tiny); map.LoadMap();

Photosynth-Style Bird's Eye Images in 3D
The bird's eye images within Virtual Earth are truly amazing. These are oblique images taken from a low angle that provide high-resolution images of all four sides of a scene. Popular with real estate applications, these images compliment the familiar straight-down orthogonal images, providing far more location detail than simply looking at rooftops.

Incorporating these images in 3D mode is a new feature in Virtual Earth. With an interface style directly based on the upcoming Microsoft Photosynth, users visually select high-resolution scenes to be loaded into the 3D space. When combined with the existing (and ever-expanding) 3D models, the photosynth feature provides developers with an innovative experience to use in their own applications. Figure 2 shows a bird's eye scene loaded over a set of 3D buildings in New York. Note the outline of surrounding images easily selectable by the user.

 
Figure 2. Photosynth Image: The figure shows Photosynth-style navigation of bird's eye images in Virtual Earth 3D.

Author's Note: Here's a tip: Use the keyboard arrow keys and the dashboard rotate buttons to navigate between the photosynth images seamlessly. You can preview this amazing functionality at http://maps.live.com.

Developers get two new bird's eye methods in the traditional 2D mode. The first is GetBoundingRectangle():

VEBirdseyeScene.GetBoundingRectangle();

This method returns an oversized approximation of the bounds of the current scene, which is perfect if you need to query for data within the current scene. For example, you could use the bounding latitude and longitude values returned from this method to query a database for records that lie within this bird's eye scene, thus loading the records for display in Virtual Earth on demand, and improving your application's performance.

Unfortunately, due to licensing restrictions, you cannot access exact latitude and longitude values from bird's eye images.

The second method is:



VEMap.SetBirdseyeScene(veLatLong, orientation,zoomLevel,callback);

This method lets you request a bird's eye scene based on a latitude/longitude coordinate and zoom level.

To facilitate highly accurate shape placement within bird's eye scenes, Microsoft has added several new methods. Firstly, you can configure a "shapes accuracy" policy using the method VEMap.SetShapesAccuracy(policy). The options are:

  • None: No shapes are accurately converted (default).
  • Pushpin: Only pushpins are accurately converted.
  • All: All shapes are accurately converted.
Secondly, you can configure the number of shapes to convert accurately using VEMap.SetShapesAccuracyRequestLimit(number). The default is 50. This process is slow, so you should use it only where absolutely required.

Editor's Note: This article was first published in Code Focus magazine, and is reprinted here by permission.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap