[mapserver-users] De-coupling legend from class name
Fawcett, David (MPCA)
David.Fawcett at state.mn.us
Wed Jan 27 10:05:44 EST 2010
Just as you did with 'style', you can reference a layer or class by it's numeric index. This gives you the flexibility to change the class name, but now you need to know which class it is based on order (index).
This is for MapServer version 5.0 or greater.
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of nikos at maich.gr
Sent: Wednesday, January 27, 2010 7:03 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] De-coupling legend from class name
It's been a while since I've been using MS and I have the following q or
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" id="VILLAGES"
size=1 onChange="change_layer_color('TOWNS')"> blah, blah..
where I pass the color to style
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
Is there a better way of doing this, or decouple legend name from the
mapserver-users mailing list
mapserver-users at lists.osgeo.org
More information about the mapserver-users