tify-iiif-viewer / tify

TIFY is a slim and mobile-friendly IIIF document viewer.
GNU Affero General Public License v3.0
108 stars 27 forks source link

How to access internal viewer object #163

Closed IgelCampus closed 4 months ago

IgelCampus commented 7 months ago

I am currently playing around with Tify and like it quite a lot. The homepage mentions (without an example) that the viewer object exposes the full OpenSeadragon API. Could you provide an example how to access this? My naive attempt with

let tify = new Tify ({
    container:   _el,
    manifestUrl: iiifUrl,
    viewer:      {
        showNavigator:      true
    }
});
let osd = tify.viewer; // !error: undefined

is not working.

t11r commented 7 months ago

The intended way is to wait for the ready promise before accessing any API properties, like this:

await tify.ready
let osd = tify.viewer

Currently though, this is working for anything but viewer, for which you would have to wait manually. I’m adding an issue, this will get fixed.

t11r commented 4 months ago

Fixed in v0.31.0.