[Chameleon] hiding annotation layers in the legend

Paul Spencer pspencer at dmsolutions.ca
Thu Apr 7 17:42:18 EDT 2005


Ken,

the problem is that the LegendTemplate widget is a bit dumb about 
layers, it assumes that if it doesn't see a layer in the form variables 
when the page is submitted, it should be turned off.

The best way to accomodate this is to actually use opt_flags=15 and use 
the layer type or metadata to hide it through using [if] flags in the 
template.  Layers that should be displayed go in one if and hidden 
layers go in another if

To get hidden layers to stay on, output

<input type="text" name="legendlayernames[]" value="[leg_layer_name]">

inside the if for hidden layers.

Cheers

Paul

Ken-ichi Ueda wrote:
> Hi all.  This may be a dumb question, but what's the best way to
> display a layer on the map while hiding it in the legend?  I have an
> annotation layer that doesn't need to be in the legend, but if I do
> something like set opt_flag=7 in the HTML legend template, the layer
> not only disappears from the legend, it also doesn't display on the
> map.
> 
> Any suggestions?
> 
> -Ken-ichi
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 


More information about the Chameleon mailing list