[mapserver-users] Using a variable as a CLASSITEM

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Fri Jul 24 12:36:22 PDT 2015


You can't use that syntax exactly. But what you want to do is possible. You'll have to set 2 parameters in the URL. You can use the dmmethod variable for the expression like you have below. For the classitem you'll have to use syntax like:

   map.layer[layername]=CLASSITEM+'somevalue'

You'll need to setup validation on both dmmethod and the classitem, should be the same regex in both cases.

Steve

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Theobald, Charles
Sent: Friday, July 24, 2015 1:53 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Using a variable as a CLASSITEM

Is it still possible to use a variable for the value of CLASSITEM?  We're passing the field name to be used in the CLASSes  in the URL as a variable (%dmmethod%):

    CLASSITEM  '%dmmethod%'
    FILTER ('[type]'='County')
    STATUS on
    CLASS
      NAME 'No Drought'
      EXPRESSION ('[%dmmethod%]'='-1')
      STYLE 
        COLOR           255 255 255       
        OUTLINECOLOR    20 20 20
      END
    END  
This used to work in previous versions.  There are 6 different fields that could be searched, for 6 possible values.  I'd really like to avoid creating 36 classes for each layer that uses this attribute table.  I am including dmmethod in a validation block in each layer trying to use this variable.  Mapserver version is 6.0.3

Any suggestions would be greatly appreciated.

Thank you.


Charles Theobald
NC Division of Water Resources
charles.theobald at ncdenr.gov
919-707-9136
*E-mail correspondence to and from this address may be subject to the North Carolina Public Records Law and may be disclosed to third parties.


_______________________________________________
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