Classes
Type Definitions
-
Properties:
Name Type Argument Default Description fontstring <optional>
Font style as CSS 'font' value, see: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font. Default is '10px sans-serif'
maxAnglenumber <optional>
When
placementis set to'line', allow a maximum angle between adjacent characters. The expected value is in radians, and the default is 45° (Math.PI / 4).offsetXnumber <optional>
0 Horizontal text offset in pixels. A positive will shift the text right.
offsetYnumber <optional>
0 Vertical text offset in pixels. A positive will shift the text down.
overflowboolean <optional>
false For polygon labels or when
placementis set to'line', allow text to exceed the width of the polygon at the label position or the length of the path that it follows.placementmodule:ol/style/TextPlacement | string <optional>
Text placement.
scalenumber <optional>
Scale.
rotateWithViewboolean <optional>
false Whether to rotate the text with the view.
rotationnumber <optional>
0 Rotation in radians (positive rotation clockwise).
textstring <optional>
Text content.
textAlignstring <optional>
Text alignment. Possible values: 'left', 'right', 'center', 'end' or 'start'. Default is 'center' for
placement: 'point'. Forplacement: 'line', the default is to let the renderer choose a placement wheremaxAngleis not exceeded.textBaselinestring <optional>
'middle' Text base line. Possible values: 'bottom', 'top', 'middle', 'alphabetic', 'hanging', 'ideographic'.
fillmodule:ol/style/Fill~Fill <optional>
Fill style. If none is provided, we'll use a dark fill-style (#333).
strokemodule:ol/style/Stroke~Stroke <optional>
Stroke style.
backgroundFillmodule:ol/style/Fill~Fill <optional>
Fill style for the text background when
placementis'point'. Default is no fill.backgroundStrokemodule:ol/style/Stroke~Stroke <optional>
Stroke style for the text background when
placementis'point'. Default is no stroke.paddingArray.<number> <optional>
[0, 0, 0, 0] Padding in pixels around the text for decluttering and background. The order of values in the array is
[top, right, bottom, left].