class Label extends Symbolizer
A Symbolizer for labeling a geometry.
You can create a Label with a Field or a Field name:
def label = new Label("STATE_ABBR")
Or with named parameters:
def label = new Label(property: "name", font: new Font(weight: "bold")))
| Fields inherited from class | Fields |
|---|---|
class Symbolizer |
filterFactory, styleBuilder, styleFactory, styleOptions |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected void |
apply(Symbolizer sym)Apply this Symbolizer to the GeoTools Symbolizer |
|
Label |
autoWrap(int length)Set the auto wrap length. |
|
Label |
characterSpacing(int spacing)Set the spacing between characters |
|
Label |
conflictResolution(boolean bool)Disable label conflict resolution or not. |
|
Label |
fill(Fill fill)Set how the Label will be filled. |
|
Label |
font(java.lang.Object font)Set the Font |
|
Label |
forceLeftToRight(boolean bool)Disable label flipping making labels always follow natural orientation of the line or not. |
|
Label |
goodnessOfFit(float goodness)Set the goodness of fit parameter (a number between 0 and 1) |
|
Label |
graphicResize(java.lang.String mode, int margin)Set the graphic resize mode (none, proportional, stretch) and margin. |
|
Label |
halo(Fill fill, java.lang.Object radius)Add a Halo to this Label |
|
Label |
labelAllGroup(boolean bool)Make all line segments are labeled instead of just the longest |
|
Label |
labelObstacle(boolean bol)Set whether to use the Label as an obstacle or not |
|
Label |
linear(java.lang.Object offset, java.lang.Object gap, java.lang.Object igap, boolean align, boolean follow, boolean group, java.lang.Object displacement, java.lang.Object repeat)Set the Line Placement for this Label |
|
Label |
linear(Map parameters)Set the Line Placement for this Label |
|
Label |
maxAngleDelta(float maxAngleDelta)Set the max angle delta |
|
Label |
maxDisplacement(double maxDisplacement)Set the max displacement |
|
Label |
point(java.util.List anchor, java.util.List displace, java.lang.Object rotate)Set the Point Placement for this Label |
|
Label |
point(Map parameters)Set the Point Placement for this Label |
|
Label |
polygonAlign(java.lang.String value)Set the polygon align option (manual, ortho, mbr) |
|
protected void |
prepare(Rule rule)Prepare the GeoTools Rule by applying this Symbolizer |
|
Label |
priority(java.lang.Object priority)Set the priority |
|
void |
setProperty(java.lang.Object property)Set the Label's Property which can be a String, a Field, or a Function |
|
Label |
shape(Shape shape)Set the Shape surrounding the Label |
|
Label |
spaceAround(float distance)Set the space around a Label. |
|
Label |
strikethrough(boolean shouldStrikeThrough)Set whether the Label should strike through the text or not |
|
java.lang.String |
toString()The string representation |
|
Label |
underline(boolean shouldUnderline)Set whether the Label should underline the text or not |
|
Label |
wordSpacing(int spacing)Set the spacing between words |
| Methods inherited from class | Name |
|---|---|
class Symbolizer |
and, apply, asSLD, asSLD, buildString, composite, createGeoToolsSymbolizer, getDefault, getDefault, getGeoToolsSymbolizers, getGtStyle, getSld, plus, prepare, prepare, range, range, sortBy, sortBy, where, zindex |
The Fill
The Font
The Halo
The Point or Line Placement
The priority
The property can be a Field, String, or Function
The Shape
Create a new Label with a property which is a field or attribute with which to generate labels form.
def label = new Label("STATE_ABBR")
property - The field or attributeCreate a new Label with named parameters.
def label = new Label(property: "name", font: new Font(weight: "bold")))
map - A Map of named parameters.Apply this Symbolizer to the GeoTools Symbolizer
sym - The GeoTools SymbolizerSet the auto wrap length. Labels longer than this value will be wrapped.
length - The auto wrap lengthSet the spacing between characters
spacing - The spacingDisable label conflict resolution or not.
bool - Whether disable conflict resolution or notSet how the Label will be filled.
fill - The FillSet the Font
font - A GeoScript Font or an object convertable to a FontDisable label flipping making labels always follow natural orientation of the line or not.
bool - Whether to disable label flippingSet the goodness of fit parameter (a number between 0 and 1)
goodness - The goodness of fit parameter (a number between 0 and 1)Set the graphic resize mode (none, proportional, stretch) and margin.
mode - The graphic resize modemode - The graphic resize modeAdd a Halo to this Label
fill - The Fillradius - The radiusMake all line segments are labeled instead of just the longest
bool - Whether to label all or just the longestSet whether to use the Label as an obstacle or not
bol - Whether to use the Label as an obstacleSet the Line Placement for this Label
offset - The perpendicular offsetgap - The gapigap - The initial gapalign - Whether to align or notfollow - Whether to follow lines or not (true or false)group - Whether to group or notdisplacement - The maximum displacement distancerepeat - The repeat distanceSet the Line Placement for this Label
parameters - A Map of named parameters (offset, gap, igap, align, follow,
group, displacement, repeat)Set the max angle delta
maxAngleDelta - The max angle deltaSet the max displacement
maxDisplacement - The max displacementSet the Point Placement for this Label
anchor - The anchordisplace - The displacementrotate - The rotationSet the Point Placement for this Label
parameters - A Map of named parameters (anchor, displace, and rotate)Set the polygon align option (manual, ortho, mbr)
value - The polygon align option (manual, ortho, mbr)Prepare the GeoTools Rule by applying this Symbolizer
rule - The GeoTools RuleSet the priority
priority - The prioritySet the Label's Property which can be a String, a Field, or a Function
property - The Label's PropertySet the Shape surrounding the Label
shape - The ShapeSet the space around a Label. A negative number will allow labels to overlap. A positive number will create more space between labels
distance - A negative or positive distance between labelsSet whether the Label should strike through the text or not
shouldStrikeThrough - Whether the label text should be underlinedThe string representation
Set whether the Label should underline the text or not
shouldUnderline - Whether the label text should be underlinedSet the spacing between words
spacing - The spacingGroovy Documentation