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

@@ -188,6 +188,25 @@ OpenLayers.Geometry.Point = OpenLayers.Class(OpenLayers.Geometry, {
}
return intersect;
},
/**
* APIMethod: transform
* Translate the x,y properties of the point from source to dest.
*
* Parameters:
* source - {<OpenLayers.Projection>}
* dest - {<OpenLayers.Projection>}
*
* Returns:
* {<OpenLayers.Geometry>}
*/
transform: function(source, dest) {
if ((source && dest)) {
OpenLayers.Projection.transform(
this, source, dest);
}
return this;
},
CLASS_NAME: "OpenLayers.Geometry.Point"
});