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:
euzuro
2006-10-06 16:17:10 +00:00
parent 5425ea861c
commit 9b73a9a4c9

View File

@@ -450,8 +450,11 @@ OpenLayers.Map.prototype = {
//redraw all layers
var center = this.getCenter();
if (center != null) {
var oldResolution = oldBaseLayer.getResolution();
var zoom = this.baseLayer.getZoomForResolution(oldResolution);
var zoom = null;
if (oldBaseLayer != null) {
var oldResolution = oldBaseLayer.getResolution();
zoom = this.baseLayer.getZoomForResolution(oldResolution);
}
this.setCenter(center, zoom);
}
if ((noEvent == null) || (noEvent == false)) {