forked from amosproj/amos2021ss05-3d-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
86 lines (80 loc) · 3.23 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Minimal Outside</title>
<style>
iframe#amos {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100vw;
height: 100vh;
margin: 0;
border: 0;
padding: 0;
overflow: hidden;
}
a {
position: absolute;
z-index: 199;
background-color: lightgray;
padding: 10px;
}
</style>
</head>
<body>
<iframe id="amos"></iframe>
<script type="module">
import { POIConverter } from './src/js/POIConverter.js'
// Callback function to start viewer via viewerAsync
window.parent = {
callback: function(viewerWindow, viewerAsync) {
console.info("initial callback called:", viewerWindow, viewerAsync);
viewerAsync("../assets/", (api) => {
console.info("loaded callback called with API:", api);
// set starting picture to right location
api.panoProp.viewerViewState.setLatov(0);
api.panoProp.viewerViewState.setLonov(295);
api.panoProp.viewerViewState.fov = 100;
api.move(11.111107794018679, 49.461045692915604, 0);
// Create div for POI description overlays (hidden for now)
api.jQuery('<div>', {
id: 'poi-desc',
}).appendTo('#pano-viewer');
api.jQuery("#poi-desc")
.css("background-color", "white")
.css("position", "fixed")
.css("width", "60%")
.css("height", "60%")
.css("top", "50%")
.css("left", "50%")
.css("margin-top", "-30%")
.css("margin-left", "-30%")
.css("border-radius", "4%")
.css("display", "none")
.css("display", "none");
// TODO: read in one by one poi_geo and at each converted coords create (small) EventMesh that has on_click to open POI and maybe on_hover to show name
// or maybe only on_hover show div with content of descrX.txt
var txt = '';
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
if (xmlhttp.status == 200 && xmlhttp.readyState == 4){
txt = xmlhttp.responseText;
let poic = new POIConverter(txt, api);
poic.insertObjectsInScene();
}
};
xmlhttp.open("GET","pois/poi_geo.txt", true);
xmlhttp.send();
});
}
};
// start src/index.html
document.getElementById('amos').setAttribute('src', "./src/index.html?onload=window.parent.callback");
</script>
<a href="pois/Station 1/affenpuzzle/index.html">Weitere Stationen</a>
</body>
</html>