From 0f2d373a905b696b32f69dc6a1b15cc78adad4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Tue, 15 Jan 2008 20:49:24 +0000 Subject: [PATCH] If scales is set on the map, you cannot use minScale and maxScale on the layer. r=crschmidt. (closes #1199) git-svn-id: http://svn.openlayers.org/trunk/openlayers@5755 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index 3351c1ebaf..4b2d20a479 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -624,6 +624,20 @@ OpenLayers.Layer = OpenLayers.Class({ confProps[property] = this.options[property] || this.map[property]; } + // Do not use the scales/resolutions at the map level if + // minScale/minResolution and maxScale/maxResolution are + // specified at the layer level + if (this.options.minScale != null && + this.options.maxScale != null && + this.options.scales == null) { + confProps.scales = null; + } + if (this.options.minResolution != null && + this.options.maxResolution != null && + this.options.resolutions == null) { + confProps.resolutions = null; + } + // If numZoomLevels hasn't been set and the maxZoomLevel *has*, // then use maxZoomLevel to calculate numZoomLevels //