Methods
Viewer
addEventListener
adds an event listener to the viewer instance example usage const eventcallback = (event) => { console log(event); }; const listener = viewer2d addeventlistener("eventname", eventcallback); parameters eventname name of the viewer event to listen for valid event names can be found in each event page type required string yes eventcallback function invoked when the event is triggered the function receives an event object as an argument which includes data specific to the event type type required (event object) => void yes return value the event listener object type object properties name type description remove () => void removes the event listener