Ticket #1796 (assigned enhancement)

Opened 7 years ago

Last modified 7 years ago

Suggested enhancements to HTML legend specification

Reported by: roland.w.martin@… Owned by: sdlime
Priority: high Milestone:
Component: MapServer C Library Version: unspecified
Severity: minor Keywords:
Cc:

Description

I'd like to request something like [leg_layer_inscale] as an addition to the
HTML legend - i.e. if current scale is between the layer's [leg_layer_minscale]
& [leg_layer_maxscale] then it's true, otherwise false.

Also perhaps [leg_layer_inextent] to ascertain whether any of the features from
that layer are visible in the current view?

Or combine them both in [leg_layer_visible]?

Change History

Changed 7 years ago by sdlime

  • cc dmorissette@… added
  • status changed from new to assigned
CC'ing Dan since his group did the HTML legend stuff...

Steve

Changed 7 years ago by dmorissette

[layer_inscale] could be done relatively easily, but would add very little value
since [if] blocks can already use [layer_visible] that is set to 1 (true) if the
layer is in scale and has its status set to ON or DEFAULT.

[layer_inextent] reminds me of an old request that we had to produce legends
that contain only classes that have at least one corresponding shape visible on
the map (we never did it in the end). This would require that we track the
number of features drawn per class in a layer, or at least track whether a class
was hit or not during map rendering, which we don't do at the moment. Plus, I
think it's possible for the legend to be generated without rendering a map, when
using MapScript for instance, so depending on the time at which the legend is
generated in a script execution you could get different results.

Is any action is required since [layer_visible] already provides most of the
requested functionality?

Changed 7 years ago by roland.w.martin@…

I should probably clarify what I'm trying to do - I'd like to disable (but not
hide) the checkboxes for the layers that are currently out of scale. Unless I've
missed some functionality somewhere, that's not presently possible.

The [layer_inextent] was more of a whim - don't worry so much about that!

Cheers.

Changed 7 years ago by sdlime

Dan: Do you guys want to take ownership of this bug? Please feel free if there's
a chance you might get to it in the near future...

Steve

Changed 7 years ago by dmorissette

  • dependson set to 750

Changed 7 years ago by dmorissette

I just found out that there is already bug 750 about showing only visible
classes (i.e. the layer_inextent feature) so that part of the discussion should
move there.

With respect to Roland's comment #3, could you not do what you need using an
[if] and checking the value of layer_visible to enable/disable the checkbox?

Changed 7 years ago by sdlime

There were also comments about being able to check the number of classes for a 
layer. If one you'd use one method of display, if more than one another method.

Steve

Changed 7 years ago by sdlime

  • blocked set to 1090

Changed 7 years ago by roland.w.martin@…

Hi guys... I think I've explained myself very badly here!

In response to Daniel in #5 - I just tried that suggestion - it disables
everything that isn't currently turned on. I'm not entirely sure I understand
the difference between [layer_status] and [layer_visible] - but they both seem
to refer to current layer visibility, not whether or not it can be shown.

Currently I do it using opt_flag=14 to hide the layers that are out of scale -
I'd prefer to have them visible in the legend - but not usable. Does that make
sense?

Ta.
Note: See TracTickets for help on using tickets.