Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AnnotationsPlugin

Viewer plugin that creates Annotations.

Hierarchy

Index

Constructors

Properties

annotations: {}

The Annotations created by AnnotationsPlugin.createAnnotation, each mapped to its Annotation.id.

Type declaration

id: string

ID for this Plugin, unique within its Viewer.

viewer: Viewer

The Viewer that contains this Plugin.

Accessors

  • get surfaceOffset(): number
  • set surfaceOffset(arg: number): void

Methods

  • clear(): void
  • createAnnotation(params: { entity?: Entity; eye?: number[]; id: string; labelElementId?: string; labelHTML?: string; labelShown?: boolean; look?: number[]; markerElementId?: string; markerHTML?: string; markerShown?: boolean; occludable?: boolean; pickResult?: PickResult; projection?: string; up?: number[]; values?: {}; worldPos?: number[] }): Annotation
  • Creates an Annotation.

    The Annotation is then registered by Annotation.id in AnnotationsPlugin.annotations.

    Parameters

    • params: { entity?: Entity; eye?: number[]; id: string; labelElementId?: string; labelHTML?: string; labelShown?: boolean; look?: number[]; markerElementId?: string; markerHTML?: string; markerShown?: boolean; occludable?: boolean; pickResult?: PickResult; projection?: string; up?: number[]; values?: {}; worldPos?: number[] }

      Annotation configuration.

      • Optional entity?: Entity
      • Optional eye?: number[]
      • id: string

        Unique ID to assign to Annotation.id. The Annotation will be registered by this in AnnotationsPlugin.annotations and {@link Scene.components}. Must be unique among all components in the Viewer.

      • Optional labelElementId?: string
      • Optional labelHTML?: string
      • Optional labelShown?: boolean
      • Optional look?: number[]
      • Optional markerElementId?: string
      • Optional markerHTML?: string
      • Optional markerShown?: boolean
      • Optional occludable?: boolean
      • Optional pickResult?: PickResult
      • Optional projection?: string
      • Optional up?: number[]
      • Optional values?: {}
        • [key: string]: string | number
      • Optional worldPos?: number[]

    Returns Annotation

    The new Annotation.

  • destroy(): void
  • destroyAnnotation(id: string): void
  • error(msg: string): void
  • Logs an error message to the JavaScript developer console, prefixed with the ID of this Plugin.

    Parameters

    • msg: string

      The error message

    Returns void

  • fire(event: string, value: any): void
  • Fires an event at this Plugin.

    Parameters

    • event: string

      The event type name

    • value: any

      The event parameters

    Returns void

  • log(msg: string): void
  • Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin.

    Parameters

    • msg: string

      The error message

    Returns void

  • on(event: "annotationCreated", callback: (annotationId: string) => void): void
  • on(event: "annotationDestroyed", callback: (annotationId: string) => void): void
  • on(event: "markerMouseEnter", callback: (annotation: Annotation) => void): void
  • on(event: "markerMouseLeave", callback: (annotation: Annotation) => void): void
  • on(event: "markerClicked", callback: (annotation: Annotation) => void): void
  • warn(msg: string): void
  • Logs a warning message to the JavaScript developer console, prefixed with the ID of this Plugin.

    Parameters

    • msg: string

      The error message

    Returns void

Generated using TypeDoc