new ol.style.Text(opt_options)
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Options.
|
Methods
-
Clones the style.
Returns:
The cloned style.
-
getExceedLength(){boolean}
src/ol/style/text.js, line 147 -
Get the
exceedLength
configuration.Returns:
Let text exceed the length of the path they follow.
-
Get the fill style for the text.
Returns:
Fill style.
-
getFont(){string|undefined}
src/ol/style/text.js, line 157 -
Get the font name.
Returns:
Font.
-
getMaxAngle(){number}
src/ol/style/text.js, line 167 -
Get the maximum angle between adjacent characters.
Returns:
Angle in radians.
-
getOffsetX(){number}
src/ol/style/text.js, line 187 -
Get the x-offset for the text.
Returns:
Horizontal text offset.
-
getOffsetY(){number}
src/ol/style/text.js, line 197 -
Get the y-offset for the text.
Returns:
Vertical text offset.
-
Get the label placement.
Returns:
Text placement.
-
getRotateWithView(){boolean|undefined}
src/ol/style/text.js, line 217 -
Determine whether the text rotates with the map.
Returns:
Rotate with map.
-
getRotation(){number|undefined}
src/ol/style/text.js, line 227 -
Get the text rotation.
Returns:
Rotation.
-
getScale(){number|undefined}
src/ol/style/text.js, line 237 -
Get the text scale.
Returns:
Scale.
-
Get the stroke style for the text.
Returns:
Stroke style.
-
getText(){string|undefined}
src/ol/style/text.js, line 257 -
Get the text to be rendered.
Returns:
Text.
-
getTextAlign(){string|undefined}
src/ol/style/text.js, line 267 -
Get the text alignment.
Returns:
Text align.
-
getTextBaseline(){string|undefined}
src/ol/style/text.js, line 277 -
Get the text baseline.
Returns:
Text baseline.
-
setExceedLength(exceedLength)
src/ol/style/text.js, line 288 -
Set the
exceedLength
property.Name Type Description exceedLength
boolean Let text exceed the path that it follows.
-
setFill(fill)
src/ol/style/text.js, line 354 -
Set the fill.
Name Type Description fill
ol.style.Fill Fill style.
-
setFont(font)
src/ol/style/text.js, line 299 -
Set the font.
Name Type Description font
string | undefined Font.
-
setMaxAngle(maxAngle)
src/ol/style/text.js, line 310 -
Set the maximum angle between adjacent characters.
Name Type Description maxAngle
number Angle in radians.
-
setOffsetX(offsetX)
src/ol/style/text.js, line 321 -
Set the x offset.
Name Type Description offsetX
number Horizontal text offset.
-
setOffsetY(offsetY)
src/ol/style/text.js, line 332 -
Set the y offset.
Name Type Description offsetY
number Vertical text offset.
-
setPlacement(placement)
src/ol/style/text.js, line 343 -
Set the text placement.
Name Type Description placement
ol.style.TextPlacement | string Placement.
-
setRotation(rotation)
src/ol/style/text.js, line 365 -
Set the rotation.
Name Type Description rotation
number | undefined Rotation.
-
setScale(scale)
src/ol/style/text.js, line 376 -
Set the scale.
Name Type Description scale
number | undefined Scale.
-
setStroke(stroke)
src/ol/style/text.js, line 387 -
Set the stroke.
Name Type Description stroke
ol.style.Stroke Stroke style.
-
setText(text)
src/ol/style/text.js, line 398 -
Set the text.
Name Type Description text
string | undefined Text.
-
setTextAlign(textAlign)
src/ol/style/text.js, line 409 -
Set the text alignment.
Name Type Description textAlign
string | undefined Text align.
-
setTextBaseline(textBaseline)
src/ol/style/text.js, line 420 -
Set the text baseline.
Name Type Description textBaseline
string | undefined Text baseline.