[mapserver-users] De-coupling legend from class name

nikos at maich.gr nikos at maich.gr
Wed Jan 27 05:03:20 PST 2010


Hello,

It's been a while since I've been using MS and I have the following q or
observation.

AFAIU, MS only supports run-time substitution for the following parameters

•	LAYER: DATA (must validate against DATAPATTERN)
•	LAYER: TILEINDEX
•	LAYER: CONNECTION
•	LAYER: FILTER
•	CLASS EXPRESSION

Layer color is not in this list.
So, in order to permit a user to change the layer colors of his map I am
using the map_object_property type syntax passed to the cgi as, for
example when using a select for picking colors



<input type="checkbox" name="layer" value="TOWNS" hecked="checked">TOWNS;

<select name="map.layer[TOWNS].class[VILLAGES].style[0]" id="VILLAGES"
size=1 onChange="change_layer_color('TOWNS')"> blah, blah..

where I pass the color to style[0]

While this works fine, I’m coupling my interface to the name of the class
for the layer in question.

Should I want for some reason change the class name from VILLAGES to
NEIGHBORHOODS, (cause class name is coupled to the legend) I would have to
change my template as well as the mapfile. This gets messy and is a bear
to maintain..

Is there a better way of doing this, or decouple legend name from the
class name

regards,

nick





More information about the MapServer-users mailing list