none
getZoomRange() not behaving as expected RRS feed

  • Question

  • I am attempting to use the getZoomRange() function to zoom the map to the highest zoom level possible. In some cases however, the max zoom range that is returned is too high and instead of an image of the property, the tiles that contain the image of a camera with a line through it are returned. Here is a code sample that includes an example latitude, longitude pair where this occurs. The getZoomRange().max returns 20, but the max zoom level that produces images is actually 18.

     

            

    function doBirdseye()
        {
          var map = new Microsoft.Maps.Map(document.getElementById("birdseye"),
              {credentials: MY_KEY,
               center: new Microsoft.Maps.Location(32.760635,-97.014239),
               mapTypeId: Microsoft.Maps.MapTypeId.birdseye,
               zoom: 18,
               enableSearchLogo: false,
               enableClickableLogo: false,
               showMapTypeSelector: false});
        
          var center = map.getCenter();
          var pin = new Microsoft.Maps.Pushpin(center);
          map.entities.push(pin);
          map.setView({zoom:map.getZoomRange().max, animate: false});
        }


    • Moved by Ricky_Brundritt Friday, March 9, 2012 6:11 PM (From:Bing Maps: Map Control and Web services Development)
    Tuesday, June 7, 2011 4:58 PM

Answers

  • Wow. this is the weirdest bug I've seen in a while. Half the time there is Birdseye imagery half the time there isn't. Panning and zooming around the area also showed some mixed results. There is birdseye imagery available at that location. It just appears that Bing.com/maps isn't always loading it. After looking around I've found that this location is right near the edge of scene and this is what is causing the issue. Based on what I've seen in the past this is as good as we are going to get with birdseye at this time.
    Windows Live Developer MVP - http://rbrundritt.wordpress.com | http://inknowledge.co.uk
    • Marked as answer by ctdalton Monday, June 20, 2011 7:28 PM
    Monday, June 20, 2011 6:00 PM

All replies

  • Birdseye imagery can be available up to zoom level 20 but it might not necessarily be available everywhere at this zoom level. What your looking for is the max zoom level imagery is available for a particular location. To find this out you need to use the Bing Maps Imagery service to find the metadate for the Birdseye Imagery.
    Windows Live Developer MVP - http://rbrundritt.wordpress.com | http://inknowledge.co.uk
    Tuesday, June 7, 2011 5:43 PM
  • When using the Bing Maps Imagery service for the same lat/lng, I also get 20 as the maxZoom:

    Request:

     

    http://dev.virtualearth.net/REST/v1/Imagery/BasicMetadata/Birdseye/32.760635,-97.014239?mapVersion=v1&o=xml&key=MY_KEY
    

     

    Response:

     

    <Response>
    	<Copyright>
    		Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.
    	</Copyright>
    	<BrandLogoUri>
    		http://dev.virtualearth.net/Branding/logo_powered_by.png
    	</BrandLogoUri>
    	<StatusCode>200</StatusCode>
    	<StatusDescription>OK</StatusDescription>
    	<AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>
    	<TraceId>
    		de689a546531450aa4fdf59aadfaf14f|BAYM001224|02.00.115.3100|
    	</TraceId>
    	<ResourceSets>
    		<ResourceSet>
    			<EstimatedTotal>1</EstimatedTotal>
    			<Resources>
    				<BirdseyeMetadata>
    					<ImageWidth>256</ImageWidth>
    					<ImageHeight>256</ImageHeight>
    					<ZoomMin>19</ZoomMin>
    					<ZoomMax>20</ZoomMax>
    					<Orientation>0</Orientation>
    					<TilesX>16</TilesX>
    					<TilesY>12</TilesY>
    				</BirdseyeMetadata>
    			</Resources>
    		</ResourceSet>
    	</ResourceSets>
    </Response>
    

     


    Tuesday, June 7, 2011 10:06 PM
  • Seems something is wrong in your case. I get expected view. Try your script on http://www.bingmapsportal.com/ISDK/AjaxV7. Just paste it in textblock & hit run.

    var map = new Microsoft.Maps.Map(document.getElementById("SDKmap"),
              { center: new Microsoft.Maps.Location(32.760635,-97.014239),
               mapTypeId: Microsoft.Maps.MapTypeId.birdseye,
               zoom: 18,
               enableSearchLogo: false,
               enableClickableLogo: false,
               showMapTypeSelector: false});
       
          var center = map.getCenter();
          var pin = new Microsoft.Maps.Pushpin(center);
          map.entities.push(pin);
           alert(map.getZoomRange().max);
          map.setView({zoom:map.getZoomRange().max, animate: false});

     


    HemantGoyal
    Tuesday, June 7, 2011 10:26 PM
  • When I use the ISDK ( http://www.bingmapsportal.com/ISDK/AjaxV7 ) with no credentials I can see the expected view. However, when I try to use it with my credentials I can no longer see any images. Also, the updated lat/lng pair below seems to reproduce the issue more consistently:

     

    var map= new Microsoft.Maps.Map(document.getElementById("SDKmap"),
    		{credentials: MY_KEY,
    		 center: new Microsoft.Maps.Location(32.7602590,-97.0156389),
    		 mapTypeId: Microsoft.Maps.MapTypeId.birdseye,
    		 zoom: 18,
    		 enableSearchLogo: false,
    		 enableClickableLogo: false,
    		 showMapTypeSelector: false});
    		
          var center = map.getCenter();
          var pin = new Microsoft.Maps.Pushpin(center); 
          map.entities.push(pin);
          alert(map.getZoomRange().max);
          map.setView({zoom:map.getZoomRange().max, animate: false});
    
    Wednesday, June 8, 2011 4:08 PM
  • I think I know what is going on here.

    When no credentials are supplied to map, the BE imagery is not displayed as it require valid credentials, Instead hybrid tiles are displayed with url like http://ecn.t2.tiles.virtualearth.net/tiles/cmd/svhybrid?a=021230021331113212&g=687&dir=dir_n&n=z & actual BE imagery is displayed when the valid credentials are entered http://ecn.t3.tiles.virtualearth.net/tiles/cmd/ObliqueHybrid?a=02123002133-3868-19-27&g=687.

    So with no credentials hybrid tiles are displayed at zoom level 20 as they are available but actual BE imagery is not available for some area. if you pan a map, you will get BE imagery at zoom level 20.
     
     


    HemantGoyal
    Thursday, June 9, 2011 5:39 AM
  • @HemantGoyal Thank you for your help with this issue. You mention above that you think that the hybrid tiles are available at zoom level 20 but that the actual BE imagery is not in this particular area. If this is the case, why does the imagery service return 20 as the ZoomMax?
    Thursday, June 9, 2011 5:13 PM
  • To determine if Birdseye imagery is available for a particular location you have to use the imagery metadata service. In the service there is zoom range information but this only tells you what zoom levels birdseye imagery is available on for the whole map. Not for the location in question. You have to check the dates to see if they are null or have a value. If the dates are null then there is no imagery.
    Windows Live Developer MVP - http://rbrundritt.wordpress.com | http://inknowledge.co.uk
    Friday, June 10, 2011 9:42 AM
  • I can not get the imagery service to return a date whenever I ask for the Birdseye imagery set whether there is BE imagery or not. If I ask for the Road or Aerial imagerySet a date is returned, but now when asking for the Birdseye imagerySet. Here is an example where BE imagery obviously exists, yet the imagery service does not return a date.

     

    http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Birdseye/33.0003440,-96.8167590?orientation=0&zoomLevel=20&o=xml&key=MY_KEY
    


    Here is the response from the service:

    <Response>
    	<Copyright>
    		Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.
    	</Copyright>
    	<BrandLogoUri>
    		http://dev.virtualearth.net/Branding/logo_powered_by.png
    	</BrandLogoUri>
    	<StatusCode>200</StatusCode>
    	<StatusDescription>OK</StatusDescription>
    	<AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>
    	<TraceId>
    		b1b80d4fc9ac4a2c8b720791eb4c273b|BAYM001205|02.00.115.3100|
    	</TraceId>
    	<ResourceSets>
    		<ResourceSet>
    			<EstimatedTotal>1</EstimatedTotal>
    			<Resources>
    				<BirdseyeMetadata>
    					<ImageUrl>
    						http://ecn.{subdomain}.tiles.virtualearth.net/tiles/o02311233001-24383-20-{tileId}.jpeg?g=687
    					</ImageUrl>
    					<ImageUrlSubdomains>
    						<string>t0</string>
    						<string>t1</string>
    						<string>t2</string>
    						<string>t3</string>
    					</ImageUrlSubdomains>
    					<ImageWidth>256</ImageWidth>
    					<ImageHeight>256</ImageHeight>
    					<ZoomMin>20</ZoomMin>
    					<ZoomMax>20</ZoomMax>
    					<Orientation>0</Orientation>
    					<TilesX>16</TilesX>
    					<TilesY>12</TilesY>
    				</BirdseyeMetadata>
    			</Resources>
    		</ResourceSet>
    	</ResourceSets>
    </Response>
    


    Put the same lat/lng into the ISDK and you can see that BE imagery does exist:

    var map= new Microsoft.Maps.Map(document.getElementById("SDKmap"),
    		{credentials: MY_KEY,
    		 center: new Microsoft.Maps.Location(33.0003440,-96.8167590),
    		 mapTypeId: Microsoft.Maps.MapTypeId.birdseye,
    		 zoom: 18,
    		 enableSearchLogo: false,
    		 enableClickableLogo: false,
    		 showMapTypeSelector: false});
    		
       var center = map.getCenter();
       var pin = new Microsoft.Maps.Pushpin(center); 
       map.entities.push(pin);
       map.setView({zoom:map.getZoomRange().max, animate: false});
    


     

    Friday, June 10, 2011 11:07 PM
  • In the past we used to use the Data as an indicator with the SOAP services. Reviewing the REST services you can just look at the value of the EstimatedTotal. If it equals 0 then there is no Birdseye imagery. If it is greater than 0 then there is.
    Windows Live Developer MVP - http://rbrundritt.wordpress.com | http://inknowledge.co.uk
    Saturday, June 18, 2011 1:13 PM
  • That doesn't seem to work either. We can use the lat/lng pairs already referenced above to disprove it. This lat/lng does indeed have images, and the EstimatedTotal is greater than 0 as expected:

    http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Birdseye/33.0003440,-96.8167590?orientation=0&zoomLevel=20&o=xml&key=MY_KEY
    <Response>
    	<Copyright>
    		Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.
    	</Copyright>
    	<BrandLogoUri>
    		http://dev.virtualearth.net/Branding/logo_powered_by.png
    	</BrandLogoUri>
    	<StatusCode>200</StatusCode>
    	<StatusDescription>OK</StatusDescription>
    	<AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>
    	<TraceId>
    		b1b80d4fc9ac4a2c8b720791eb4c273b|BAYM001205|02.00.115.3100|
    	</TraceId>
    	<ResourceSets>
    		<ResourceSet>
    			<EstimatedTotal>1</EstimatedTotal>
    			<Resources>
    				<BirdseyeMetadata>
    					<ImageUrl>
    						http://ecn.{subdomain}.tiles.virtualearth.net/tiles/o02311233001-24383-20-{tileId}.jpeg?g=687
    					</ImageUrl>
    					<ImageUrlSubdomains>
    						<string>t0</string>
    						<string>t1</string>
    						<string>t2</string>
    						<string>t3</string>
    					</ImageUrlSubdomains>
    					<ImageWidth>256</ImageWidth>
    					<ImageHeight>256</ImageHeight>
    					<ZoomMin>20</ZoomMin>
    					<ZoomMax>20</ZoomMax>
    					<Orientation>0</Orientation>
    					<TilesX>16</TilesX>
    					<TilesY>12</TilesY>
    				</BirdseyeMetadata>
    			</Resources>
    		</ResourceSet>
    	</ResourceSets>
    </Response>

     

    However, this lat/lng does not have images (this can be verified by using the ISDK) and yet the EstimatedTotal is still greater than 0:

    http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Birdseye/32.7602590,-97.0156389?orientation=0&zoomLevel=20&o=xml&key=MY_KEY
    
    <Response>
    	<Copyright>
    		Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.
    	</Copyright>
    	<BrandLogoUri>
    		http://dev.virtualearth.net/Branding/logo_powered_by.png
    	</BrandLogoUri>
    	<StatusCode>200</StatusCode>
    	<StatusDescription>OK</StatusDescription>
    	<AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>
    	<TraceId>
    		0a4108c155df45c9b2f04d60f87f73e7|BAYM001220|02.00.115.3100|
    	</TraceId>
    	<ResourceSets>
    		<ResourceSet>
    			<EstimatedTotal>1</EstimatedTotal>
    			<Resources>
    				<BirdseyeMetadata>
    					<ImageUrl>
    						http://ecn.{subdomain}.tiles.virtualearth.net/tiles/o02311233020-19422-20-{tileId}.jpeg?g=689
    					</ImageUrl>
    					<ImageUrlSubdomains>
    						<string>t0</string>
    						<string>t1</string>
    						<string>t2</string>
    						<string>t3</string>
    					</ImageUrlSubdomains>
    					<ImageWidth>256</ImageWidth>
    					<ImageHeight>256</ImageHeight>
    					<ZoomMin>20</ZoomMin>
    					<ZoomMax>20</ZoomMax>
    					<Orientation>0</Orientation>
    					<TilesX>16</TilesX>
    					<TilesY>12</TilesY>
    				</BirdseyeMetadata>
    			</Resources>
    		</ResourceSet>
    	</ResourceSets>
    </Response>
    



     

    Monday, June 20, 2011 3:55 PM
  • I just tested your second coordinate and it does have Birdseye imagery: http://www.bing.com/maps/?v=2&where1=32.760259%2C%20-97.0156389&q=32.7602590%2C-97.0156389&form=LMLTSN&cp=32.76036896520739~-97.01552386005429&lvl=19.42044365795835&sty=b&encType=1
    Windows Live Developer MVP - http://rbrundritt.wordpress.com | http://inknowledge.co.uk
    Monday, June 20, 2011 4:10 PM
  • Simply navigating to the url you posted does not give any Birdseye imagery. I do not get any imagery until I zoom out then zoom back in (and that doesn't even seem to work every time). Why does the imagery not show until after zoom navigation? I might be able to work around it by forcing the map to zoom out then back in on page load, but I'd rather understand why the imagery isn't there in the first place, especially since zooming does not always work.
    Monday, June 20, 2011 5:06 PM
  • Wow. this is the weirdest bug I've seen in a while. Half the time there is Birdseye imagery half the time there isn't. Panning and zooming around the area also showed some mixed results. There is birdseye imagery available at that location. It just appears that Bing.com/maps isn't always loading it. After looking around I've found that this location is right near the edge of scene and this is what is causing the issue. Based on what I've seen in the past this is as good as we are going to get with birdseye at this time.
    Windows Live Developer MVP - http://rbrundritt.wordpress.com | http://inknowledge.co.uk
    • Marked as answer by ctdalton Monday, June 20, 2011 7:28 PM
    Monday, June 20, 2011 6:00 PM