[OpenLayers-Users] Re: Mercator projected Images coordinate problem with layer

shitake83 shitake83 at googlemail.com
Wed Jul 6 09:05:43 EDT 2011


Hi. I used to have this problem too, until i found a small workaround that
suited my needs.

var geographic = new OpenLayers.Projection("EPSG:4326");
var mercator = new OpenLayers.Projection("EPSG:900913");
var dortmund= new OpenLayers.LonLat(7.46, 51.51).transform(geographic,
mercator);

I setup the projection types in variables and then use the .transform method
to manipulate the "EPSG:4326" coordinates into "EPSG:900913- Mercator"
coordinates. This should work for you.


There is also a very neat explanation in the OL Docs.
http://docs.openlayers.org/library/spherical_mercator.html


Laterz.

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Mercator-projected-Images-coordinate-problem-with-layer-tp6553981p6554281.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list