-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
131 lines (117 loc) · 3.98 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Radar azi test</title>
<style>
body {
overscroll-behavior-y: contain;
}
.top-left {
float: left;
width: 50%;
}
.radarimg {
float: right;
width: 50%;
}
.buttom {
float: left;
width: 50%;
}
@media only screen and (max-width:800px) {
.top-left, .radarimg, .buttom {
width: 100%;
}
}
.switch {
position: relative;
display: inline-block;
width: 30px;
height: 17px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #00cc11;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 13px;
width: 13px;
left: 2px;
bottom: 2px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #2196F3;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(13px);
-ms-transform: translateX(13px);
transform: translateX(13px);
}
</style>
</head>
<body>
<div class="container">
<div class="top-left">
<h1>Radar azi test</h1>
<div><b>Location of radar: </b></div>
<label>lat: <input id="radar_lat" type="number" value="24.99054" min="-90" max="90" onchange="draw()"></label>
<label>lon: <input id="radar_lon" type="number" value="121.01263" min="-180" max="180" onchange="draw()"></label>
<label>range: <input id="radar_range" type="number" value="150" min="0" max="1000" onchange="draw()"></label>
<br><br>
azi: <textarea id="azi" value="" rows="3" onchange="draw()">190.2 192.2 194.2 196.2 198.2 200.2 209.1 299</textarea>
<br>
</div>
<canvas class="radarimg" id="canvas" height="1000" width="1000"></canvas>
<div class="buttom">
<hr>
<h3>Change the background image</h3>
<label>img source:
<span>url</span>
<label class="switch">
<input type="checkbox" id="imgsrcswitcher">
<span class="slider"></span>
</label>
<span>local file</span><br>
</label>
<span id="toggleurl" style="display:initial">url: <input id='imgurl' type="text" value="https://www.cwa.gov.tw/Data/radar/CV1_TW_1000.png"></span>
<span id="togglelocalfile" style="display:none">local file: <input type="file" id="filein"></span>
<br>
<div>
<b>Boundaries of the image: </b>
<br>
<div>    lat_end=<input id='imglat_end' type="number" value="26.5" min="-90" max="90"></div>
<br>
<div>lon_start=<input id='imglon_start' type="number" value="118" min="-180" max="180">
lon_end=<input id='imglon_end' type="number" value="124" min="-180" max="180"></div>
<br>
<div>    lat_start=<input id='imglat_start' type="number" value="20.5" min="-90" max="90"></div>
<br>
<button onclick='changeimg()'>        change        </button>
</div>
</div>
</div><!-- container -->
<script src="index.js"></script>
</body>
</html>