2015-06-24 01:02:46 +03:00
|
|
|
<html>
|
2016-01-07 04:25:58 +03:00
|
|
|
<title>OpenSeadragon Overlay Demo</title>
|
|
|
|
<script type="text/javascript" src='../../build/openseadragon/openseadragon.js'></script>
|
|
|
|
<script type="text/javascript" src='../lib/jquery-1.9.1.min.js'></script>
|
|
|
|
<style type="text/css">
|
|
|
|
|
|
|
|
.openseadragon1 {
|
|
|
|
width: 800px;
|
|
|
|
height: 600px;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
2015-06-24 01:02:46 +03:00
|
|
|
</head>
|
|
|
|
<body>
|
2016-01-07 04:25:58 +03:00
|
|
|
<div id="contentDiv" class="openseadragon1"></div>
|
|
|
|
<div id="annotation-div">
|
2016-03-25 23:49:58 +03:00
|
|
|
<input type="button" value="Hide Overlays" id="hideOverlays">
|
2016-03-30 22:12:50 +03:00
|
|
|
<input type="button" value="Rotate" id="rotate">
|
|
|
|
<span id="degrees">0deg</span>
|
2016-01-07 04:25:58 +03:00
|
|
|
</div>
|
|
|
|
|
2015-06-24 01:02:46 +03:00
|
|
|
<script type="text/javascript">
|
2016-01-07 04:25:58 +03:00
|
|
|
|
|
|
|
var viewer = OpenSeadragon({
|
|
|
|
id: "contentDiv",
|
|
|
|
prefixUrl: "../../build/openseadragon/images/",
|
2016-03-25 23:49:58 +03:00
|
|
|
tileSources: "../data/testpattern.dzi",
|
|
|
|
minZoomImageRatio: 0,
|
2023-03-06 00:12:30 +03:00
|
|
|
maxZoomPixelRatio: 10
|
2016-01-07 04:25:58 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
viewer.addHandler("open", function(event) {
|
|
|
|
var elt = document.createElement("div");
|
2016-03-25 23:49:58 +03:00
|
|
|
elt.className = "runtime-overlay";
|
2016-01-07 04:25:58 +03:00
|
|
|
elt.style.background = "green";
|
2016-03-30 22:12:50 +03:00
|
|
|
elt.style.outline = "3px solid red";
|
|
|
|
elt.style.opacity = "0.7";
|
2016-03-25 23:49:58 +03:00
|
|
|
elt.textContent = "Scaled overlay";
|
2016-03-30 22:12:50 +03:00
|
|
|
viewer.addOverlay({
|
|
|
|
element: elt,
|
|
|
|
location: new OpenSeadragon.Rect(0.21, 0.21, 0.099, 0.099),
|
2016-04-01 16:19:40 +03:00
|
|
|
rotationMode: OpenSeadragon.OverlayRotationMode.BOUNDING_BOX
|
2016-03-30 22:12:50 +03:00
|
|
|
});
|
2016-03-25 23:49:58 +03:00
|
|
|
|
|
|
|
elt = document.createElement("div");
|
|
|
|
elt.className = "runtime-overlay";
|
|
|
|
elt.style.background = "white";
|
2016-04-01 16:19:40 +03:00
|
|
|
elt.style.outline = "3px solid red";
|
2016-03-25 23:49:58 +03:00
|
|
|
elt.style.width = "100px";
|
|
|
|
elt.textContent = "Scaled vertically";
|
|
|
|
viewer.addOverlay({
|
|
|
|
element: elt,
|
2016-03-30 22:12:50 +03:00
|
|
|
location: new OpenSeadragon.Point(0.6, 0.6),
|
|
|
|
height: 0.1,
|
2016-04-01 16:19:40 +03:00
|
|
|
placement: OpenSeadragon.Placement.TOP_LEFT,
|
|
|
|
rotationMode: OpenSeadragon.OverlayRotationMode.NO_ROTATION
|
2016-03-25 23:49:58 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
elt = document.createElement("div");
|
|
|
|
elt.className = "runtime-overlay";
|
|
|
|
elt.style.background = "white";
|
|
|
|
elt.style.opacity = "0.5";
|
2016-04-01 16:19:40 +03:00
|
|
|
elt.style.outline = "1px solid blue";
|
2016-03-25 23:49:58 +03:00
|
|
|
elt.style.height = "100px";
|
|
|
|
elt.textContent = "Scaled horizontally";
|
|
|
|
viewer.addOverlay({
|
|
|
|
element: elt,
|
2016-03-30 22:12:50 +03:00
|
|
|
location: new OpenSeadragon.Point(0.1, 0.5),
|
2016-04-01 16:19:40 +03:00
|
|
|
width: 0.1
|
2016-03-25 23:49:58 +03:00
|
|
|
});
|
2016-01-07 04:25:58 +03:00
|
|
|
|
2016-03-25 23:49:58 +03:00
|
|
|
elt = document.createElement("div");
|
|
|
|
elt.className = "runtime-overlay";
|
|
|
|
elt.style.background = "white";
|
|
|
|
elt.style.opacity = "0.5";
|
2016-04-01 16:19:40 +03:00
|
|
|
elt.style.outline = "5px solid pink";
|
2016-03-25 23:49:58 +03:00
|
|
|
elt.style.width = "100px";
|
|
|
|
elt.style.height = "100px";
|
|
|
|
elt.textContent = "Not scaled, centered in the middle";
|
|
|
|
viewer.addOverlay({
|
|
|
|
element: elt,
|
|
|
|
location: new OpenSeadragon.Point(0.5, 0.5),
|
2016-03-30 22:12:50 +03:00
|
|
|
placement: OpenSeadragon.Placement.CENTER,
|
2016-04-01 16:19:40 +03:00
|
|
|
checkResize: false,
|
|
|
|
rotationMode: OpenSeadragon.OverlayRotationMode.EXACT
|
2016-03-25 23:49:58 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
$("#hideOverlays").click(function(){
|
|
|
|
$(".runtime-overlay").toggle();
|
2016-01-07 04:25:58 +03:00
|
|
|
});
|
2016-03-30 22:12:50 +03:00
|
|
|
$("#rotate").click(function() {
|
|
|
|
viewer.viewport.setRotation(viewer.viewport.getRotation() + 22.5);
|
|
|
|
$("#degrees").text(viewer.viewport.getRotation() + "deg");
|
|
|
|
});
|
2016-01-07 04:25:58 +03:00
|
|
|
|
2015-06-24 01:02:46 +03:00
|
|
|
</script>
|
|
|
|
</body>
|
2023-03-06 00:12:30 +03:00
|
|
|
</html>
|