Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

VenueMapCreationOptions Object

Bing

Contains options for creating a venue map.

Properties

Name Type Description

error

function

The function to call if the venue map was not successfully created. The function must accept two parameters: an integer which is an error code and an object that contains the arguments passed to the create method of the VenueMapFactory.

The error codes are:

  • 1 The metadata needed to create the venue map was not found because of a 404 or other web exception, or because the metadata was found but was empty.

  • 2 The venue map metadata is invalid.

  • 3 A timeout has occurred trying to retrieve the venue map metadata.

success

function

The function to call if the venue map was successfully created. The function must accept two parameters: a VenueMap and an object that contains the arguments passed to the create method of the VenueMapFactory.

venueMapId

string

A string that identifies the venue map to display.

Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>

      <script type="text/javascript">
         
         var map = null;
         
         function GetMap()
         {
            // Initialize the map
            map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), credentials:"Bing Maps Key"}); 

            Microsoft.Maps.loadModule('Microsoft.Maps.VenueMaps', { callback: venuemapsModuleLoaded });

         }

         function venuemapsModuleLoaded()
         {
            // Create the venue map
            var vmaps = new Microsoft.Maps.VenueMaps.VenueMapFactory(map); 
            vmaps.create({venueMapId: 'bingmapsteam-bellevuesquare', success:ShowVenue, error:ShowError}); 

         }

         function ShowVenue(venue)
         {
            // Set the map view 
            map.setView(venue.bestMapView);
            venue.show();

         }

         function ShowError()
         {
            // Show an error
            alert("An error occurred trying to create the venue map.");

         }
      </script>
   </head>
   <body onload="GetMap();">
      <div id='mapDiv' style="position:relative; width:500px; height:500px;"></div>       
   </body>
</html>
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.