Table of Contents |
---|
For more information on the use of EXPRESSIONs please refer to the MapServer Documentation.
With a CLASSITEM
If you wish to use more complicated styles for say OS MasterMap layers then you can use the following which will colour according to the value of a field name using EXPRESSION. It is also advisable to have a CLASS entry at the bottom of the list as a “catch all” style for the layer:
...
Code Block | ||
---|---|---|
| ||
CLASSITEM "Legend" CLASS EXPRESSION "0030 Obstructing feature" STYLE COLOR 102 102 102 END END CLASS EXPRESSION "0001 Building outline" STYLE COLOR 0 0 0 WIDTH 2 END END |
With a LABELITEM
GoLoader holds text as lines that require labeling.
Code Block | ||
---|---|---|
| ||
LABELITEM "TEXTSTRING"
#LABELANGLEITEM "OGR:LabelAngle"
MINSCALE 1
MAXSCALE 4000
#REQUIRES "![Aerial]"
#STYLEITEM "auto"
CLASSITEM "FEATURECODE"
CLASS
EXPRESSION ([FEATURECODE] == 10026 OR [FEATURECODE] == 10166 OR [FEATURECODE] == 10178 OR [FEATURECODE] == 10184)
LABEL
FONT "arial"
TYPE TRUETYPE
ANTIALIAS TRUE
COLOR 0 0 0
OUTLINECOLOR 230 230 230
SIZE 7
POSITION cc
ANGLE AUTO
END
END
CLASS
EXPRESSION ([FEATURECODE] == 10033)
LABEL
FONT "arialbd"
TYPE TRUETYPE
#ANTIALIAS TRUE
COLOR 153 153 153
#OUTLINECOLOR 255 255 255
SIZE 15
POSITION cc
ANGLE AUTO
END
END |
TranspOSe / SuperpOSe holds text as an annotation layer therefore no labeling is required.
Code Block | ||
---|---|---|
| ||
LAYER
NAME CartoText
TYPE ANNOTATION
STATUS DEFAULT
CONNECTIONTYPE OGR
CONNECTION "Base/MasterMap/Carto_Text.TAB"
MINSCALE 1
MAXSCALE 6000
STYLEITEM "auto"
CLASS
END
END |