Export (0) Print
Expand All
0 out of 7 rated this helpful - Rate this topic

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

Determines whether the bird's eye map style is available in the current map view.


VEMap.IsBirdseyeAvailable();

Returns false if the map mode is set to 3D (VEMap.GetMapMode Method returns 2). Returns true if bird's eye images are available and the zoom level is 11 or greater.

<!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;

         function GetMap()
         {
            map = new VEMap('myMap');
         
            map.LoadMap(new VELatLong(47.62165, -122.3492), 18);

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

         function OnObliqueEnterHandler()
         {
            if (map.IsBirdseyeAvailable())
            {
               map.SetMapStyle(VEMapStyle.Birdseye);

               // So we don't repeatedly reset map style
               map.DetachEvent("onobliqueenter", OnObliqueEnterHandler);
            }
         }
            
         function GetInfo()
         {
            var info = "";

            if (map.IsBirdseyeAvailable())
            {
               var be = map.GetBirdseyeScene();

               // Get pixel info about center of the map
               var pixel = be.LatLongToPixel(map.GetCenter(), map.GetZoomLevel());

               info += "Map center pixel coordinates are : (" + pixel.x + ", " + pixel.y + ")\n\n";

               var rect = be.GetBoundingRectangle();

               // Display bounding rectangle property values to user
               info += "Top-left corner: (" + 
                       rect.TopLeftLatLong.Latitude + 
                       ", " +
                       rect.TopLeftLatLong.Longitude +
                       ")\n";
               
               if(map.GetMapMode() == VEMapMode.Mode3D)
               {
                  info += "Top-right corner: (" + 
                          rect.TopRightLatLong.Latitude + 
                          ", " +
                          rect.TopRightLatLong.Longitude +
                          ")\n";
               }

               info += "Bottom-right corner: (" + 
                       rect.BottomRightLatLong.Latitude + 
                       ", " +
                       rect.BottomRightLatLong.Longitude +
                       ")\n";
                       
               if(map.GetMapMode() == VEMapMode.Mode3D)
               {
                  info += "Bottom-left corner: (" + 
                          rect.BottomLeftLatLong.Latitude + 
                          ", " +
                          rect.BottomLeftLatLong.Longitude +
                          ")\n";
               }

               alert(info);
            }
            else
            {
              alert("Sorry, birdseye is not available");
            }
         }
      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:600px; height:400px;"></div>
      <input id="getinfo" type="button" value="Show info about current scene" name="getinfo" 
         onclick="GetInfo();">
   </body>
</html>

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.