These are chat archives for openseadragon/openseadragon

16th
Apr 2015
Daniel Haehn
@haehn
Apr 16 2015 15:39 UTC
Another question: how can i manually copy viewport information from one openseadragon instance to another?
Daniel Haehn
@haehn
Apr 16 2015 16:04 UTC
i mean camera information
Daniel Haehn
@haehn
Apr 16 2015 16:53 UTC
so have the same functionality as preserveViewport but across multiple OSD instances
Daniel Haehn
@haehn
Apr 16 2015 19:16 UTC
and start OSD with a configured camera position
Daniel Haehn
@haehn
Apr 16 2015 19:56 UTC
OK, i think i figured it out:
var bounds = this._viewers[this._page-1].viewport.getBounds();
var new_viewport_bounds = new OpenSeadragon.Rect(bounds.x, bounds.y, bounds.width, bounds.height);
this._viewers[this._page].viewport.fitBounds(new_viewport_bounds);
is this the best way?
Daniel Haehn
@haehn
Apr 16 2015 20:13 UTC
okok i now use panTo and zoomTo
but there seems to be a discrepancy using the getZoom and passing it as zoomTo..
anyone knows why?
panTo with getCenter works great
seems like a timing thing
shall i wait for some events before zooming?
Daniel Haehn
@haehn
Apr 16 2015 20:28 UTC
seems to be related with hiding/showing the different OSDs. if i use z-index instead of display:none it works :)
Ian Gilman
@iangilman
Apr 16 2015 20:35 UTC
hello! Yes, you're on the right track.
Are both of the viewers the same size and aspect ratio?
Daniel Haehn
@haehn
Apr 16 2015 20:35 UTC
yes
it works now :)
Ian Gilman
@iangilman
Apr 16 2015 20:36 UTC
Cool; that simplifies things.
Excellent :-)
Daniel Haehn
@haehn
Apr 16 2015 21:52 UTC
is there an event which let's me know that all required tiles are drawn?
Ian Gilman
@iangilman
Apr 16 2015 22:43 UTC
@haehn unfortunately there isn't really. Seems like a good idea, though.
Probably wouldn't be too hard to add.