OpenLayers OpenLayers

Changeset 6421

Show
Ignore:
Timestamp:
02/29/08 12:32:02 (10 months ago)
Author:
tschaub
Message:

Changing bounds.transform so it works with non-conformal projections. r=ahocevar (closes #1407)

Files:

Legend:

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

    r6313 r6421  
    460460        var ll = OpenLayers.Projection.transform( 
    461461            {'x': this.left, 'y': this.bottom}, source, dest); 
     462        var lr = OpenLayers.Projection.transform( 
     463            {'x': this.right, 'y': this.bottom}, source, dest); 
     464        var ul = OpenLayers.Projection.transform( 
     465            {'x': this.left, 'y': this.top}, source, dest); 
    462466        var ur = OpenLayers.Projection.transform( 
    463467            {'x': this.right, 'y': this.top}, source, dest); 
    464         this.left   = ll.x
    465         this.bottom = ll.y
    466         this.right  = ur.x
    467         this.top    = ur.y
     468        this.left   = Math.min(ll.x, ul.x)
     469        this.bottom = Math.min(ll.y, lr.y)
     470        this.right  = Math.max(lr.x, ur.x)
     471        this.top    = Math.max(ul.y, ur.y)
    468472        return this; 
    469473    },