[OpenLayers-Dev] Problem with getting latitude nad longitude(mapnik layer)

Christopher Schmidt crschmidt at metacarta.com
Tue Feb 17 16:14:59 EST 2009


On Tue, Feb 17, 2009 at 09:12:58PM +0000, Tom Hughes wrote:
> sniipe wrote:
> 
> > On click event(only on Mapnik layer) I received some data, but it is  
> > not longitude and latitude. And my question is how to convert it to  
> > get properly values(lat, lon)?
> 
> Yes - project it back from 900913 (spherical mercator) to 4326 
> (lat/lon). Off the top of y head, something like this should do it:
> 
> latlon.transform(map.getProjectionObject(),
>                   new OpenLayers.Projection("EPSG:4326"))

And, generally speaking, read and understand all of
http://docs.openlayers.org/library/spherical_mercator .

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list