-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.html
438 lines (343 loc) · 14.7 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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<!DOCTYPE html>
<html>
<head>
<title>COVID-19 Testing Facilities</title>
<link rel="image_src" href="https://www.ineff.ch/cov19testmap/img/facilityicon.png" />
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-163208355-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-163208355-1');
</script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin="" />
<link rel="stylesheet" href="css/sidebar.css">
<link rel="stylesheet" href="css/disclaimer.css">
<style>
body {
padding: 0;
margin: 0;
}
html,
body,
#map {
height: 100%;
font: 10pt "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.boxtext {
font-style: italic;
text-align: justify;
color: #AAA;
}
th {
text-align: left;
padding: 15px;
}
td, tr {
padding: 5px;
}
</style>
</head>
<body>
<div id="boxes">
<div style="top: 50%; left: 50%; display: none;" id="dialog" class="window">
<div id="san">
<a href="#" class="close agree"><img src="img/btn_close.png" width="25"
style="float:right; margin-right: -11px; margin-top: -12px;"></a>
<br>
<h1><font color="red">WARNING</font></h1>
<b>Always call your doctor first when you suspect a COVID-19 infection. Do not visit testing facilities without being told so by a health professional!</b>
<br><br>
<b>Disclaimer:</b> The information on this map is not accurate nor does it represent any medical or safety advice. This
site is only for education purposes.
<br><br>
<a href="https://bag-coronavirus.ch/">Offical FOPH information</a>
<br><br>
<img src="img/stayhome.png" width="450">
</div>
</div>
<div style="width: 2478px; font-size: 32pt; color:white; height: 1202px; display: none; opacity: 0.4;"
id="mask"></div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.js"></script>
<script src="js/disclaimer.js"></script>
<!-- language packs -->
<script>
var language;
function getLanguage() {
(localStorage.getItem('language') == null) ? setLanguage('en') : false;
$.ajax({
url: 'language/' + localStorage.getItem('language') + '.json',
dataType: 'json', async: false, dataType: 'json',
success: function (lang) { language = lang } });
}
function setLanguage(lang) {
console.log(lang);
localStorage.setItem('language', lang);
reloadContent();
//zoom to the country
if (language.zoomto_data != null) {
if (map != null) {
map.flyTo([language.zoomto_data.lat, language.zoomto_data.lon], language.zoomto_data.zoomlevel);
}
}
}
</script>
<!-- optionally define the sidebar content via HTML markup -->
<div id="sidebar" class="leaflet-sidebar collapsed">
<!-- nav tabs -->
<div class="leaflet-sidebar-tabs">
<!-- top aligned tabs -->
<ul role="tablist">
<li><a href="#home" role="tab"><i class="fa fa-bars active"></i></a></li>
<li><a href="#autopan" role="tab"><i class="fa fa-info"></i></a></li>
</ul>
<!-- bottom aligned tabs -->
<ul role="tablist">
<li><a href="https://github.com/IneffableKoD/cov19testmap"><i class="fa fa-github"></i></a></li>
</ul>
</div>
<!-- panel content -->
<div class="leaflet-sidebar-content">
<div class="leaflet-sidebar-pane" id="home">
<h1 id="info_title" class="leaflet-sidebar-header">
<span class="leaflet-sidebar-close"><i class="fa fa-caret-left"></i></span>
</h1>
<div id="info_welcome"></div>
<p id="info_iconlegend"></p>
<table style="width:100%">
<tr>
<td width=50 ><img src="img/facilityicon.png" alt="Testing Facility Icon" width="32" height="32"></th>
<td id="info_icon1"></th>
</tr>
<tr>
<td width=50 ><img src="img/hospitalicon.png" alt="Health Facility Icon" width="32" height="32"></td>
<td id="info_icon2"></td>
</tr>
</table>
<p id="info_para1" class="boxtext"></p>
<p id="info_para2" class="boxtext"></p>
<p id="info_para3" class="boxtext"></p>
<p id="info_para4" class="boxtext"></p>
<p id="info_languageTitle" class="boxtext"></p>
<p class="boxtext">
<a href="#" onclick="setLanguage('en')" class="flag-selector"><img src="img/US_flag.png" alt="English"></a>
<a href="#" onclick="setLanguage('cz')" class="flag-selector"><img src="img/CZ_flag.png" alt="Czech"></a>
<a href="#" onclick="setLanguage('pl')" class="flag-selector"><img src="img/PL_flag.png" alt="Polish"></a>
<a href="#" onclick="setLanguage('zulu')" class="flag-selector"><img src="img/SA_flag.png" alt="Zulu"></a>
</p>
</div>
<div class="leaflet-sidebar-pane" id="autopan">
<h1 id="madeby_title" class="leaflet-sidebar-header">
<span class="leaflet-sidebar-close"><i class="fa fa-caret-left"></i></span>
</h1>
<p id="madeby_created"></p>
<p id="madeby_contributors"></p>
</div>
<div class="leaflet-sidebar-pane" id="messages">
<h1 class="leaflet-sidebar-header">Messages<span class="leaflet-sidebar-close"><i
class="fa fa-caret-left"></i></span></h1>
</div>
</div>
</div>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" crossorigin=""></script>
<script src="js/sidebar.js"></script>
<script src="geojson/testsitesCrdSrc.js" type="text/javascript"></script>
<script src="geojson/hospitalsCHEoverpassexport.js" type="text/javascript"></script>
<script src="geojson/testsitesCZE.js" type="text/javascript"></script>
<script src="geojson/testsitesZAF.js" type="text/javascript"></script>
<script src="geojson/antibodysitesCHE.js" type="text/javascript"></script>
<script src="geojson/testsitesPOL.js" type="text/javascript"></script>
<script src="geojson/testsitesSVN.js" type="text/javascript"></script>
<div id="map"></div>
<!-- language packs -->
<script>
function reloadContent() {
getLanguage();
// filling in the variable for the defined language
for (x in language) {
if (x != "zoomto_data") {
if (document.getElementById(x) != null ) {
document.getElementById(x).innerHTML = language[x];
}
}
}
};
$(document).ready(function(){
reloadContent();
});
</script>
<script>
var testIcon = L.Icon.extend({
options: {
//shadowUrl: 'iconshadow.png',
iconSize: [32, 32], // size of the icon
//shadowSize: [50, 64], // size of the shadow
//iconAnchor: [22, 94], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
//popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor
}
});
var testFacility = new testIcon({ iconUrl: 'img/facilityicon.png' }),
hospitalIcon = new testIcon({ iconUrl: 'img/hospitalicon.png' }),
antibodyFacility = new testIcon({ iconUrl: 'img/antibodyfacilityicon.png' });
// standard leaflet map setup
var map = L.map('map');
map.setView([46, 8], 6);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data © OpenStreetMap contributors'
}).addTo(map);
// create the sidebar instance and add it to the map
var sidebar = L.control.sidebar({ container: 'sidebar' })
.addTo(map)
.open('home');
// add panels dynamically to the sidebar
/* Remove options buttons
sidebar
.addPanel({
id: 'js-api',
tab: '<i class="fa fa-gear"></i>',
title: 'JS API',
pane: '<p>The Javascript API allows to dynamically create or modify the panel state.<p/><p><button onclick="sidebar.enablePanel(\'mail\')">enable mails panel</button><button onclick="sidebar.disablePanel(\'mail\')">disable mails panel</button></p><p><button onclick="addUser()">add user</button></b>',
})
// add a tab with a click callback, initially disabled
.addPanel({
id: 'mail',
tab: '<i class="fa fa-envelope"></i>',
title: 'Messages',
button: function() { alert('opened via JS callback') },
disabled: true,
})
// be notified when a panel is opened
sidebar.on('content', function (ev) {
switch (ev.id) {
case 'autopan':
sidebar.options.autopan = true;
break;
default:
sidebar.options.autopan = false;
}
});
*/
/* User Function
var userid = 0
function addUser() {
sidebar.addPanel({
id: 'user' + userid++,
tab: '<i class="fa fa-user"></i>',
title: 'User Profile ' + userid,
pane: '<p>user ipsum dolor sit amet</p>',
});
}
*/
function onEachFeature(feature, layer) {
var popupContent =
"<h2>" + feature.properties.name + "</h2>" + "<p>" +
"<b>Address</b><br>" + feature.properties.address + "<p>" +
"<b>Contact</b><br>" + feature.properties.contact + "<p>" +
"<b>Web</b><br>" + feature.properties.web + "<p>" +
"<b>Comment</b><br>" + feature.properties.comment;
if (feature.properties && feature.properties.popupContent) {
popupContent += feature.properties.popupContent;
}
layer.bindPopup(popupContent);
}
var testsitesCrdSrc = L.geoJson(testsitesCrdSrc, {
style: function (feature) {
return feature.properties && feature.properties.style;
},
onEachFeature: onEachFeature,
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: testFacility
});
}
}).addTo(map);
var hospitalsCHEoverpassexport = L.geoJson(hospitalsCHEoverpassexport, {
style: function (feature) {
return feature.properties && feature.properties.style;
},
onEachFeature: onEachFeature,
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: hospitalIcon
});
}
});
var testsitesCZE = L.geoJson(testsitesCZE, {
style: function (feature) {
return feature.properties && feature.properties.style;
},
onEachFeature: onEachFeature,
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: testFacility
});
}
}).addTo(map);
var testsitesZAF = L.geoJson(testsitesZAF, {
style: function (feature) {
return feature.properties && feature.properties.style;
},
onEachFeature: onEachFeature,
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: testFacility
});
}
}).addTo(map);
var testsitesPOL = L.geoJson(testsitesPOL, {
style: function (feature) {
return feature.properties && feature.properties.style;
},
onEachFeature: onEachFeature,
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: testFacility
});
}
}).addTo(map);
var testsitesSVN = L.geoJson(testsitesSVN, {
style: function (feature) {
return feature.properties && feature.properties.style;
},
onEachFeature: onEachFeature,
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: testFacility
});
}
}).addTo(map);
var antibodysitesCHE = L.geoJson(antibodysitesCHE, {
style: function (feature) {
return feature.properties && feature.properties.style;
},
onEachFeature: onEachFeature,
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: antibodyFacility
});
}
}).addTo(map);
//Layer Control
var baseMaps = {
'Open StreetMap': map
};
var overlayMaps = {
'Testing Facilities': testsitesCrdSrc,
'CHE Antibodytests': antibodysitesCHE,
'CZE Testing Facilities': testsitesCZE,
'ZAF Testing Facilities': testsitesZAF,
'ZAF Testing Facilities': testsitesPOL,
'ZAF Testing Facilities': testsitesSVN,
'CHE Hospitals': hospitalsCHEoverpassexport
};
L.control.layers(baseMaps, overlayMaps).addTo(map);
</script>
</body>
</html>