From 66f5e034dac02fe3e648129bc761f61ee7a262a1 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Mon, 12 Jun 2006 12:16:43 +0000 Subject: [PATCH] Never zoom more than the max. It just stays where it is. git-svn-id: http://svn.openlayers.org/trunk/openlayers@573 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 33413ae29e..6318009f9f 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -283,7 +283,7 @@ OpenLayers.Map.prototype = { var height = bounds.getHeight(); var deg_per_pixel = (width > height ? width / size.w : height / size.h); var zoom = Math.log(this.maxResolution / deg_per_pixel) / Math.log(2); - return Math.floor(Math.max(zoom, 0)); + return Math.floor(Math.min(Math.max(zoom, 0), this.getZoomLevels())); }, /**