[Chameleon] Legend template using group rather than layer

Paul Spencer pagameba at magma.ca
Wed May 19 20:50:35 EDT 2004


Liz, you may be right ... the piece of the documentation that appears to 
be pertinent is:

"HTML block to use for layer group headers if layers should be grouped 
in the legend. If not set then layers are not grouped in the legend.

When the [leg_group_html] tag is used, then layers that don't belong to 
any group (i.e. LAYER GROUP not set in the mapfile) and their classes 
will not show up at all in the legend. The group list is decided by the 
order_metadata parameter, which is explained later."

What I think is most confusing here is that layers that have no group 
will not show up in the legend if the leg_group_html is used, regardless 
of whether you use a leg_layer_html or not.

Certainly example 4 shows the two being used together.

However, when we tried it for one of our clients, I seem to remember 
that we could not get it to work as we wanted, but that could have been 
a limitation of our requirements or the legend template processor, can't 
remember which.

Cheers,

Paul

Godwin, Liz wrote:

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



More information about the Chameleon mailing list