[OpenLayers-Commits] r4787 - sandbox/euzuro/zoomToResolution/lib/OpenLayers

commits at openlayers.org commits at openlayers.org
Wed Oct 3 12:44:16 EDT 2007


Author: euzuro
Date: 2007-10-03 12:44:15 -0400 (Wed, 03 Oct 2007)
New Revision: 4787

Modified:
   sandbox/euzuro/zoomToResolution/lib/OpenLayers/Map.js
Log:
we must support this at the map level as well as the layer level.

Modified: sandbox/euzuro/zoomToResolution/lib/OpenLayers/Map.js
===================================================================
--- sandbox/euzuro/zoomToResolution/lib/OpenLayers/Map.js	2007-10-03 16:28:09 UTC (rev 4786)
+++ sandbox/euzuro/zoomToResolution/lib/OpenLayers/Map.js	2007-10-03 16:44:15 UTC (rev 4787)
@@ -1385,15 +1385,22 @@
      * 
      * Parameter:
      * resolution - {Float}
+     * closest - {Boolean} Find the zoom level that corresponds to the absolute 
+     *     closest resolution, which may result in a zoom whose corresponding
+     *     resolution is actually smaller than we would have desired (if this
+     *     is being called from a getZoomForExtent() call, then this means that
+     *     the returned zoom index might not actually contain the entire 
+     *     extent specified... but it'll be close).
+     *     Default is false.
      * 
      * Returns:
      * {Integer} A suitable zoom level for the specified resolution.
      *           If no baselayer is set, returns null.
      */
-    getZoomForResolution: function(resolution) {
+    getZoomForResolution: function(resolution, closest) {
         var zoom = null;
         if (this.baseLayer != null) {
-            zoom = this.baseLayer.getZoomForResolution(resolution);
+            zoom = this.baseLayer.getZoomForResolution(resolution, closest);
         }
         return zoom;
     },



More information about the Commits mailing list