Virtual Earth-What's New in the Latest Release Now in its sixth major release, Virtual Earth offers an entire world of opportunities for innovative Web-based mapping. Microsoft’s premier Web-based mapping solution has undergone upgrades to it user interface, compatibility, and functionality making it an ideal time to get started with the platform or upgrade your existing application. Let’s explore what’s new and what has changed in this latest release. The Virtual Earth 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 that you need to access the powerful AJAX mapping. Listing 1 shows a basic “hello world” example. | " | With an interface style directly based on the upcoming Microsoft “Photosynth,” the user visually selects high-resolution scenes to be loaded in the 3D space.
| " |
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, installed on demand and still offering a seamless “in browser” experience, supports Internet Explorer and Firefox on Windows-based machines with adequate 3D hardware. Virtual Earth code development is not tied to any server side technology. As demonstrated in Listing 1, the control only relies on HTML and JavaScript allowing development in your favorite editor. Although Microsoft Visual Studio combined with ASP.NET AJAX extensions is an obvious choice, you can quite happily achieve great results with PHP and other AJAX frameworks-the choice is yours. New Navigation with a New Default Dashboard The new navigation dashboard as shown in Figure 1 provides all the default navigation functionality like zooming, panning, and changing map styles and map modes. Revamped in nearly every version to date, the latest control has a minimalist look and smaller download footprint. Importantly the user can minimize the control if they need more screen real estate for the map application.  Figure 1: The Default Virtual Earth Dashboard.You have three built-in dashboards in Virtual Earth to choose from or you turn them off completely and create your own. If you want to change to a different, built-in dashboard, you must do this 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 oblique images are taken from a low angle and give high-resolution images of all four sides of a scene. Popular with Real Estate applications, these images compliment the straight down orthogonal images providing much more location detail than simply rooftops. New to Virtual Earth is the incorporation of these images in 3D mode. With an interface style directly based on the upcoming Microsoft “Photosynth,” the user visually selects high-resolution scenes to be loaded into the 3D space. Combined with the existing and ever expanding 3D models, this provides an innovative experience ready for developers to utilize 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 style navigation of bird’s eye images in Virtual Earth 3D.A tip, use the keyboard arrow keys and the dashboard rotate buttons to navigate between the images seamlessly. You can preview this amazing functionality at http://maps.live.com. Additionally you get two new Birdseye methods in the traditional 2D mode, first: VEBirdseyeScene.GetBoundingRectangle();
This method returns an oversized approximation of the bounds of the current scene. This method 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 within this bird’s eye scene, thus loading the records for display in Virtual Earth on demand and improving your application’s performance. 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 allows you to request a bird’s eye scene based on a latitude/longitude coordinate and zoom level. To facilitate highly accurate placement of shapes plotted within the bird’s eye scene, Microsoft has added several new methods. Firstly you can configure a “shapes accuracy” policy using the method VEMap.SetShapesAccuracy(policy) where 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 accurately convert using VEMap.SetShapesAccuracyRequestLimit(number). The default is 50. It is important to understand that this process is slow and you should only use it where absolutely required. Create Your Own 3D Models Virtual Earth has had world-class, highly accurate, 3D models for some time. Now, thanks to a partnership with Dassault, the new 3DVIA technology allows you to create your own models within Virtual Earth just like Figure 3. The application allows you to build your 3D model in a simple environment and add either built-in textures or your own. This allows you to capture an image yourself for use on your custom model.  Figure 3: Building a 3D model in 3DVIA.The models themselves are stored at http://maps.live.com in a personal “collection” and you can add them to your own map by importing that collection as a layer as follows: var l = new VEShapeLayer(); var veLayerSpec = new VEShapeSourceSpecification(VEDataType.VECollection , "54139577DC329980!625", l); map.ImportShapeLayerData(veLayerSpec,null,false);
| & | | 
By: John O'Brien
John O’Brien is a Director of Soul Solutions, based in Brisbane, Australia.
John is a Windows Live Developer MVP and moderates the Virtual Earth forum on MSDN. He is part of the core team that runs the ViaWindowsLive.com community site for Windows Live technologies.
John has presented on Windows Live technologies at many events including Tech Ed Australia, Museums and the Web, and MSDN/SQL user groups.
webm0nk3y@hotmail.com | Fast Facts | | Whether you need a store locator, sell Real Estate, track assets, or simple have some data to visualize on the Earth, Microsoft Virtual Earth is ready to provide a stable, high-performance, accurate, and engaging Web-based experience for your clients. Rich features include “in browser” 3D, unique “bird’s eye” images, turn-by-turn directions, and place searches. Visualize your data as a static tile overlay or interactive pushpins, lines, and polygons. Development is straightforward with your choice of server-side technology and a well documented and supported JavaScript API. With SSL support and a SLA, bring Virtual Earth into your project today! | |
|