<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19394"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=937405121-16012013><FONT color=#0000ff
size=2 face=Arial>Hi Caspar,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=937405121-16012013><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=937405121-16012013>"</SPAN>In other words,
it will only use the map projection in it's WMS request URL's<SPAN
class=937405121-16012013>"</SPAN></DIV>
<DIV><SPAN class=937405121-16012013></SPAN> </DIV>
<DIV><SPAN class=937405121-16012013><FONT color=#0000ff size=2 face=Arial>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.</FONT></SPAN></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV><SPAN class=937405121-16012013></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT size=2>S<SPAN class=937405121-16012013>ome 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.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=937405121-16012013></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=937405121-16012013>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.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=937405121-16012013></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=937405121-16012013>If you have maps with other projections and a server
support only an alias of the projection, then the above will perhaps not
work.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=937405121-16012013></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=937405121-16012013>Then the only way is to overwrite the
getFullRequestString-method of
OpenLayers.Layer.WMS.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=937405121-16012013></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=937405121-16012013>Example</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=937405121-16012013><A
href="http://gis.ibbeck.de/ginfo/apps/OLExamples/OL212/wms_options_projection.asp">http://gis.ibbeck.de/ginfo/apps/OLExamples/OL212/wms_options_projection.asp</A></SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=937405121-16012013></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=937405121-16012013>Arnd</SPAN></FONT></FONT></FONT></DIV>
<DIV><BR></DIV><BR>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> openlayers-users-bounces@lists.osgeo.org
[mailto:openlayers-users-bounces@lists.osgeo.org] <B>Im Auftrag von </B>Casper
Span<BR><B>Gesendet:</B> Mittwoch, 16. Januar 2013 12:53<BR><B>An:</B>
Sergeant_york<BR><B>Cc:</B> openlayers-users@lists.osgeo.org<BR><B>Betreff:</B>
Re: [OpenLayers-Users] epsg:3857 and google 900913<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>Hi,<BR><BR></DIV>If you look at the source of WMS
(lib\OpenLayers\Layer\WMS.js), take a look at getFullRequestString.<BR></DIV>In
it, the baselayer's projection will always override the given projection. In
fact, the layers projection itself will be ignored:<BR></DIV>- It takes the Map
Projection (=Baselayer projection)<BR></DIV>- then, if the WMS layer projection
equals the map projection, it uses the layer projection<BR></DIV>- otherwise, it
uses the map projection<BR><BR></DIV>In other words, it will only use the map
projection in it's WMS request URL's<BR>
<DIV>
<DIV>
<DIV>
<DIV><BR>So yeah... everything MUST be the same projection for WMS layers or it
cannot be placed on top of eachother.<BR>
<DIV class=gmail_extra></DIV>
<DIV class=gmail_extra>For me, this meant reprojecting my own data so I can
serve it with WMS onto OSM.<BR><BR></DIV>
<DIV class=gmail_extra>You can check these actual outgoing URL's with Firebug
and such.<BR><BR></DIV>
<DIV class=gmail_extra>regards,<BR></DIV>
<DIV class=gmail_extra>Casper Span<BR></DIV>
<DIV class=gmail_extra><BR>
<DIV class=gmail_quote>On Wed, Jan 16, 2013 at 12:31 PM, Sergeant_york <SPAN
dir=ltr><<A href="mailto:electronicpanda@gmail.com"
target=_blank>electronicpanda@gmail.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>Hello there,<BR><BR>Thank you for the answer. That gave me a
good idea. Unfortunately it doesn't<BR>work when initializing layer.<BR><BR>On
the other hand creating a layer (for example aLayer object) then
changing<BR>projection works!<BR><BR>Workin way is:<BR>layer aLayer=new
OpenLayers.Layer.WMS ......<BR>aLayer.projection= new
OpenLayers.Projection("EPSG:3857")<BR><BR><BR><BR>--<BR>View this message in
context: <A
href="http://osgeo-org.1560.n6.nabble.com/epsg-3857-and-google-900913-tp5027619p5027809.html"
target=_blank>http://osgeo-org.1560.n6.nabble.com/epsg-3857-and-google-900913-tp5027619p5027809.html</A><BR>
<DIV class=HOEnZb>
<DIV class=h5>Sent from the OpenLayers Users mailing list archive at
Nabble.com.<BR>_______________________________________________<BR>Users
mailing list<BR><A
href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</A><BR><A
href="http://lists.osgeo.org/mailman/listinfo/openlayers-users"
target=_blank>http://lists.osgeo.org/mailman/listinfo/openlayers-users</A><BR></DIV></DIV></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR><BR>Casper Span<BR>T: <A
href="https://twitter.com/#%21/Span_Droid" target=_blank>@Span_Droid</A><BR>W:
<A href="http://www.spatially-oriented.com"
target=_blank>http://www.spatially-oriented.com</A><BR>M: <A
href="mailto:info@spatially-oriented.com"
target=_blank>info@spatially-oriented.com</A><BR><BR></DIV></DIV></DIV></DIV></DIV></DIV></BODY></HTML>