diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index 62482bab48..483c53930d 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -159,12 +159,6 @@ OpenLayers.Layer.prototype = { //this function can be implemented by subclasses. }, - /** - */ - reproject:function() { - //this function can be implemented by subclasses. - }, - /** Set the map property for the layer. This is done through an accessor * so that subclasses can override this and take special action once * they have their map variable set. diff --git a/lib/OpenLayers/Layer/Markers.js b/lib/OpenLayers/Layer/Markers.js index 4382456ad7..94297116e2 100644 --- a/lib/OpenLayers/Layer/Markers.js +++ b/lib/OpenLayers/Layer/Markers.js @@ -53,14 +53,6 @@ OpenLayers.Layer.Markers.prototype = } }, - - /** - */ - reproject:function() { - this.redraw(); - }, - - /** * @param {OpenLayers.Marker} marker */ diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 9980b9edff..4aea80fff5 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -360,29 +360,21 @@ OpenLayers.Map.prototype = { var foundLayer = (this.layers.indexOf(newBaseLayer) != -1); if (foundLayer) { - var oldExtent = null; - // make the old base layer invisible if (this.baseLayer != null) { - oldExtent = this.baseLayer.getExtent(); this.baseLayer.setVisibility(false, noEvent); } - // set new baselayer and move it to the old layer's extent + // set new baselayer and make it visible this.baseLayer = newBaseLayer; - if (oldExtent != null) { - this.baseLayer.moveTo(oldExtent, true); - } - - // make the new baselayer visible this.baseLayer.setVisibility(true, noEvent); - - // now go back and reproject the overlays - for(var i=0; i < this.layers.length; i++) { - var layer = this.layers[i]; - if (!layer.isBaseLayer) { - layer.reproject(); - } + + //redraw all layers + var center = this.getCenter(); + if (center != null) { + var zoom = this.getZoom(); + this.zoom = null; + this.setCenter(center, zoom); } if ((noEvent == null) || (noEvent == false)) {