These are chat archives for openseadragon/openseadragon

13th
Jul 2016
Glen Little
@glittle
Jul 13 2016 17:10
newbie question... I want to zoom in on a grid that I've built in Javascript... at some point during the zoom, I'll need to generate a more detailed grid for the current view and show that, and so on. Is this doable with OpenSeadragon?
Ian Gilman
@iangilman
Jul 13 2016 18:25
@glittle I assume there's also imagery involved, or is it just the grid?
OSD isn't really set up for infinite zoom on generated imagery like a grid, though its viewport can zoom pretty deep. You might consider using something like the canvas overlay plugin to do the grid drawing
Glen Little
@glittle
Jul 13 2016 20:59
@iangilman Correct... there would be no pre-created image files (gif/jpg/etc.), just the generated grid. The grid would be done in HTML, but could be done in a canvas.
Ian Gilman
@iangilman
Jul 13 2016 21:00
Cool... I think the canvas overlay plugin is probably your best bet
Glen Little
@glittle
Jul 13 2016 21:00
I wouldn't need infinite zoom. Could likely do with 3 levels, but it would be nice to have it zoom smoothly and fill in more details when zoomed in.
Cool
Seems like something that could be useful for a number of projects... interesting no one's done one yet.
I'd love to see how it comes out!
Glen Little
@glittle
Jul 13 2016 21:21
Looks interesting... a bit beyond me at the moment, but I may try to tackle it.
Ian Gilman
@iangilman
Jul 13 2016 21:21
Okay... let me know if you need any pointers!
Glen Little
@glittle
Jul 13 2016 21:23
A few initial thoughts... are there events when a zoom threshold has been passed? And is the visible boundary known at that point?
I see that there is a zoom event... that should be enough
Ian Gilman
@iangilman
Jul 13 2016 21:25
With the canvas overlay you get a callback for every frame; within that you're free to query the zoom and the boundaries of the viewport.
viewer.viewport.getZoom(true) and viewer.viewport.getBounds(true)
The true is to know exactly where you are right now rather than where you're zooming to (during animation)
Glen Little
@glittle
Jul 13 2016 21:27
Thanks, @iangilman
Ian Gilman
@iangilman
Jul 13 2016 21:27
:)
Glen Little
@glittle
Jul 13 2016 21:30
@iangilman just sent you a private chat with more details