Ticket #105 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

[HTML Legend] Need access to metadata and layer settings in [if] blocks

Reported by: dmorissette Owned by: dmorissette
Priority: high Milestone:
Component: MapServer C Library Version: 3.6
Severity: normal Keywords:
Cc: mcilhagga@…, jdoyon@…, sfournier@…

Description

"Doyon, Jean-Francois" wrote:
> 
> - I would like the "if" to be expanded to be able to do a condition on a
> metatag, as well as layer/class keywords, in my case specifically, if
> group=base then ... or if group=theme then ...  This would be used to color
> the     output differently based on whether it's a base or theme layer in my
> case, although I can think of many many other usefull things to do with
> this!
>

Change History

Changed 11 years ago by dmorissette

  • cc mcilhagga@… added
  • status changed from new to assigned
This is definitely a nice to have feature and we planned the [if] block for 
that, but before going too far, we need to define exactly which information is 
really useful and should be available in which context.  

Adding support for too many parameters, in addition to being time consuming for 
the developers (and adding long term maintenance when changes happen to the map 
objects structure), would add unnecessary overhead in the template parsing.

Here is a suggestion:

1- In the [leg_group_html] context:
  - Access to web metadata only
  - Layer metadata makes no sense in this context unless we make all layers 
    metadata available which means lots of overhead at runtime.

2- In the [leg_layer_html] and [leg_class_html] context:
  - Access to layer metadata
  - Access to some selected layer parameters... only those that are useful
    (e.g. layer_status, ???)
  - Access to some selected class params in the [leg_class_html] context only
  - Access to web metadata (layer metadata is processed first, in priority)

Would that sound like a good plan?  In this context, which layers and class 
parameters do you need JF?

Changed 11 years ago by dmorissette

  • cc steve.lime@… added

Changed 11 years ago by jdoyon@…

Sure that sounds fine by me.  In my case for the current work at hand, I guess 
I would need access to the "GROUP" keyword value ... In order to modify output 
based on that (i.e. theme vs base).  Other ones that might be handy is the 
layer NAME (Could build exceptions in the legend template based on that), and 
the status and type, which are allready there.

One question though, can one layer belong to more than one group? If so how 
would that be handled.

But then again you know, using just 2 values > 0 for legend_order basically had 
a grouping effect, and since that's metadata, I could achieve what I want just 
using that. But the minute someone decides to use more refined control, I loose 
that ability.

So, I'm babbling ... Bascially I need GROUP for now, and NAME could be handy, 
and that's about it, the other 2 are allready there.  Just keep in mind this 
multiple group thing, I vaguely recall seeing somewhere that it could be 
done ...

Thanks,
J.F.

Changed 11 years ago by dmorissette

I don't think a layer can belong to multiple groups since there is a single 
GROUP parmeter in the LAYER object.  I think Steve can answer that question 
easily... I'll add him to the CC: of this bug.

Changed 11 years ago by sfournier@…

  • status changed from assigned to closed
  • resolution set to fixed
Fixed. Now WEB metadata are supported in group, layer and class template. LAYER
metadata are supported by layer and class template.

Changed 11 years ago by sfournier@…

Also, I forgot to mention that layer_name and layer_group value are supported in
if tag.
Note: See TracTickets for help on using tickets.