fixing getOLZoomFromMapObjectZoom so it also works when the layer is not the baseLayer. r=bartvde,tschaub (see #3342)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@12105 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -287,6 +287,11 @@ OpenLayers.Layer.FixedZoomLevels = OpenLayers.Class({
|
||||
var zoom = null;
|
||||
if (moZoom != null) {
|
||||
zoom = moZoom - this.minZoomLevel;
|
||||
if (this.map.baseLayer !== this) {
|
||||
zoom = this.map.baseLayer.getZoomForResolution(
|
||||
this.getResolutionForZoom(zoom)
|
||||
)
|
||||
}
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
@@ -306,6 +311,11 @@ OpenLayers.Layer.FixedZoomLevels = OpenLayers.Class({
|
||||
var zoom = null;
|
||||
if (olZoom != null) {
|
||||
zoom = olZoom + this.minZoomLevel;
|
||||
if (this.map.baseLayer !== this) {
|
||||
zoom = this.getZoomForResolution(
|
||||
this.map.baseLayer.getResolutionForZoom(zoom)
|
||||
);
|
||||
}
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user