[mapserver-users] Changing map colors dynamically doesn't work

Michael Wessel michael_wessel at gmx.de
Sun Mar 2 06:12:13 PST 2008


Dear MapServer list, 

according to 

http://mapserver.gis.umn.edu/docs/reference/cgi/controls
"Changing map file parameters via a form or a URL"

it should be possible to change the fill color 
of my map polygons to blue via the GET parameter  

map_lakes_class_color=0+0+255, e.g. in 

http://localhost/cgi-bin/mapserv?map=/srv/www/htdocs/mapserver/test4.map&map_lakes_class_color=0+0+255

However, there is no change; the polygons stay red, 
as defined in the reference map file: 

 MAP
  NAME 'map'
  STATUS ON
  IMAGETYPE      PNG
  EXTENT         -3037632.000000 -708658.398506 1846021.625000 4934649.999999
  SIZE           1024 768
  SHAPEPATH      "/srv/www/mapserver/"

 WEB
   TEMPLATE "/home/mi.wessel/test/global.html"
   IMAGEPATH "/srv/www/htdocs/temp/"
   IMAGEURL "../temp/" 
 END
 
  LAYER
    NAME         'lakes'
    STATUS       DEFAULT
    TYPE         POLYGON
    DATA         lakes

    CLASS
      COLOR 100 0 0 
    END 
  END 

END 

I have also tried 

map_layer_0_class_color=200+0+0

but then I get 

getSymbol(): Symbol definition error. Parsing error near (0):(line 1)he error 

What's wrong here? Adding a name to the class doesn't work either. 

I am using MapServer 5.0.2 (2008-01-28) on SuSE Linux 10.2. 

Best regards and thanks in advance, 

Michael 




More information about the MapServer-users mailing list