[mapserver-users] Hide Layers on HTML legend where filtered r
esults are null
Palmer, Steve
Steve_Palmer@lpsg.com
Fri, 15 Nov 2002 17:01:00 -0600
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C28CFA.DDB87080
Content-Type: text/plain;
charset="iso-8859-1"
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@erac.com]
Sent: Thursday, November 14, 2002 4:58 PM
To: Palmer, Steve; mapserver-users@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@lpsg.com]
Sent: Thursday, November 14, 2002 3:29 PM
To: mapserver-users@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@erac.com]
Sent: Thursday, November 14, 2002 12:37 PM
To: Palmer, Steve; mapserver-users@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@lpsg.com]
Sent: Thursday, November 14, 2002 11:27 AM
To: mapserver-users@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
------_=_NextPart_001_01C28CFA.DDB87080
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Hide Layers on HTML legend where filtered results are null</TITLE>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=589065922-15112002><FONT color=#0000ff size=2>Thanks - I
managed to hack out a Javascript method to hide said layers - ugly but works
like a charm</FONT></SPAN></DIV>
<DIV><SPAN class=589065922-15112002><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=589065922-15112002><FONT color=#0000ff
size=2>Steve</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Martin, Daniel
[mailto:DMartin@erac.com]<BR><B>Sent:</B> Thursday, November 14, 2002 4:58
PM<BR><B>To:</B> Palmer, Steve;
mapserver-users@lists.gis.umn.edu<BR><B>Subject:</B> RE: [mapserver-users]
Hide Layers on HTML legend where filtered r esults are
null<BR><BR></FONT></DIV>
<DIV><SPAN class=187065323-14112002><FONT face=Arial color=#0000ff
size=2>Steve,</FONT></SPAN></DIV>
<DIV><SPAN class=187065323-14112002><FONT face=Arial color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=187065323-14112002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=187065323-14112002><FONT face=Arial color=#0000ff size=2>I'd
bet one of the developers knows why it's not working. ;)</FONT></SPAN></DIV>
<DIV><SPAN class=187065323-14112002><FONT face=Arial color=#0000ff
size=2>-Dan</FONT></SPAN></DIV>
<DIV><SPAN class=187065323-14112002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=187065323-14112002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Palmer, Steve
[mailto:Steve_Palmer@lpsg.com]<BR><B>Sent:</B> Thursday, November 14, 2002
3:29 PM<BR><B>To:</B> mapserver-users@lists.gis.umn.edu<BR><B>Subject:</B>
RE: [mapserver-users] Hide Layers on HTML legend where filtered r esults are
null<BR><BR></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=161091021-14112002>Thanks to Dan
& Peter for their prompt replies. Works like a charm if I
"hard-code" those values in my map file.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=161091021-14112002></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=161091021-14112002>Currently, I
have all the layers in my mapfile set with...</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=161091021-14112002></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=161091021-14112002>METADATA</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=161091021-14112002> "legend_order" "0"</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=161091021-14112002>End</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=161091021-14112002></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=161091021-14112002>I know before
I initialize the map if there won't be any results to display as a
result of my filter</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=161091021-14112002></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=161091021-14112002>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?</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=161091021-14112002></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2><SPAN
class=161091021-14112002>Thanks</SPAN></FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Martin, Daniel
[mailto:DMartin@erac.com]<BR><B>Sent:</B> Thursday, November 14, 2002
12:37 PM<BR><B>To:</B> Palmer, Steve;
mapserver-users@lists.gis.umn.edu<BR><B>Subject:</B> RE: [mapserver-users]
Hide Layers on HTML legend where filtered r esults are
null<BR><BR></FONT></DIV>
<DIV><SPAN class=924492619-14112002><FONT face=Arial color=#0000ff
size=2>Steve,</FONT></SPAN></DIV>
<DIV><SPAN class=924492619-14112002><FONT face=Arial color=#0000ff
size=2>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:</FONT></SPAN></DIV>
<DIV><SPAN class=924492619-14112002><FONT face=Arial color=#0000ff
size=2>1) Setting the status to off -> requires not using an
opt_flag of 2.</FONT></SPAN></DIV>
<DIV><SPAN class=924492619-14112002><FONT face=Arial color=#0000ff
size=2>2) Using the order_metadata feature, and setting the metadata value
to a negative number. In this case the status is
irrelevant.</FONT></SPAN></DIV>
<DIV><SPAN class=924492619-14112002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=924492619-14112002><FONT face=Arial color=#0000ff
size=2>I'm don't think you can do either as the result of a
filter without Mapscript. Perhaps someone else knows a
way....</FONT></SPAN></DIV>
<DIV><SPAN class=924492619-14112002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=924492619-14112002><FONT face=Arial color=#0000ff
size=2>-Dan</FONT></SPAN></DIV>
<DIV><SPAN class=924492619-14112002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Palmer, Steve
[mailto:Steve_Palmer@lpsg.com]<BR><B>Sent:</B> Thursday, November 14,
2002 11:27 AM<BR><B>To:</B>
mapserver-users@lists.gis.umn.edu<BR><B>Subject:</B> [mapserver-users]
Hide Layers on HTML legend where filtered results are
null<BR><BR></FONT></DIV>
<P><FONT face=Arial size=2>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.</FONT></P>
<P><FONT face=Arial size=2>I am displaying layers on an HTML
legend</FONT> </P>
<P><FONT face=Arial size=2>The content of those layers is controlled by
passing a filter value as part of my GET string
(map_mylayername_filter=somevalue)</FONT></P>
<P><FONT face=Arial size=2>If the filter doesn't "find" any records, I
would like to be able to hide that layer on my legend</FONT> </P>
<P><FONT face=Arial size=2>Any tips/guidance that anyone could provide
would be greatly appreciated</FONT> </P>
<P><FONT face=Arial size=2>MapServer 3.6.1, WinNT/IIS4 -
Win2000/IIS5</FONT> </P>
<P><FONT face=Arial size=2>Thanks</FONT> </P>
<P><FONT face=Arial
size=2>*************************************************************************************************************</FONT>
<BR><FONT face=Arial size=2>Steve Palmer</FONT> <BR><FONT face=Arial
size=2>GIS Developer</FONT> <BR><FONT face=Arial size=2>406-728-9323
x206<B></B></FONT>
</P></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C28CFA.DDB87080--