<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
Thanks for your reply!<br>
<br>
I have found a way to enable the legend the way I want, only showing
metadata-including layers. I've also modified the LegendTemplate widget
(set ControlVisibility="true"). So far everything seems fine.<br>
<br>
Now the issue exists where the layers will disappear after updating the
map! The first click results in the proper "on" layer being hidden, but
any non-default layers are hidden. A following update to the map will
remove all layers except those controlled by the legend. Strange!<br>
<br>
The "always on" rivers layer which stays put after the first Update,
but disappears after subsequent updates, and a normal
initially-invisible layer which the legend controls just fine:<br>
<br>
<small><tt><font color="#3333ff">&nbsp;&nbsp;&nbsp; #----------------------------------<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; LAYER<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GROUP&nbsp;&nbsp;&nbsp; "Base Layers"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NAME&nbsp;&nbsp;&nbsp; "Rivers"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp; POLYGON<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DATA&nbsp;&nbsp;&nbsp; rivers<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; STATUS&nbsp;&nbsp;&nbsp; DEFAULT<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CLASS<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NAME&nbsp;&nbsp;&nbsp; "Rivers"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; COLOR &nbsp;&nbsp;&nbsp; 48 100 230<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; OUTLINECOLOR 64 128 255<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; END<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; METADATA<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SHOWINLEGEND "no"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; END<br>
&nbsp;&nbsp;&nbsp; END<br>
<br>
&nbsp;&nbsp;&nbsp; LAYER<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GROUP&nbsp;&nbsp;&nbsp; "Sites"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NAME&nbsp;&nbsp;&nbsp; "Sites"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp; POINT<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DATA&nbsp;&nbsp;&nbsp; sites<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TOLERANCE 6<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; STATUS&nbsp;&nbsp;&nbsp; OFF<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HEADER '../query/query_header.html'<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; FOOTER '../query/query_footer.html'<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MAXSCALE 30000<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; METADATA<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SHOWINLEGEND "yes"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; END<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CLASSITEM "sites"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; LABELITEM "sites"<br>
&nbsp;&nbsp;&nbsp; END<br>
<br>
&nbsp;&nbsp;&nbsp; #----------------------------------</font><br>
</tt></small><br>
The legend template layer section:<br>
<font color="#3333ff"><br>
<big><tt><small><small>[leg_layer_html order_metadata=legend_order
opt_flag=15]<br>
[if name=SHOWINLEGEND oper=eq value="yes"] <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr bgcolor="#ffffff"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td align="center" width=20&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type="checkbox" name="legendlayername[]"
value="[leg_layer_name]"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [if name=layer_status oper=eq&nbsp; value=1]CHECKED[/if]<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [if name=layer_status oper=eq
value=2]CHECKED[/if]&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;img src="[leg_icon width=20 height=18]" width="20"
height="18"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;<br>
&nbsp;&nbsp;&nbsp; <br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;span class="label"&gt;[leg_layer_name]&lt;/span&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
[/if]<br>
[/leg_layer_html]</small></small></tt></big></font><br>
<br>
And finally, the LegendTemplate widget:<br>
<br>
<font color="#3333ff"><small><tt>&nbsp;&nbsp;&nbsp; &lt;cwc2 <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; type="LegendTemplate" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; visible="true" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; embedded="true" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; template="legend_template.html" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; popupstyleresource="TextButtons" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; popupwidth="500" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; popupheight="400" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; status="false" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; menubar="false"<br>
&nbsp;&nbsp;&nbsp; /&gt;<br>
</tt></small></font><br>
<br>
Is this a circular catch-22 problem? Is there a way around this
behavior?<br>
<br>
Best regards,<br>
- Peter<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Ken Boss wrote:
<blockquote cite="mids315cb5e.096@co5.dnr.state.mn.us" type="cite">
  <pre wrap="">Peter--

It's been awhile since I've thought about this (so take the advice with some salt), but my approach to the checkbox portion of html legends has been more along these lines:

         &lt;input type="radio" name="[leg_layer_name]" 
           [if name=layer_status oper=neq value=0]
             CHECKED
           [/if]
         &gt;

HTH,

--Ken


  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <blockquote type="cite">
        <pre wrap="">Peter Kingsbury <a class="moz-txt-link-rfc2396E" href="mailto:peter.kingsbury@GMAIL.COM">&lt;peter.kingsbury@GMAIL.COM&gt;</a> 8/31/2005 2:39:56 PM &gt;&gt;&gt;
        </pre>
      </blockquote>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->Hello all,

Grief once again with my legends.

The symptom is that, if the Layer status in the .MAP file is set to OFF, 
the layer doesn't show up ... if set to ON, it shows up. This behavior 
so far is normal.

However, when checking/unchecking layers from the LegendTemplate widget, 
then clicking Update, the page refreshes, and all layers listed in the 
LegendTemplate become unchecked!

I've gone through the documentation numerous times, and I am unable to 
find anything that might be wrong with the code. I've also used the 
sample legend template HTML code, which results in much the same 
behavior. Not sure where to look at this point. Going to give it a go 
again tomorrow.

I've included the legend_template.html and widget code below.

Any insight is appreciated!

Best regards,
- Peter



---- legend_template.html ----
[leg_group_html]
    &lt;tr&gt;
        &lt;td colspan=3 bgcolor=#cccccc&gt;&lt;b&gt;[leg_group_name]&lt;/b&gt;&lt;/td&gt;
    &lt;/tr&gt;
[/leg_group_html]

[leg_layer_html order_metadata=legend_order opt_flag=15]
    &lt;tr&gt;
        &lt;td&gt;
            &lt;input type=checkbox name=layer_status value=
                     [if name=layer_status oper=eq value=1]on[/if]
                     [if name=layer_status oper=eq value=0]off[/if]&gt;
        &lt;/td&gt;
        &lt;td&gt;
            &lt;img src="[leg_icon width=20 height=18]" width="20" height="18"&gt;
        &lt;/td&gt;
        &lt;td&gt;
            &lt;span class="label"&gt;
                [leg_layer_name]
            &lt;/span&gt;
        &lt;/td&gt;
    &lt;/tr &gt;
[/leg_layer_html]
---- end legend_template.html ----

---- chameleon widget ----
    &lt;cwc2
        type="LegendTemplate"
        visible="true"
        embedded="true"
        template="legend_template.html"
        popupstyleresource="TextButtons"
        popupwidth="500"
        popupheight="400"
        status="false"
        menubar="false"
        controlvisibility="false"
        /&gt;
---- end chameleon widget ----

  </pre>
</blockquote>
<br>
</body>
</html>