Dynamic legend

DjwStone D.Stone at ED.AC.UK
Tue May 2 10:07:43 EDT 2006


OK, I've got a legend now showing class-names for all selected layers,
including the 'layer of dots' generated from a PostGIS table. At the moment,
that layer has a fixed, generic class-name, but the layer is actually
dynamic: its DATA statement is modified by a FILTER containing a
substitution variable:

    FILTER        "dedicationtype='%dtype%'"

What I'd like is for the layer's class-name to mirror the dedication type,
so if the user via the HTML template sets dedicationtype = Bell, the legend
on the generated map should label the dots as 'Bell' rather than just the
fixed 'Dedications'.

I nearly achieve this with:

   <INPUT TYPE="HIDDEN" NAME="map_layer_3_class_0_name" VALUE="[dtype]">

in the template, but the order of processing is such that the first time the
template is submitted, 'dtype' (the select list containing dedication types)
has no value, and the map has to be redrawn again before 'Bell' appears in
the legend.

Is there a way to get the value of dtype selected on the 1st display of the
template to update the class-name in the mapfile before it's used in
generating the legend on the 2nd display?

Hope that's intelligible -- if not, just shout!

Dave
--
View this message in context: http://www.nabble.com/Dynamic-legend-t1538507.html#a4179750
Sent from the Mapserver - User forum at Nabble.com.



More information about the mapserver-users mailing list