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

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6421 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-02-29 17:32:02 +00:00
parent 279af295f1
commit 05858dc9fb

View File

@@ -459,12 +459,16 @@ OpenLayers.Bounds = OpenLayers.Class({
transform: function(source, dest) { transform: function(source, dest) {
var ll = OpenLayers.Projection.transform( var ll = OpenLayers.Projection.transform(
{'x': this.left, 'y': this.bottom}, source, dest); {'x': this.left, 'y': this.bottom}, source, dest);
var lr = OpenLayers.Projection.transform(
{'x': this.right, 'y': this.bottom}, source, dest);
var ul = OpenLayers.Projection.transform(
{'x': this.left, 'y': this.top}, source, dest);
var ur = OpenLayers.Projection.transform( var ur = OpenLayers.Projection.transform(
{'x': this.right, 'y': this.top}, source, dest); {'x': this.right, 'y': this.top}, source, dest);
this.left = ll.x; this.left = Math.min(ll.x, ul.x);
this.bottom = ll.y; this.bottom = Math.min(ll.y, lr.y);
this.right = ur.x; this.right = Math.max(lr.x, ur.x);
this.top = ur.y; this.top = Math.max(ul.y, ur.y);
return this; return this;
}, },