[OpenLayers-Users] WMS-layer: BBOX and SRS not being detected

InterRob rob.marjot at gmail.com
Thu Apr 21 17:36:44 EDT 2011


Dear list,

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).
At the bottom of this message, I copy/pasted the GetCapabilites-response.

The bit of JavaScript used to load the OpenLayers control + map + layer, is
classical:

============

 var map, layer;
  function init(){
    map = new OpenLayers.Map( 'map' );
    layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", "
http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&", { layers
: 'pgn_verwachting' }, { units : 'm', projection : new
OpenLayers.Projection("EPSG:28992"), singleTile : true, buffer : 0, ratio :
1 } );

============

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:
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

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...

And shouldn't the SRS be detected automatically as well?

Hints are much appreciated!

Kind regards,


Rob



=============== GetCapabilities response ======================
<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE WMT_MS_Capabilities SYSTEM "
http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd"
 [
 <!ELEMENT VendorSpecificCapabilities EMPTY>
 ]>  <!-- end of DOCTYPE declaration -->

<WMT_MS_Capabilities version="1.1.1">

<!-- 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 -->

<Service>
  <Name>OGC:WMS</Name>
  <Title>Beleidskaart_Binnenstad</Title>
  <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="
http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp;"/>
  <ContactInformation>
  </ContactInformation>
</Service>

<Capability>
  <Request>
    <GetCapabilities>
      <Format>application/vnd.ogc.wms_xml</Format>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp
;"/></Get>
          <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp
;"/></Post>
        </HTTP>
      </DCPType>
    </GetCapabilities>
    <GetMap>
      <Format>image/gif</Format>
      <Format>image/png</Format>
      <Format>image/png; mode=24bit</Format>
      <Format>image/jpeg</Format>
      <Format>image/vnd.wap.wbmp</Format>
      <Format>image/tiff</Format>
      <Format>image/svg+xml</Format>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp
;"/></Get>
          <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp
;"/></Post>
        </HTTP>
      </DCPType>
    </GetMap>
    <GetFeatureInfo>
      <Format>text/plain</Format>
      <Format>application/vnd.ogc.gml</Format>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp
;"/></Get>
          <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp
;"/></Post>
        </HTTP>
      </DCPType>
    </GetFeatureInfo>
    <DescribeLayer>
      <Format>text/xml</Format>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp
;"/></Get>
          <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp
;"/></Post>
        </HTTP>
      </DCPType>
    </DescribeLayer>
    <GetLegendGraphic>
      <Format>image/gif</Format>
      <Format>image/png</Format>
      <Format>image/png; mode=24bit</Format>
      <Format>image/jpeg</Format>
      <Format>image/vnd.wap.wbmp</Format>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp
;"/></Get>
          <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp
;"/></Post>
        </HTTP>
      </DCPType>
    </GetLegendGraphic>
    <GetStyles>
      <Format>text/xml</Format>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp
;"/></Get>
          <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://localhost/mapserv?map=/var/www/geo/binnenstad_wms.map&amp
;"/></Post>
        </HTTP>
      </DCPType>
    </GetStyles>
  </Request>
  <Exception>
    <Format>application/vnd.ogc.se_xml</Format>
    <Format>application/vnd.ogc.se_inimage</Format>
    <Format>application/vnd.ogc.se_blank</Format>
  </Exception>
  <VendorSpecificCapabilities />
  <UserDefinedSymbolization SupportSLD="1" UserLayer="0" UserStyle="1"
RemoteWFS="0"/>
  <Layer>
    <Name>Beleidskaart_Binnenstad</Name>
    <Title>Beleidskaart_Binnenstad</Title>
    <Abstract>Beleidskaart_Binnenstad</Abstract>
    <SRS>EPSG:28992</SRS>
    <LatLonBoundingBox minx="5.03953" miny="52.0181" maxx="5.05006"
maxy="52.0236" />
    <BoundingBox SRS="EPSG:28992"
                minx="131110" miny="447700" maxx="131830" maxy="448310" />
    <Layer queryable="0" opaque="0" cascaded="0">
        <Name>pgn_verwachting</Name>
        <Title>pgn_verwachting</Title>
        <LatLonBoundingBox minx="5.04025" miny="52.0182" maxx="5.04993"
maxy="52.0236" />
        <BoundingBox SRS="EPSG:28992"
                    minx="131160" miny="447707" maxx="131821" maxy="448305"
/>
        <Style>
          <Name>default</Name>
          <Title>default</Title>
          <LegendURL width="147" height="41">
             <Format>image/png</Format>
             <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:type="simple" xlink: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
"/>
          </LegendURL>
        </Style>
    </Layer>
  </Layer>
</Capability>
</WMT_MS_Capabilities>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110421/59b539c3/attachment.html


More information about the Users mailing list