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:
ahocevar
2011-01-24 21:43:35 +00:00
parent 2f7a3e818a
commit a1c80ffb7e
4 changed files with 84 additions and 5 deletions

View File

@@ -1800,8 +1800,8 @@ OpenLayers.Map = OpenLayers.Class({
* within the min/max range of zoom levels.
*/
isValidZoomLevel: function(zoomLevel) {
return ( (zoomLevel != null) &&
(zoomLevel >= 0) &&
return ( (zoomLevel != null) &&
(zoomLevel >= this.getRestrictedMinZoom()) &&
(zoomLevel < this.getNumZoomLevels()) );
},
@@ -1905,6 +1905,20 @@ OpenLayers.Map = OpenLayers.Class({
return maxExtent;
},
/**
* Method: getRestricteMinZoom
*
* Returns:
* {Integer} the minimum zoom level allowed for the current baseLayer.
*/
getRestrictedMinZoom: function() {
var minZoom = null;
if (this.baseLayer != null) {
minZoom = this.baseLayer.restrictedMinZoom;
}
return minZoom;
},
/**
* APIMethod: getNumZoomLevels
*