[OpenLayers-Users] projection problem proj4js

karsten vennemann karsten at terragis.net
Mon Oct 5 20:00:04 EDT 2009


Thanks, now I do not get an error any more with this code:

var mapcenter = new OpenLayers.LonLat(-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);
alert('coordinates transformed:'+mapcenter.toString());

However the coordinates are the same as the input values (-122.30785315739, 47.638080437239) and not transformed. 
What is still wrong ?

Karsten 




More information about the Users mailing list