[mapserver-users] Using a variable as a CLASSITEM

Fawcett, David (MNIT) David.Fawcett at state.mn.us
Fri Jul 24 12:29:11 PDT 2015


Charles, 

I can't remember in which version the validation requirement was added, but take a look at this page:
http://mapserver.org/cgi/runsub.html

You may need to add a validation property to your layer.

David.

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