[OpenLayers-Commits] r4789 - sandbox/euzuro/zoomToResolution/lib/OpenLayers
commits at openlayers.org
commits at openlayers.org
Wed Oct 3 13:59:07 EDT 2007
Author: crschmidt
Date: 2007-10-03 13:59:06 -0400 (Wed, 03 Oct 2007)
New Revision: 4789
Modified:
sandbox/euzuro/zoomToResolution/lib/OpenLayers/Map.js
Log:
add in closest support to zoomToExtent
Modified: sandbox/euzuro/zoomToResolution/lib/OpenLayers/Map.js
===================================================================
--- sandbox/euzuro/zoomToResolution/lib/OpenLayers/Map.js 2007-10-03 17:11:53 UTC (rev 4788)
+++ sandbox/euzuro/zoomToResolution/lib/OpenLayers/Map.js 2007-10-03 17:59:06 UTC (rev 4789)
@@ -1367,15 +1367,22 @@
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
+ * 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 bounds.
* If no baselayer is set, returns null.
*/
- getZoomForExtent: function (bounds) {
+ getZoomForExtent: function (bounds, closest) {
var zoom = null;
if (this.baseLayer != null) {
- zoom = this.baseLayer.getZoomForExtent(bounds);
+ zoom = this.baseLayer.getZoomForExtent(bounds, closest);
}
return zoom;
},
More information about the Commits
mailing list