[MapServer-users] Seeing Missing required parameter STYLES in some calls in the network tab

Seth G sethg at geographika.co.uk
Sat Aug 24 02:45:47 PDT 2024


Hi Rob,

You have 2 options:

 1. Update your front-end application to add &STYLES= to the querystring. This would make the requests compliant with the WMS specification. The STYLES parameter is used to select all CLASSes in a LAYER with the same CLASS GROUP - so a single layer could han have multiple styles and a front-end application can choose which one to use, Leaving STYLES= empty means the default style is used. See https://mapserver.org/mapfile/class.html#mapfile-class-group and https://mapserver.org/ogc/wms_server.html#test-with-a-getmap-request
 2. Update your Mapfile to include "wms_allow_getmap_without_styles" "true" in your MAP WEB METADATA section to allow querystrings with a STYLES= parameter. E.g.

 MAP
   WEB
       METADATA
          "wms_allow_getmap_without_styles" "true"
          ...

Seth


--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Sat, Aug 24, 2024, at 1:23 AM, Rob Dennett via MapServer-users wrote:
> Hi, 
> 
> Looking at the network tab for a page request which doesn't seem to be downloading our map following an upgrade to 8.0, I am seeing the following in the payload preview:
> 
> <?xml version='1.0' encoding="UTF-8" standalone="no" ?>
> <!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
> <ServiceExceptionReport version="1.1.1">
> <ServiceException code="MissingParameterValue">
> msWMSLoadGetMapParams(): WMS server error. Missing required parameter STYLES. Note to service administrators: defining the "wms_allow_getmap_without_styles" "true" MAP.WEB.METADATA item will disable this check (backward compatibility with behaviour of MapServer < 8.0)
> </ServiceException>
> </ServiceExceptionReport>
> 
> Part of the URL is 
> format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&transparent=true&width=256&height=256&layers=PolygonSources,LineSources,PointSources,AllSources
> 
> And I am guessing this all has something to do with https://github.com/mapserver/mapserver/issues/6012
 <https://github.com/mapserver/mapserver/issues/6012>
> MapServer treats WMS STYLES param as optional, but the WMS spec says it is mandatory · Issue #6012 · MapServer/MapServer <https://github.com/mapserver/mapserver/issues/6012>
> We got a report that MapServer treats the WMS GetMap STYLES param as optional, but the WMS spec state that it should be mandatory. (I verified and GetMap STYLES is indeed mandatory in WMS 1.1.0, 1....
> github.com
> 
> The problem is that I don't know what the STYLES param is.  Is this related and if so, where can I learn about this to see what changes I need to make to my .map files?
> 
> Thanks,
> Rob
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20240824/11315353/attachment.htm>


More information about the MapServer-users mailing list