Legend Template Bug?

Peter Kingsbury peterkingsbury at ISTOP.COM
Thu Jun 30 06:39:19 PDT 2005


Hello all,

When working on the legend for my map project, I have noted a strange 
behavior. Unfortunately, my limited experience with the scripting system 
does not allow me to determine if this is a bug, or if I am doing 
something I shouldn't be.

I am working with the LegendTemplate widget in Chameleon, and have used 
the example code from legend_template.html and additional code to 
display grouped layers. I've pulled out everything and only added in 
basic code to display legend groups, and the behavior still presents 
itself. At the end of this email is my current code.

The problem with adding the leg_group_html code in, is that upon zooming 
to a certain scale on my map, the layers which are not visible in the 
legend (yet are visible on the map), disappear! This seems to be a 
catch-22... I need to hide some layers from the legend, but if they are 
not given names or groups in the map file, the legend turns this 
"hidden" layer off!

I'm uncertain if this is a behavioral problem with Chameleon, or some 
weirdness with the legend script, any ideas?

Cheers,
- Peter



---- script ----



[leg_group_html]
    <tr>
        <td colspan=3 bgcolor=#cccccc><b>[leg_group_name]</b></td>
    </tr>
[/leg_group_html]

[leg_layer_html order_metadata=legend_order opt_flag=15]
    <tr>
        <td>
            <input type=checkbox name="map_[leg_layer_name]_status" 
value=1 [if name=layer_status oper=eq value=2]CHECKED[/if]>
        </td>
        <td>
            <img src="[leg_icon width=20 height=18]" width="20" height="20">
        </td>
        <td>
            <span class="label">
                [leg_layer_name]
            </span>
        </td>
    </tr >
[/leg_layer_html]



More information about the MapServer-users mailing list