new Text(opt_options)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Options.
|
Methods
-
Clones the style.
Returns:
The cloned style.
-
Get the background fill style for the text.
Returns:
Fill style.
-
Get the background stroke style for the text.
Returns:
Stroke style.
-
Get the fill style for the text.
Returns:
Fill style.
-
getFont(){string|undefined}
style/Text.js, line 222 -
Get the font name.
Returns:
Font.
-
getMaxAngle(){number}
style/Text.js, line 231 -
Get the maximum angle between adjacent characters.
Returns:
Angle in radians.
-
getOffsetX(){number}
style/Text.js, line 249 -
Get the x-offset for the text.
Returns:
Horizontal text offset.
-
getOffsetY(){number}
style/Text.js, line 258 -
Get the y-offset for the text.
Returns:
Vertical text offset.
-
getOverflow(){boolean}
style/Text.js, line 213 -
Get the
overflow
configuration.Returns:
Let text overflow the length of the path they follow.
-
getPadding(){Array.<number>}
style/Text.js, line 365 -
Get the padding for the text.
Returns:
Padding.
-
Get the label placement.
Returns:
Text placement.
-
getRotateWithView(){boolean|undefined}
style/Text.js, line 276 -
Determine whether the text rotates with the map.
Returns:
Rotate with map.
-
getRotation(){number|undefined}
style/Text.js, line 285 -
Get the text rotation.
Returns:
Rotation.
-
Get the text scale.
Returns:
Scale.
-
Get the stroke style for the text.
Returns:
Stroke style.
-
getText(){string|undefined}
style/Text.js, line 320 -
Get the text to be rendered.
Returns:
Text.
-
getTextAlign(){string|undefined}
style/Text.js, line 329 -
Get the text alignment.
Returns:
Text align.
-
getTextBaseline(){string|undefined}
style/Text.js, line 338 -
Get the text baseline.
Returns:
Text baseline.
-
setBackgroundFill(fill)
style/Text.js, line 516 -
Set the background fill.
Name Type Description fill
module:ol/style/Fill~Fill Fill style.
-
setBackgroundStroke(stroke)
style/Text.js, line 526 -
Set the background stroke.
Name Type Description stroke
module:ol/style/Stroke~Stroke Stroke style.
-
setFill(fill)
style/Text.js, line 445 -
Set the fill.
Name Type Description fill
module:ol/style/Fill~Fill Fill style.
-
setFont(font)
style/Text.js, line 385 -
Set the font.
Name Type Description font
string | undefined Font.
-
setMaxAngle(maxAngle)
style/Text.js, line 395 -
Set the maximum angle between adjacent characters.
Name Type Description maxAngle
number Angle in radians.
-
setOffsetX(offsetX)
style/Text.js, line 405 -
Set the x offset.
Name Type Description offsetX
number Horizontal text offset.
-
setOffsetY(offsetY)
style/Text.js, line 415 -
Set the y offset.
Name Type Description offsetY
number Vertical text offset.
-
setOverflow(overflow)
style/Text.js, line 375 -
Set the
overflow
property.Name Type Description overflow
boolean Let text overflow the path that it follows.
-
setPadding(padding)
style/Text.js, line 536 -
Set the padding (
[top, right, bottom, left]
).Name Type Description padding
Array.<number> Padding.
-
setPlacement(placement)
style/Text.js, line 425 -
Set the text placement.
Name Type Description placement
module:ol/style/TextPlacement | string Placement.
-
setRotateWithView(rotateWithView)
style/Text.js, line 435 -
Set whether to rotate the text with the view.
Name Type Description rotateWithView
boolean Rotate with map.
-
setRotation(rotation)
style/Text.js, line 455 -
Set the rotation.
Name Type Description rotation
number | undefined Rotation.
-
setScale(scale)
style/Text.js, line 465 -
Set the scale.
Name Type Description scale
number | module:ol/size~Size | undefined Scale.
-
setStroke(stroke)
style/Text.js, line 476 -
Set the stroke.
Name Type Description stroke
module:ol/style/Stroke~Stroke Stroke style.
-
setText(text)
style/Text.js, line 486 -
Set the text.
Name Type Description text
string | undefined Text.
-
setTextAlign(textAlign)
style/Text.js, line 496 -
Set the text alignment.
Name Type Description textAlign
string | undefined Text align.
-
setTextBaseline(textBaseline)
style/Text.js, line 506 -
Set the text baseline.
Name Type Description textBaseline
string | undefined Text baseline.