[Mapserver-users] variable substitution for color

Daniel Morissette dmorissette at dmsolutions.ca
Sat Apr 10 10:32:17 PDT 2004


John Hagstrand wrote:
> Hello,
> 
> I'm trying to vary layer colors using variable substitution.  I've tried two
> ways.
> 
> COLOR %coparks%
> where coparks=128 255 128
> 
> and
> 
> COLOR %coparksr% %coparksg% %coparksb%
> where coparksr=128 and coparksg=255 and coparksb=128
> 

%variable% substitutions work only with some string parameters such as 
DATA, CONNECTION and EXPRESSIONs.  You can't use them with colors.

> 
> What's the best way to do vary colors?
> 

You could try using map_layer_x_class_x_style_x_color=... in the URL. I 
didn't try changing colors specifically, but that should work, see 
http://mapserver.gis.umn.edu/doc40/cgi-reference.html#mapfileURL

Daniel
-- 
------------------------------------------------------------
  Daniel Morissette               dmorissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------




More information about the MapServer-users mailing list