-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
65 lines (53 loc) · 1.4 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>MapLibre GL JS Versatiles Styler</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<script src="https://tiles.versatiles.org/assets/maplibre/maplibre-gl.js"></script>
<link href="https://tiles.versatiles.org/assets/maplibre/maplibre-gl.css" rel="stylesheet">
<script src="dist/maplibre-gl-versatiles-styler.js"></script>
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
#logo {
position: absolute;
top: 1em;
left: 1em;
z-index: 1;
}
#logo img {
width: 3em;
}
</style>
</head>
<body>
<div id="map" class="maplibregl-compact"></div>
<script>
const map = new maplibregl.Map({
container: 'map',
bounds: [-180, -80, 180, 80],
zoom: 5,
maxZoom: 20,
hash: true,
});
map.addControl(new maplibregl.NavigationControl(), 'top-left');
map.addControl(new VersatilesStyler({
tiles: ['https://tiles.versatiles.org/tiles/osm/{z}/{x}/{y}'],
sprite: 'https://tiles.versatiles.org/assets/sprites/sprites',
glyphs: 'https://tiles.versatiles.org/assets/fonts/{fontstack}/{range}.pbf',
open: true,
}));
// collapse attribution control
document.getElementsByClassName('maplibregl-ctrl-attrib')[0].classList.remove('maplibregl-compact-show');
</script>
</body>
</html>