Class TextElementInternal

TextElement is used to create 2D text elements (for example, labels).

Hierarchy

  • TextElement

Constructors

  • Creates a new TextElement.

    Parameters

    • text: string

      The text to display.

    • points: Vector3 | Vector3[]

      The position or a list of points for a curved text, both in world space.

    • renderParams: TextRenderParameters | TextRenderStyle

      TextElement text rendering parameters.

    • layoutParams: TextLayoutParameters | TextLayoutStyle

      TextElement text layout parameters.

    • priority: number = 0

      The priority of the TextElement. Elements with the highest priority get placed first, elements with priority of 0are placed last, elements with a negative value are always rendered, ignoring priorities and allowing overrides. @param xOffset - Optional X offset of thisTextElementin screen coordinates. @param yOffset - Optional Y offset of thisTextElement` in screen coordinates.

    • xOffset: number = 0
    • yOffset: number = 0
    • Optional featureId: string | number

      Optional string to identify feature (originated from DataSource). Number ids are deprecated in favor of strings.

    • Optional style: string
    • Optional fadeNear: number

      Distance to the camera (0.0 = camera position, 1.0 = farPlane) at which the label starts fading out (opacity decreases).

    • Optional fadeFar: number

      Distance to the camera (0.0 = camera position, 1.0 = farPlane) at which the label becomes transparent. A value of <= 0.0 disables fading.

    • Optional tileOffset: number
    • Optional offsetDirection: number

      Direction represented as an angle in degrees clockwise from north to offset the icon in world space.

    • Optional dataSourceName: string
    • Optional dataSourceOrder: number

    Returns TextElement

Properties

alwaysOnTop?: boolean

If true, the label will always be rendered on top. If overlapping with other labels, the render order is undefined;

Default

false

bounds?: Box2

Screen space bounds for this TextElement.

Remarks

Used by point labels in TextElementsRenderer. Valid after loadingState is Initialized.

dataSourceName?: string
dataSourceOrder?: number
distanceScale: number = 0.5

Scaling factor of text. Defaults to 0.5, reducing the size ot 50% in the distance.

elevated: boolean = false

If set to true the geometry has been already overlaid on elevation.

fadeFar?: number

Distance to the camera (0.0 = camera position, 1.0 = farPlane) at which the label becomes transparent. A value of <= 0.0 disables fading.

fadeNear?: number

Distance to the camera (0.0 = camera position, 1.0 = farPlane) at which the label starts fading out (opacity decreases).

featureId?: string | number

Optional string to identify feature (originated from DataSource). Number ids are deprecated in favor of strings.

ignoreDistance?: boolean

Ignore distance limit. Used for label in labeled-icons.

kind?: string | GeometryKindSet

Specified kind of geometry. One kind is set as default in the technique, and can be overridden in the style.

layoutParams: TextLayoutParameters | TextLayoutStyle

TextElement text layout parameters.

maxZoomLevel?: number

Determines maximum zoom level for visibility. Can be used to reduce the number of visible TextElements based on zoom level.

mayOverlap?: boolean

If true, label is allowed to overlap other labels or icons of lower priority.

Default

false

minZoomLevel?: number

Determines minimum zoom level for visibility. Can be used to reduce the number of visible TextElements based on zoom level.

offsetDirection?: number

Direction represented as an angle in degrees clockwise from north to offset the icon in world space.

pathLengthSqr?: number
points: Vector3 | Vector3[]

The position or a list of points for a curved text, both in world space.

priority: number = 0

The priority of the TextElement. Elements with the highest priority get placed first, elements with priority of 0are placed last, elements with a negative value are always rendered, ignoring priorities and allowing overrides. @param xOffset - Optional X offset of thisTextElementin screen coordinates. @param yOffset - Optional Y offset of thisTextElement` in screen coordinates.

renderOrder: number = 0

If specified, determines the render order between TextElements. The number different renderOrders should be as small as possible, because every specific renderOrder may result in one or more draw calls.

TextElements with the same integer renderOrder will be rendered in the same batch.

The renderOrder of TextElements are only relative to other TextElements, and not other map elements.

A TextElement with a higher renderOrder will be rendered after a TextElement with a lower renderOrder.

renderParams: TextRenderParameters | TextRenderStyle

TextElement text rendering parameters.

reserveSpace?: boolean

If true, label will reserve screen space, other markers of lower priority will not be able to overlap.

Default

true

style?: string
text: string

The text to display.

textFadeTime?: number

Time to fade in text in milliseconds.

Default

[[DEFAULT_FADE_TIME]] 800
tileOffset?: number
type: TextElementType
userData?: any

Optional user data. Will be retrieved during picking.

visible: boolean = true

Determines visibility. If set to false, it will not be rendered.

xOffset: number = 0
yOffset: number = 0
HIGHEST_PRIORITY: number = Number.MAX_SAFE_INTEGER

Text elements with this priority are placed on screen before any others.

Accessors

Methods

Generated using TypeDoc