These are chat archives for openseadragon/openseadragon

1st
Feb 2018
Tammy DiPrima
@tdiprima
Feb 01 2018 21:35
I'm doing a Custom Tile Source, like the 2nd example on that page (look for pink). But let's say I have a similar overlay, but in blue. And I want to display both overlays at the same time. I tried using the same viewer object to do both, but I got an error. What can I do to make it work? Should I make an array of tileSource(s) or something?
Ian Gilman
@iangilman
Feb 01 2018 22:09
@tdiprima You can certainly overlay two images on each other (as long as the top one has transparency in it). What error did you get when having two tile sources? Did you make an array to pass to the viewer?
Tammy DiPrima
@tdiprima
Feb 01 2018 22:22
Hi @iangilman
The error was the infamous:
tile.js:309 [Tile.drawCanvas] attempting to draw tile 6/277_178 when it's not cached
And I did not make an array yet. I wanted to ask first, in case I was heading down the wrong path...

Ah, you said

you can certainly overlay two images on each other (as long as the top one has transparency in it)

By "the top one", you mean the one I loaded first, correct?
In that case, the top image has no transparency, and is served by IIP server. Then I overlay the (2) transparencies.

Ian Gilman
@iangilman
Feb 01 2018 22:29
@tdiprima No, I mean whichever one is visually over the others. If you don't do anything to change the draw order, it'll be the last one loaded. In your case with three images, you want to load the image with no transparency first, and then the other two (which is what it sounds like you're planning already).
It should be as simple as:
var viewer = OpenSeadragon({
  tileSources: [
    backgroundLayerTileSource,
    overlayTileSource1,
    overlayTileSource2
  ],
  ...
});
If you don't specify any positioning (as in the above example) and if they are all the same aspect ratio, they will already be stacked on top of each other.