-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbasicexample_canvas.html
82 lines (67 loc) · 2.1 KB
/
basicexample_canvas.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, user-scalable=0"
/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="example.css" />
<!-- <script async type="text/javascript" src="http://localhost:3000/script/peakfinder.1.0.min.js"></script> -->
<script async type="text/javascript" src="https://www.peakfinder.com/script/peakfinder.1.0.min.js"></script>
</head>
<body>
<div class="container">
<header>
<img
id="logo"
src="https://www.peakfinder.com/peakfinder.svg"
alt="PeakFinder Logo"
title="PeakFinder Logo"
height="30"
width="208"
/>
<br />
Demo Page
</header>
<div class="content">
<canvas id="pfcanvas" oncontextmenu="event.preventDefault()"> </canvas>
<div id="pfcanvasprogress">
<div class="spinner" id="spinner">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>
</div>
</div>
<footer>
<p>Footer</p>
</footer>
</div>
<script type="text/javascript">
window.onload = () => {
if (PeakFinder.utils.caniuse()) {
let panel = new PeakFinder.PanoramaPanel({
canvasid: 'pfcanvas',
locale: 'en'
}) // attach to canvas
panel.addEventListener('viewpointjourney finished', function (args) {
console.log('viewpointjourney finished' + args)
})
panel.init(function() {
console.log('ready')
panel.settings.distanceUnit(1)
panel.loadViewpoint(46.53722, 8.12610, 'Finsteraarhorn')
// animate to view
panel.azimut(209.0, 2.0)
panel.altitude(1.0, 1.0)
panel.fieldofview(45.0, 2.0)
});
}
else { // !caniuse
}
}
</script>
</body>
</html>