[OpenLayers-Users] Change from OpenLayers.Layer.Google to OpenLayers.Layer.OSM

mail.roliveira at gmail.com mail.roliveira at gmail.com
Tue May 28 07:34:49 PDT 2013


Ok, my distraction:


 new OpenLayers.Layer.OSM("osm", {projection: new OpenLayers.Projection('EPSG:4326')})


Should be 
 new OpenLayers.Layer.OSM("osm", "", {projection: new OpenLayers.Projection('EPSG:4326')})





Sent from Alto - altomail.com


From: mail.roliveira at gmail.com<mail.roliveira at gmail.com>
To: <OPENLAYERS-USERS at lists.osgeo.org>
Sent: Tuesday, May 28, 2013
Subject: Change from OpenLayers.Layer.Google to OpenLayers.Layer.OSM

I'm confused about EPSGs used by Google's layer and OSM layer.


My project has geoserver serving layers in EPSG:4326 projection.


When I create a google layer:



	        var gmap = new OpenLayers.Layer.Google("Google Streets", {numZoomLevels: 20})

;EPSG is 4326,
and units are in degrees.


So I have no problem when requesting a WMS layer and data is placed correctly.


However, if I switch to OSM layer:


    var osm = new OpenLayers.Layer.OSM("osm", {projection: new OpenLayers.Projection('EPSG:4326')})


;EPSG is 900913,
and units are in meters.


My questions:
- Why is OSM layer projection EPSG:900913?
- Can I have a OSM baseLayer in a different projection? The {projection: new OpenLayers.Projection('EPSG:4326')} argument seemed to have no effect on the layer.


Thanks in advance,
Ruben




Sent from Alto - altomail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130528/30fe1d07/attachment-0001.html>


More information about the Users mailing list