Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1603 closed defect (invalid)

WMS Server fails with layers=all

Reported by: condit@… Owned by: mapserverbugs
Priority: high Milestone:
Component: WMS Server Version: 4.8
Severity: normal Keywords:
Cc:

Description

I'm not sure if this is a bug or a feature request, but I'd like to be able to
pass the cgi arg LAYERS=all to my mapserver cgi and get all the layers in the
mapfile that aren't set to OFF.  Currently I end up with
"msWMSLoadGetMapParams(): Invalid layer(s) given in the LAYERS parameter." if I
specify LAYERS=all in the request.  

The problematic code is at mapwms.c:736

Attachments (1)

mapwms.c (113.3 KB ) - added by condit@… 18 years ago.
Turns on all MS_DEFAULT layers when layers arg is "all"

Download all attachments as: .zip

Change History (4)

by condit@…, 18 years ago

Attachment: mapwms.c added

Turns on all MS_DEFAULT layers when layers arg is "all"

comment:1 by dmorissette, 18 years ago

Resolution: invalid
Status: newclosed
Chris, sorry for not commenting earlier on this.

The WMS interface is based on the specification from OGC. We cannot add support
for LAYERS=all to the WMS interface as this is not documented or permited by the
WMS specification.

But all is not lost for you: there is already a valid way to turn on all layers
at once that is compliant with the spec. If you look at the GetCapabilities
response returned by MapServer, you'll notice that there is always a top-level
<Layer> whose name is the name of your map (at the top-level in the mapfile).
Use that name in the LAYERS parameter of a GetMap request and all the layers
will be turned on.

Closing bug as INVALID.

comment:2 by condit@…, 18 years ago

Thanks for looking into this!
Yes - I saw this, but it seems to also display layers that have STATUS = OFF. 
Is there a way to display all layers that have STATUS set to DEFAULT or ON, but
not render any layers that have status set to OFF?

comment:3 by dmorissette, 18 years ago

No, there is not way to do that directly. Please keep in mind that if you use
WMS then you have to follow the WMS rules, and there is no such thing as status
in the WMS spec.

Something you could possibly do if you don't use groups already would be to set
a group on all the layers that you want turned on and use a different group for
those that you would have set to status OFF. Then you can turn on all the layers
at once using the group name in the LAYERS=... parameter.
Note: See TracTickets for help on using tickets.