Author: | Jeff McKenna |
---|---|
Contact: | jmckenna at gatewaygeomatics.com |
Revision: | $Revision: 8295 $ |
Date: | $Date: 2008-12-26 21:08:04 -0800 (Fri, 26 Dec 2008) $ |
Last Updated: | 2008/07/16 |
Table of Contents
The following example creates a dashed line with 10 pixels on, 5 off, 5 on, 10 off ...
SYMBOL
NAME 'dashed1'
TYPE ELLIPSE
POINTS 1 1 END
FILLED true
PATTERN 10 5 5 10 END
END
The next example symbol is a star, used to represent the national capital, hence the name. The font name in defined in the FONTSET file. The code number “114” varies, you can use MS Windows’ character map to figure it out, or guestimate.
SYMBOL
NAME "natcap"
TYPE TRUETYPE
FONT geo
FILLED true
ANTIALIAS true
CHARACTER "r"
END
The next example is fairly straight forward. Note that to have 3 sides you need 4 points, hence the first and last points are identical.
SYMBOL
NAME "triangle"
TYPE vector
POINTS
0 4
2 0
4 4
0 4
END
END
The next example draws a cross, that is 2 lines (vectors) that are not connected end-to-end (Like the triangle in the previous example). The negative values separate the two.
SYMBOL
NAME "cross"
TYPE vector
POINTS
2 0
2 4
-99 -99
0 2
4 2
END
END
The next example creates a simple filled circle. Using non-equal values for the point will give you an actual ellipse.
SYMBOL
NAME "circle"
TYPE ellipse
FILLED true
POINTS
1 1
END
END
SYMBOL
NAME "downwarddiagonalfill"
TYPE vector
TRANSPARENT 0
POINTS
0 1
1 0
END
END
The next example creates a dashed line with 10 pixels on, 5 off,... The line will have butt caps and short miter joins. For layers with a scaled symbol (SYMBOLSCALE, MINSIZE, MAXSIZE, ...) the PATTERN will be resized to maintain symbol ratios.
SYMBOL
NAME "cartoline"
TYPE cartoline
LINECAP butt
LINEJOIN miter
LINEJOINMAXSIZE 1
PATTERN 10 5 END
END
As of MapServer 4.6, you can now use the symbol type HATCH to produce hatched lines. The following will display hatched lines at a 45 degree angle, 10 pixels apart, and 3 pixels wide.
Symbol definition:
SYMBOL
NAME 'hatch-test'
TYPE HATCH
END
Layer definition:
LAYER
...
CLASS
...
STYLE
SYMBOL 'hatch-test'
COLOR 255 0 0
ANGLE 45
SIZE 10
WIDTH 3
END
END
END
Other parameters available for HATCH are: ANGLEITEM, SIZEITEM, MINWIDTH, and MAXWIDTH.