-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·268 lines (242 loc) · 9.49 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Drought Observe</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css" integrity="sha512-hoalWLoI8r4UszCkZ5kL8vayOGVae1oxXe/2A4AO6J9+580uKHDO3JdHb7NzwwzK5xr/Fs0W40kiNHxM9vyTtQ==" crossorigin="" />
<link rel="=stylesheet" href="./css/leaflet.fullscreen.css" />
<link rel="=stylesheet" href="./css/leaflet.zoomhome.css" />
<link rel="=stylesheet" href="./css/leaflet-search.css" />
<link rel="=stylesheet" href="./css/font-awesome.min.css" />
<script src="https://unpkg.com/leaflet@1.8.0/dist/leaflet.js" integrity="sha512-BB3hKbKWOc9Ez/TAwyWxNXeoV9c1v6FIeYiBieIWkpLjauysF18NzgR1MBNBXf8/KABdlkX68nAhlwcDFLGPCQ==" crossorigin=""></script>
<script src="./leaflet/leaflet.zoomhome.min.js" type="text/javascript"></script>
<script src="./leaflet/Leaflet.fullscreen.min.js" type="text/javascript"></script>
<script src="./leaflet/leaflet.groupedlayercontrol.min.js"></script>
<script src="https://kit.fontawesome.com/bf95ccfc20.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-annotation/2.0.1/chartjs-plugin-annotation.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/hammerjs@2.0.8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-zoom/1.2.1/chartjs-plugin-zoom.min.js" integrity="sha512-klQv6lz2YR+MecyFYMFRuU2eAl8IPRo6zHnsc9n142TJuJHS8CG0ix4Oq9na9ceeg1u5EkBfZsFcV3U7J51iew==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.bundle.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.1.slim.min.js" integrity="sha256-w8CvhFs7iHNVUtnSP0YKEg00p9Ih13rlL9zGqvLdePA=" crossorigin="anonymous"></script>
<script src="https://cdn.rawgit.com/hayeswise/Leaflet.PointInPolygon/v1.0.0/wise-leaflet-pip.js"></script>
<style>
html{
height: 100%;
margin: 0;
}
body{
min-height: 100vh;
margin: 0;
}
.leaflet-container {
height: 400px;
width: 600px;
max-width: 100%;
max-height: 100%;
}
.info-legend {
padding: 6px 8px;
font: 12px/14px Arial, Helvetica, sans-serif;
background: white;
background: rgba(255,255,255,0.8);
box-shadow: 0 0 15px rgb(0 0 0 / 20%);
border-radius: 5px;
width: 150px;
height: 150px;
}
#refreshButton {
display: flex;
align-items: center;
position: absolute;
top: 70px;
left: 60px;
width: 35px;
height: 30px;
background-color: white;
border-radius: 5px;
border-color: gray;
border-style: solid;
border-width: 1px 1px 1px 1px;
opacity: 0.6;
text-align: center;
z-index: 500;
}
#monthArea {
display: flex;
align-items: center;
position: absolute;
top: 10px;
left: 60px;
height: 20px;
background-color: white;
border-radius: 5px;
border-color: gray;
border-style: solid;
border-width: 1px 1px 1px 1px;
opacity: 0.6;
text-align: center;
z-index: 500;
}
div#chartArea {
display: inline-block;
align-items: center;
position: absolute;
bottom: 5px;
left: 1px;
right: 10px;
width: 75%;
height: 28%;
opacity: 0.8;
text-align: center;
z-index: 500;
float: left;
}
div#barArea {
font: 14px/16px Arial, Helvetica, sans-serif;
display: inline-block;
bottom: 5px;
left: 5px;
right: 10px;
width: 24%;
height: 100%;
float: right;
opacity: 0.8;
text-align: left;
z-index: 500;
}
#refreshButton:hover {
opacity: 0.8;
cursor: pointer;
}
div#map {
display: inline-block;
height: 100%;
width: 75%;
float: left;
margin-right: 0px !important;
}
div {
margin: 0;
padding: 0;
box-sizing: border-box;
}
#slide {
display: flex;
align-items: center;
position: absolute;
top: 225px;
left: 10px;
width: 140px;
height: 50px;
background-color: white;
border-radius: 5px;
border-color: gray;
border-style: solid;
border-width: 1px 1px 1px 1px;
opacity: 0.6;
text-align: center;
z-index: 500;
}
/*.btn {
display: flex;
align-items: center;
position: absolute;
bottom: 200px;
width: 30px;
height: 30px;
background-color: white;
border-radius: 5px;
border-color: gray;
border-style: solid;
border-width: 1px 1px 1px 1px;
opacity: 0.6;
text-align: center;
z-index: 500;
}
.zoom {
left: 10px;
}
.csv {
left: 50px;
}*/
.btn {
background-color: white;
border-radius: 5px;
border-color: gray;
border-style: solid;
border-width: 1px 1px 1px 1px;
opacity: 1;
float:right;
}
div#footer {
position: absolute;
width: 100%;
bottom: 0; /* stick to bottom */
background: #ddd;
}
/* Three image containers (use 25% for four, and 50% for two, etc) */
.column {
float: left;
width: 50%;
padding: 5px;
}
/* Clear floats after image containers */
.row::after {
content: "";
clear: both;
display: table;
}
</style>
</head>
<body>
<div id="map">
</div>
<div id="barArea">
<h3><label id="lblName" > Africa and Middle East </label>; <label id="lblMonth"></label></h3>
<h4 style="display:none; margin-top: -10px" id="h4Pop">Population: <label id="lblPopu">1 Billion</label></h4>
<div id="barChartArea" style="height:auto !important; min-height: 25%; margin-top: -20px">
<canvas id="barChart"></canvas>
</div>
<div id="pieChartArea" style="height: 200px !important; min-height: 10%">
<canvas id="pieChart"></canvas>
</div>
<div id="logoArea" style="height:auto !important; min-height: 5%; text-align: justify; padding: 5px">
<h5><b>Drought Observe</b> shows near real time (since 2010) drought intensity maps at monthly scale. Computed using the <b>Standardised Precipitation Actual Evapotranspiration Index (SPAEI)</b> as explained in
<a href="https://www.sciencedirect.com/science/article/pii/S2452316X16300321" target="_blank">Homdee et.al 2016</a>. The data used are monthly Actual Evapotranspiration and Interception (AETI) and Precipitation acquired from <a href="https://wapor.apps.fao.org" target="_blank">FAO WaPOR</a> database. </h5>
<br>
<div class="row">
<div class="column">
<a href="https://www.un-ihe.org" target="_blank"> <img src="img/logo1.png" alt="IHE Delft" style="width:100%"> </a>
</div>
<div class="column">
<a href="https://waterpip.un-ihe.org/" target="_blank"> <img src="img/logo3.png" alt="WaterPIP" style="width:100%"> </a>
</div>
</div>
<img src="img/logo2.png" alt="alternatetext" style="width:100%">
</div>
<br>
<i><a href="https://waterpip.un-ihe.org/" target="_blank">Read more about WaterPIP project</a></i>
</div>
<div id="chartArea" style="display:none">
<canvas id="myChart"></canvas>
<div id="chrBtns" style="display:none">
<button id="resetZoom" class="btn zoom" onclick="resetZoom()" title="Reset Zoom"><i class="fa-solid fa-arrows-rotate"></i></button>
<button id="exportCSV" class="btn csv" onclick="jsonToCSV()" title="Export to CSV"><i class="fa-solid fa-file-csv"></i></button>
</div>
</div>
<div id="monthArea">
<input type="month" id="monthsel" min="2010-01" name="monthsel" onchange="monChanged()">
</div>
<button id="refreshButton" style="display:none" onclick="refClicked()" title="Back">
<i class="fa-solid fa-left-long fa-xl"></i>
</button>
<input id="slide" title="spi Opacity" type="range" min="0" max="1" step="0.1" value="0.8" onchange="updateOpacity(this.value)"/>
<script src="./data/levelzero.js"></script>
<script src="./data/levelone.js"></script>
<script src="./js/chart.js"></script>
<script src="./js/map.js"></script>
</body>
</html>