These are chat archives for openseadragon/openseadragon

8th
Jan 2018
Douglas Russell
@dpwrussell
Jan 08 2018 19:16
@iangilman I am just having a play around trying to implement your suggestion to my multi-image layout problem. Is the only option to start with an empty Viewer and then add the images in the locations that I desire with addTiledImage? I can't see a way to pass the necessary parameters to the Viewer constructor as it takes a list of tilesources as opposed to an array of tiled images (each of which would include a tilesource and the x, y, opacity, etc) to display.
Ian Gilman
@iangilman
Jan 08 2018 21:12
@dpwrussell addTiledImage is certainly a fine option. You can use the Viewer constructor as well, though... Just pass in an array of the tiled image specifications (just the same stuff you would pass into addTiledImage). I know it's a confusing API... too many ways to use it.
Douglas Russell
@dpwrussell
Jan 08 2018 21:55
@iangilman I think I'm missing something. Under what key do I pass it to the Viewer constructor? Doesn't seem to work if I user the tileSources key. Also a bit confusing to me that I would them be merging the tilesource properties into the tiledimage properties. I was expecting to find a property called something like .images which would take an array of tileimages, each of which containing a tilesource object.
var viewer = OpenSeadragon({
   id: "openseadragon1",
   prefixUrl: "https://cdnjs.cloudflare.com/ajax/libs/openseadragon/2.3.1/images/",
   tileSources: [
     {
       height: 16192,
       width:  13120,
       tileSize: 1024,
       maxLevel: 4,
       getTileUrl: function( level, x, y ){
         return base + (4 - level) + "_" + x + "_" + y + ".jpg";
       },
       x: 0.1,
       y: 0.1,
       width: 0.1,
       opacity: 1
     },
     {
       height: 16192,
       width:  13120,
       tileSize: 1024,
       maxLevel: 4,
       getTileUrl: function( level, x, y ){
         return base + (4 - level) + "_" + y + "_" + x + ".jpg";
       },
       x: 0.1,
       y: 0.1,
       width: 0.1,
       opacity: 0
     }
   ],
   preserveViewport: true
  });
Eugh, I thought triple backticks would work, sorry. (It's just a bit insistent on line returns)