[OpenLayers-Users] proj4js problem
Walter Lorenzetti
lorenzetti at faunalia.it
Tue Jan 29 10:48:47 EST 2008
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080129/c3de9c87/attachment.html
More information about the Users
mailing list