-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
57 lines (50 loc) · 1.35 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Protomaps Github Pages</title>
<link
href="https://cdn.skypack.dev/[email protected]/dist/maplibre-gl.css"
rel="stylesheet"
/>
<style>
html,
body,
#map {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
#map {
height: 60%;
width: 60%;
}
</style>
</head>
<body>
<div>Style URL: <span id="style-url"></span></div>
<div id="map"></div>
<script type="module">
import maplibregl from "https://cdn.skypack.dev/[email protected]";
import { Protocol } from "https://cdn.skypack.dev/[email protected]";
const protocol = new Protocol();
maplibregl.addProtocol("pmtiles", protocol.tile);
document.getElementById("style-url").textContent = new URL(
"./styles/light/en.json",
window.location.href,
);
var map = new maplibregl.Map({
container: "map",
style: "./styles/light/en.json",
attributionControl: {},
});
</script>
</body>
</html>