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 206 -
Get the font name.
Returns:
Font.
-
getMaxAngle(){number}
style/Text.js, line 215 -
Get the maximum angle between adjacent characters.
Returns:
Angle in radians.
-
getOffsetX(){number}
style/Text.js, line 233 -
Get the x-offset for the text.
Returns:
Horizontal text offset.
-
getOffsetY(){number}
style/Text.js, line 242 -
Get the y-offset for the text.
Returns:
Vertical text offset.
-
getOverflow(){boolean}
style/Text.js, line 197 -
Get the
overflowconfiguration.Returns:
Let text overflow the length of the path they follow.
-
getPadding(){Array.<number>}
style/Text.js, line 341 -
Get the padding for the text.
Returns:
Padding.
-
Get the label placement.
Returns:
Text placement.
-
getRotateWithView(){boolean|undefined}
style/Text.js, line 260 -
Determine whether the text rotates with the map.
Returns:
Rotate with map.
-
getRotation(){number|undefined}
style/Text.js, line 269 -
Get the text rotation.
Returns:
Rotation.
-
getScale(){number|undefined}
style/Text.js, line 278 -
Get the text scale.
Returns:
Scale.
-
Get the stroke style for the text.
Returns:
Stroke style.
-
getText(){string|undefined}
style/Text.js, line 296 -
Get the text to be rendered.
Returns:
Text.
-
getTextAlign(){string|undefined}
style/Text.js, line 305 -
Get the text alignment.
Returns:
Text align.
-
getTextBaseline(){string|undefined}
style/Text.js, line 314 -
Get the text baseline.
Returns:
Text baseline.
-
setBackgroundFill(fill)
style/Text.js, line 491 -
Set the background fill.
Name Type Description fillmodule:ol/style/Fill~Fill Fill style.
-
setBackgroundStroke(stroke)
style/Text.js, line 501 -
Set the background stroke.
Name Type Description strokemodule:ol/style/Stroke~Stroke Stroke style.
-
setFill(fill)
style/Text.js, line 421 -
Set the fill.
Name Type Description fillmodule:ol/style/Fill~Fill Fill style.
-
setFont(font)
style/Text.js, line 361 -
Set the font.
Name Type Description fontstring | undefined Font.
-
setMaxAngle(maxAngle)
style/Text.js, line 371 -
Set the maximum angle between adjacent characters.
Name Type Description maxAnglenumber Angle in radians.
-
setOffsetX(offsetX)
style/Text.js, line 381 -
Set the x offset.
Name Type Description offsetXnumber Horizontal text offset.
-
setOffsetY(offsetY)
style/Text.js, line 391 -
Set the y offset.
Name Type Description offsetYnumber Vertical text offset.
-
setOverflow(overflow)
style/Text.js, line 351 -
Set the
overflowproperty.Name Type Description overflowboolean Let text overflow the path that it follows.
-
setPadding(padding)
style/Text.js, line 511 -
Set the padding (
[top, right, bottom, left]).Name Type Description paddingArray.<number> Padding.
-
setPlacement(placement)
style/Text.js, line 401 -
Set the text placement.
Name Type Description placementmodule:ol/style/TextPlacement | string Placement.
-
setRotateWithView(rotateWithView)
style/Text.js, line 411 -
Set whether to rotate the text with the view.
Name Type Description rotateWithViewboolean Rotate with map.
-
setRotation(rotation)
style/Text.js, line 431 -
Set the rotation.
Name Type Description rotationnumber | undefined Rotation.
-
setScale(scale)
style/Text.js, line 441 -
Set the scale.
Name Type Description scalenumber | undefined Scale.
-
setStroke(stroke)
style/Text.js, line 451 -
Set the stroke.
Name Type Description strokemodule:ol/style/Stroke~Stroke Stroke style.
-
setText(text)
style/Text.js, line 461 -
Set the text.
Name Type Description textstring | undefined Text.
-
setTextAlign(textAlign)
style/Text.js, line 471 -
Set the text alignment.
Name Type Description textAlignstring | undefined Text align.
-
setTextBaseline(textBaseline)
style/Text.js, line 481 -
Set the text baseline.
Name Type Description textBaselinestring | undefined Text baseline.
OpenLayers