Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface VerticalLineStyle

Interface for configuring the visual appearance of VerticalLines.

Hierarchy

  • VerticalLineStyle

Index

Properties

Optional altitude

altitude: number | boolean | "terrain" | StyleValueFunction<number | boolean | "terrain"> | StyleZoomRange<number | boolean | "terrain"> | StyleExpression<number | boolean | "terrain">

Altitude of the VerticalLine, in meters.

Defines the reference height used together with VerticalLineStyle.altitudeReference to determine the vertical placement of the line.

Supported values:

  • number – Fixed altitude in meters, relative to the global ground plane.
  • true – Use the altitude (z) from the feature geometry if present; otherwise 0 m.
  • false – Ignore any z-value from the feature geometry and use 0 m.
  • 'terrain' – Clamp to the sampled terrain height.

Notes:

  • When altitudeReference = 'top', the altitude defines the top of the line; the base is fixed at 0 m.
  • When altitudeReference = 'base', the altitude defines the base of the line; the top must be specified using VerticalLineStyle.offsetZ.
  • VerticalLineStyle.offsetZ extends the line upward from the reference altitude. With 'terrain', it defines how far above the terrain the line extends.

Examples:

// Top = 100 m, Base = 0 m
{ type: "VerticalLine", altitudeReference: "top", altitude: 100 }

// Base = terrain, Top = terrain + 2 m
{ type: "VerticalLine", altitudeReference: "base", altitude: "terrain", offsetZ: "2m" }

// Base = 0, Top = feature Z (if available)
{ type: "VerticalLine", altitudeReference: "top", altitude: true }
defaultvalue

true

experimental

Optional altitudeReference

altitudeReference: "top" | "base"

Defines how the altitude value is interpreted for the VerticalLine.

By default, the meaning of altitude depends on the style type:

  • For most flat styles (Circle, Rect, Icon, etc.), altitude defines the center position.
  • For VerticalLine, VerticalLineStyle.altitude defines a vertical reference — either the top or the base.

Supported values:

  • 'top': the altitude specifies the top of the line; the base is fixed at 0 m (global ground).
  • 'base': the altitude specifies the base (bottom) of the line; the top must be defined via VerticalLineStyle.offsetZ.

Notes:

  • This property only affects VerticalLine styles; other style types ignore it.
  • When VerticalLineStyle.altitude is 'terrain' and altitudeReference is not specified, 'base' is automatically assumed (the line stands on the terrain surface).
defaultvalue

'top'

experimental

Optional offsetZ

offsetZ: number | string | StyleValueFunction<number | string> | StyleZoomRange<number | string> | StyleExpression<number | string>

Vertical offset of the shape along the z-axis.

Shifts or extends the line relative to its reference altitude.

  • Positive values move the line upward.
  • Negative values move the line downward.

Units:

  • Default is pixels.
  • Can also be a string with units (e.g., "1m" for meters).

Special notes for VerticalLine:

  • altitudeReference defines which point the altitude value refers to (top or base).
  • offsetZ always extends the line upward from the reference point, regardless of whether altitudeReference is 'base' or 'top'.
  • With altitude: 'terrain', offsetZ shifts the line relative to the terrain surface.
example
// Move the VerticalLine 8 px upward from its reference
{ type: "VerticalLine", zIndex: 0, stroke: "black", offsetZ: 8 }

// Base = terrain, extend line 1 m upward
{ type: "VerticalLine", zIndex: 0, stroke: "black", altitude: "terrain", altitudeReference: "base", offsetZ: "1m" }

// Top = terrain, extend line 2 m upward
{ type: "VerticalLine", zIndex: 0, stroke: "black", altitude: "terrain", altitudeReference: "top", offsetZ: "2m" }

Optional opacity

opacity: number | StyleValueFunction<number> | StyleZoomRange<number> | StyleExpression<number>

Defines the opacity of the style. The value must be between 0.0 (fully transparent) and 1.0 (fully opaque). It is valid for all style types.

defaultvalue

1

Optional stroke

Sets the stroke color of the shape.

see

Color for a detailed list of possible supported formats.

type

type: "VerticalLine"

Indicates type of the shape to render.

zIndex

zIndex: number | StyleValueFunction<number> | StyleZoomRange<number> | StyleExpression<number>

Indicates the drawing order within a layer. Styles with larger zIndex value are rendered above those with smaller values. The zIndex is defined relative to the "zLayer" property. If "zLayer" is defined all zIndex values are relative to the "zLayer" value.

Optional zLayer

zLayer: number | StyleValueFunction<number> | StyleExpression<number>

Indicates drawing order across multiple layers. Styles using zLayer with a high value are rendered on top of zLayers with a low value. If no zLayer is defined, it will fall back to the LayerStyle.zLayer or depend on the display layer order. The first (lowest) layer has a zLayer value of 1.

example

{...zLayer: 2, zIndex: 5} will be rendered on top of {...zLayer: 1, zIndex: 10}

Generated using TypeDoc