Export (0) Print
Expand All

NearbyVenueOptions Object

Bing

Contains search options for retrieving nearby venue maps.

Properties

Name Type Description

callback

function

The function to call when the search is completed. The function must accept an array of VenueMap objects.

location

Location

The center of the circle in which to search for nearby venue maps.

map

Map

The base map.

radius

double

The radius, in meters, of the circle in which to search for nearby venue maps.

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 and set the view to a specific location
            map = new Microsoft.Maps.Map(document.getElementById("mapDiv"),{credentials:"Bing Maps Key", center: new Microsoft.Maps.Location(47.6,-122.3), zoom:11}); 

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

         }

         function venuemapsModuleLoaded()
         {
            // Create the venue map
            var vmaps = new Microsoft.Maps.VenueMaps.VenueMapFactory(map); 


            // Search for nearby venues
            vmaps.getNearbyVenues({map: map, location: map.getCenter(), radius:10000, callback:DisplayNearbyVenueCount});

         }


         function DisplayNearbyVenueCount(venues)
         {
            alert("There are " + venues.length + " venue maps nearby.");
         }


      </script>
   </head>
   <body onload="GetMap();">
      <div id='mapDiv' style="position:relative; width:500px; height:500px;"></div>       
   </body>
</html>
Show:
© 2014 Microsoft