Currently, I am in the process of integrating a viewer for scanned pages using OpenSeadragon along with the Selection plugin (https://github.com/picturae/openseadragonselection) to allow users to select a portion of the page.
I have successfully incorporated custom controls for zooming in/out and switching between selection mode and image zoom. Things are going smoothly so far.
However, I am facing challenges when it comes to dynamically changing the selection state in my code.
During the initialization of my viewer, the code looks something like this:
var options = {
showNavigator: true,
toggleButton: 'toggle-selection',
zoomPerClick: 2.0,
element: 'myElement',
url: <url to image>
};
var viewer = OpenSeadragon(options);
The viewer initializes as expected and all seems to be working fine. By clicking on the element with id="toggle-selection", I can easily enable or disable the selection mode.
My goal is to connect an Angular ng-click handler to a certain element that will toggle the selection mode of my viewer. However, I am struggling to figure out how to update the option and ensure that the viewer reflects the new state.