0

I am trying to migrate my code from seadragon 0.8.9 to Openseadragon 2.4.1 I am trying to add functionalities to the image viewer like adding rotation buttons, which I am able to. Here is the seadragon code:

    viewer = new Seadragon.Viewer('container');

    viewer.addEventListener('open', addHighlight);

    if(openListener != undefined && openListener != null) {
        viewer.addEventListener('open', openListener);
    }

    var nav = viewer.getNavControl();

    viewer.clearControls();

    viewer.addControl(nav, Seadragon.ControlAnchor.TOP_LEFT);

    viewer.openDzi(imagePath, imageViewerXml);

And here's the openseadragon code:

    viewer = new OpenSeadragon.Viewer('container');

    viewer.addHandler('open', addHighlight);

    if (openListener != undefined && openListener != null) {
        viewer.addHandler('open', openListener);
    }

    var navbar = document.createElement("div");

    viewer.addControl(navbar, { anchor: OpenSeadragon.ControlAnchor.TOP_LEFT });

    viewer.open(imagePath, imageViewerXml);

where in both the code imagePath is the 'tileSources' and imageViewerXml is 'initialPage' as described in Openseadragon .js file.

I am getting Error in loading the .dzi file on my QA environment. What am I doing wrong. Please help!! Thanks in Advance!!!

Avinash Prasad
  • 158
  • 1
  • 13
  • Hard to say from your example, but the error implies that it's not getting the right path somehow. Can you share an example of the full error message? BTW, there's some discussion on this upgrade path here: https://github.com/openseadragon/site-build/issues/5 I don't know if any of that is relevant. – iangilman Oct 24 '19 at 18:36
  • 1
    Thanks for the help @iangilman, actually I had to change the path as u suggested. I was giving the path of the .dzi file and it had required the path of the images. The dzi XML was already provided with 'imageViewerXml'. So I just changed the path and it worked. Thanks again for the Link provided. Cheers!!! – Avinash Prasad Oct 25 '19 at 19:11

0 Answers0