[mapserver-users] Dynamic symbols based on attribute - how?

Steve Lime Steve.Lime at dnr.state.mn.us
Mon Sep 1 18:34:05 EDT 2008


Steve: You can bind the symbol to an attribute but the attribute must contain the entire
text necessary to access the image. That is, the column "icon" must contain the 
"C:\Inetpub\wwwroot\Map\images\". Then you can do:

  SYMBOL [icon]

If you're using PostGIS you can do this on-the-fly. Shapefiles will require some processing.

Steve

>>> "Steve White" <steve at online-archaeology.co.uk> 08/30/08 4:09 PM >>>
I'm using MS4W version 2.2.7 and have an Icon field in my shp file. My map
file CLASS for the layer looks like this:

 

CLASS

                TEMPLATE
"C:\Inetpub\wwwroot\Map\test.html"

                SYMBOL
"C:\Inetpub\wwwroot\Map\images\[Icon]"

                SIZE 16

                COLOR 255 0 255

END

 

This doesn't want to play because I get the following error:

 

Undefined overlay symbol "C:\Inetpub\wwwroot\Map\images\[Icon]"

 

If I add an explicit png file name it works, like this:

 

CLASS

                TEMPLATE
"C:\Inetpub\wwwroot\Map\test.html"

                SYMBOL
"C:\Inetpub\wwwroot\Map\images\test.png"

                SIZE 16

                COLOR 255 0 255

END

 

I thought it was possible to use attribute data in a map file like this.

 

How would I get this to work so that my data holds the filenames and I can
have different icons per item?

 

Cheers,

 

Steve




More information about the mapserver-users mailing list