Search code examples
openseadragon

"Book like" view in Openseadragon (several "2 pages" sequences)


Openseadragon newbbie here !

I'm trying to display images by group of 2 AND keeping sequence mode activated, so I can "turn pages".

I managed to display 2 pages, I managed to read pages 1 by 1 in sequence mode, ... But I just didn't find a way to do both.

To display 2 pages, I loaded 2 tiles sets and configured "sequenceMode=false". Then I set coordinates, to display visuals aside.

To read pages 1 by 1, I loaded several tiles and configured "sequenceMode = true".

What I would like to do is display two visuals (= tiles sets) aside (like an open book). And then, on "next" button click, display the two next visuals from my "tilesSources" array... and so on !

Thank you for your help !


Solution

  • I recommend keeping sequence mode off, like you did for the two pages, and lay out the entire sequence (in pairs) that way. You should then create your own next/previous buttons and use viewer.viewport.fitBounds to animate the viewer to each pair as needed.

    Here's an example of a system that does something like that (plus a lot more):

    https://iangilman.com/osd/test/demo/m2/

    Press the "book" button at the top to see the "two-page" mode. The code for this is here:

    https://github.com/openseadragon/openseadragon/tree/master/test/demo/m2

    Of course you don't need all of that code, but hopefully it can be a helpful reference.