Class: Text

ol.style.Text

Set text style for vector features.

new ol.style.Text(opt_options) experimental

Name Type Description
options

Options.

Name Type Description
font string | undefined experimental

Font.

offsetX number | undefined experimental

Horizontal text offset in pixels. A positive will shift the text right. Default is 0.

offsetY number | undefined experimental

Vertical text offset in pixels. A positive will shift the text down. Default is 0.

scale number | undefined experimental

Scale.

rotation number | undefined experimental

Rotation.

text string | undefined experimental

Text.

textAlign string | undefined experimental

Text alignment.

textBaseline string | undefined experimental

Text base line.

fill ol.style.Fill | undefined experimental

Fill style.

stroke ol.style.Stroke | undefined experimental

Stroke style.

Methods

Returns:
Fill style.

getFont(){string|undefined} experimental

Returns:
Font.

getRotation(){number|undefined} experimental

Returns:
Rotation.

getScale(){number|undefined} experimental

Returns:
Scale.
Returns:
Stroke style.

getText(){string|undefined} experimental

Returns:
Text.

getTextAlign(){string|undefined} experimental

Returns:
Text align.

getTextBaseline(){string|undefined} experimental

Returns:
Text baseline.