[OpenLayers-Users] projection problem proj4js
Karsten
karsten at terragis.net
Tue Oct 6 01:39:50 EDT 2009
Nice this works now after using Roberts code suggestions:
var mapcenter = new OpenLayers.Geometry.Point(-122.30785315739,
47.638080437239);
Proj4js.defs["EPSG:102003"] = "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5
+lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs";
var source = new OpenLayers.Projection("EPSG:4326");
var dest = new OpenLayers.Projection("EPSG:102003");
OpenLayers.Projection.transform(mapcenter, source, dest);
gpsx = mapcenter.x;
gpsy = mapcenter.y;
alert('coordinates transformed:'+gpsx.toString()+','+gpsy.toString());
Now - to learn a bit more it would be nice to find out why this works using
the OpenLayers.Geometry.Point and the .x and .y values but not
OpenLayers.LonLat(-122.30785315739, 47.638080437239)...
Cheers
Karsten
--
View this message in context: http://n2.nabble.com/projection-problem-proj4js-tp3757498p3773265.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list