[mapserver-dev] A thought about a CGI parameter add, basically a switch for turning a default layer off.

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Tue Feb 1 22:54:08 EST 2011


1) If your interface is smart enough to explicitly turn the centerlines off why wouldn't you just set STATUS OFF in the mapfile and explicitly turn them on? I think the REQUIRES parameter is a better means of triggering this auto-off capability in any regard.

2) You might already be able to do the layer list using the [toggle_layers] tag. It returns a space delimited list of layers that can be toggled. It's available in any query/browse template so I imagine you could craft a URL that runs quickly to access them that way... Just a thought.

Steve
________________________________________
From: mapserver-dev-bounces at lists.osgeo.org [mapserver-dev-bounces at lists.osgeo.org] On Behalf Of Bob Basques [Bob.Basques at ci.stpaul.mn.us]
Sent: Tuesday, February 01, 2011 2:43 PM
To: MapServer Dev Mailing List
Subject: [mapserver-dev] A thought about a CGI parameter add,   basically a switch for turning a default layer off.

All,


Is this doable?


Was wondering about a mechanism to turn a DEFAULT layer off via CGI, something like "layers=-centerlines", where the negative sign ( - ) would be used to indicate that a default layer should NOT be drawn for a CGI request.


In short terms, could adding a negative sign ( - ) to the front of a layer name to NOT draw that layer be easily implemented in the CGI calls?


WARNING:  If the above is possible, the next question would be to get a list of the layers that are available in a MAPFILE (like GetCapabilities) for drawing.  And don't say use WMS, otherwise you should get rid of the LEGEND generation in MapServer too, since that can be done via WMS as well.  :c)   I also have an inkling that having the ability to poll the mapfile for the layers available might be an interesting capability to add in that would allow for some interesting user GUI elements to be built around.


---------


Here is my use case (if needed):


Say I have a centerline file of a street network for a map, and then add in a Aerial photo background, I want to turn the centerlines off, but keep the labels as an overlay.  Both the centerlines and the labels are on by default at the mapfile.


Thanks


bobb





More information about the mapserver-dev mailing list