[Chameleon] Legend template using group rather than layer

Paul Spencer pagameba at magma.ca
Wed May 19 06:49:34 EDT 2004


Jacob,

you have run into a limitation of the html legend template processor in 
mapserver, it is possible to show only groups OR layers.  This was one 
of the reasons that we built the XMLThemeLegend, it allows you to create 
Themes and Groups of layers for display purposes independently of the 
grouping of layers in the map file.

Unfortunately, the XMLThemeLegend cannot display classes.

We did one project where we combined both the XMLThemeLegend and 
LegendTemplate.  The XMLThemeLegend was used to generate layer 
visibility controls in a compact set of themes and groups and the 
LegendTemplate displayed groups and classes of visible layers (no 
checkboxes).  Pretty cool.

Sorry I couldn't help you more,

Paul

Delfos, Jacob wrote:

> Hi All,
> 
> I've been tying to create a legend template which generates a legend 
> with tickboxes to turn layers on and off, but which shows groups as 
> well. If a layer is in a group, I don't want the invidividual layer to 
> be shown at all.
> 
> At the moment I'm using a basic template which I think I got off the 
> mapserver website (pasted below).
> 
> I tried to modify it to show groups, but it doesn't seem to work. Can 
> anyone give me a hint?
> 
> Regards,
> 
> Jacob
> 
> 
> ---------------------------------------------------------------------------------------------------------------------------------------
> 
> [leg_layer_html order=ascending opt_flag=15]
> [if name=CWC_TMP_LAYER oper=isnull]
> 
>   <tr bgcolor="#FFFFFF">
>     <td align="center"><input type="checkbox" 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><a href="#" 
> onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><font 
> face="Arial, Helvetica, sans-serif" 
> size="1">[leg_layer_name]</font></a></td>
> 
>   </tr>
>     [/if]
>     [if name=wms_name oper=isset]
>     <td><a href="#" 
> onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><font 
> face="Arial, Helvetica, sans-serif" size="1">[metadata 
> name=WMS_TITLE]</font></a></td>
> 
>   </tr>
>     [/if]
> [/if]
> [/leg_layer_html]
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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