Home | Docs | Issue Tracker | FAQ | Download | |
Specifies text alignment for multiline labels (see WRAP) Note that the alignment algorithm is far from precise, so don’t expect fabulous results (especially for right alignment) if you’re not using a fixed width font.
New in version 5.4.
Angle, given in degrees, to draw the label.
AUTO allows MapServer to compute the angle. Valid for LINE layers only.
AUTO2 same as AUTO, except no logic is applied to try to keep the text from being rendered in reading orientation (i.e. the text may be rendered upside down). Useful when adding text arrows indicating the line direction.
FOLLOW was introduced in version 4.10 and tells MapServer to compute a curved label for appropriate linear features (see MS RFC 11: Support for Curved Labels for specifics). See also MAXOVERLAPANGLE.
[Attribute] was introduced in version 5.0, to specify the item name in the attribute table to use for angle values. The hard brackets [] are required. For example, if your shapefile’s DBF has a field named “MYANGLE” that holds angle values for each record, your LABEL object might contain:
LABEL
COLOR 150 150 150
OUTLINECOLOR 255 255 255
FONT "sans"
TYPE truetype
SIZE 6
ANGLE [MYANGLE]
POSITION AUTO
PARTIALS FALSE
END
The associated RFC document for this feature is MS RFC 19: Style & Label attribute binding.
Color to draw a background rectangle (i.e. billboard). Off by default.
Note
Removed in 6.0. Use a LABEL STYLE object with GEOMTRANSFORM labelpoly and COLOR.
Color to draw a background rectangle (i.e. billboard) shadow. Off by default.
Note
Removed in 6.0. Use a LABEL STYLE object with GEOMTRANSFORM labelpoly, COLOR and OFFSET.
How far should the background rectangle be offset? Default is 1.
Note
Removed in 6.0. Use a LABEL STYLE object with GEOMTRANSFORM labelpoly, COLOR and OFFSET.
Color to draw text with.
[Attribute] was introduced in version 5.0, to specify the item name in the attribute table to use for color values. The hard brackets [] are required. For example, if your shapefile’s DBF has a field named “MYCOLOR” that holds color values for each record, your LABEL object might contain:
LABEL
COLOR [MYCOLOR]
OUTLINECOLOR 255 255 255
FONT "sans"
TYPE truetype
SIZE 6
POSITION AUTO
PARTIALS FALSE
END
The associated RFC document for this feature is MS RFC 19: Style & Label attribute binding.
Supported encoding format to be used for labels. If the format is not supported, the label will not be drawn. Requires the iconv library (present on most systems). The library is always detected if present on the system, but if not, the label will not be drawn.
Required for displaying international characters in MapServer. More information can be found in the Label Encoding document.
Expression that determines when the LABEL is to be applied. See EXPRESSION in CLASS.
New in version 6.2.
This keyword interacts with the WRAP keyword so that line breaks only occur after the defined number of characters.
maxlength = 0 | maxlength > 0 | maxlength < 0 | |
wrap = ‘char’ | always wrap at the WRAP character | newline at the first WRAP character after MAXLENGTH characters | hard wrap (always break at exactly MAXLENGTH characters) |
no wrap | no processing | skip label if it contains more than MAXLENGTH characters | hard wrap (always break at exactly MAXLENGTH characters) |
The associated RFC document for this feature is MS RFC 40: Support Label Text Transformations.
New in version 5.4.
Angle threshold to use in filtering out ANGLE FOLLOW labels in which characters overlap (floating point value in degrees). This filtering will be enabled by default starting with MapServer 6.0. The default MAXOVERLAPANGLE value will be 22.5 degrees, which also matches the default in GeoServer. Users will be free to tune the value up or down depending on the type of data they are dealing with and their tolerance to bad overlap in labels. As per RFC 60, if MAXOVERLAPANGLE is set to 0, then we fall back on pre-6.0 behavior which was to use maxoverlapangle = 0.4*MS_PI (40% of 180 degrees = 72degree).
The associated RFC document for this feature is MS RFC 60: Labeling enhancement: ability to skip ANGLE FOLLOW labels with too much character overlap.
Minimum scale at which this LABEL is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.
New in version 5.4.
See also
Maximum scale at which this LABEL is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.
New in version 5.4.
See also
Offset values for labels, relative to the lower left hand corner of the label and the label point. Given in pixels. In the case of rotated text specify the values as if all labels are horizontal and any rotation will be compensated for.
When used with FOLLOW angle, two additional options are available to render the label parallel to the original feature:
See LAYER SYMBOLSCALEDENOM.
Color to draw a one pixel outline around the characters in the text.
[attribute] was introduced in version 5.0, to specify the item name in the attribute table to use for color values. The hard brackets [] are required. For example, if your shapefile’s DBF has a field named “MYOUTCOLOR” that holds color values for each record, your LABEL object might contain:
LABEL
COLOR 150 150 150
OUTLINECOLOR [MYOUTCOLOR]
FONT "sans"
TYPE truetype
SIZE 6
POSITION AUTO
PARTIALS FALSE
END
The associated RFC document for this feature is MS RFC 19: Style & Label attribute binding.
The priority parameter takes an integer value between 1 (lowest) and 10 (highest). The default value is 1. It is also possible to bind the priority to an attribute (item_name) using square brackets around the [item_name]. e.g. “PRIORITY [someattribute]”
Labels are stored in the label cache and rendered in order of priority, with the highest priority levels rendered first. Specifying an out of range PRIORITY value inside a map file will result in a parsing error. An out of range value set via MapScript or coming from a shape attribute will be clamped to the min/max values at rendering time. There is no expected impact on performance for using label priorities.
[Attribute] was introduced in version 5.6.
New in version 5.0.
The label will be repeated on every line of a multiline shape and will be repeated multiple times along a given line at an interval of REPEATDISTANCE pixels.
The associated RFC document for this feature is MS RFC 57: Labeling enhancements: ability to repeat labels along a line/multiline.
New in version 5.6.
Shadow offset in pixels, see SHADOWCOLOR.
[Attribute] was introduced in version 6.0, and can be used like:
SHADOWSIZE 2 2
SHADOWSIZE [shadowsizeX] 2
SHADOWSIZE 2 [shadowsizeY]
SHADOWSIZE [shadowsize] [shadowsize]
Text size. Use a number to give the size in pixels of your TrueType font based label, or any of the other 5 listed keywords for bitmap fonts.
When scaling is in effect (SYMBOLSCALEDENOM is specified for the LAYER), SIZE gives the size of the font to be used at the map scale 1:SYMBOLSCALEDENOM.
Starting from version 5.4, the value can also be a fractional value (and not only integer).
[Attribute] was introduced in version 5.0, to specify the item name in the attribute table to use for size values. The hard brackets [] are required. For example, if your shapefile’s DBF has a field named “MYSIZE” that holds size values for each record, your LABEL object might contain:
LABEL
COLOR 150 150 150
OUTLINECOLOR 255 255 255
FONT "sans"
TYPE truetype
SIZE [MYSIZE]
POSITION AUTO
PARTIALS FALSE
END
The associated RFC document for this feature is MS RFC 19: Style & Label attribute binding.
The start of a STYLE object.
Label specific mechanisms of the STYLE object are the GEOMTRANSFORM options:
Creates a geometry that can be used for styling the label.
The resulting geometries can be styled using the mechanisms available in the STYLE object.
Example - draw a red background rectangle for the labels (i.e. billboard) with a “shadow” in gray:
STYLE GEOMTRANSFORM 'labelpoly' COLOR 153 153 153 OFFSET 3 2 END # STYLE STYLE GEOMTRANSFORM 'labelpoly' COLOR 255 0 0 END # STYLE
New in version 6.0.
Text to label features with (useful when multiple labels are used). Overrides values obtained from the LAYER LABELITEM and the CLASS TEXT. See TEXT in CLASS.
New in version 6.2.
Type of font to use. Generally bitmap fonts are faster to draw then TrueType fonts. However, TrueType fonts are scalable and available in a variety of faces. Be sure to set the FONT parameter if you select TrueType.
Note
Bitmap fonts are only supported with the AGG and GD renderers.