1
votes

I'm using the DeepZoom Composer to layer different images on top of the other, with each layer on top being smaller. (Similar to http://msdn.microsoft.com/en-us/expression/cc745977.aspx)

Is there an easy way using Seadragon Ajax 0.8.9 to zoom into each layered image on top (with the container showing the exact 1:1 ratio of the top layered image), instead of manually creating a control overlay and assigning click behaviour to zoom/pan to the layered area on the overall composition?

Update: I've also tried to use the SparseImageSceneGraph.xml values to set zoomTo to:

<x>0.0663816754801515</x>
<y>0.0850837639496624</y>
<Width>0.0322681051707401</Width>
<Height>0.0322681051707415</Height>
<ZOrder>2</ZOrder>

using

viewer.viewport.zoomTo(30.990353933356293, 
new Seadragon.Point(0.0663816754801515, 0.0850837639496624));

but it is slightly off the 2nd level image.

Also tried:

var x = 0.066381675480155;
var y = 0.085083763949665;
var w = 0.0322681051707403;
var h = 0.0322681051707407;
var rect = new Seadragon.Rect(x,y,w,h); 
viewer.viewport.fitBounds(rect);

But that is off the 2nd layer image too. (even though the 2nd image is partially visible)

2nd update

I'm investigating using OpenSeaDragon now to test what I wanted to achieve, and here is what I have:

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

$.extend(true, OpenSeadragon.options, {
    autoHideControls: false,
    defaultZoomLevel : 1,
    visibilityRatio : 1.1,
    constrainDuringPan : true,
    minZoomImageRatio : 1,
    maxZoomPixelRatio : 30,
    animationTime: 1.5,
    tileSources: [{
        id: 'example-overlay',
         x: 0,
         y: 0,
         width: 0.015, 
         height: 0.015,
         className: 'highlight'
    }]  
});         

viewer.showNavigator = false;
viewer.open("test4/GeneratedImages/dzc_output.xml");
viewer.clearControls(); 

I can't get the overlay to show up using the above, what am I doing wrong? Is there a good example of initialising OpenSeadragon with an xml(dzi) with all the overlays and associated click events for the overlays ? Any code sample would be much appreciated!

1

1 Answers

1
votes

Definitely seems like it should be possible, and it seems like you're on the right track. Perhaps there's some pattern to how off the numbers are?

By the way, Seadragon Ajax has evolved a good deal since 0.8.9, and is now OpenSeadragon:

http://openseadragon.github.io/

Perhaps what you're trying to do already works with that? If not, you could file a bug there... it's actively being developed.