-
Notifications
You must be signed in to change notification settings - Fork 21
/
template.html
59 lines (48 loc) · 1.71 KB
/
template.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Werejugo Results</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<script src="https://unpkg.com/[email protected]/dist/material-components-web.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="http://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="http://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="http://unpkg.com/[email protected]/L.KML.js"></script>
</head>
<body>
<div style="width: 100vw; height: 85vh" id="map"></div>
<div class="container">
<table>
<thead>
<tr>
<th>Date/Time</th>
<th>Source</th>
<th>Coordinate</th>
<th>Map Link</th>
</tr>
</thead>
<tbody>
!!!DATA!!!
</tbody>
</table>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script>
$(".switch").on("click",function() {
$($(this).closest("tr").find(".result_map")[0]).toggle()
})
</script>
<script type="text/javascript">
// Make basemap
const map = new L.Map('map', { center: new L.LatLng(58.4, 43.0), zoom: 11 });
const osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
map.addLayer(osm);
const parser = new DOMParser();
const kml = parser.parseFromString(`!!!KML!!!`, 'text/xml');
const track = new L.KML(kml);
map.addLayer(track);
const bounds = track.getBounds();
map.fitBounds(bounds);
</script>
</body>
</html>