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

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Thu Jan 28 01:18:56 EST 2010


I hope to see this fixed in 6.0. There was a attribute named 'title' added to classes years ago but it's never been hooked up...

Steve

________________________________________
From: mapserver-users-bounces at lists.osgeo.org [mapserver-users-bounces at lists.osgeo.org] On Behalf Of Fawcett, David (MPCA) [David.Fawcett at state.mn.us]
Sent: Wednesday, January 27, 2010 9:05 AM
To: nikos at maich.gr; mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] De-coupling legend from class name

Nick,

Just as you did with 'style[0]', 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).

http://mapserver.org/cgi/controls.html?highlight=Example%203#using-mapserver-version-5

This is for MapServer version 5.0 or greater.

David.

-----Original Message-----
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

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


_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list