[mapserver-users] Dynamic Layer name in Legend

Lime, Steve D (DNR) steve.lime at state.mn.us
Thu Apr 21 17:12:50 EDT 2011


You can't muck about with NAMEs. In 6.0 we did finally hook the TITLE attribute up for legend production (takes precedence over NAME) as always intended. A class title can be changed within the limits established by its validation settings. For example:

  LAYER
    NAME 'foo'
    ...
    VALIDATION
      'title' '^[A-z]{5,20}$' # title's can be between 5 and 20 characters long consisting only of alpha characters
    END
    ...
    CLASS
      NAME 'bar'
      TITLE 'my default title'
      ...
    END
  END
 
Then via URL you could do:

  ...&map.layer[foo].class[bar]=TITLE+'New+Title'&...

At least that's the plan. You might give it a shot against the latest beta.

Steve

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Eric Weisbender
Sent: Thursday, April 21, 2011 3:29 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Dynamic Layer name in Legend

How would you dynamically generate a layer name in the map legend with use input or url substitutions.  Right know I imagine it looking something like this...
 
CLASS
    NAME "Entered Point'%[xytext]'"
    SYMBOL "xsymbol"
    COLOR 0 0 0
    SIZE 12
 
but is obviously it does not work... this is just a excerpt from the layer def.  Any help is greatly appreciated.
 
Thanks,
EW



More information about the mapserver-users mailing list