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. git-svn-id: http://svn.openlayers.org/branches/openlayers/2.0@1355 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -371,9 +371,12 @@ OpenLayers.Map.prototype = {
|
||||
if (center != null) {
|
||||
var zoom = this.getZoom();
|
||||
this.zoom = null;
|
||||
if (zoom > this.baseLayer.numZoomLevels - 1) {
|
||||
zoom = this.baseLayer.numZoomLevels - 1;
|
||||
}
|
||||
this.setCenter(center, zoom);
|
||||
|
||||
}
|
||||
|
||||
if ((noEvent == null) || (noEvent == false)) {
|
||||
this.events.triggerEvent("changebaselayer");
|
||||
}
|
||||
@@ -562,7 +565,6 @@ OpenLayers.Map.prototype = {
|
||||
* trigger movestart/end events
|
||||
*/
|
||||
setCenter: function (lonlat, zoom, minor) {
|
||||
|
||||
var zoomChanged = (this.isValidZoomLevel(zoom)) &&
|
||||
(zoom != this.getZoom());
|
||||
|
||||
@@ -599,7 +601,7 @@ OpenLayers.Map.prototype = {
|
||||
this.popups[i].updatePosition();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//send the move call to the baselayer and all the overlays
|
||||
var bounds = this.getExtent();
|
||||
for (var i = 0; i < this.layers.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user