VEShape.SetAltitudeMode 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 mode in which a shape's altitude is represented.

VEShape.SetAltitudeMode(mode);

Parameters

Parameter Description

mode

A VEAltitudeMode Enumeration value specifying the altitude representation.

Remarks

If the shape is a model, the altitude mode cannot be set.

If any point in the shape has a null altitude value, this method sets that altitude value to 0.

The sample uses the following custom image.

Bb877867.2ad0f04b-c758-4b4e-bbcd-9f6f94377bbd(en-us,MSDN.10).gif

Examples

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

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

         var SpaceNeedle = new VELatLong(47.6215, -122.3493);

         function GetMap()
         {
            map = new VEMap('myMap');
            map.onLoadMap = DoAfterMapLoaded;
            map.LoadMap(SpaceNeedle, 17, VEMapStyle.Aerial, false, VEMapMode.Mode3D, true, null);
         }

         function DoAfterMapLoaded()
         {
            map.SetPitch(-12.5);

            var SpaceNeedleTop = new VELatLong(47.6208,   -122.3493);

            var pushpin = new VEShape(VEShapeType.Pushpin, SpaceNeedleTop);

            pushpin.SetCustomIcon("images/LGM.gif");

            if(pushpin.GetAltitude() != 210)
            {
               pushpin.SetAltitude(210);
            }

            if(pushpin.GetAltitudeMode() != VEAltitudeMode.RelativeToGround)
            {
               pushpin.SetAltitudeMode(VEAltitudeMode.RelativeToGround);
            }

            map.AddShape(pushpin);
         }
      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:600px; height:400px;"></div>
   </body>
</html>

See Also

Reference

VEShape.GetAltitudeMode Method
VEShape.SetAltitude Method