new ol.style.Text(opt_options)
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Options.
|
|||||||||||||||||||||||||||||||||||||
Methods
-
Clones the style.
Returns:
The cloned style.
-
Get the fill style for the text.
Returns:
Fill style.
-
getFont(){string|undefined}
src/ol/style/text.js, line 125 -
Get the font name.
Returns:
Font.
-
getOffsetX(){number}
src/ol/style/text.js, line 135 -
Get the x-offset for the text.
Returns:
Horizontal text offset.
-
getOffsetY(){number}
src/ol/style/text.js, line 145 -
Get the y-offset for the text.
Returns:
Vertical text offset.
-
getRotateWithView(){boolean|undefined}
src/ol/style/text.js, line 165 -
Determine whether the text rotates with the map.
Returns:
Rotate with map.
-
getRotation(){number|undefined}
src/ol/style/text.js, line 175 -
Get the text rotation.
Returns:
Rotation.
-
getScale(){number|undefined}
src/ol/style/text.js, line 185 -
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 205 -
Get the text to be rendered.
Returns:
Text.
-
getTextAlign(){string|undefined}
src/ol/style/text.js, line 215 -
Get the text alignment.
Returns:
Text align.
-
getTextBaseline(){string|undefined}
src/ol/style/text.js, line 225 -
Get the text baseline.
Returns:
Text baseline.
-
setFill(fill)
src/ol/style/text.js, line 269 -
Set the fill.
Name Type Description fillol.style.Fill Fill style.
-
setFont(font)
src/ol/style/text.js, line 236 -
Set the font.
Name Type Description fontstring | undefined Font.
-
setOffsetX(offsetX)
src/ol/style/text.js, line 247 -
Set the x offset.
Name Type Description offsetXnumber Horizontal text offset.
-
setOffsetY(offsetY)
src/ol/style/text.js, line 258 -
Set the y offset.
Name Type Description offsetYnumber Vertical text offset.
-
setRotation(rotation)
src/ol/style/text.js, line 280 -
Set the rotation.
Name Type Description rotationnumber | undefined Rotation.
-
setScale(scale)
src/ol/style/text.js, line 291 -
Set the scale.
Name Type Description scalenumber | undefined Scale.
-
setStroke(stroke)
src/ol/style/text.js, line 302 -
Set the stroke.
Name Type Description strokeol.style.Stroke Stroke style.
-
setText(text)
src/ol/style/text.js, line 313 -
Set the text.
Name Type Description textstring | undefined Text.
-
setTextAlign(textAlign)
src/ol/style/text.js, line 324 -
Set the text alignment.
Name Type Description textAlignstring | undefined Text align.
-
setTextBaseline(textBaseline)
src/ol/style/text.js, line 335 -
Set the text baseline.
Name Type Description textBaselinestring | undefined Text baseline.
OpenLayers