<div dir="ltr"><div>Arnd, Sergant_york<br><br>Thats actually quite scary on one hand, but thanks a lot for clarifying it for me! <br><br></div>Casper<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 17, 2013 at 7:46 PM, Arnd Wippermann <span dir="ltr"><<a href="mailto:arnd.wippermann@web.de" target="_blank">arnd.wippermann@web.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>



<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial">Hi Caspar,</font></span></div><div class="im">
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span>"</span>If the layer 
projection equals the mapprojection, the layer projection is returned<span>"</span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial"></font></span> </div>
</div><div><span><font color="#0000ff" face="Arial">In the 
case of map projection = EPSG:900913 and a WMS projection = 
EPSG:3857 the WMS GetMap Request will use EPSG:3857.</font></span></div>
<div><span></span><span></span><font face="Arial"><font color="#0000ff"><font>B<span>ecause EPSG:900913 equals EPSG:3857. 
Declared in Projection.js.</span></font></font></font></div>
<div><font face="Arial"><font color="#0000ff"><font><span></span></font></font></font> </div><span>
<div><font color="#0000ff" face="Arial"><span>For 
other projections and aliases OpenLayers cann't decide equality and the map 
projection will be used.</span></font></div>
<div><font color="#0000ff" face="Arial"></font> </div>
<div><font face="Arial"><font color="#0000ff"><font><span>I</span>f you include the proj4js-library to your 
application, then OpenLayers tests for equality by text comparision of 
the proj-strings and that may lead to other results as above, if the <span>proj-</span>strings not ===.<span> </span></font></font></font></div>
<div><font face="Arial"><font color="#0000ff"><font><span>But it would also provide a possibility to add other 
projections and aliases to ones 
applications.</span></font></font></font></div></span></div>
<div><font face="Arial"><font color="#0000ff"><font><span></span></font></font></font><font face="Arial"><font color="#0000ff"><font><span></span></font></font></font><font color="#0000ff" face="Arial"></font> </div>
<div><span></span><font face="Arial"><font color="#0000ff"><font>A<span>rnd</span></font></font></font><br></div>
<div dir="ltr" align="left" lang="de">
<hr>
<font face="Tahoma"><b>Von:</b> Casper Span 
[mailto:<a href="mailto:info@spatially-oriented.com" target="_blank">info@spatially-oriented.com</a>] <br><b>Gesendet:</b> Donnerstag, 17. Januar 
2013 08:51<br><b>An:</b> <a href="mailto:arnd.wippermann@web.de" target="_blank">arnd.wippermann@web.de</a><div><div class="h5"><br><b>Cc:</b> 
<a href="mailto:openlayers-users@lists.osgeo.org" target="_blank">openlayers-users@lists.osgeo.org</a><br><b>Betreff:</b> Re: [OpenLayers-Users] 
epsg:3857 and google 900913<br></div></div></font><br></div><div class="HOEnZb"><div class="h5">
<div></div>
<div dir="ltr">
<div>
<div>
<div>Arnd,<br><br>I'm talking about lines 247-251 from wms.js (<a href="https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Layer/WMS.js" target="_blank">https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Layer/WMS.js</a>):<br>
<br>var 
mapProjection = this.map.getProjectionObject();<br>var projectionCode = 
this.projection && this.projection.equals(mapProjection) ? 
this.projection.getCode() : mapProjection.getCode();<br>var value = 
(projectionCode == "none") ? null : projectionCode;<br><br></div>If the layer 
projection equals the mapprojection, the layer projection is returned. If not, 
the mapprojection is returned.<br><br></div>Correct me if I'm wrong, but that 
would say it always returns the map projection code, no matter what I fill in on 
the projection code or when I fill it.<br><br></div>
<div>I came across this piece of code after building a WMS server with SharpMap. 
I only built in support for EPSG:3857 but the default OSM layer is in 
EPSG:900913. My WMS server kept coming with error "SRS 900913 not 
supported"<br></div>
<div>Please note that in my case the WMS layer is NOT my base layer. If it was, 
it WOULD listen to the projection of the layer (as the Map.Projection asks it's 
baselayer for the projection)<br></div>
<div><br></div>Casper<br></div>
<div class="gmail_extra"><br><br>
<div class="gmail_quote">On Wed, Jan 16, 2013 at 11:13 PM, Arnd Wippermann <span dir="ltr"><<a href="mailto:arnd.wippermann@web.de" target="_blank">arnd.wippermann@web.de</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote"><u></u>
  <div>
  <div dir="ltr" align="left"><span><font color="#0000ff" face="Arial">Hi 
  Caspar,</font></span></div>
  <div>
  <div dir="ltr" align="left"><span><font color="#0000ff" face="Arial"></font></span> </div>
  <div dir="ltr" align="left"><span>"</span>In other words, it will only use the map 
  projection in it's WMS request URL's<span>"</span></div>
  <div><span></span> </div></div>
  <div><span><font color="#0000ff" 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" face="Arial"></font> </div>
  <div><span></span><font face="Arial"><font color="#0000ff"><font size="+0">S<span>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="+0"><span></span></font></font></font> </div>
  <div><font face="Arial"><font color="#0000ff"><font size="+0"><span>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="+0"><span></span></font></font></font> </div>
  <div><font face="Arial"><font color="#0000ff"><font size="+0"><span>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="+0"><span></span></font></font></font> </div>
  <div><font face="Arial"><font color="#0000ff"><font size="+0"><span>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="+0"><span></span></font></font></font> </div>
  <div><font face="Arial"><font color="#0000ff"><font size="+0"><span>Example</span></font></font></font></div>
  <div><font face="Arial"><font color="#0000ff"><font size="+0"><span><a href="http://gis.ibbeck.de/ginfo/apps/OLExamples/OL212/wms_options_projection.asp" target="_blank">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="+0"><span></span></font></font></font> </div>
  <div><font face="Arial"><font color="#0000ff"><font size="+0"><span>Arnd</span></font></font></font></div>
  <div><br></div><br>
  <div dir="ltr" align="left" lang="de">
  <hr>
  <font face="Tahoma"><b>Von:</b> <a href="mailto:openlayers-users-bounces@lists.osgeo.org" target="_blank">openlayers-users-bounces@lists.osgeo.org</a> [mailto:<a href="mailto:openlayers-users-bounces@lists.osgeo.org" target="_blank">openlayers-users-bounces@lists.osgeo.org</a>] <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> <a href="mailto:openlayers-users@lists.osgeo.org" target="_blank">openlayers-users@lists.osgeo.org</a><br><b>Betreff:</b> Re: 
  [OpenLayers-Users] epsg:3857 and google 900913<br></font><br></div>
  <div>
  <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>
    <div>Sent from the OpenLayers Users mailing list archive at 
    Nabble.com.<br>_______________________________________________<br>Users 
    mailing list<br><a href="mailto:Users@lists.osgeo.org" target="_blank">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></div></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></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>