[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:21:51 EST 2011


Steve, 

Hmmm, good point on the Copyright thing, I suppose it's complicating things, but you could use a KEYWORD / function in the Mapfiles to enforce the stamping, or hide such layers from a [toggle_layer] listing. 

It's sometimes easier to predict (or assume) that certain layers should be on by default.   In a GeoMoose configuration, the data owners/custodians can have their own publication controls, and they will have their preferences for default layers, for particular users, this may work very well for them, but other (unpredicted) users, may want/need to display things in different combinations of layers in their view of the world. 

I've been a long (LONG) time user of the CGI model for MapServer, even building my own image generator before ever moving to using MapServer.  The CGI methods for me just seem easier and less verbose to use, and much quicker to implement on the fly, especially when I have control of everything from front to back.  Some WMS queries are optional, so not all capabilities that a CGI approach would afford are necessarily available via WMS all the time.  The thread was aimed at making things more flexible overall, not just more complicated. 

Templates work very well, and look like they will work for the layer listing too (I thought about this before sending the questions).  Lastly, since MapServer is in the mix, I can combine CGI with WMS calls as well.  I may need to run the request through some proxy, but then I have even more control over things,  A WMS+ service if you will. 

My parting thought on this, would be, if this is truly seen as a cumbersome or time consuming thing to add to mapserver, should some review of current capabilities be performed to see what redundant capabilities might be removable from MapServer since they are now available via other means, like WMS, or at the very least, implement/convert them to a WMS like call. 

I prefer to keep both products/services in their own sand boxes, and apply the best capabilities list to each, but maybe I'm missing something at the big(ger) picture level. 

:c) 

bobb 



>>> Stephen Woodbridge <woodbri at swoodbridge.com> wrote:


I do not think this would be a good idea because it would allow a user
to turn off say a copyright layer for instance.

I think it is better to plan out your application to turn things on that
you want on as Steve suggests.

So while I do you the CGI even in OpenLayers over the WMS, mostly
because I learned it first and partly because WMS just makes it too easy
for unwanted users to pull maps, I am somewhat inclined to think the WMS
is the better way to go if you want all the capabilities of WMS. What is
your rationale for adding a all this stuff to the CGI? Does working it
through the template system meet your needs?

Inquiring minds want to know :)

Best regards,
   -Steve W

On 2/1/2011 10:54 PM, Lime, Steve D (DNR) 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
>
>
>
> _______________________________________________ mapserver-dev mailing
> list mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev

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


More information about the mapserver-dev mailing list