[Chameleon] Legend Template Bug?

Peter Kingsbury peterkingsbury at istop.com
Sat Jul 9 15:57:21 EDT 2005


Hi Ken-ichi,

Thanks for your response.

I have changed my mapfile layers to contain metadata as your article 
describes, and seemed to have resolved this issue. However, if I even 
include a legend layer in the map page, I get javascript scripting 
errors in IE! This behavior does not occur in Firefox or Opera.

Any ideas on this? I'm quite stumped, I can't see anything I might be 
doing incorrectly, as the code that is giving the error is 
Chameleon-generated.

Cheers,
- Peter




Ken-ichi wrote:

> I've had similar problems trying to hide layers from the legend.  
> Check out this thread:
>
> http://lists.maptools.org/pipermail/chameleon/2005-June/thread.html#2394
>
> and my own notes on the issue here:
>
> http://www.pageofguh.org/technicality/488
>
> -Ken-ichi
>
> On Jun 30, 2005, at 6:39 AM, Peter Kingsbury wrote:
>
>> 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]
>>
>>
>> _______________________________________________
>> Chameleon mailing list
>> Chameleon at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/chameleon
>>
>
>
>




More information about the Chameleon mailing list