Ticket #1893 (closed bug: fixed)
Setting numZoomLevels to 17 or more breaks Virtual Earth layer
| Reported by: | openlayers | Owned by: | euzuro |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.9 Release |
| Component: | Layer.VirtualEarth | Version: | SVN |
| Keywords: | Cc: | trevor.timbeck@… | |
| State: | Complete |
Description
If you set the numZoomLevels to 17 or higher, then when you switch away from from the VE layer and switch back, nothing is displayed.
Platform: Windows XP Browser: Firefox 3.05
Steps to reproduce: Create a map with:
map = new OpenLayers.Map( 'map', {numZoomLevels: 17});
and add a VE layer and any other layer(s). Then switch from VE to another layer, and switch back to VE. When you switch back to VE, nothing is displayed.
The reason I was trying for a zoom level higher than 17 (24 actually) is one of the layers is a TMS layer that supports a higher zoom level. The Google and Yahoo layers seem to handle this case fine. If zoomed beyond the max, they just revert to their max when you switch to that layer. But the VE layer doesn't even seem to draw properly (or at all) when you switch back to it.
Here is sample code to reproduce:
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#map {
width: 80%; height: 90%; border: 4px solid black;
} #banner {
width: 100%; background-color: 003366; border-top: 4px solid black; border-left: 4px solid black; border-right: 4px solid black; border-bottom: 0px solid black; padding: 0px;
}
</style>
<script src="http://openlayers.org/api/OpenLayers.js"></script> <script src=" http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1" type="text/javascript"></script> <script src=" http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
<script type="text/javascript"> <!--
var map;
function init(){
map = new OpenLayers.Map( 'map', {numZoomLevels: 17});
var ve = new OpenLayers.Layer.VirtualEarth( "VE", {'type': VEMapStyle.Aerial}); var yahoo = new OpenLayers.Layer.Yahoo( "Yahoo"); map.addLayers([ve, yahoo]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
} // -->
</script>
</head> <body onload="init()">
<div id="map"></div>
</body>
</html>

