Export (0) Print
Expand All

Primitive Class

Bing

Represents a venue map primitive, which represents a venue map entity.

Properties

Name Type Description

bounds

LocationRect

The rectangle that defines the bounding box for the primitive.

businessId

string

The Yellow Pages ID for the entity.

categoryId

string

The Yellow Pages business category ID for the entity.

categoryName

string

The Yellow Pages business category name for the entity.

center

Location

The location of the center of the primitive.

floor

Floor

The floor to which this primitive belongs.

id

string

The unique ID of the entity.

locations

Location[]

An array of locations that represent the vertices of the primitive.

name

string

The name of the entity.

Methods

Name Definition Return Type Description

highlight

highlight()

None

Highlights the primitive.

unhighlight

unhighlight()

None

Removes the highlighting of the primitive.

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;
         var vmaps = 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}); 


         }


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

            Microsoft.Maps.Events.addHandler(venue, 'click', DisplayVenueEntity); 


            alert("Click on the venue map to display entity info.");

         }


         function DisplayVenueEntity(e) 
         {
            alert("The name of the store that was clicked is " + e.name + "."); 

         }
         

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