Formats now support reprojection using internalProjection and

externalProjection properties. These allow for the reprojection of data --
OpenLayers users with SphericalMercator get this built in for EPSG:900913, and
other users can use the external proj4js library available from MapBuilder SVN
to add support for any number of projections. This means that featres can be,
for example, transformed from a KML doc in 4326 to Spherical Mercator before
being added to a layer, making using SphericalMercator slightly more enticing. 
r=elemoine
(Closes #1039)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@5516 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-12-19 22:07:12 +00:00
parent 7440556585
commit 6d6c08fbef
8 changed files with 128 additions and 11 deletions

View File

@@ -94,6 +94,10 @@ OpenLayers.Format.Text = OpenLayers.Class(OpenLayers.Format, {
}
}
if (set) {
if (this.internalProjection && this.externalProjection) {
geometry.transform(this.externalProjection,
this.internalProjection);
}
var feature = new OpenLayers.Feature.Vector(geometry, attributes, style);
features.push(feature);
}