The viewer can be rotated either programmatically or by activating the corresponding controls in the user interface.
If you just want to let the user rotate the viewer, you can simply add the rotation controls and enable the pinch rotate on tactile devices. You can also specify an initial rotation.
OpenSeadragon({
...
// Initial rotation angle
degrees: 90,
// Show rotation buttons
showRotationControl: true,
// Enable touch rotation on tactile devices
gestureSettingsTouch: {
pinchRotate: true
}
});
To have more control over the rotation, you can set it via the Viewport.setRotation method.
var viewer = OpenSeadragon({
id: "example-programmatically",
prefixUrl: "/openseadragon/images/",
tileSources: "/example-images/highsmith/highsmith.dzi"
});
// Using jQuery UI slider
$("#slider").slider({
min: -180,
max: 180,
slide: function(event, ui) {
viewer.viewport.setRotation(ui.value);
}
});