<!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.19046"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=661583321-22042011><FONT color=#0000ff
size=2 face=Arial>hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661583321-22042011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=661583321-22042011><FONT color=#0000ff
size=2 face=Arial>if you declare your map without options, then OL takes the
default (see Map.js):</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661583321-22042011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=661583321-22042011><FONT color=#0000ff
size=2 face=Arial> projection: "EPSG:4326",
<BR> units: 'degrees',<BR> maxResolution:
1.40625,<BR> maxExtent: new
OpenLayers.Bounds(-180,-90,180,90),<BR></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661583321-22042011><FONT color=#0000ff
size=2 face=Arial>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 class=661583321-22042011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=661583321-22042011><FONT color=#0000ff
size=2 face=Arial>You should use map options to overwrite the
default.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661583321-22042011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=661583321-22042011><FONT color=#0000ff
size=2 face=Arial> //set always mapOptions, if you use a
projection other than EPSG:4326<BR> mapOptions =
{<BR> projection: new
OpenLayers.Projection("EPSG:28992"),<BR>
units: "m",<BR> numZoomLevels:
18,<BR> maxResolution:
5,<BR> maxExtent: new
OpenLayers.Bounds(131110,447700,131830,448310)<BR>
};<BR> map = new OpenLayers.Map('map',
mapOptions);<BR></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661583321-22042011><FONT color=#0000ff
size=2 face=Arial>Arnd</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661583321-22042011></SPAN> </DIV>
<DIV dir=ltr align=left>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr align=left><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>InterRob<BR><B>Gesendet:</B> Donnerstag, 21. April 2011 23:37<BR><B>An:</B>
openlayers-users@lists.osgeo.org<BR><B>Betreff:</B> [OpenLayers-Users]
WMS-layer: BBOX and SRS not being detected<BR></FONT><BR></DIV>
<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( 'map' );</DIV>
<DIV> layer = new OpenLayers.Layer.WMS( "OpenLayers
WMS", "<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&</A>",
{ layers : 'pgn_verwachting' }, { units : 'm', projection : new
OpenLayers.Projection("EPSG:28992"), 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&LAYERS=pgn_verwachting&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fjpeg&SRS=EPSG%3A28992&BBOX=-281.25,-210.9375,281.25,210.9375&WIDTH=800&HEIGHT=600">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&LAYERS=pgn_verwachting&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fjpeg&SRS=EPSG%3A28992&BBOX=-281.25,-210.9375,281.25,210.9375&WIDTH=800&HEIGHT=600</A></DIV>
<DIV><BR></DIV>
<DIV>I don'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'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><?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?></DIV>
<DIV>
<DIV><!DOCTYPE WMT_MS_Capabilities SYSTEM "<A
href="http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd">http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd</A>"</DIV>
<DIV> [</DIV>
<DIV> <!ELEMENT VendorSpecificCapabilities EMPTY></DIV>
<DIV> ]> <!-- end of DOCTYPE declaration --></DIV>
<DIV><BR></DIV>
<DIV><WMT_MS_Capabilities version="1.1.1"></DIV>
<DIV><BR></DIV>
<DIV><!-- 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 --></DIV>
<DIV><BR></DIV>
<DIV><Service></DIV>
<DIV> <Name>OGC:WMS</Name></DIV>
<DIV> <Title>Beleidskaart_Binnenstad</Title></DIV>
<DIV> <OnlineResource xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></DIV>
<DIV> <ContactInformation></DIV>
<DIV> </ContactInformation></DIV>
<DIV></Service></DIV>
<DIV><BR></DIV>
<DIV><Capability></DIV>
<DIV> <Request></DIV>
<DIV> <GetCapabilities></DIV>
<DIV>
<Format>application/vnd.ogc.wms_xml</Format></DIV>
<DIV> <DCPType></DIV>
<DIV> <HTTP></DIV>
<DIV> <Get><OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></Get></DIV>
<DIV> <Post><OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></Post></DIV>
<DIV> </HTTP></DIV>
<DIV> </DCPType></DIV>
<DIV> </GetCapabilities></DIV>
<DIV> <GetMap></DIV>
<DIV> <Format>image/gif</Format></DIV>
<DIV> <Format>image/png</Format></DIV>
<DIV> <Format>image/png;
mode=24bit</Format></DIV>
<DIV> <Format>image/jpeg</Format></DIV>
<DIV>
<Format>image/vnd.wap.wbmp</Format></DIV>
<DIV> <Format>image/tiff</Format></DIV>
<DIV> <Format>image/svg+xml</Format></DIV>
<DIV> <DCPType></DIV>
<DIV> <HTTP></DIV>
<DIV> <Get><OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></Get></DIV>
<DIV> <Post><OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></Post></DIV>
<DIV> </HTTP></DIV>
<DIV> </DCPType></DIV>
<DIV> </GetMap></DIV>
<DIV> <GetFeatureInfo></DIV>
<DIV> <Format>text/plain</Format></DIV>
<DIV>
<Format>application/vnd.ogc.gml</Format></DIV>
<DIV> <DCPType></DIV>
<DIV> <HTTP></DIV>
<DIV> <Get><OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></Get></DIV>
<DIV> <Post><OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></Post></DIV>
<DIV> </HTTP></DIV>
<DIV> </DCPType></DIV>
<DIV> </GetFeatureInfo></DIV>
<DIV> <DescribeLayer></DIV>
<DIV> <Format>text/xml</Format></DIV>
<DIV> <DCPType></DIV>
<DIV> <HTTP></DIV>
<DIV> <Get><OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></Get></DIV>
<DIV> <Post><OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></Post></DIV>
<DIV> </HTTP></DIV>
<DIV> </DCPType></DIV>
<DIV> </DescribeLayer></DIV>
<DIV> <GetLegendGraphic></DIV>
<DIV> <Format>image/gif</Format></DIV>
<DIV> <Format>image/png</Format></DIV>
<DIV> <Format>image/png;
mode=24bit</Format></DIV>
<DIV> <Format>image/jpeg</Format></DIV>
<DIV>
<Format>image/vnd.wap.wbmp</Format></DIV>
<DIV> <DCPType></DIV>
<DIV> <HTTP></DIV>
<DIV> <Get><OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></Get></DIV>
<DIV> <Post><OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></Post></DIV>
<DIV> </HTTP></DIV>
<DIV> </DCPType></DIV>
<DIV> </GetLegendGraphic></DIV>
<DIV> <GetStyles></DIV>
<DIV> <Format>text/xml</Format></DIV>
<DIV> <DCPType></DIV>
<DIV> <HTTP></DIV>
<DIV> <Get><OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></Get></DIV>
<DIV> <Post><OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:href="<A
href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp">http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp</A>;"/></Post></DIV>
<DIV> </HTTP></DIV>
<DIV> </DCPType></DIV>
<DIV> </GetStyles></DIV>
<DIV> </Request></DIV>
<DIV> <Exception></DIV>
<DIV>
<Format>application/vnd.ogc.se_xml</Format></DIV>
<DIV>
<Format>application/vnd.ogc.se_inimage</Format></DIV>
<DIV>
<Format>application/vnd.ogc.se_blank</Format></DIV>
<DIV> </Exception></DIV>
<DIV> <VendorSpecificCapabilities /></DIV>
<DIV> <UserDefinedSymbolization SupportSLD="1" UserLayer="0"
UserStyle="1" RemoteWFS="0"/></DIV>
<DIV> <Layer></DIV>
<DIV> <Name>Beleidskaart_Binnenstad</Name></DIV>
<DIV> <Title>Beleidskaart_Binnenstad</Title></DIV>
<DIV>
<Abstract>Beleidskaart_Binnenstad</Abstract></DIV>
<DIV> <SRS>EPSG:28992</SRS></DIV>
<DIV> <LatLonBoundingBox minx="5.03953" miny="52.0181"
maxx="5.05006" maxy="52.0236" /></DIV>
<DIV> <BoundingBox SRS="EPSG:28992"</DIV>
<DIV> minx="131110"
miny="447700" maxx="131830" maxy="448310" /></DIV>
<DIV> <Layer queryable="0" opaque="0"
cascaded="0"></DIV>
<DIV>
<Name>pgn_verwachting</Name></DIV>
<DIV>
<Title>pgn_verwachting</Title></DIV>
<DIV> <LatLonBoundingBox minx="5.04025"
miny="52.0182" maxx="5.04993" maxy="52.0236" /></DIV>
<DIV> <BoundingBox SRS="EPSG:28992"</DIV>
<DIV>
minx="131160" miny="447707" maxx="131821" maxy="448305" /></DIV>
<DIV> <Style></DIV>
<DIV>
<Name>default</Name></DIV>
<DIV>
<Title>default</Title></DIV>
<DIV> <LegendURL width="147"
height="41"></DIV>
<DIV>
<Format>image/png</Format></DIV>
<DIV> <OnlineResource
xmlns:xlink="<A
href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</A>"
xlink:type="simple" xlink:href="<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">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</A>"/></DIV>
<DIV> </LegendURL></DIV>
<DIV> </Style></DIV>
<DIV> </Layer></DIV>
<DIV> </Layer></DIV>
<DIV></Capability></DIV>
<DIV></WMT_MS_Capabilities></DIV></DIV>
<DIV><BR></DIV></BODY></HTML>