new ol.style.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}
src/ol/style/text.js, line 178 -
Get the font name.
Returns:
Font.
-
getMaxAngle(){number}
src/ol/style/text.js, line 188 -
Get the maximum angle between adjacent characters.
Returns:
Angle in radians.
-
getOffsetX(){number}
src/ol/style/text.js, line 208 -
Get the x-offset for the text.
Returns:
Horizontal text offset.
-
getOffsetY(){number}
src/ol/style/text.js, line 218 -
Get the y-offset for the text.
Returns:
Vertical text offset.
-
getOverflow(){boolean}
src/ol/style/text.js, line 168 -
Get the
overflow
configuration.Returns:
Let text overflow the length of the path they follow.
-
getPadding(){Array.<number>}
src/ol/style/text.js, line 328 -
Get the padding for the text.
Returns:
Padding.
-
Get the label placement.
Returns:
Text placement.
-
getRotateWithView(){boolean|undefined}
src/ol/style/text.js, line 238 -
Determine whether the text rotates with the map.
Returns:
Rotate with map.
-
getRotation(){number|undefined}
src/ol/style/text.js, line 248 -
Get the text rotation.
Returns:
Rotation.
-
getScale(){number|undefined}
src/ol/style/text.js, line 258 -
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 278 -
Get the text to be rendered.
Returns:
Text.
-
getTextAlign(){string|undefined}
src/ol/style/text.js, line 288 -
Get the text alignment.
Returns:
Text align.
-
getTextBaseline(){string|undefined}
src/ol/style/text.js, line 298 -
Get the text baseline.
Returns:
Text baseline.
-
setBackgroundFill(fill)
src/ol/style/text.js, line 482 -
Set the background fill.
Name Type Description fill
ol.style.Fill Fill style.
-
setBackgroundStroke(stroke)
src/ol/style/text.js, line 493 -
Set the background stroke.
Name Type Description stroke
ol.style.Stroke Stroke style.
-
setFill(fill)
src/ol/style/text.js, line 405 -
Set the fill.
Name Type Description fill
ol.style.Fill Fill style.
-
setFont(font)
src/ol/style/text.js, line 350 -
Set the font.
Name Type Description font
string | undefined Font.
-
setMaxAngle(maxAngle)
src/ol/style/text.js, line 361 -
Set the maximum angle between adjacent characters.
Name Type Description maxAngle
number Angle in radians.
-
setOffsetX(offsetX)
src/ol/style/text.js, line 372 -
Set the x offset.
Name Type Description offsetX
number Horizontal text offset.
-
setOffsetY(offsetY)
src/ol/style/text.js, line 383 -
Set the y offset.
Name Type Description offsetY
number Vertical text offset.
-
setOverflow(overflow)
src/ol/style/text.js, line 339 -
Set the
overflow
property.Name Type Description overflow
boolean Let text overflow the path that it follows.
-
setPadding(padding)
src/ol/style/text.js, line 504 -
Set the padding (
[top, right, bottom, left]
).Name Type Description padding
Array.<number> Padding.
-
setPlacement(placement)
src/ol/style/text.js, line 394 -
Set the text placement.
Name Type Description placement
ol.style.TextPlacement | string Placement.
-
setRotation(rotation)
src/ol/style/text.js, line 416 -
Set the rotation.
Name Type Description rotation
number | undefined Rotation.
-
setScale(scale)
src/ol/style/text.js, line 427 -
Set the scale.
Name Type Description scale
number | undefined Scale.
-
setStroke(stroke)
src/ol/style/text.js, line 438 -
Set the stroke.
Name Type Description stroke
ol.style.Stroke Stroke style.
-
setText(text)
src/ol/style/text.js, line 449 -
Set the text.
Name Type Description text
string | undefined Text.
-
setTextAlign(textAlign)
src/ol/style/text.js, line 460 -
Set the text alignment.
Name Type Description textAlign
string | undefined Text align.
-
setTextBaseline(textBaseline)
src/ol/style/text.js, line 471 -
Set the text baseline.
Name Type Description textBaseline
string | undefined Text baseline.