These are chat archives for openseadragon/openseadragon

15th
Apr 2015
Alex Zhang
@YingjieHit
Apr 15 2015 03:43 UTC
@iangilman Haha , Thanks!
Daniel Haehn
@haehn
Apr 15 2015 16:12 UTC
yes I use sequenceMode: true and I only want one image at a time. so when navigating to the next page, i would have the right dimensions and could pass it to OSD
Ian Gilman
@iangilman
Apr 15 2015 16:13 UTC
And each new image isn't filling the viewer when you do that?
It should be the default behavior.
Do you have an example running somewhere?
Daniel Haehn
@haehn
Apr 15 2015 16:23 UTC
well i didn't try that yet.. how do i pass the updated width and height to the viewer?
right now, i have everything ready at the beginning at pass an array to tileSources when constructing the viewer
Daniel Haehn
@haehn
Apr 15 2015 16:36 UTC
if i update height and width of a tilesource in my tilesource array, it has no effect since it seems to be only read when i pass it to the constructor of the viewer
Ian Gilman
@iangilman
Apr 15 2015 16:38 UTC
Haven't tried what yet?
And yes, changing the height and width later won't have any effect. But also you shouldn't need to...the height and width of a tile source is just the pixel dimensions...it doesn't have anything to do with how large it's shown on screen.
Do you have preserveViewport: true on? That needs to be off.
Can you share your code?
Daniel Haehn
@haehn
Apr 15 2015 16:41 UTC
ok i tried now the following: tilesources = [{... width:1000, height:1000.....}, {...width: -1, height: -1...}, {...width: -1, height: -1...}]; viewer=OpenSeadragon({...., tileSources: tilesources,...}); and the first one is correctly displayed.. then before going to the next page i say tilesources1.width = 1000; tilesources1.height = 1000; viewer.tileSources = tilesources; but it does not pickup the new width and height
tilesources1 should be tilesource [ 1 ]
yes i do have preserveViewport true
Ian Gilman
@iangilman
Apr 15 2015 16:42 UTC
Try changing that to false
Daniel Haehn
@haehn
Apr 15 2015 16:42 UTC
same behavior
Ian Gilman
@iangilman
Apr 15 2015 16:42 UTC
Also you shouldn't need to set the width or height at all if you're using sequenceMode
Daniel Haehn
@haehn
Apr 15 2015 16:43 UTC
why? each image in the sequence has a different width and height
how would OSD else wise get this information
Ian Gilman
@iangilman
Apr 15 2015 16:43 UTC
It'll calculate the width and height automatically from the actual tile source data. What sort of tile source are you using? DZI?
Daniel Haehn
@haehn
Apr 15 2015 16:44 UTC
no custom one
Ian Gilman
@iangilman
Apr 15 2015 16:44 UTC
Gotcha
Daniel Haehn
@haehn
Apr 15 2015 16:44 UTC
could i set width and height to a function which requests the data via ajax?
would this be called only when navigating to the next page?
Ian Gilman
@iangilman
Apr 15 2015 16:44 UTC
So how about setting them all to 1000 to begin with? Does that work?
Daniel Haehn
@haehn
Apr 15 2015 16:45 UTC
yes this works
but problem is, i don't have this information.. i need to read it on demand
Ian Gilman
@iangilman
Apr 15 2015 16:46 UTC
Have you written a getImageInfo for your custom tile source?
Unfortunately I'm not terribly familiar with what's involved in writing custom tile sources that load their data via ajax, but it's supposed to be possible with OSD.
Ian Gilman
@iangilman
Apr 15 2015 16:52 UTC
Another approach would be to skip sequence mode entirely and build that UI yourself, using viewer.open for each new image. That way you could do whatever ajax you needed to before calling open each time.
Daniel Haehn
@haehn
Apr 15 2015 16:54 UTC
hmm no getImageInfo yet.. i will look into it
would prefer to use sequencemode tho.. there must be a way to update that
Ian Gilman
@iangilman
Apr 15 2015 16:56 UTC
If you want it to use ajax, your tile source would just be an URL, instead of actual data. That's it's clue to do an ajax call.
You might not have to do your own getImageInfo, but you should read how getImageInfo works so you can plug into it properly
Daniel Haehn
@haehn
Apr 15 2015 16:58 UTC
ok thanks for the pointer!
Ian Gilman
@iangilman
Apr 15 2015 17:02 UTC
Sure...sorry it's a little rough in there. Keep me posted!