[mapserver-users] Mapserver 5 and Openlayers 2.5 passing of parameters.

Steve Lime Steve.Lime at dnr.state.mn.us
Wed Apr 9 10:45:19 PDT 2008


Hi Aileen: The direct setting of class expressions using via the syntax you're trying is no
longer supported. It's not possible to apply any validation rules in this case. There is a work
around using runtime substitution though. For example, if your mapfile looks like this:

  LAYER
    NAME 'foo'
    ...
    CLASS
       EXPRESSION '%foo_value%'
       ...
    END
  END

Then you can set the expression like so:

  ...&foo_value=makati&...

You can also validate the input using a regex, just add a metadata block like this to the layer above:

  METADATA
    # allow foo_value to be a string 1 to 10 chars in length, no special characters
    foo_value_validation_pattern '^[a-z]{1,10}$' 
  END

This applies to FILTERs as well.

The syntax to change a class color is documented in the examples you've already seen. 

Steve

>>> On 4/8/2008 at 8:25 PM, in message <10A58E451AF7442E8B186020DDBA59ED at Aileen>,
"Aileen" <aileen.baylon at cybersoft.ph> wrote:

> ----- Original Message ----- 
> From: "Aileen" <aileen at mapcentral.ph>
> To: <mapserver-users at lists.osgeo.org>
> Sent: Wednesday, April 09, 2008 8:28 AM
> Subject: Mapserver 5 and Openlayers 2.5 passing of parameters.
> 
> 
>>> Hi all,
>>>
>> We are currently using the latest release of Mapserver, the 5.0.2 version 
>> and Openlayers 2.5
>>>
>>> We are having problems with rendering lines and polygons because although
>>> it worked for us in Mapserver 4.10, we are told that there's a new syntax
>>> for passing values to mapserver.
>>>
>>> Currently, here's part of the url that we are using to pass to mapserver:
>>>
>>> map_layer_class_expression=makati&map_layer_class_color=255 0 0.
>>>
>>>
>>> We already have looked at your samples but with no avail.
>>>
>>> Can you help us with the new syntax?
>> 
> 
> _______________________________________________
> 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