-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
101 lines (99 loc) · 2.51 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LongdoMap-Rainviewer</title>
<script src="./lib/rainradar.js"></script>
<style type="text/css">
@import url('https://fonts.googleapis.com/css2?family=Bai+Jamjuree:ital,wght@0,200;0,400;1,200&display=swap');
html {
height: 100%;
}
body {
font-family: 'Bai Jamjuree', sans-serif;
margin: 0px;
height: 100%;
}
#map {
height: 100%;
}
.control{
padding: 10px;
}
.justify-content-center{
display: flex;
justify-content: center;
}
</style>
<script
type="text/javascript"
src="https://api.longdo.com/map/?key=4695081f1d38504afe7f6931cf375493"
></script>
</head>
<body>
<div class="control justify-content-center">
<button class="button" id="play" onclick="play()">
Play
</button>
<button class="button" id="play" onclick="radarNow()">
Now
</button>
<button class="button" onclick="previos()">
Back
</button>
<button class="button" onclick="next()">
Next
</button>
<div class="select">
<select onchange="changeOpacity(event)">
<option value="0.3">0.3</option>
<option value="0.5" selected>0.5</option>
<option value="0.6">0.6</option>
</select>
</div>
</div>
<div style="text-align: center;">
<p id="timeradar"></p>
</div>
<div id="map"></div>
</body>
<script>
var map = new longdo.Map({
placeholder: document.getElementById("map"),
});
var rainRadar = new rainradar(map,{
opacity: 0.5,
color: 2,
tileSize: 256,
speed: 500,
timeDisplay: 'timeradar'
});
function next() {
rainRadar.rainNext();
}
function previos() {
rainRadar.rainBack();
}
function radarNow() {
rainRadar.rainNow();
}
function changeOpacity(e) {
const val = e.target.value
rainRadar.setOpacity(val)
}
function play() {
const playButton = document.getElementById('play')
const isPlayed = rainRadar.playAnimation()
if(isPlayed){
playButton.innerHTML = 'Stop';
} else {
playButton.innerHTML = 'Play';
}
}
function clearLayer(){
rainRadar.clearLayers(true)
}
</script>
</html>