The correct approach to using only Spherical Mercator projection maps

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? 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? 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? 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? Source.


Яндекс.Метрика Рейтинг@Mail.ru Free Web Counter
page counter
Last Modified: April 18, 2016 @ 1:08 pm