[mapserver-users] De-coupling legend from class name
nikos at maich.gr
nikos at maich.gr
Wed Jan 27 23:52:33 PST 2010
Thanx Steve and David,
A title attribute would be really useful. Consider it a feature request,
or tell me and I'll submit it;-)
I'll use David's solution to resolve this for now, but as he points out we
now have to keep track of class hierarchy, which does not seem too bad.
OTOH, does class order within a layer have any significance, as for
instance layer order/rendering order has in the mapfile?
thanx again,
nick
> 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