Seadragon - how toogle zoom on/off?

  • 1
  • Question
  • Updated 7 years ago
hello @ all,

i want a problem to solve.

how can i build a controll-bottom which toogle the zoom-effekt *on/off*???

thanks much for help!!!

Now i use this script:

";
document.getElementById("Scoordx").value = coordx;

document.getElementById("Scoordy").value = coordy;
document.getElementById("Pos_x").value = Pos_x;
document.getElementById("Pos_y").value = Pos_y;
}
function Positionierung () {
document.getElementById('container').onclick = Anzeige_Koordinaten;
}
window.onload = Positionierung;
var viewer = null;

function init() {
viewer = new Seadragon.Viewer("container");
viewer.addEventListener("open", addOverlays);
viewer.openDzi("/GeneratedImages/dzc_output.xml");
var controlsContainer = document.createElement("container");

/* "down" button */
var saveControlDown = makeControlDOWN();
saveControlDown.style.marginLeft="417px";
viewer.addControl(saveControlDown, Seadragon.ControlAnchor.TOP_LEFT);
/* "up" button */
var saveControlUp = makeControlUP();
saveControlUp.style.marginLeft="0px";
viewer.addControl(saveControlUp, Seadragon.ControlAnchor.TOP_LEFT);
/* "left" button */
var saveControlLeft = makeControlLEFT();
saveControlLeft.style.marginLeft="0px";
viewer.addControl(saveControlLeft, Seadragon.ControlAnchor.TOP_LEFT);
/* "right" button */
var saveControlRight = makeControlRIGHT();
saveControlRight.style.marginLeft="0px";
viewer.addControl(saveControlRight, Seadragon.ControlAnchor.TOP_LEFT);

}

var zoomfaktor = 0.1;

function goDown(event) {
viewer.viewport.panBy(new Seadragon.Point(0, -zoomfaktor));
}
function makeControlDOWN(){
var controlDOWN = document.createElement("a");
var controlImg = document.createElement('img');
controlImg.src="images/go_down.png";
controlImg.className="thumb";
controlImg.title="go down";
controlImg.onmouseover = function(event){ var img = document.getElementById('controlDOWN2').firstChild;
img.src = "images/go_down_hover.png";}
controlImg.onmouseout = function(event){ var img = document.getElementById('controlDOWN2').firstChild;
img.src = "images/go_down.png";}
controlDOWN.href = "#";
controlDOWN.id = "controlDOWN2";
controlDOWN.className = "controlDOWN";
controlDOWN.appendChild(controlImg);
Seadragon.Utils.addEvent(controlDOWN, "click", goDown);
return controlDOWN;
}

function goUp(event) {
viewer.viewport.panBy(new Seadragon.Point(0, zoomfaktor));
}
function makeControlUP(){
var controlUP = document.createElement("a");
var controlImg = document.createElement('img');
controlImg.src="images/go_up.png";
controlImg.className="thumb";
controlImg.title="go up";
controlImg.onmouseover = function(event){ var img = document.getElementById('controlUP2').firstChild;
img.src = "images/go_up_hover.png";}
controlImg.onmouseout = function(event){ var img = document.getElementById('controlUP2').firstChild;
img.src = "images/go_up.png";}
controlUP.href = "#";
controlUP.id = "controlUP2";
controlUP.className = "controlUP";
controlUP.appendChild(controlImg);
Seadragon.Utils.addEvent(controlUP, "click", goUp);
return controlUP;
}

function goLeft(event) {
viewer.viewport.panBy(new Seadragon.Point(-zoomfaktor, 0));
}
function makeControlLEFT(){
var controlLEFT = document.createElement("a");
var controlImg = document.createElement('img');
controlImg.src="images/go_left.png";
controlImg.className="thumb";
controlImg.title="go left";
controlImg.onmouseover = function(event){ var img = document.getElementById('controlLEFT2').firstChild;
img.src = "images/go_left_hover.png";}
controlImg.onmouseout = function(event){ var img = document.getElementById('controlLEFT2').firstChild;
img.src = "images/go_left.png";}
controlLEFT.href = "#";
controlLEFT.id = "controlLEFT2";
controlLEFT.className = "controlLEFT";
controlLEFT.appendChild(controlImg);
Seadragon.Utils.addEvent(controlLEFT, "click", goLeft);
return controlLEFT;
}

function goRight(event) {
viewer.viewport.panBy(new Seadragon.Point(zoomfaktor, 0));
}
function makeControlRIGHT(){
var controlRIGHT = document.createElement("a");
var controlImg = document.createElement('img');
controlImg.src="images/go_right.png";
controlImg.className="thumb";
controlImg.title="go right";
controlImg.onmouseover = function(event){ var img = document.getElementById('controlRIGHT2').firstChild;
img.src = "images/go_right_hover.png";}
controlImg.onmouseout = function(event){ var img = document.getElementById('controlRIGHT2').firstChild;
img.src = "images/go_right.png";}
controlRIGHT.href = "#";
controlRIGHT.id = "controlRIGHT2";
controlRIGHT.className = "controlRIGHT";
controlRIGHT.appendChild(controlImg);
Seadragon.Utils.addEvent(controlRIGHT, "click", goRight);
return controlRIGHT;
}
function addOverlays(viewer) {
// Overlay **********************************
var div = document.createElement("div");
var xx = document.createElement("xx");
var yy = document.createElement("yy");
xx = + "";
yy = + "";
// ClassName ändern (Verfügbar/Vergeben ---> boxen.css ****************
var zz = "" + "";
var rect = new Seadragon.Rect(xx, yy, 0.012, 0.012);
div.className = zz;

viewer.drawer.addOverlay(div, rect);

}
function switchTo(event, dzi) {
if (dzi) {
viewer.openDzi(dzi);
} else {
viewer.close();
}
// don't let the browser handle the link
Seadragon.Utils.cancelEvent(event);
}
Seadragon.Utils.addEvent(window, "load", init);
Photo of Santana

Santana

  • 1 Post
  • 0 Reply Likes

Posted 7 years ago

  • 1
Photo of Nathanael Lawrence

Nathanael Lawrence

  • 795 Posts
  • 55 Reply Likes
Hi, Santana,

The Seadragon team and their parent organization Microsoft Live Labs was disbanded in November 2010, so you may not get an answer to your question on this forum.

If you want to use something similar which one of the original Seadragon team (Ian Gilman) is helping to work on and is undergoing active development by the open source community, look up OpenSeadragon on GitHub.

If you don't mind my asking, why in the world do you want to disable zoom on a piece of software whose sole purpose is to zoom?