setting variable value in mapfile {Scanned}

Jerl Simpson jerl.simpso at GMAIL.COM
Mon Jan 30 15:36:06 EST 2006


That works great!!

I did have to change the comments in my mapfile to be sure I had ## rather
than just #.  Otherwise errors and missed lines happened.

Thanks for the info.

Jerl

On 1/30/06, Siki Zoltan <siki at agt.bme.hu> wrote:
>
> Hi,
>
> AFAIK you cannot create variable in the map file, but you can use the
> cpp (the c preprocessor) to create macro substitution.
> For example
> #define HIGHWAY_COLOR 123 43 112
> #define HIGHWAY_MAX_SCALE 1600
>
> ...
>         MAXSCALE HIGHWAY_MAX_SCALE
> ...
>         COLOR HIGHWAY_COLOR
> ...
>
> then
> cpp map_file_with_defines > generated_map_file
>
> Bye
> Zoltan
>
> On Mon, 30 Jan 2006, Jerl Simpson wrote:
>
> > Hello,
> >
> > I know I can easily use variables in a mapfile, when the value comes
> from
> > cookies or a GET request.  But what about setting a variable inside the
> > mapfile itself?
> > Something like:
> >
> > HIGHWAY_MAX_SCALE=2000000
> > HIGHWAY_MIN_SCALE=90000
> >
> > or
> >
> > HIGHWAY_COLOR="255 250 115"
> >
> > then be able to use something like:
> >
> > COLOR  %HIGHWAY_COLOR%
> >
> > in a CLASS
> >
> >
> > That way if I decide I want to change a color, I can change it once, and
> > have it take affect for everywhere else?
> >
> > Thanks,
> >
> >
> > Jerl
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060130/efe3d054/attachment.html


More information about the mapserver-users mailing list