OpenLayers OpenLayers

Changeset 1355

Show
Ignore:
Timestamp:
08/24/06 10:08:18 (2 years ago)
Author:
crschmidt
Message:

Map should change zoom level to maximum for the baseLayer when the baseLayer
changes, rather than trying to set it to 17, which will fail, and leave the
zoom level as null, and then everything explodes. Thanks to Heidi Fox at MC
for this report.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/openlayers/2.0/lib/OpenLayers/Map.js

    r1331 r1355  
    372372                    var zoom = this.getZoom(); 
    373373                    this.zoom = null; 
     374                    if (zoom > this.baseLayer.numZoomLevels - 1) { 
     375                        zoom = this.baseLayer.numZoomLevels - 1; 
     376                    }     
    374377                    this.setCenter(center, zoom);             
     378                 
    375379                } 
    376  
    377380                if ((noEvent == null) || (noEvent == false)) { 
    378381                    this.events.triggerEvent("changebaselayer"); 
     
    563566    */ 
    564567    setCenter: function (lonlat, zoom, minor) { 
    565  
    566568        var zoomChanged = (this.isValidZoomLevel(zoom)) &&  
    567569                          (zoom != this.getZoom()); 
     
    600602                } 
    601603            }     
    602  
     604             
    603605            //send the move call to the baselayer and all the overlays     
    604606            var bounds = this.getExtent();