[mapserver-users] Hide Layers on HTML legend where filtered r esults are null

Palmer, Steve Steve_Palmer at lpsg.com
Fri Nov 15 18:01:00 EST 2002


Thanks - I managed to hack out a Javascript method to hide said layers -
ugly but works like a charm
 
Steve

-----Original Message-----
From: Martin, Daniel [mailto:DMartin at erac.com]
Sent: Thursday, November 14, 2002 4:58 PM
To: Palmer, Steve; mapserver-users at lists.gis.umn.edu
Subject: RE: [mapserver-users] Hide Layers on HTML legend where filtered r
esults are null


Steve,
You are definitely on the right track.  I didn't even think of that.
Unfortunately, you've gone beyond my understanding.  I've yet to work with
the URL based dynamic changes to the map file.  I tinkered with your example
below, but I also was unable to affect change in the metadata from the URL.
 
I'd bet one of the developers knows why it's not working. ;)
-Dan
 
 

-----Original Message-----
From: Palmer, Steve [mailto:Steve_Palmer at lpsg.com]
Sent: Thursday, November 14, 2002 3:29 PM
To: mapserver-users at lists.gis.umn.edu
Subject: RE: [mapserver-users] Hide Layers on HTML legend where filtered r
esults are null


Thanks to Dan & Peter for their prompt replies. Works like a charm if I
"hard-code" those values in my map file.
 
Currently, I have all the layers in my mapfile set with...
 
METADATA
 "legend_order" "0"
End
 
I know before I initialize the map if there won't be any results to display
as a result of my filter
 
If I try and pass the values to my map template as part of my GET string
(e.g., map_mylayername_metadata_legend_order=-1) it seems to ignore it -
shouldn't this method work?
 
Thanks

-----Original Message-----
From: Martin, Daniel [mailto:DMartin at erac.com]
Sent: Thursday, November 14, 2002 12:37 PM
To: Palmer, Steve; mapserver-users at lists.gis.umn.edu
Subject: RE: [mapserver-users] Hide Layers on HTML legend where filtered r
esults are null


Steve,
Without Mapscript, I suspect that's going to be hard to do.  The two ways I
know of to hide a layer in the legend is:
1) Setting the status to off  -> requires not using an opt_flag of 2.
2) Using the order_metadata feature, and setting the metadata value to a
negative number.  In this case the status is irrelevant.
 
I'm don't think you can do either as the result of a filter without
Mapscript.  Perhaps someone else knows a way....
 
-Dan
 

-----Original Message-----
From: Palmer, Steve [mailto:Steve_Palmer at lpsg.com]
Sent: Thursday, November 14, 2002 11:27 AM
To: mapserver-users at lists.gis.umn.edu
Subject: [mapserver-users] Hide Layers on HTML legend where filtered results
are null



I've waded through hundreds and hundreds of archived messages and have not
found any guidance and am hoping someone can point me in the right
direction.

I am displaying layers on an HTML legend 

The content of those layers is controlled by passing a filter value as part
of my GET string (map_mylayername_filter=somevalue)

If the filter doesn't "find" any records, I would like to be able to hide
that layer on my legend 

Any tips/guidance that anyone could provide would be greatly appreciated 

MapServer 3.6.1, WinNT/IIS4 - Win2000/IIS5 

Thanks 

****************************************************************************
********************************* 
Steve Palmer 
GIS Developer 
406-728-9323 x206 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20021115/f4c1063c/attachment.html


More information about the mapserver-users mailing list