3D-City Model
    Preparing search index...

    Class Label

    Label – Utility class for rendering a text label at a 3D position in a Cesium scene.

    Encapsulates a Cesium entity (with a label), providing easy access to label content, number/unit formatting, show/hide, and position, as well as destruction/cleanup logic.

    Parent application or Cesium Viewer reference.

    Unique label id.

    Label position in 3D.

    Initial text/numeric value.

    Label font family.

    Label font size (pixels).

    Unit string to be appended to numeric values.

    Prefix string for label text.

    Initial visibility.

    destroy() - Removes the label entity from the scene and disables reference.

    const label = new Label(viewer, {position: [1,2,3], value: 99, unit: 'm'});
    label.position = [4,5,6];
    label.value = 123.456;
    label.show = false;
    label.destroy();
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Create a new label entity.

      Parameters

      • app: any

        App or Cesium Viewer.

      • Optionaloptions: object = {}

      Returns Label

    Properties

    _value: undefined | string | number
    app: any
    entity: any

    The underlying Cesium entity.

    font: any

    Font family.

    id: any

    UUID for this label.

    prefix: any

    Prefix shown before values.

    size: any

    Font size (px).

    unit: any

    Unit suffix for values.

    Accessors

    • get position(): number[] | Cartesian3

      Set or get label 3D position. Accepts either a Cesium Cartesian3 or an array [x, y, z].

      Returns number[] | Cartesian3

    • set position(value: number[] | Cartesian3): void

      Parameters

      • value: number[] | Cartesian3

      Returns void

    • get value(): string | number

      Set label content (formats numeric to 2 decimal places + prefix + unit). Accepts either a string or a number.

      Returns string | number

    • set value(value: string | number): void

      Parameters

      • value: string | number

      Returns void

    Methods

    • Remove the label's Cesium entity from the viewer.

      Returns void