if there is no old base layer, dont try to get the zoom from it
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1655 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -450,8 +450,11 @@ OpenLayers.Map.prototype = {
|
|||||||
//redraw all layers
|
//redraw all layers
|
||||||
var center = this.getCenter();
|
var center = this.getCenter();
|
||||||
if (center != null) {
|
if (center != null) {
|
||||||
var oldResolution = oldBaseLayer.getResolution();
|
var zoom = null;
|
||||||
var zoom = this.baseLayer.getZoomForResolution(oldResolution);
|
if (oldBaseLayer != null) {
|
||||||
|
var oldResolution = oldBaseLayer.getResolution();
|
||||||
|
zoom = this.baseLayer.getZoomForResolution(oldResolution);
|
||||||
|
}
|
||||||
this.setCenter(center, zoom);
|
this.setCenter(center, zoom);
|
||||||
}
|
}
|
||||||
if ((noEvent == null) || (noEvent == false)) {
|
if ((noEvent == null) || (noEvent == false)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user