-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsnapshot-viewer.html
46 lines (46 loc) · 1.42 KB
/
snapshot-viewer.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"/>
<title>Snapshot {{SNAPSHOT}} – Field Papers Tiler</title>
<script src="https://unpkg.com/maplibre-gl@^5.1.0/dist/maplibre-gl.js"></script>
<link href="https://unpkg.com/maplibre-gl@^5.1.0/dist/maplibre-gl.css" rel="stylesheet" />
</head>
<body>
<div id="map" style="height:100vh;width:100vw;position:absolute;left:0;top:0;"></div>
<script>
window.addEventListener('load', function() {
var map = new maplibregl.Map({
container: 'map', // container id
style: {
"version": 8,
"sources": {
"snapshot": {
"type": "raster",
"url": window.location.origin + "/snapshots/{{SNAPSHOT}}/index.json"
}
},
"layers": [
{
"id": "snapshot",
"source": "snapshot",
"type": "raster"
}
]
},
center: [0, 0],
zoom: 1,
hash: true
});
// Add zoom and rotation controls to the map.
map.addControl(new maplibregl.NavigationControl({
visualizePitch: true,
showZoom: true,
showCompass: true
}));
map.fitBounds({{BOUNDS}});
});
</script>
</body>
</html>