-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
72 lines (63 loc) · 1.5 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
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>TrailMap - USTP CDO</title>
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<link rel="icon" href="icon.png">
<script src="https://cdn.maptiler.com/maplibre-gl-js/v1.13.0-rc.4/mapbox-gl.js"></script>
<link href="https://cdn.maptiler.com/maplibre-gl-js/v1.13.0-rc.4/mapbox-gl.css" rel="stylesheet" />
<style>
#map {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.marker {
background-size: cover;
width: 50px;
height: 50px;
border-radius: 50%;
cursor: pointer;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
// Temporary access token
const token = 'i18W7fGAdJySy2z6con5';
// Map configuration
const map = new mapboxgl.Map({
container: 'map',
style: `https://api.maptiler.com/maps/topo-v2/style.json?key=${token}`,
minZoom: 5,
maxZoom: 20,
pitch: 30,
center: [124.656, 8.485],
});
// Add geolocate control to the map.
map.addControl(
new mapboxgl.GeolocateControl({
positionOptions: {
enableHighAccuracy: true
},
trackUserLocation: true
})
);
map.on('load', function () {
map.fitBounds([
[124.65466898725411, 8.487184535194167],
[124.6588773916622, 8.484294026410323]
]);
// Add marker
const marker = new mapboxgl.Marker().setLngLat([124.6567, 8.485827379457602]).addTo(map);
});
</script>
</body>
</html>