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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user