new restrictedMinZoom property. r=bartvde (closes #3024)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11058 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
+15
-2
@@ -274,6 +274,18 @@ OpenLayers.Layer = OpenLayers.Class({
|
||||
* {Integer}
|
||||
*/
|
||||
numZoomLevels: null,
|
||||
|
||||
/**
|
||||
* Property: restrictedMinZoom
|
||||
* {Integer} Restriction of the minimum zoom level. This is used for layers
|
||||
* that only use a subset of the resolutions in the <resolutions>
|
||||
* array. This is independent of <numResolutions>, which always starts
|
||||
* counting at zoom level 0. If restrictedMinZoom is e.g. set to 2,
|
||||
* the first two zoom levels (0 and 1) will not be used by this layer.
|
||||
* If the layer is a base layer, zooming to the map's maxExtent means
|
||||
* setting the map's zoom to 2.
|
||||
*/
|
||||
restrictedMinZoom: 0,
|
||||
|
||||
/**
|
||||
* APIProperty: minScale
|
||||
@@ -740,7 +752,8 @@ OpenLayers.Layer = OpenLayers.Class({
|
||||
} else {
|
||||
if (this.map) {
|
||||
var resolution = this.map.getResolution();
|
||||
inRange = ( (resolution >= this.minResolution) &&
|
||||
inRange = ( this.map.getZoom() >= this.restrictedMinZoom &&
|
||||
(resolution >= this.minResolution) &&
|
||||
(resolution <= this.maxResolution) );
|
||||
}
|
||||
}
|
||||
@@ -1171,7 +1184,7 @@ OpenLayers.Layer = OpenLayers.Class({
|
||||
}
|
||||
zoom = Math.max(0, i-1);
|
||||
}
|
||||
return zoom;
|
||||
return Math.max(this.restrictedMinZoom, zoom);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user