#1603 closed defect (invalid)
WMS Server fails with layers=all
Reported by: | 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)
Change History (4)
by , 18 years ago
comment:1 by , 18 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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 , 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 , 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.
Turns on all MS_DEFAULT layers when layers arg is "all"