These are chat archives for openseadragon/openseadragon

21st
Apr 2016
Antoine Vandecreme
@avandecreme
Apr 21 2016 13:17
What about add-item?
^ @gechols
Grant Echols
@gechols
Apr 21 2016 15:35
add-item doesn't seem to be getting fired
I have a listener for it and it never gets hit
Antoine Vandecreme
@avandecreme
Apr 21 2016 19:11
hum, both remove-item and add-item should be fired
note that they are fired on the world, not the viewer
Grant Echols
@gechols
Apr 21 2016 19:12
That might be the issue. I hadn't thought of listening to the wrong object - let me try that
Grant Echols
@gechols
Apr 21 2016 19:21
Thanks for the help @avandecreme I'm much closer now to what I need.
Antoine Vandecreme
@avandecreme
Apr 21 2016 19:21
no problem :)
Grant Echols
@gechols
Apr 21 2016 19:32
Apparently the 'add-item' event is still a bit too soon. It gets fired when the image is not yet rendered so the bounds are still wrong for the overlay I need to add. Is there a later event fired that indicates the image display is more complete?
Antoine Vandecreme
@avandecreme
Apr 21 2016 19:43
that may be what you need: openseadragon/openseadragon#837
probably not actually
Grant Echols
@gechols
Apr 21 2016 20:06
Thanks - I think I have it working with a setTimeout for now. My next hurdle is to handle images that have been panned or scrolled out of the viewport. Are there any events that notify me when an image is no longer 'in view', or when they are 'in view'. I realize that when using the world view this could be part of a zoom, or a scroll, etc. so it would nice to be notified when it happens so we can release some resources that might bog the system down (we frequently load thousands of images in the world view)
Ian Gilman
@iangilman
Apr 21 2016 20:12
@gechols You want to listen for the first tile-drawn event of the tiledImage. Here's a demo: http://iangilman.com/osd/test/demo/tilesource-swap.html ... and here is the code: https://github.com/openseadragon/openseadragon/blob/master/test/demo/tilesource-swap.html#L88
@gechols There is no "out of view" event, but you can watch the viewer's pan and zoom events and compare the tiledImage bounds to the world bounds
Antoine Vandecreme
@avandecreme
Apr 21 2016 20:16
@iangilman I added 2 new PR that I would like to see merged before the release (sorry :D)
Ian Gilman
@iangilman
Apr 21 2016 20:23
@avandecreme I'm happy to have them!
I'm in no hurry on the release... I just figure it's time to start thinking about it.