Ah!<br>Indeed, I already thought the solution would be trivial! Thanks, this solved my problem.<br><br>As I am new to OpenLayers, I started off here:<br><a href="http://docs.openlayers.org/">http://docs.openlayers.org/</a><br>
<br>Too bad I couldn&#39;t find any hints on OL&#39;s defaulting when it comes to projection, units, extents etc. In fact, I expect many newbies wanting to deviate from the default EPSG:4326...<br><br>May I suggest to insert the below lines of code on this page: <a href="http://docs.openlayers.org/library/introduction.html">http://docs.openlayers.org/library/introduction.html</a><br>
<span><font color="#0000ff" face="Arial" size="2">    //set always mapOptions, if you use a 
projection other than EPSG:4326<br>    mapOptions = 
{<div class="im"><br>        projection: new 
OpenLayers.Projection(&quot;EPSG:28992&quot;),<br></div>        
units: &quot;m&quot;,<br>        numZoomLevels: 
18,<br>        maxResolution: 
5,<br>        maxExtent: new 
OpenLayers.Bounds(131110,447700,131830,448310)<br>    
};<br>    map = new OpenLayers.Map(&#39;map&#39;, 
mapOptions);</font></span><br><br>Ciao,<br>Rob<br><br><div class="gmail_quote">2011/4/22 Arnd Wippermann <span dir="ltr">&lt;<a href="mailto:arnd.wippermann@web.de">arnd.wippermann@web.de</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">hi,</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">if you declare your map without options, then OL takes the 
default (see Map.js):</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">    projection: &quot;EPSG:4326&quot;,    
<br>    units: &#39;degrees&#39;,<br>    maxResolution: 
1.40625,<br>    maxExtent: new 
OpenLayers.Bounds(-180,-90,180,90),<br></font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">But it seems, when you declare a projection in your baselayer, 
then this projection overwrites the map projection and is used for the SRS 
parameter of the WMS request. But the maxExtent are still the default 
ones.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">You should use map options to overwrite the 
default.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">    //set always mapOptions, if you use a 
projection other than EPSG:4326<br>    mapOptions = 
{<div class="im"><br>        projection: new 
OpenLayers.Projection(&quot;EPSG:28992&quot;),<br></div>        
units: &quot;m&quot;,<br>        numZoomLevels: 
18,<br>        maxResolution: 
5,<br>        maxExtent: new 
OpenLayers.Bounds(131110,447700,131830,448310)<br>    
};<br>    map = new OpenLayers.Map(&#39;map&#39;, 
mapOptions);<br></font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Arnd</font></span></div>
<div dir="ltr" align="left"><span></span> </div>
<div dir="ltr" align="left">
<hr>
</div>
<div dir="ltr" align="left"><font face="Tahoma" size="2"><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>InterRob<br><b>Gesendet:</b> Donnerstag, 21. April 2011 23:37<br><b>An:</b> 
<a href="mailto:openlayers-users@lists.osgeo.org" target="_blank">openlayers-users@lists.osgeo.org</a><br><b>Betreff:</b> [OpenLayers-Users] 
WMS-layer: BBOX and SRS not being detected<br></font><br></div><div><div></div><div class="h5">
<div></div>Dear list,
<div><br></div>
<div>Today I set up a MapServer WMS service. The service seems to work just 
fine, as I tested it with QGIS. Even the SRS is recognized automatically: 
EPSG:28992 (Dutch CS).</div>
<div>At the bottom of this message, I copy/pasted the 
GetCapabilites-response.</div>
<div><br></div>
<div>The bit of JavaScript used to load the OpenLayers control + map + layer, is 
classical:</div>
<div><br></div>
<div>============</div>
<div>
<div><br></div>
<div> var map, layer;</div>
<div>  function init(){</div>
<div>    map = new OpenLayers.Map( &#39;map&#39; );</div>
<div>    layer = new OpenLayers.Layer.WMS( &quot;OpenLayers 
WMS&quot;, &quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;</a>&quot;, 
{ layers : &#39;pgn_verwachting&#39; }, { units : &#39;m&#39;, projection : new 
OpenLayers.Projection(&quot;EPSG:28992&quot;), singleTile : true, buffer : 
0, ratio : 1 } );</div></div>
<div><br></div>
<div>============</div>
<div><br></div>
<div>In my browser, OpenLayers does load nicely (zoom and pan tools become 
available in the upper right corner of an empty map-div) and then does the 
following GET to fetch that single tile:</div>
<div><a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;LAYERS=pgn_verwachting&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;FORMAT=image%2Fjpeg&amp;SRS=EPSG%3A28992&amp;BBOX=-281.25,-210.9375,281.25,210.9375&amp;WIDTH=800&amp;HEIGHT=600" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;LAYERS=pgn_verwachting&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;FORMAT=image%2Fjpeg&amp;SRS=EPSG%3A28992&amp;BBOX=-281.25,-210.9375,281.25,210.9375&amp;WIDTH=800&amp;HEIGHT=600</a></div>

<div><br></div>
<div>I don&#39;t see how I can get the BBOX parameter right... What am I missing? 
When I edit the above URL, it works just fine, obviously...</div>
<div><br></div>
<div>And shouldn&#39;t the SRS be detected automatically as well?</div>
<div><br></div>
<div>Hints are much appreciated!</div>
<div><br></div>
<div>Kind regards,</div>
<div><br></div>
<div><br></div>
<div>Rob</div>
<div><br></div>
<div><br></div>
<div><br></div>
<div>=============== GetCapabilities response ======================</div>
<div>&lt;?xml version=&#39;1.0&#39; encoding=&quot;ISO-8859-1&quot; standalone=&quot;no&quot; ?&gt;</div>
<div>
<div>&lt;!DOCTYPE WMT_MS_Capabilities SYSTEM &quot;<a href="http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd" target="_blank">http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd</a>&quot;</div>
<div> [</div>
<div> &lt;!ELEMENT VendorSpecificCapabilities EMPTY&gt;</div>
<div> ]&gt;  &lt;!-- end of DOCTYPE declaration --&gt;</div>
<div><br></div>
<div>&lt;WMT_MS_Capabilities version=&quot;1.1.1&quot;&gt;</div>
<div><br></div>
<div>&lt;!-- MapServer version 5.6.6 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG 
OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE 
SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER 
SUPPORTS=WFS_CLIENT SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=EPPL7 
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE --&gt;</div>
<div><br></div>
<div>&lt;Service&gt;</div>
<div>  &lt;Name&gt;OGC:WMS&lt;/Name&gt;</div>
<div>  &lt;Title&gt;Beleidskaart_Binnenstad&lt;/Title&gt;</div>
<div>  &lt;OnlineResource xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;</div>
<div>  &lt;ContactInformation&gt;</div>
<div>  &lt;/ContactInformation&gt;</div>
<div>&lt;/Service&gt;</div>
<div><br></div>
<div>&lt;Capability&gt;</div>
<div>  &lt;Request&gt;</div>
<div>    &lt;GetCapabilities&gt;</div>
<div>     
 &lt;Format&gt;application/vnd.ogc.wms_xml&lt;/Format&gt;</div>
<div>      &lt;DCPType&gt;</div>
<div>        &lt;HTTP&gt;</div>
<div>          &lt;Get&gt;&lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;&lt;/Get&gt;</div>
<div>          &lt;Post&gt;&lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;&lt;/Post&gt;</div>
<div>        &lt;/HTTP&gt;</div>
<div>      &lt;/DCPType&gt;</div>
<div>    &lt;/GetCapabilities&gt;</div>
<div>    &lt;GetMap&gt;</div>
<div>      &lt;Format&gt;image/gif&lt;/Format&gt;</div>
<div>      &lt;Format&gt;image/png&lt;/Format&gt;</div>
<div>      &lt;Format&gt;image/png; 
mode=24bit&lt;/Format&gt;</div>
<div>      &lt;Format&gt;image/jpeg&lt;/Format&gt;</div>
<div>     
 &lt;Format&gt;image/vnd.wap.wbmp&lt;/Format&gt;</div>
<div>      &lt;Format&gt;image/tiff&lt;/Format&gt;</div>
<div>      &lt;Format&gt;image/svg+xml&lt;/Format&gt;</div>
<div>      &lt;DCPType&gt;</div>
<div>        &lt;HTTP&gt;</div>
<div>          &lt;Get&gt;&lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;&lt;/Get&gt;</div>
<div>          &lt;Post&gt;&lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;&lt;/Post&gt;</div>
<div>        &lt;/HTTP&gt;</div>
<div>      &lt;/DCPType&gt;</div>
<div>    &lt;/GetMap&gt;</div>
<div>    &lt;GetFeatureInfo&gt;</div>
<div>      &lt;Format&gt;text/plain&lt;/Format&gt;</div>
<div>     
 &lt;Format&gt;application/vnd.ogc.gml&lt;/Format&gt;</div>
<div>      &lt;DCPType&gt;</div>
<div>        &lt;HTTP&gt;</div>
<div>          &lt;Get&gt;&lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;&lt;/Get&gt;</div>
<div>          &lt;Post&gt;&lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;&lt;/Post&gt;</div>
<div>        &lt;/HTTP&gt;</div>
<div>      &lt;/DCPType&gt;</div>
<div>    &lt;/GetFeatureInfo&gt;</div>
<div>    &lt;DescribeLayer&gt;</div>
<div>      &lt;Format&gt;text/xml&lt;/Format&gt;</div>
<div>      &lt;DCPType&gt;</div>
<div>        &lt;HTTP&gt;</div>
<div>          &lt;Get&gt;&lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;&lt;/Get&gt;</div>
<div>          &lt;Post&gt;&lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;&lt;/Post&gt;</div>
<div>        &lt;/HTTP&gt;</div>
<div>      &lt;/DCPType&gt;</div>
<div>    &lt;/DescribeLayer&gt;</div>
<div>    &lt;GetLegendGraphic&gt;</div>
<div>      &lt;Format&gt;image/gif&lt;/Format&gt;</div>
<div>      &lt;Format&gt;image/png&lt;/Format&gt;</div>
<div>      &lt;Format&gt;image/png; 
mode=24bit&lt;/Format&gt;</div>
<div>      &lt;Format&gt;image/jpeg&lt;/Format&gt;</div>
<div>     
 &lt;Format&gt;image/vnd.wap.wbmp&lt;/Format&gt;</div>
<div>      &lt;DCPType&gt;</div>
<div>        &lt;HTTP&gt;</div>
<div>          &lt;Get&gt;&lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;&lt;/Get&gt;</div>
<div>          &lt;Post&gt;&lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;&lt;/Post&gt;</div>
<div>        &lt;/HTTP&gt;</div>
<div>      &lt;/DCPType&gt;</div>
<div>    &lt;/GetLegendGraphic&gt;</div>
<div>    &lt;GetStyles&gt;</div>
<div>      &lt;Format&gt;text/xml&lt;/Format&gt;</div>
<div>      &lt;DCPType&gt;</div>
<div>        &lt;HTTP&gt;</div>
<div>          &lt;Get&gt;&lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;&lt;/Get&gt;</div>
<div>          &lt;Post&gt;&lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp</a>;&quot;/&gt;&lt;/Post&gt;</div>
<div>        &lt;/HTTP&gt;</div>
<div>      &lt;/DCPType&gt;</div>
<div>    &lt;/GetStyles&gt;</div>
<div>  &lt;/Request&gt;</div>
<div>  &lt;Exception&gt;</div>
<div>   
 &lt;Format&gt;application/vnd.ogc.se_xml&lt;/Format&gt;</div>
<div>   
 &lt;Format&gt;application/vnd.ogc.se_inimage&lt;/Format&gt;</div>
<div>   
 &lt;Format&gt;application/vnd.ogc.se_blank&lt;/Format&gt;</div>
<div>  &lt;/Exception&gt;</div>
<div>  &lt;VendorSpecificCapabilities /&gt;</div>
<div>  &lt;UserDefinedSymbolization SupportSLD=&quot;1&quot; UserLayer=&quot;0&quot; 
UserStyle=&quot;1&quot; RemoteWFS=&quot;0&quot;/&gt;</div>
<div>  &lt;Layer&gt;</div>
<div>    &lt;Name&gt;Beleidskaart_Binnenstad&lt;/Name&gt;</div>
<div>    &lt;Title&gt;Beleidskaart_Binnenstad&lt;/Title&gt;</div>
<div>   
 &lt;Abstract&gt;Beleidskaart_Binnenstad&lt;/Abstract&gt;</div>
<div>    &lt;SRS&gt;EPSG:28992&lt;/SRS&gt;</div>
<div>    &lt;LatLonBoundingBox minx=&quot;5.03953&quot; miny=&quot;52.0181&quot; 
maxx=&quot;5.05006&quot; maxy=&quot;52.0236&quot; /&gt;</div>
<div>    &lt;BoundingBox SRS=&quot;EPSG:28992&quot;</div>
<div>                minx=&quot;131110&quot; 
miny=&quot;447700&quot; maxx=&quot;131830&quot; maxy=&quot;448310&quot; /&gt;</div>
<div>    &lt;Layer queryable=&quot;0&quot; opaque=&quot;0&quot; 
cascaded=&quot;0&quot;&gt;</div>
<div>       
 &lt;Name&gt;pgn_verwachting&lt;/Name&gt;</div>
<div>       
 &lt;Title&gt;pgn_verwachting&lt;/Title&gt;</div>
<div>        &lt;LatLonBoundingBox minx=&quot;5.04025&quot; 
miny=&quot;52.0182&quot; maxx=&quot;5.04993&quot; maxy=&quot;52.0236&quot; /&gt;</div>
<div>        &lt;BoundingBox SRS=&quot;EPSG:28992&quot;</div>
<div>                   
 minx=&quot;131160&quot; miny=&quot;447707&quot; maxx=&quot;131821&quot; maxy=&quot;448305&quot; /&gt;</div>
<div>        &lt;Style&gt;</div>
<div>         
 &lt;Name&gt;default&lt;/Name&gt;</div>
<div>         
 &lt;Title&gt;default&lt;/Title&gt;</div>
<div>          &lt;LegendURL width=&quot;147&quot; 
height=&quot;41&quot;&gt;</div>
<div>             
&lt;Format&gt;image/png&lt;/Format&gt;</div>
<div>             &lt;OnlineResource 
xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; 
xlink:type=&quot;simple&quot; xlink:href=&quot;<a href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;version=1.1.1&amp;service=WMS&amp;request=GetLegendGraphic&amp;layer=pgn_verwachting&amp;format=image/png&amp;STYLE=default" target="_blank">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;amp;version=1.1.1&amp;amp;service=WMS&amp;amp;request=GetLegendGraphic&amp;amp;layer=pgn_verwachting&amp;amp;format=image/png&amp;amp;STYLE=default</a>&quot;/&gt;</div>

<div>          &lt;/LegendURL&gt;</div>
<div>        &lt;/Style&gt;</div>
<div>    &lt;/Layer&gt;</div>
<div>  &lt;/Layer&gt;</div>
<div>&lt;/Capability&gt;</div>
<div>&lt;/WMT_MS_Capabilities&gt;</div></div>
<div><br></div></div></div></div>
</blockquote></div><br>