Share via


Displaying 3D Maps

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.

Important

On November 2, 2010, the end-of-life was announced for the 3D control. Effective December 1, 2011, the 3D control will no longer function. The full announcement is found at: https://www.bing.com/community/site_blogs/b/maps/archive/2010/11/02/changes-to-bird-s-eye-and-3d-maps.aspx

The Bing Maps AJAX Control 6.3 includes the ability to display a three-dimensional view of the world so that you can you to incorporate the same Bing Maps 3D experience found at the Bing Maps Web site into your own Web sites.

Enabling 3D maps

Because the three-dimensional map functionality is built in to the same map control as the standard two-dimensional maps, you do not need to change how you build your map-enabled Web site. You can program against the new 3D APIs in the same way that you use the 2D APIs. On the programming side, including the 3D maps in your existing sites requires very little additional effort.

However, because of the complexity and the graphics-intensive nature of the Bing Maps 3D maps, software must be installed on the client computer, and the client computer must have sufficient hardware to display the maps. The software, called Bing Maps 3D, requires the following on the client computer:

  • Microsoft Windows XP Service Pack 2, Microsoft Windows Server 2003, or Microsoft Windows Vista

  • Microsoft Internet Explorer 6, 7 or 8, including 64-bit versions, or Mozilla Firefox 2.0 or 3.0.

  • Microsoft .NET Framework version 2.0

  • 250 MB or more of hard disk space

  • A 1.0 GHz processor (2.8 GHz or faster recommended)

  • 256 MB of system memory (1 GB recommended)

  • 32-MB video card (256 MB recommended) that supports Microsoft DirectX 9, with 3D hardware acceleration enabled

  • A high-speed or broadband Internet connection

Verifying the Requirements

Because there are several client-side requirements that users don't need when viewing the standard two-dimensional maps, you should provide an appropriate user interface to verify that the Bing Maps 3D control is installed. To do this, use the VEMap.AttachEvent Method to attach the VEMap.onmodenotavailable Event to your VEMap Class object. If the software is not yet installed on the client computer when the map mode is changed to 3D mode, this event fires. You can then provide instructions on installing the software.

For example, the following code creates a new VEMap object, attaches the onmodenotavailable event, and loads the map. When run on a computer without the software installed, the event handler is called when the map is switched to 3D mode. The event handler provides instructions to the customer on how to install the Bing Maps 3D software.

map=null;
function onPageLoad()
{
   map = new VEMap('map');
   map.LoadMap();
   map.AttachEvent('onmodenotavailable', No3DInstalled);
}
function No3DInstalled ()
{
    alert('Before viewing the maps in 3D mode, '+
      'you must install the Bing Maps 3D software on your computer.' +
      '\nTo install the software, visit ' +
      'https://go.microsoft.com/fwlink/?LinkId=72623.');
}

Note

The link to the installation program for the Bing Maps 3D software (and its prerequisites) is https://go.microsoft.com/fwlink/?LinkId=72623.

Issues when Using 3D Mode

Because Bing Maps 3D is an embedded control on your Web page, certain web-based events and properties behave differently from the traditional 2D maps. Consider the following situations when designing your site to use 3D maps:

  • Custom controls or Web elements that you display on top of a 2D map will be hidden behind the 3D map. You can prevent this by using an IFRAME "shim" for each control. For more information, see the VEMap.AddControl Method topic and code example.

  • The default find control is also hidden when the map mode is switched to 3D mode. To prevent this call the VEMap.ShowFindControl Method when the map mode is changed.

  • When the Bing Maps 3D control has focus, it captures keyboard and mouse events and handles them. Map Control events are passed from the Bing Maps 3D control, so you can continue to use all of them except VEMap.onstartpan Event. Page-level events will not fire when the Bing Maps 3D control has focus.

  • Other map enhancements, including pushpins, custom pushpin and tile layers, polylines, and polygons work in both 2D and 3D mode maps.

Note

The client computer cannot have more than one instance of the 3D map running in the same process at the same time.

Disabling 3D maps

Because the additional requirements for displaying 3D maps, you may want to prevent users from switching to 3D mode. You can do this by setting the showSwitch parameter of the VEMap.LoadMap Method to false.