Class: AnnotationLayout

AnnotationLayout(viewer, optsopt)

AnnotationLayout Builds the annotation grid DOM, places the viewer and optional toolbar/layer UI panels, handles right-panel resize, and optionally adds the single annotation toggle button.

Constructor

new AnnotationLayout(viewer, optsopt)

Parameters:
Name Type Attributes Description
viewer OpenSeadragon.Viewer OpenSeadragon viewer (use viewer.element and viewer.container).
opts Object <optional>
All optional.
Properties
Name Type Attributes Default Description
toolbar Object | null <optional>
If present, add to top row.
layerUI Object | null <optional>
If present, add to right column with resize handle.
addButton boolean <optional>
true If true, add the pencil/toggle button (requires opts.addViewerButton).
addViewerButton function <optional>
When addButton is true, called as addViewerButton({ onClick, faIconClass, tooltip }) to create the button. Required if addButton is true.
buttonTogglesToolbar boolean <optional>
true Toggle button controls toolbar visibility.
buttonTogglesLayerUI boolean <optional>
true Toggle button controls layer UI visibility.
initialOpen boolean <optional>
true Initial visibility state for toolbar/layer UI.
Source:

Methods

arePanelsVisible() → {boolean}

Whether toolbar/layer panels are in the "open" state (same as after pencil toggle).
Source:
Returns:
Type
boolean

destroy()

Remove the grid from the viewer, remove the toggle button, detach listeners. Does not destroy toolbar or layer UI; caller owns those.
Source:

getPencilViewerButton() → {Object|null}

OpenSeadragon viewer button for the annotation toggle (pencil), or null if addButton was false.
Source:
Returns:
Type
Object | null

togglePanelsFromButton()

Same behavior as clicking the pencil viewer button (toggle toolbar/layer visibility per options).
Source: