These are chat archives for openseadragon/openseadragon

20th
May 2016
foobarable
@foobarable
May 20 2016 08:47
yay
John Susi
@johnsusi
May 20 2016 09:03
Hi everyone. I'm looking for a way to save state between two openseadragon sessions. i.e. i want to open the same image again at the same position and zoom-level. (viewer dimension might have changed though). any pointers?
foobarable
@foobarable
May 20 2016 09:05
Do you use any backend?
John Susi
@johnsusi
May 20 2016 09:06
do you mean server side?
foobarable
@foobarable
May 20 2016 09:06
Yes
Well, there are several options to do this.
John Susi
@johnsusi
May 20 2016 09:07
not realy, we are feeding osd a dzitilesource with only image urls. we have local state that i want to synchronize
if that makes any sense :)
foobarable
@foobarable
May 20 2016 09:07
yeah, i think i got you
i know how i would do it with angular using local routes
and then using the parameters in the url to create the osd instance with the fitting parameters
but that may be not for you if you are not using angular
John Susi
@johnsusi
May 20 2016 09:10
it might, the missing link for me is what i should take out from osd when the user zooms or pans. I've hooked up 'animation-finish' but I can't figure out what to save.
I'm guessing setting x, y and width on the addTiledImage should suffice when opening a new viewer
John Susi
@johnsusi
May 20 2016 09:21
think I've found a solution, viewer.viewport.getBounds() might do the trick
John Susi
@johnsusi
May 20 2016 09:34
Yes it works. (getBounds/fitBounds) awsome. :)
foobarable
@foobarable
May 20 2016 09:47
congratz :)
Ian Gilman
@iangilman
May 20 2016 16:17
@johnsusi Yes, that's what I'd recommend :)