Vertex Viewer SDK
    Preparing search index...

    Class AnnotationController

    The controller for managing the annotations of a scene and scene view.

    Index

    Constructors

    Properties

    onStateChange: EventDispatcher<AnnotationState> = ...

    A dispatcher that emits an event whenever the state of the annotations has changed. The annotation state includes the annotation sets that are active and the annotations that belong to each set.

    Methods

    • Activates an annotation set for the current session. This method will emit an event on onStateChange when the annotation set has been added, and return a promise the resolves with the new annotation state.

      Parameters

      • id: string

        The ID of the annotation set.

      Returns Promise<AnnotationState>

      A promise that resolves with the new annotation state.

    • Starts the automatic retrieval of annotation state. When a new annotation state is retrieved, an event will be emitted on onStateChange.

      Parameters

      • pollingIntervalInMs: number = 10000

        The interval to poll for a new annotation state.

      Returns void

    • Performs a manual fetch of the annotation state. This method will emit an event on onStateChange when the annotation set has been added, and return a promise the resolves with the new annotation state.

      Parameters

      • opts: { signal?: AbortSignal } = {}

        Options to configure the fetch behavior. If an abort signal is given, then this will not emit a change event if the signal is aborted.

      Returns Promise<AnnotationState>

      A promise that resolves with the new annotation state.

    • Deactivates an annotation set for the current session. This method will emit an event on onStateChange when the annotation set has been added, and return a promise the resolves with the new annotation state.

      Parameters

      • id: string

        The ID of the annotation set.

      Returns Promise<AnnotationState>

      A promise that resolves with the new annotation state.