-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapbox_maps_api.html
More file actions
44 lines (40 loc) · 1.12 KB
/
mapbox_maps_api.html
File metadata and controls
44 lines (40 loc) · 1.12 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>First Mapbox Map</title>
<!-- Mapbox CSS -->
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.css' rel='stylesheet' />
<!-- Custom CSS -->
<style>
#map {
/* the width and height may be set to any size */
width: 100%;
height: 700px;
}
</style>
<script src="js/keys.js"></script>
</head>
<body>
<h1>My First Mapbox Map!</h1>
<!-- The HTML element that serves as the Mapbox container -->
<div id='map'></div>
<!-- Mapbox JS -->
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.js'></script>
<!-- Custom JS -->
<script>
mapboxgl.accessToken = mapboxToken;
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v9',
zoom: 10,
center: [-98.4916, 29.4252]
});
geocode("6413 Clayton Ave, St. Louis, MO 63139", mapboxToken).then(function(result) {
console.log(result);
map.setCenter(result);
map.setZoom(20);
});
</script>
</body>
</html>