[OpenLayers-Users] The correct approach to using only Spherical Mercator projection maps

Janis Elmeris janis.elmeris at intelligentsystems.lv
Sat May 7 09:25:24 EDT 2011


Hello!

I am using an OpenLayers map with OpenStreetMap and Google map base 
layers. Currently I've get it working by setting map's projection to 
EPSG:900913, map's display projection to EPSG:4326, setting an option 
sphericalMercator=true for Google maps layer's and transforming 
OpenLayer.LonLat and OpenLayer.Geometry.Point from EPSG:4326 to 
EPSG:900913 every time I add one to the map. I've picked this up from 
various examples, so I'm not sure if this is the right approach in my 
situation. Is it?

If it is the right approach, I have several questions.

1) Why should I set sphericalMercator=true for Google maps, but not for 
OpenStreetMap? Can the Google maps layers be also used with the option 
being false, and can OSM be used with the option true?

2) What's the point of setting the map's projection to EPSG:900913 and 
map's display projection to EPSG:4326, if I still have to transform the 
coordinates every time my script interacts with the map (adding objects 
on specific coordinates)?

3) Do I need the transformation at all, if I use only maps with the 
Spherical Mercator projection (Google maps and OSM are all supposed to 
be using Spherical Mercator)? Shouldn't everything already be in that 
projection?

Thank you!
Janis

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110507/2d7bd6b9/attachment.html


More information about the Users mailing list