forked from iwpnd/tegola-example-bonn
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
45 lines (45 loc) · 1.2 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
<!DOCTYPE html>
<html>
<head>
<title>Tegola Sample</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ol.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/ol.css"
/>
<style>
#map {
width: 100%;
height: 100%;
position: absolute;
background: #f8f4f0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map = new ol.Map({
layers: [
new ol.layer.VectorTile({
source: new ol.source.VectorTile({
attributions:
'© <a href="http://www.openstreetmap.org/copyright">' +
"OpenStreetMap contributors</a>",
format: new ol.format.MVT(),
tileGrid: ol.tilegrid.createXYZ({ maxZoom: 22 }),
tilePixelRatio: 16,
url: "http://localhost:8080/maps/bonn/{z}/{x}/{y}.vector.pbf",
}),
}),
],
target: "map",
view: new ol.View({
//coordinates the map will center on initially
center: [790793.4954921771, 6574927.869849075],
zoom: 14,
}),
});
</script>
</body>
</html>