0

I am trying to setup image annotation using Annotorious on OpenSeaDragon but I am running into an issue during initialization. According to the API, I should first setup the viewer using,

  const viewer = OpenSeadragon({
  id: "openseadragon",
  tileSources: {
    type: "image",
    url: "1280px-Hallstatt.jpg"
  }
 });
 var anno = OpenSeadragon.Annotorious(viewer);

but this generates a whole new OpenSeadragon viewer/canvas whereas the page I am working on will already have a viewer setup, so this creates another viewer. Is there a way to get the viewer already in the page and pass to OpenSeadragon.Annotorious()? I am new to JavaScript and web development so this may be a trivial question.

J.g
  • 41
  • 1
  • 7
  • Is the existing viewer already stored in a variable somewhere? Do you have access to that part of the code? If possible, that's definitely how you want to do it. Otherwise, here's a hack you can try: https://stackoverflow.com/questions/67396654/get-reference-to-existing-openseadragon-viewer – iangilman May 27 '21 at 18:29
  • Note this is also being discussed here: https://github.com/openseadragon/openseadragon/issues/1983 – iangilman May 27 '21 at 18:32

0 Answers0