-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
70 lines (62 loc) · 1.91 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Display a map</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.js"></script>
<link href="https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@700&display=swap" rel="stylesheet">
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
#title {
position: fixed;
top: .25em;
left: .25em;
z-index: 10;
background: rgba(0,0,0,0.1);
padding: .5em;
font-family: 'Inter';
}
h1 {
font-size: 1.25em;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<div id="title">
<h1>SF 49 mile walk</h1>
<a href="https://projects.sfchronicle.com/total-sf/49-mile-map/">original</a>
</span>
<script>
mapboxgl.accessToken = 'pk.eyJ1Ijoiam1jYnJvb20iLCJhIjoianRuR3B1NCJ9.cePohSx5Od4SJhMVjFuCQA';
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://styles/jmcbroom/ckfu54hqc30fn1ap68x401c0g', // style URL
center: [-74.5, 40], // starting position [lng, lat]
zoom: 9, // starting zoom
maxBounds: [-122.681158, 37.589390, -122.200320, 37.914937]
});
map.addControl(
new mapboxgl.GeolocateControl({
positionOptions: {
enableHighAccuracy: true
},
trackUserLocation: true
})
);
</script>
</body>
</html>