OpenLayers - limit the number of zoom levels
Hello,
I'm trying to limit the zoom levels of my OpenLayers application. I want to make max zoom level to be 14 using standard zoom levels (nothing fancy like fractional zooms and resolutions) and that is all. I've read this article: http://trac.osgeo.org/openlayers/wiki/SettingZoomLevels I've tried tons of combinations of maxExtent, minExtent, maxResolution, minResolution, numZoomLevels and so on... the user is always able to go beyond ZL 14 :(
Here is my map definition:
<pre>
var options = {
projection: new OpenLayers.Projection("EPSG:900913"),
units: "m",
controls: [
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.Permalink(),
new OpenLayers.Control.Attribution(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.ScaleLine()
],
displayProjection: new OpenLayers.Projection("EPSG:4326")
}
map = new OpenLayers.Map("mapdiv",options);
map.addLayer(new OpenLayers.Layer.OSM());
</pre>