These are chat archives for openseadragon/openseadragon

30th
Aug 2017
Cameron Baney
@cameronbaney
Aug 30 2017 20:15

Hello. Are there any resources for a custom navigator, or just placing the navigator somewhere else? I cannot use navigatorId because I need the navigator to appear in a different component (I'm using Polymer for components wrapping OpenSeadragon)

My use case is an OpenSeadragon Viewer in a main panel, and a navigator in a side panel

Ian Gilman
@iangilman
Aug 30 2017 20:36
@cameronbaney And why doesn't navigatorId work in that context?
Cameron Baney
@cameronbaney
Aug 30 2017 20:39
Perhaps this is a unique problem with components, but I think since they're scoped, one component cannot see other markup from others
OpenSeadragon can't search the DOM for that ID and create in there. If there was a method I could create a Navigator myself by specifying where it goes, and what viewer it belongs to, that would solve my problem. Currently, constructing a new navigator just adds the navigator to the viewer
Ian Gilman
@iangilman
Aug 30 2017 20:44
Interesting. Would it work if you could pass the element in instead of the id?
Or does it need to happen after the viewer is created?
You can look at how the navigator is created here: https://github.com/openseadragon/openseadragon/blob/master/src/viewer.js#L417
The navigator is just an OpenSeadragon viewer that does specific things; another option would be for you to build your own starting with a fresh viewer. It basically needs to watch the other viewer and update when images, pan, and zoom change
Cameron Baney
@cameronbaney
Aug 30 2017 20:53

Yeah, i believe that would work, and had originally looked for an element option.

Building another viewer that watches the main viewer would work as well. I was just hoping to get the "view box" and stuff for free

Ian Gilman
@iangilman
Aug 30 2017 21:39
@cameronbaney I hear you. Adding an element option should be easy enough if you'd like to give it a try, and it's certainly something that would make sense to add to the API.
It would just be another section in the if/else statement where this appears: https://github.com/openseadragon/openseadragon/blob/master/src/navigator.js#L87