Class: AnnotationUI

OSDPaperjsAnnotation.AnnotationUI(annotationToolkit, toolset, opts)

A class for creating and managing the annotation UI. Intended to be constructed only via AnnotationToolkit.addAnnotationUI(). Toolbar and layer UI are owned by the toolkit; this class uses them via getToolbar()/getLayerUI() and places them via AnnotationLayout.

Constructor

new AnnotationUI(annotationToolkit, toolset, opts)

Creates an instance of AnnotationUI.
Parameters:
Name Type Description
annotationToolkit Object The annotation toolkit object.
toolset AnnotationToolset The toolset (owned by the toolkit).
opts Object The options for the AnnotationUI.
Properties
Name Type Attributes Default Description
autoOpen boolean <optional>
true Determines if the AnnotationUI should be automatically opened.
featureCollections Array <optional>
[] An array of feature collections to load.
addButton boolean <optional>
true Determines if the AnnotationUI button should be added.
addToolbar boolean <optional>
true Whether toolbar is requested (toolkit already created it via getToolbar if true).
tools Array.<string> <optional>
null An array of tool names to use in the AnnotationToolbar.
addLayerUI boolean <optional>
true Whether layer UI is requested (toolkit already created it via getLayerUI if true).
addFileButton boolean <optional>
true Determines if the file button should be added for saving/loading annotations.
buttonTogglesToolbar boolean <optional>
true Determines if the AnnotationToolbar visibility is toggled by the AnnotationUI button.
buttonTogglesLayerUI boolean <optional>
true Determines if the LayerUI visibility is toggled by the AnnotationUI button.
Source:

Methods

areAnnotationPanelsVisible() → {boolean}

Whether annotation panels are open (pencil toggle state).
Source:
Returns:
Type
boolean

destroy()

Destroys the AnnotationUI and cleans up its resources. Does not destroy the toolkit's toolbar or layer UI.
Source:

getViewerToolbarButtons() → {Object}

Viewer toolbar buttons managed by this UI (for host integrations such as ConfigurationWidget addSection).
Source:
Returns:
OpenSeadragon button objects with `.element`, or null entries when not created.
Type
Object

hideToolbar()

Hide the toolbar
Source:

hideUI()

Hide the LayerUI interface
Source:

openFileDialog()

Opens the save/load file dialog (no-op if addFileButton was false).
Source:

showToolbar()

Show the toolbar
Source:

showUI()

Show the LayerUI interface
Source:

toggleAnnotationPanels()

Same as clicking the pencil button: toggles toolbar/layer visibility per constructor options.
Source: