Hello Ian: Some time ago I tried to use Proj4js for trasforming coordinates from/to laea (accidentally, the same EPSG definition as you). Not sure if this still holds for today, but at the time it was said that the laea class still needed work: http://osgeo-org.1803224.n2.nabble.com/proj4js-problem-td1827509.html
As a quick test, I'd check your code with transforming to some other known to work projection class. I ended up doing coordinate transform server side, a serious kludge... Alex > On Wed, Oct 27, 2010 at 2:55 PM, Ian Turton <ijtur...@gmail.com> wrote: >> I'm stuck on what should be a simple reprojection (see >> http://ian01.geog.psu.edu/geoserver/www/cartogram/alphabyvalue.html >> for the "working example"). >> >> I happen to know the bounds of the US lower 48 in lat/long but I >> wanted to draw my map using EPSG:2163 (since it stops my cartographer >> colleagues from moaning) so I thought all I would need to do was add >> >> Proj4js.defs["EPSG:2163"] = "+proj=laea +lat_0=45 >> +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs"; >> proj_4326 = new OpenLayers.Projection('EPSG:4326'); >> proj_2163 = new OpenLayers.Projection('EPSG:2163'); >> >> bounds.transform(proj_4326,proj_2163); >> >> and use bounds to set up my map accordingly >> >> map = new OpenLayers.Map( 'map', >> { >> projection: 'EPSG:2163', >> maxResolution: 45740.96078867187, >> maxExtent: bounds, >> units: 'm' >> } >> ); >> >> But bounds becomes null when I call .transform(...) - looking in >> firebug shows plausible values for the two projections (and I did >> include proj4js-combined). >> >> Currently the example is using hand calculated bounds with the >> transform commented out but it would be nice if I could get it to work >> properly. >> >> Cheers >> >> Ian >> -- >> Ian Turton >> _______________________________________________ >> Users mailing list >> us...@lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/openlayers-users >> > _______________________________________________ Users mailing list us...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-users