Add reprojection support on Geometry classes. Geometries can now be transformed

in place by using .transform(source, dest). r=elemoine (Closes #1037) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@5515 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-12-19 22:04:30 +00:00
parent 50ec61dfc9
commit 7440556585
3 changed files with 61 additions and 0 deletions

View File

@@ -152,6 +152,27 @@ OpenLayers.Geometry.LinearRing = OpenLayers.Class(
this.components[i].resize(scale, origin, ratio);
}
},
/**
* APIMethod: transform
* Reproject the components geometry from source to dest.
*
* Parameters:
* source - {<OpenLayers.Projection>}
* dest - {<OpenLayers.Projection>}
*
* Returns:
* {<OpenLayers.Geometry>}
*/
transform: function(source, dest) {
if (source && dest) {
for (var i = 0; i < this.components.length - 1; i++) {
var component = this.components[i];
component.transform(source, dest);
}
}
return this;
},
/**
* APIMethod: getArea