BimCT SDK / WebGL2 Viewer
    Preparing search index...

    Class Legend

    Class managing legend on a canvas.

    Index

    Accessors

    • get options(): LegendOptions

      Gets the current legend configuration options.

      Returns LegendOptions

      The current legend options including position, styling, and items

    • set options(value: LegendOptions): void

      Sets the legend configuration options. Updates all visual properties and redraws the legend.

      Parameters

      Returns void

    • get visible(): boolean

      Gets whether the legend is currently visible.

      Returns boolean

      True if the legend is visible, false otherwise

    • set visible(value: boolean): void

      Sets the visibility of the legend. Shows or hides the legend and triggers necessary updates.

      Parameters

      • value: boolean

        True to show the legend, false to hide it

      Returns void

    • get backgroundOpacity(): number

      Gets the current background opacity of the legend.

      Returns number

      The opacity value between 0.0 and 1.0

    • set backgroundOpacity(value: number): void

      Sets the background opacity of the legend.

      Parameters

      • value: number

        Opacity value between 0.0 (transparent) and 1.0 (opaque)

      Returns void

    • get backgroundColor(): string

      Gets the current background color of the legend.

      Returns string

      The background color as a CSS color string

    • set backgroundColor(value: string): void

      Sets the background color of the legend.

      Parameters

      • value: string

        The background color as a CSS color string

      Returns void

    • get textColor(): string

      Gets the current text color for legend labels.

      Returns string

      The text color as a CSS color string

    • set textColor(value: string): void

      Sets the text color for all legend labels.

      Parameters

      • value: string

        The text color as a CSS color string

      Returns void

    • get textFontFamily(): string

      Gets the current font family for legend text.

      Returns string

      The font family name

    • set textFontFamily(value: string): void

      Sets the font family for all legend text.

      Parameters

      • value: string

        The font family name

      Returns void

    • get textFontSize(): number

      Gets the current font size for legend text.

      Returns number

      The font size in pixels

    • set textFontSize(value: number): void

      Sets the font size for all legend text.

      Parameters

      • value: number

        The font size in pixels

      Returns void

    • get imageSize(): number

      Gets the current size of legend icons.

      Returns number

      The icon size in pixels (width and height)

    • set imageSize(value: number): void

      Sets the size of all legend icons.

      Parameters

      • value: number

        The icon size in pixels (applies to both width and height)

      Returns void

    • get rotation(): number

      Gets the current rotation angle of the legend.

      Returns number

      The rotation angle in radians

    • set rotation(value: number): void

      Sets the rotation angle of the legend.

      Parameters

      • value: number

        The rotation angle in radians

      Returns void

    • get canvasPosition(): { x: number; y: number }

      Gets the current canvas/screen position of the legend.

      Returns { x: number; y: number }

      Object containing x and y coordinates in canvas space

    • get worldPosition(): { x: number; y: number; z: number }

      Gets the current world/3D position of the legend.

      Returns { x: number; y: number; z: number }

      Object containing x, y, and z coordinates in world space

    • get optionsChangedEvent(): IEvent<BaseRenderer, LegendOptions>

      Gets the event dispatcher for legend options changes. Subscribe to this event to be notified when legend options are modified.

      Returns IEvent<BaseRenderer, LegendOptions>

      Event that fires when legend options change

    Methods

    • Returns Promise<void>

    • Parameters

      Returns Promise<void>

    • Adds a new item to the legend display.

      Parameters

      Returns Promise<void>

    • Sets the legend position using canvas/screen coordinates. Automatically calculates the corresponding world position.

      Parameters

      • x: number

        The X coordinate in canvas/screen space

      • y: number

        The Y coordinate in canvas/screen space

      Returns void

    • Sets the legend position using world/3D coordinates. Automatically calculates the corresponding canvas position.

      Parameters

      • worldX: number

        The X coordinate in world space

      • worldY: number

        The Y coordinate in world space

      • worldZ: number

        The Z coordinate in world space

      Returns void