-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
57 lines (47 loc) · 1.27 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
<html lang="en">
<head>
<title>PTV Raster Map Leaflet Tutorial</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"/>
<link rel="icon" href="../../favicon.ico" />
<style>
body,
html {
border: 0;
padding: 0;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script type="text/javascript" src="./headerTileLayer.js"></script>
<script type="text/javascript">
const tileURL = "https://api.myptv.com/rastermaps/v1/image-tiles/{z}/{x}/{y}?size={tileSize}";
const api_key = "YOUR_API_KEY"
// Karlsruhe
const coordinate = L.latLng(49, 8.4);
const initializeMap = () => {
const map = new L.Map("map", {
center: coordinate,
zoom: 13,
zoomControl: false
});
L.control.zoom({
position: "bottomright"
}).addTo(map);
L.tileLayer(tileURL, {
attribution: "©" + new Date().getFullYear() + " PTV Logistics, HERE",
},
[
{ header: "apiKey", value: api_key },
]).addTo(map);
};
window.onload = initializeMap;
</script>
</body>
</html>