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

Bob Basques Bob.Basques at ci.stpaul.mn.us
Wed Feb 2 10:04:12 EST 2011


Steve, 

I was just trying to work within the current framework of MapServer.  Your point number one below, is certainly an option.  But it would require quite a bit of dataset catalog modification (at least on our part, where we have a mapfile per layer X 250 layers)  

I thought about the TEMPLATE approach to the GetCapabilites aspect, and thought that was a viable option.  But I added in the question anyway, as it seemed there might be another method available for something like that.  I remember the toggle_layers option now that you've mentioned it, does that work with groups too, and/or REGEX to group layers. 

The desire here was to provide more end user controls without neededint to redesign the comm aspects of the client and services.  Maybe that's a requirement though. 

bobb 




>>> "Lime, Steve D (DNR)" <Steve.Lime at state.mn.us> wrote:


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



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20110202/63f2f044/attachment.html


More information about the mapserver-dev mailing list