none
How to check the birdeye available or not in bing map version 7.0 RRS feed

  • Question

  • Can anybody provide me the solution to how to check the birdeye available or not because in some property address cases bing map don't provide the birdeye due to some restrict area so we need to show the message to your application if birdeye not available.

    In bingmap version 6.3 IsBirdEyeScene() method to accomplish this task.
    • Moved by Ricky_Brundritt Friday, March 9, 2012 5:42 PM (From:Bing Maps: Map Control and Web services Development)
    Monday, May 30, 2011 4:45 AM

Answers

  • Use Map getoptions:

    IsRotationEnabled - To find if Birdeye or Synth view is available at current display, getImageryId() returns NativeBirdeye, if actual birdeye is available, otherwise it can have Aerial, EnhancedBirdeye values

     


    HemantGoyal
    Monday, May 30, 2011 5:11 AM
  • Yes! BE is always available in v7, but places where BE is not available Aerial view is displayed.
    HemantGoyal
    Tuesday, May 31, 2011 1:25 AM
  • One other and supported way to do this would be to use the Imagery API : http://msdn.microsoft.com/en-us/library/ff701716

    And to check if the view is available, you can use a simple code like this:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        <script type="text/javascript" charset="UTF-8" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&onscriptload=getMap">
        </script>
        <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js" type="text/javascript"></script>
        <script type="text/javascript">
            var map = null;
            var key = 'INSERYOURKEY';
    		var sessionKey = null;
            function getMap() {
    
                // Initialize the map
                map = new Microsoft.Maps.Map($('#map').get(0), {
                    credentials: key,
                    center: new Microsoft.Maps.Location(47.5, 2.75),
                    zoom: 4,
                    mapTypeId: Microsoft.Maps.MapTypeId.road
                });
    
    			map.getCredentials(function(bmKey) {
    				if (bmKey) {
    					sessionKey = bmKey;
    
    					// Add a handler for the pushpin click event.
    					Microsoft.Maps.Events.addHandler(map, 'viewchangeend', checkBirdEye);
    				}
    			});
    			
            }
               
            function checkBirdEye() {
                var loc = map.getCenter();
    
                var composedUrl = 'http://dev.virtualearth.net/REST/V1/Imagery/Metadata/Birdseye/';
                composedUrl += loc.latitude.toFixed(6) + ',';
                composedUrl += loc.longitude.toFixed(6);
                composedUrl += '?key=' + key;
                composedUrl += '&zl=20&dir=1&dl=2&jsonp=onSuccess';
    
                $.ajax({
                    type: 'GET',
                    url: composedUrl,
                    dataType: 'jsonp',
                    contentType: 'application/json; charset=utf-8'
                });
            }
    
            function onSuccess(data) {
                if (data.resourceSets[0] != null) {
                    if (data.resourceSets[0].estimatedTotal != 0) {
                        alert('View available');
                    }
                }
            }
            
    
        </script>
    </head>
    <body onload="getMap();">
        <div id="map" style="position: relative; width: 800px; height: 600px;">
        </div>
    </body>
    </html>
    
    Of course, you can limits the number or request by calling the service when you're over a specific places at a certain zoom level and eventualy keep the latest request and check the distance between the two possible calls but I think you'll get the point.

    MVP - Bing Maps - My blog (FR): http://blogs.developpeur.org/nicoboo/ Twitter: http://twitter.com/nicolasboonaert/

    Monday, July 9, 2012 1:41 PM
    Moderator

All replies

  • Use Map getoptions:

    IsRotationEnabled - To find if Birdeye or Synth view is available at current display, getImageryId() returns NativeBirdeye, if actual birdeye is available, otherwise it can have Aerial, EnhancedBirdeye values

     


    HemantGoyal
    Monday, May 30, 2011 5:11 AM
  • Thanks every one for your help.

    We have already application built in bing map version 6.3, in that we have few properties for which bird eye view is not available. We have looked for those properties bird eye view in bing map 7.0 and its showing.

    From my analysis it looks that bird eye view for properties are alsways available in bing map 7.0. Please correct me if i am wrong.

     

    Monday, May 30, 2011 11:05 AM
  • Yes! BE is always available in v7, but places where BE is not available Aerial view is displayed.
    HemantGoyal
    Tuesday, May 31, 2011 1:25 AM
  • This does not appear to be 100% accurate.

    Check this map out:

    www.homes.com/Home-Prices/ID-600017915379/12544-W-123RD-ST/

    The birdseye view of that map returns no image but it doesn't switch automatically to aerial view.  isRotationEnabled returns true, getImageryId returns NativeBirdseye and even calling the image webservice returns that birdseye is available.

    Any thoughts on this?

    Monday, July 9, 2012 12:33 PM
  • One other and supported way to do this would be to use the Imagery API : http://msdn.microsoft.com/en-us/library/ff701716

    And to check if the view is available, you can use a simple code like this:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        <script type="text/javascript" charset="UTF-8" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&onscriptload=getMap">
        </script>
        <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js" type="text/javascript"></script>
        <script type="text/javascript">
            var map = null;
            var key = 'INSERYOURKEY';
    		var sessionKey = null;
            function getMap() {
    
                // Initialize the map
                map = new Microsoft.Maps.Map($('#map').get(0), {
                    credentials: key,
                    center: new Microsoft.Maps.Location(47.5, 2.75),
                    zoom: 4,
                    mapTypeId: Microsoft.Maps.MapTypeId.road
                });
    
    			map.getCredentials(function(bmKey) {
    				if (bmKey) {
    					sessionKey = bmKey;
    
    					// Add a handler for the pushpin click event.
    					Microsoft.Maps.Events.addHandler(map, 'viewchangeend', checkBirdEye);
    				}
    			});
    			
            }
               
            function checkBirdEye() {
                var loc = map.getCenter();
    
                var composedUrl = 'http://dev.virtualearth.net/REST/V1/Imagery/Metadata/Birdseye/';
                composedUrl += loc.latitude.toFixed(6) + ',';
                composedUrl += loc.longitude.toFixed(6);
                composedUrl += '?key=' + key;
                composedUrl += '&zl=20&dir=1&dl=2&jsonp=onSuccess';
    
                $.ajax({
                    type: 'GET',
                    url: composedUrl,
                    dataType: 'jsonp',
                    contentType: 'application/json; charset=utf-8'
                });
            }
    
            function onSuccess(data) {
                if (data.resourceSets[0] != null) {
                    if (data.resourceSets[0].estimatedTotal != 0) {
                        alert('View available');
                    }
                }
            }
            
    
        </script>
    </head>
    <body onload="getMap();">
        <div id="map" style="position: relative; width: 800px; height: 600px;">
        </div>
    </body>
    </html>
    
    Of course, you can limits the number or request by calling the service when you're over a specific places at a certain zoom level and eventualy keep the latest request and check the distance between the two possible calls but I think you'll get the point.

    MVP - Bing Maps - My blog (FR): http://blogs.developpeur.org/nicoboo/ Twitter: http://twitter.com/nicolasboonaert/

    Monday, July 9, 2012 1:41 PM
    Moderator
  • Sadly this method doesn't work either.  The Imagery API returns success for the lat/lng and zoom in question yet when you go to the page I linked you get no tiles at all.

    www.homes.com/Home-Prices/ID-600017915379/12544-W-123RD-ST/

    Tuesday, July 17, 2012 11:41 AM
  • The methods provided above are valid. Imagery for this area is being released. Thus the reason why the map control thinks there is imagery here.

    http://rbrundritt.wordpress.com

    Tuesday, July 17, 2012 12:58 PM