These are chat archives for openseadragon/openseadragon

21st
Mar 2016
sickrandir
@sickrandir
Mar 21 2016 14:27
Hi, can someone point me to a complete example of a sequence of images loaded in OSD with different overlays on each image? I've seen the example that use getTileUrl method to recover the image url (https://github.com/openseadragon/openseadragon.github.com/blob/master/examples/ui-overlays/index.html) ...but what's the syntax for simply specifying a static URL to a dzi for each image?
Antoine Vandecreme
@avandecreme
Mar 21 2016 15:48
@iangilman what do you think about adding a method TiledImage.fitBounds?
Ian Gilman
@iangilman
Mar 21 2016 16:54
@avandecreme As a shortcut for zooming in on an image?
I guess I don't like the idea of asking the image to manipulate the viewport.
... but I suppose we could have Viewport.fitImage or something
Though Viewport.fitBounds(image.getBounds()) doesn't seem like a terrible hardship.
I'm all for adding sugar, but at some point it doesn't seem worth it
Antoine Vandecreme
@avandecreme
Mar 21 2016 16:58
No, it would be to position the tiledImage in the world, sorry for the confusion.
similar to TiledImage.setPosition
but it would take a rectangle and position the image inside that rectangle
with an option to anchor it on either side of the rectangle
(or in the middle)
this would be helpful to lay images in a grid (like the m2 demo)
Ian Gilman
@iangilman
Mar 21 2016 16:59
Both horizontally or vertically, of course
Yeah, seems reasonable :)
Antoine Vandecreme
@avandecreme
Mar 21 2016 17:00
ok, I will make a PR then :)
Ian Gilman
@iangilman
Mar 21 2016 17:01
Right on :)
@sickrandir So you're using sequenceMode and you want each image to have its own overlay? And you're specifying the images with the tileSources option at creation? I believe you can just add the overlays via an overlays property for each tile source...
Ian Gilman
@iangilman
Mar 21 2016 17:06
Another option would be to watch for page events on the viewer and handle adding and removing overlays at that time.
Antoine Vandecreme
@avandecreme
Mar 21 2016 20:21
@iangilman Implemented in #888
Ian Gilman
@iangilman
Mar 21 2016 21:50
@avandecreme Thanks!