remove reproject() method which was sort of silly anyways -- i think the ve/goog marker misplacement problem was that the layercontainerdiv was not being correctly reset on a changebaselayer. so im changing the setbaselayer() to auto call setCenter() with a new zoom (by nulling the zoom beforehand and passing in the current zoom).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1259 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -159,12 +159,6 @@ OpenLayers.Layer.prototype = {
|
|||||||
//this function can be implemented by subclasses.
|
//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
|
/** Set the map property for the layer. This is done through an accessor
|
||||||
* so that subclasses can override this and take special action once
|
* so that subclasses can override this and take special action once
|
||||||
* they have their map variable set.
|
* they have their map variable set.
|
||||||
|
|||||||
@@ -53,14 +53,6 @@ OpenLayers.Layer.Markers.prototype =
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
reproject:function() {
|
|
||||||
this.redraw();
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {OpenLayers.Marker} marker
|
* @param {OpenLayers.Marker} marker
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -360,29 +360,21 @@ OpenLayers.Map.prototype = {
|
|||||||
var foundLayer = (this.layers.indexOf(newBaseLayer) != -1);
|
var foundLayer = (this.layers.indexOf(newBaseLayer) != -1);
|
||||||
if (foundLayer) {
|
if (foundLayer) {
|
||||||
|
|
||||||
var oldExtent = null;
|
|
||||||
|
|
||||||
// make the old base layer invisible
|
// make the old base layer invisible
|
||||||
if (this.baseLayer != null) {
|
if (this.baseLayer != null) {
|
||||||
oldExtent = this.baseLayer.getExtent();
|
|
||||||
this.baseLayer.setVisibility(false, noEvent);
|
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;
|
this.baseLayer = newBaseLayer;
|
||||||
if (oldExtent != null) {
|
|
||||||
this.baseLayer.moveTo(oldExtent, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// make the new baselayer visible
|
|
||||||
this.baseLayer.setVisibility(true, noEvent);
|
this.baseLayer.setVisibility(true, noEvent);
|
||||||
|
|
||||||
// now go back and reproject the overlays
|
//redraw all layers
|
||||||
for(var i=0; i < this.layers.length; i++) {
|
var center = this.getCenter();
|
||||||
var layer = this.layers[i];
|
if (center != null) {
|
||||||
if (!layer.isBaseLayer) {
|
var zoom = this.getZoom();
|
||||||
layer.reproject();
|
this.zoom = null;
|
||||||
}
|
this.setCenter(center, zoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((noEvent == null) || (noEvent == false)) {
|
if ((noEvent == null) || (noEvent == false)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user