A viewport navigator shows the source image displayed
as a reference, with a highlighted area showing which portion of
the image the user is currently viewing. The navigator reuses the
configured image sources so no additional image derivatives are
required. Set the showNavigator
to true
to activate the navigator feature.
OpenSeadragon({ ... showNavigator: true, ... });
By default the navigator is positioned in the upper right corner, though it is possible to position it through configuration into any corner.
The relevant configuration options are shown below. The
navigatorPosition
attribute identifies the corner
into which the navigator should be overlayed.
OpenSeadragon({ ... showNavigator: true, navigatorPosition: "BOTTOM_LEFT", ... });
In addition to the corners, the navigator can be positioned at a specific size and location.
The relevant configuration options are shown below. The
navigatorPosition
attribute is set to "ABSOLUTE"
and the navigatorTop
, navigatorLeft
,
navigatorHeight
, and navigatorWidth
attributes define the size and location of the navigator.
OpenSeadragon({ ... showNavigator: true, navigatorPosition: "ABSOLUTE", navigatorTop: "40px", navigatorLeft: "4px", navigatorHeight: "120px", navigatorWidth: "145px", ... });
By default, the navigator will auto fade after some timeout when the user stops interacting with the viewport. You can disable this behavior and make it visible persistently.
The relevant configuration options are shown below.
var viewer = OpenSeadragon({ ... showNavigator: true, navigatorAutoFade: false, ... }); // UI code for toggling navigator // e.g.: button onclick handler var navShown = true; function toggleNav () { if (navShown) viewer.navigator.element.style.display = "none"; else viewer.navigator.element.style.display = "inline-block"; navShown = !navShown; }
Instead of placing the navigator overtop of the main image, the navigator may be placed elsewhere in the web page as illustrated in the example below. The navigator can be placed in a jQuery UI dialog or other widget.
The relevant configuration options are shown below. The
navigatorId
attribute identifies the div into
which the navigator is placed. When using this variation the navigator
does not autofade.
OpenSeadragon({ ... showNavigator: true, navigatorId: "navigatorDiv", ... });