Hi Caspar, "In other words, it will only use the map projection in it's WMS request URL's" That's not right as you have found out by yourself. If the map projection is equal the wms projection, then the WMS GetMap Request use the wms projection. Some servers provide only requests for EPSG:3857 (an alias for EPSG:900913) and if you use for your map EPSG:900913, then you can add these servers and set the projection to EPSG:3857 and it works. But it seems, that that only works for EPSG:900913 and EPSG:4326 and their aliases, because OpenLayers has aliases defined in OpenLayers Projection.js. If you have maps with other projections and a server support only an alias of the projection, then the above will perhaps not work. Then the only way is to overwrite the getFullRequestString-method of OpenLayers.Layer.WMS. Example http://gis.ibbeck.de/ginfo/apps/OLExamples/OL212/wms_options_projection.asp Arnd
_____ Von: [email protected] [mailto:[email protected]] Im Auftrag von Casper Span Gesendet: Mittwoch, 16. Januar 2013 12:53 An: Sergeant_york Cc: [email protected] Betreff: Re: [OpenLayers-Users] epsg:3857 and google 900913 Hi, If you look at the source of WMS (lib\OpenLayers\Layer\WMS.js), take a look at getFullRequestString. In it, the baselayer's projection will always override the given projection. In fact, the layers projection itself will be ignored: - It takes the Map Projection (=Baselayer projection) - then, if the WMS layer projection equals the map projection, it uses the layer projection - otherwise, it uses the map projection In other words, it will only use the map projection in it's WMS request URL's So yeah... everything MUST be the same projection for WMS layers or it cannot be placed on top of eachother. For me, this meant reprojecting my own data so I can serve it with WMS onto OSM. You can check these actual outgoing URL's with Firebug and such. regards, Casper Span On Wed, Jan 16, 2013 at 12:31 PM, Sergeant_york <[email protected]> wrote: Hello there, Thank you for the answer. That gave me a good idea. Unfortunately it doesn't work when initializing layer. On the other hand creating a layer (for example aLayer object) then changing projection works! Workin way is: layer aLayer=new OpenLayers.Layer.WMS ...... aLayer.projection= new OpenLayers.Projection("EPSG:3857") -- View this message in context: http://osgeo-org.1560.n6.nabble.com/epsg-3857-and-google-900913-tp5027619p50 27809.html Sent from the OpenLayers Users mailing list archive at Nabble.com. _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users -- Casper Span T: @Span_Droid <https://twitter.com/#%21/Span_Droid> W: http://www.spatially-oriented.com M: [email protected]
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
