OpenLayers OpenLayers

Changeset 4048

Show
Ignore:
Timestamp:
08/27/07 08:59:55 (1 year ago)
Author:
thliese
Message:

improved the getZoomForExtent function (still not satisfied, though ;)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/thliese/openlayers/lib/OpenLayers/Layer/Map24.js

    r4030 r4048  
    228228     */ 
    229229    getZoomForExtent: function (bounds) { 
    230         var res = (bounds.right - bounds.left) / this.canvasWidth; 
     230        var res = Math.max( 
     231            Math.abs(bounds.right - bounds.left) / this.canvasWidth, 
     232            Math.abs(bounds.top - bounds.bottom) / this.canvasHeight 
     233        ); 
    231234         
    232235        // find the corresponding zoom level