VEPushpin Constructor 

Initializes a new instance of the VEPushpin class.

var x = new VEPushpin(id, location, icon_url, title, details, iconSt yle, titleStyle, detailsStyle);

Parameters

Parameter

Description

id

The ID of the pushpin that will be added to the map. The id value must be unique for each pushpin on a map control.

location

The location of the pushpin, specified as a VELatLong object.

icon_url

The URL that points to the file you want to use as an icon. Optional.

title

The string to display in the title field of the enhanced preview. Optional.

details

The string to display in the details field of the enhanced preview. Optional.

iconSt yle

A cascading style sheet class name that defines the look of the icon. Optional.

titleStyle

A cascading style sheet class name that defines the look of the title field of the enhanced preview. Optional.

detailsStyle

A cascading style sheet class name that defines the look of the description field of the enhanced preview. Optional.

Remarks

When you create a new pushpin, all parameters are optional except for id.

If no location is specified, the pushpin is created at the center of the map.

Example

<html>
   <head>
      <title></title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <script src="http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js"></script>
      <script>
         var map = null;
         var pinID = 1;
         
         function GetMap()
         {
            map = new VEMap('myMap');
            map.LoadMap();
         }   
         
         function AddPin()
         {   
            var pin = new VEPushpin(pinID, 
                        new VELatLong(27.69, 85.313), 
                        'pict92.jpg', 
                        'Kathmandu', 
                        'A street scene in Kathmandu'
                        );
            map.AddPushpin(pin);
            pinID++;
         }   
      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
      <a href="#" onclick="AddPin();">Add a custom pushpin</a>
   </body>
</html>