An open-source, web-based viewer for zoomable images, implemented in pure JavaScript.
The relevant HTML (for the toolbar and for the OSD initialization) is here:
<div id="toolbar">
<div id="logo_div" style="max-height: 50px !important; display: inline-block">
<a id="logo" href="https://davisthompsonfoundation.org">
<img class="dtfLogo" src="..." alt="Davis Thompson Logo" style="max-height:50px !important;">
</a>
</div>
<svg id="fullscreen" fill="#fff" style="height: 40px;" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">...</svg></span>
<svg id="zoomIn" class="w-6 h-6" style="height: 40px;" fill="#FFF" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">...</svg>
<svg id="zoomOut" class="w-6 h-6" fill="#FFF" style="height: 40px;" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">...</svg>
...
</div>
...
<script>
...
var viewer = OpenSeadragon({
id: "openseadragon1",
prefixUrl: "https://cdnjs.cloudflare.com/ajax/libs/openseadragon/2.4.2/images/",
navigatorAutoFade: false,
showNavigator: true,
zoomInButton: "zoomIn",
zoomOutButton: "zoomOut",
homeButton: "home",
fullPageButton: "fullscreen",
gestureSettingsTouch: {
pinchRotate: true
},
success: function(event) {
imageDone = true;
},
tileSources: {
...
}
});
(... inserted for portions trimmed out for clarity)
@PrafulB - thanks for the workaround! @iangilman - when I get a little more time, I'll work on a stripped-down version. Unfortunately, I'm a pathologist who knows computers some, so my code is... not great... :) And, I swear I had it working before.
Anyways - thanks to everyone who works on OSD - I've stopped being surprised at how often I see it in various whole-slide imaging implementations (including ours!). It's a great piece of software, and being open-source is great.
Hello
I have small problem.
Trying to add overlay points to an image that is taller than it is wider. I do this with the help of the command:
viewer.addOverlay(element, new OpenSeadragon.Point(x, y));
In case the value of x is greater than 1 - there is no problem. The overlay is simply displayed outside the borders of the image. However, when y is greater than 1, even being inside the image borders, it is displayed as if it had a value of 1. So:
viewer.addOverlay(element, new OpenSeadragon.Point(0.1, 1.25));
looks like
viewer.addOverlay(element, new OpenSeadragon.Point(0.1, 1));
What could this be due to?