-
Notifications
You must be signed in to change notification settings - Fork 0
/
HE-deneme.html
100 lines (73 loc) · 2.79 KB
/
HE-deneme.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<html> <!-- do not use <!DOCTYPE html> -->
<head>
<title>HE deneme</title>
<script src="./openseadragon/openseadragon.min.js"></script>
<!-- OpenSeadragon annotations -->
<script src="./openseadragon-annotations/dist/openseadragon-annotations.js"></script>
<style>
.loading {
position: absolute;
left: 50px;
top: 50px;
font-size: 30px;
z-index: 10;
}
</style>
</head>
<body>
<div id="openseadragon1" style="width: 100%; height: 95%;"></div>
<div class="loading">LOADING!</div>
<script type="text/javascript">
var viewer = OpenSeadragon({
id: 'openseadragon1',
// prefixUrl: 'https://images.patolojiatlasi.com/openseadragon/images/',
prefixUrl: './openseadragon/images/',
tileSources: {
Image: {
Url: './HE2_files/', // name of image folder
TileSize: '254', // see .dzi file
Overlap: '1', // see .dzi file
Format: 'jpeg', // see .dzi file
ServerFormat: 'Default', // optional
xmlns: 'http://schemas.microsoft.com/deepzoom/2008', // see .dzi file
Size: {
Width: '13198', // see .dzi file
Height: '11685' // see .dzi file
}
}
}
});
viewer.initializeAnnotations();
function areAllFullyLoaded() {
var tiledImage;
var count = viewer.world.getItemCount();
for (var i = 0; i < count; i++) {
tiledImage = viewer.world.getItemAt(i);
if (!tiledImage.getFullyLoaded()) {
return false;
}
}
return true;
}
var isFullyLoaded = false;
function updateLoadingIndicator() {
// Note that this function gets called every time isFullyLoaded changes, which it will do as you
// zoom and pan around. All we care about is the initial load, though, so we are just hiding the
// loading indicator and not showing it again.
if (isFullyLoaded) {
document.querySelector('.loading').style.display = 'none';
}
}
viewer.world.addHandler('add-item', function (event) {
var tiledImage = event.item;
tiledImage.addHandler('fully-loaded-change', function () {
var newFullyLoaded = areAllFullyLoaded();
if (newFullyLoaded !== isFullyLoaded) {
isFullyLoaded = newFullyLoaded;
updateLoadingIndicator();
}
});
});
</script>
</body>
</html>