OpenLayers OpenLayers

Changeset 1227

Show
Ignore:
Timestamp:
08/15/06 21:09:42 (2 years ago)
Author:
euzuro
Message:

fix for #168 - getScale() thanks for great patch from Tim Schaub

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Map.js

    r1219 r1227  
    811811    }, 
    812812 
     813     /** 
     814      * @returns The current scale denominator of the map.  
     815      *          If no baselayer is set, returns null. 
     816      * @type float 
     817      */ 
     818    getScale: function () { 
     819        var scale = null; 
     820 
     821        if (this.baseLayer != null) { 
     822            var res = this.baseLayer.getResolution(); 
     823            var units = this.baseLayer.units; 
     824            scale = res * OpenLayers.INCHES_PER_UNIT[units] * 
     825                    OpenLayers.DOTS_PER_INCH; 
     826        } 
     827        return scale; 
     828    }, 
     829 
     830 
    813831    /** 
    814832    * @param {OpenLayers.Bounds} bounds