[OpenLayers-Users] proj4js problem
Mike Adair
madair at dmsolutions.ca
Tue Jan 29 11:49:39 EST 2008
Walter,
The projection class code for the 'laea' projection isn't validated yet
in proj4js.
For the record, as of today, the following projection classes work (or
should work). These are the 'proj=' parameter in the proj
initialization string: utm, lcc, tmerc, merc, stere, gauss, sterea, aea.
And the following classes are not validated yet: aeqd, eqdc, equi, laea,
mill, moll, omerc, ortho, poly, sinu, vandg
Mike
Walter Lorenzetti wrote:
> Hi list,
> I've a problem with proj4js library:
>
> if I use it in my Ol project like this:
>
> Proj4js.defs["EPSG:3035"] = "+proj=laea +lat_0=52 +lon_0=10
> +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs ";
> Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84
> +no_defs ";
>
> var coord = map.getLonLatFromPixel(new
> OpenLayers.Pixel(event.xy.x,event.xy.y));
> // utilizzo la libreria proj4js di boygenius per riottenere lat e lon
> dalla mappa con un epsg diverso da 4326
> var sourceProj = new Proj4js.Proj(map.getProjection());
> var destProj = new Proj4js.Proj("EPSG:4326");
> var p = new OpenLayers.Geometry.Point(coord.lon, coord.lat);
> OpenLayers.Console.log(p);
> Proj4js.transform(sourceProj, destProj,p);
> OpenLayers.Console.log(p);
>
> those that I obtain in firebug for example is:
>
> POINT(4375185.477325439 2300601.9556884766)
> id=OpenLayers.Geometry.Point_231
> POINT(2.3206480904276474 -57.2957795131) id=OpenLayers.Geometry.Point_231
>
> and is not corret because the new point 'd be like 10,... 43,...
>
> do you know why this?
> I use Ol 2.5 stable and not svn where I can find
> OpenLayers.Projection.transform function
>
> W
> --
> Please no .doc, .xls, .ppt, .dwg:
> https://www.faunalia.it/dokuwiki/doku.php?id=public:OpenFormats
>
> Walter Lorenzetti
> email+jabber: lorenzetti at faunalia.it
> www.faunalia.it
> Cell: (+39) 347-6597931 Tel+Fax: (+39) 0587-213742
> Piazza Garibaldi 5 - 56025 Pontedera (PI), Italy
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
More information about the Users
mailing list