Export (0) Print
Expand All

VELatLong.SetAltitude Method

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.

Specifies the altitude for a point on the globe.


VELatLong.SetAltitude(altitude, mode)

Parameters

Parameter Description

altitude

The altitude, in meters

mode

The VEAltitudeMode Enumeration value that defines whether altitude is relative to ground-level or absolute

<!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=6.3"></script>

      <script type="text/javascript">
         var map = null;

         var SpaceNeedle = new VELatLong(47.6218, -122.3492);
         var pinLocation = new VELatLong(47.6222, -122.34865);

         function GetMap()
         {
            map = new VEMap('myMap');

            map.LoadMap(SpaceNeedle, 17);

            // Let me know if a birdseye scene is available
            map.AttachEvent("onobliqueenter", OnObliqueEnterHandler);
         }

         function OnObliqueEnterHandler()
         {
            if(map.IsBirdseyeAvailable())
            {
               var TopOfNeedle = new VELatLong(47.622, -122.3491); 
               map.SetBirdseyeScene(TopOfNeedle);
            }
         }

         function AddPin()
         {
            if(map.IsBirdseyeAvailable())
            {
               pinLocation.SetAltitude(604, VEAltitudeMode.RelativeToGround);
               var pushpin = new VEShape(VEShapeType.Pushpin, pinLocation);
               map.AddShape(pushpin);
            }
         }
      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
      <input id="addpin" type="button" value="Where's my table?" name="addpin" 
         onclick="AddPin();">
   </body>
</html>

Show:
© 2014 Microsoft