<!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 5.50.4613.1700" name=GENERATOR></HEAD>
<BODY>
<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.&nbsp; I didn't even think of that.&nbsp; 
Unfortunately, you've gone beyond my understanding.&nbsp; I've yet to work with 
the URL based dynamic changes to the map file.&nbsp; I tinkered with your 
example below, but I also was unable to affect&nbsp;change in the metadata from 
the URL.</FONT></SPAN></DIV>
<DIV><SPAN class=187065323-14112002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=187065323-14112002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</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 
  &amp; Peter for&nbsp;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>&nbsp;</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>&nbsp;</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>&nbsp;"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>&nbsp;</DIV>
  <DIV><FONT color=#0000ff size=2><SPAN class=161091021-14112002>I know before I 
  initialize the map&nbsp;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>&nbsp;</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>&nbsp;</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.&nbsp; 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&nbsp; -&gt; 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.&nbsp; In this case the status is 
    irrelevant.</FONT></SPAN></DIV>
    <DIV><SPAN class=924492619-14112002><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=924492619-14112002><FONT face=Arial color=#0000ff 
    size=2>I'm&nbsp;don't think&nbsp;you can do either as the result of a filter 
    without Mapscript.&nbsp; Perhaps someone else knows a 
    way....</FONT></SPAN></DIV>
    <DIV><SPAN class=924492619-14112002><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</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>&nbsp;</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></BODY></HTML>