Built-in buttons
Thenavbar option accepts an array of button identifiers and/or custom button objects. The following built-in identifiers are available:
| Identifier | Description |
|---|---|
zoomOut | Zoom out button |
zoomRange | Zoom slider |
zoomIn | Zoom in button |
zoom | Shorthand for zoomOut + zoomRange + zoomIn |
moveLeft | Pan left button |
moveRight | Pan right button |
moveTop | Pan up button |
moveDown | Pan down button |
move | Shorthand for moveLeft + moveRight + moveTop + moveDown |
download | Download the panorama |
description | Open the description panel |
caption | Display the caption text |
fullscreen | Toggle fullscreen |
Plugin buttons
Plugins can register their own navbar buttons. When you do not override thenavbar option, plugin buttons appear automatically. When you do provide a custom navbar array, you must explicitly include the plugin button identifiers.
The button identifier for each plugin is listed on its documentation page.
Custom buttons
You can include arbitrary custom buttons in thenavbar array. A custom button is a plain object with the following fields:
Content of the button. Preferably a square image or SVG icon string.
Function called when the button is clicked. Receives the
Viewer instance.Unique identifier for the button. Required if you want to reference the button later via
viewer.navbar.getButton().CSS class name added to the button element.
Initially renders the button in a disabled state.
Initially shows or hides the button.
Example: custom button
Controlling buttons at runtime
Once the viewer is initialized, you can show, hide, enable, or disable any button by itsid:
Disabling the navbar
Setnavbar to false (or omit it entirely if it is not needed) to hide the navbar completely. Note that the caption option will also have no visible effect when the navbar is disabled.
