VEShape.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 the shape.

VEShape.SetAltitude(altitude, altitudeMode);


Parameter Description


A floating-point value or array of floating-point values specifying the altitude, in meters, of the shape.


A VEAltitudeMode Enumeration value specifying the mode in which the shape's altitude is represented.

If the shape is a model, this method returns false, and the altitude is not changed.

If the shape is a pushpin, altitude must be a single floating-point value. If the shape is a polyline or polygon and altitude is an array of floating-point values, the array must be the same length as the number of points in the shape and the shape altitudes are set to the respective array value. Otherwise, this method throws an exception.

The sample uses the following custom image.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

      <script type="text/javascript" src=""></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()

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

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


            if(pushpin.GetAltitude() != 210)

            if(pushpin.GetAltitudeMode() != VEAltitudeMode.RelativeToGround)

   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:600px; height:400px;"></div>