[Chameleon] Legend template using group rather than layer

Godwin, Liz Godwinl at AGR.GC.CA
Wed May 19 08:39:20 EDT 2004


This is the second time I have heard this, but I'm not convinced.

Why does this work then?  Go to the Itasca demo:
http://www2.dmsolutions.ca/msapps/itasca_legend/demo_init.html

Legend 3 uses groups of layers.  Also.. The online documentation
suggests that this works.

Liz

-----Original Message-----
From: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Paul Spencer
Sent: May 19, 2004 6:50 AM
To: Delfos, Jacob
Cc: chameleon at lists.maptools.org
Subject: Re: [Chameleon] Legend template using group rather than layer


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/|
  -----------------------------------------------------------------

_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon



More information about the Chameleon mailing list