VEMap.SetBirdseyeOrientation 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.

Changes the orientation of the existing bird's eye image (VEBirdseyeScene Class object) to the specified orientation.


VEMap.SetBirdseyeOrientation(orientation);

Parameters

Parameter Description

orientation

You can set this value by using either the VEOrientation Enumeration or a string value. Valid string values are North, South, East, and West.

Returns false if the map mode is set to 3D (VEMap.GetMapMode Method returns 2).

<!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 defaultLatLong = new VELatLong(33.5074070839019, -111.94647789001467);
         var defaultZoom    = 17;

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

            map.SetCenterAndZoom(defaultLatLong, defaultZoom);
            map.SetMapStyle(VEMapStyle.Birdseye);

            map.SetBirdseyeScene(defaultLatLong, VEOrientation.North, defaultZoom, myCallback);
         }   
     
         function SetBirdseyeOrientation(orientation)
         {
            switch(orientation)
            {
               case 'north': map.SetBirdseyeOrientation(VEOrientation.North);
                             break;
               case 'south': map.SetBirdseyeOrientation(VEOrientation.South);
                             break;
               case 'east':  map.SetBirdseyeOrientation(VEOrientation.East);
                             break;
               default:      map.SetBirdseyeOrientation(VEOrientation.West);
                             break;
            }

            var be = map.GetBirdseyeScene();
            var id = be.GetID();                
            var link = "<a href='#' onclick='SetBirdseyeScene(" + id + ")'>" + id + "</a><br />";            
            idList.innerHTML += link;                
         }

         function SetBirdseyeScene(bsid)
         {
            map.SetBirdseyeScene(bsid);
         }

         function myCallback(be)
         {
            // Add this to the list of IDs
            var id = be.GetID();                
            var link = "<a href='#' onclick='SetBirdseyeScene(" + id + ")'>" + id + "</a> (default)<br />";            
            idList.innerHTML += link;
         }
      </script>
   </head>
   <body onload="GetMap();" style="font-family:Arial">
      <div id='myMap' style="position:relative; width:400px; height:400px;"></div>

      <p>
         Set Birdseye Orientation:
         <br/>
         <input id="btnNorth" type="button" value="N" onclick="SetBirdseyeOrientation('north')">
         <br/>
         <input id="btnWest"  type="button" value="W" onclick="SetBirdseyeOrientation('west')">
         <input id="btnEast"  type="button" value="E" onclick="SetBirdseyeOrientation('east')">
         <br/>
         <input id="btnSouth" type="button" value="S" onclick="SetBirdseyeOrientation('south')">
      </p>

      <h4>Bird's eye scene ID's:</h4>

      <div id="idList"></div>
   </body>
</html>

Show: