2013-06-28 23:44:38 +04:00
|
|
|
<!DOCTYPE html>
|
2013-05-20 21:44:36 +04:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>OpenSeadragon Basic Demo</title>
|
2013-06-11 04:23:09 +04:00
|
|
|
<script type="text/javascript" src='../../build/openseadragon/openseadragon.js'></script>
|
|
|
|
<script type="text/javascript" src='../lib/jquery-1.9.1.min.js'></script>
|
2013-05-20 21:44:36 +04:00
|
|
|
<style type="text/css">
|
|
|
|
|
|
|
|
.openseadragon1 {
|
|
|
|
width: 800px;
|
|
|
|
height: 600px;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div>
|
|
|
|
Simple demo page to show a default OpenSeadragon viewer.
|
|
|
|
</div>
|
|
|
|
<div id="contentDiv" class="openseadragon1"></div>
|
2013-10-04 01:26:44 +04:00
|
|
|
<div>
|
|
|
|
<table border="1">
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th>Window (pixel)</th>
|
|
|
|
<th>Container (pixel)</th>
|
|
|
|
<th>Image (pixel)</th>
|
|
|
|
<th>Viewport (point)</th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Cursor position</th>
|
|
|
|
<td id="windowPosition"></td>
|
|
|
|
<td id="containerPosition"></td>
|
|
|
|
<td id="imagePosition"></td>
|
|
|
|
<td id="viewportPosition"></td>
|
|
|
|
<tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
2013-05-20 21:44:36 +04:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
var viewer = OpenSeadragon({
|
2013-05-21 22:06:03 +04:00
|
|
|
// debugMode: true,
|
|
|
|
id: "contentDiv",
|
|
|
|
prefixUrl: "../../build/openseadragon/images/",
|
2013-07-01 20:55:58 +04:00
|
|
|
tileSources: "../data/testpattern.dzi",
|
2013-06-08 20:03:51 +04:00
|
|
|
showNavigator:true
|
2013-05-20 21:44:36 +04:00
|
|
|
});
|
|
|
|
|
2013-10-04 01:26:44 +04:00
|
|
|
function pointToString(point) {
|
|
|
|
return point.x.toPrecision(4) + "," + point.y.toPrecision(4);
|
|
|
|
}
|
|
|
|
|
|
|
|
var onMouseTrackerMove = function(eventSender, eventData) {
|
|
|
|
var viewerX = eventData.position.x;
|
|
|
|
var viewerY = eventData.position.y;
|
|
|
|
var windowPoint = new OpenSeadragon.Point(viewerX, viewerY);
|
|
|
|
$("#windowPosition").text( pointToString(windowPoint));
|
|
|
|
|
|
|
|
var containerPoint = windowPoint.minus(
|
|
|
|
OpenSeadragon.getElementPosition(viewer.element));
|
|
|
|
$("#containerPosition").text( pointToString(containerPoint));
|
|
|
|
|
|
|
|
var imagePoint = viewer.viewport.windowToImageCoordinates(windowPoint);
|
|
|
|
$("#imagePosition").text( pointToString(imagePoint));
|
|
|
|
|
|
|
|
var viewportPoint = viewer.viewport.windowToViewportCoordinates(windowPoint);
|
|
|
|
$("#viewportPosition").text( pointToString(viewportPoint));
|
|
|
|
};
|
|
|
|
|
|
|
|
mouseTracker = new OpenSeadragon.MouseTracker({
|
|
|
|
element: document,
|
|
|
|
moveHandler: onMouseTrackerMove
|
|
|
|
}).setTracking(true);
|
|
|
|
|
2013-05-20 21:44:36 +04:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|