OpenLayers OpenLayers

Changeset 4787

Show
Ignore:
Timestamp:
10/03/07 12:44:15 (1 year ago)
Author:
euzuro
Message:

we must support this at the map level as well as the layer level.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/euzuro/zoomToResolution/lib/OpenLayers/Map.js

    r4768 r4787  
    13861386     * Parameter: 
    13871387     * resolution - {Float} 
     1388     * closest - {Boolean} Find the zoom level that corresponds to the absolute  
     1389     *     closest resolution, which may result in a zoom whose corresponding 
     1390     *     resolution is actually smaller than we would have desired (if this 
     1391     *     is being called from a getZoomForExtent() call, then this means that 
     1392     *     the returned zoom index might not actually contain the entire  
     1393     *     extent specified... but it'll be close). 
     1394     *     Default is false. 
    13881395     *  
    13891396     * Returns: 
     
    13911398     *           If no baselayer is set, returns null. 
    13921399     */ 
    1393     getZoomForResolution: function(resolution) { 
     1400    getZoomForResolution: function(resolution, closest) { 
    13941401        var zoom = null; 
    13951402        if (this.baseLayer != null) { 
    1396             zoom = this.baseLayer.getZoomForResolution(resolution); 
     1403            zoom = this.baseLayer.getZoomForResolution(resolution, closest); 
    13971404        } 
    13981405        return zoom;