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:
ahocevar
2011-06-18 19:11:54 +00:00
parent 1ccf325285
commit 6248cdc94d
3 changed files with 94 additions and 1 deletions

View File

@@ -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;
},