-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvisualization_template.html
39 lines (39 loc) · 1.2 KB
/
visualization_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
<!DOCTYPE html>
<html lang="en">
<head>
<title>tpov Match Visualization</title>
<meta charset="utf-8">
<link rel="stylesheet" href="assets/leaflet/leaflet.css" />
<script src="assets/leaflet/leaflet.js"></script>
<style>
html, body {
margin: 0px;
height: 100vh;
height: 100dvh;
display: flex;
flex-direction: column;
}
#map {
flex: 1;
}
</style>
</head>
<body>
<noscript><p>JavaScript is required to use this website.</p></noscript>
<div id="map"></div>
<script>
var polyline = L.polyline (%points);
var map = L.map ("map").fitBounds (polyline.getBounds ());
L.tileLayer ("https://tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: "© <a href = 'https://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",
maxZoom: 19,
}).addTo (map);
var markers = %markers;
polyline.addTo (map);
for (var i = 0; i < markers.length; i++) {
var marker = markers [i];
L.marker ([marker.lat, marker.lon]).addTo (map).bindPopup (marker.text);
}
</script>
</body>
</html>