[Chameleon] Can LegendTemplate keep legend-unvisible
layers map-visible after update?
Paul Spencer
pspencer at dmsolutions.ca
Tue Aug 30 09:18:02 EDT 2005
yes it is possible, but you have to trick the widget a bit to make it
work. Try adding the following:
[if name=layer_group oper=neq value="Bestemmingen"]
[if name=layer_status oper=eq value=1]
<input type="hidden" name="legendlayername[]" value="[leg_layer_name]"]
[/if]
[if name=layer_status oper=eq value=2]
<input type="hidden" name="legendlayername[]" value="[leg_layer_name]"]
[/if]
[/if]
The way php processes GET/POST will ensure that the layer names for
other layers that are "ON" will be included in the array legendlayernames.
Cheers
Paul
Davelaar, Hilbert wrote:
> Hi all,
>
> I have a problem with the LegendTemplate-widget. In my mapfile I have three groups of layers. When starting the application I want the user to be able to turn on the layers contained in the 'Bestemmingen'-group. So only the layers in from this group are shown with a checkbox in the legend. Therefore a use following code in my legend_template.html:
>
> [leg_layer_html order=ascending opt_flag=15]
> [if name=layer_group value="Bestemmingen"]
> <tr bgcolor="#ffffff">
> <td align="center" width=20><input type="checkbox" style="background-color:#AAFFBB" name="legendlayername[]"
> value="[leg_layer_name]"
> [if name=layer_status oper=eq value=1]CHECKED[/if]
> [if name=layer_status oper=eq value=2]CHECKED[/if]></td>
> [if name=wms_name oper=isnull]
> <td><span class="label">[leg_layer_name]</span></td>
> </tr>
> [/if]
> [if name=wms_name oper=isset]
> <td><a href="#" onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span class="label">[metadata name=WMS_TITLE]</span></a></td>
> </tr>
> [/if]
> [/if]
>
> Turn on the layers from the 'Bestemmingen'-group works fine this way, but the problem is after the update of the map the other to groups of layer which by default have status=ON are turned off. Is it possible to keep their status ON all the time?
>
> Kind regards,
> Hilbert Davelaar
>
>
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
>
--
+-----------------------------------------------------------------+
|Paul Spencer pspencer at dmsolutions.ca |
+-----------------------------------------------------------------+
|Applications & Software Development |
|DM Solutions Group Inc http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+
More information about the Chameleon
mailing list