-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapbox.html
More file actions
54 lines (47 loc) · 1.32 KB
/
mapbox.html
File metadata and controls
54 lines (47 loc) · 1.32 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
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>First Mapbox Map</title>
<!-- Mapbox CSS -->
<link href='https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.css' rel='stylesheet' />
<!-- Custom CSS -->
<style>
#map {
/* the width and height may be set to any size */
width: 100%;
height: 700px;
}
</style>
</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.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.js'></script>
<!-- Custom JS -->
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoibGV4aWJvciIsImEiOiJjbGQ2bWE2bzMxZGJwM3lyeTh1czNzMGE3In0.tqgNGUXlJUn8N9qqHgOHVw'
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v9',
zoom: 10,
center: [-98.4916, 29.4252]
});
//ALAMO MARKER
var marker = new mapboxgl.Marker()
.setLngLat([-98.4916, 29.4260])
.addTo(map);
//ALAMO POPUP
var alamoPopup = new mapboxgl.Popup()
.setHTML("<p>Remember The Alamo!</p>")
marker.setPopup(alamoPopup)
//CODEUP POPUP
// var popup = new mapboxgl.Popup()
// .setLngLat([-98.489615, 29.426827])
// .setHTML("<p>Codeup Rocks!</p>")
// .addTo(map)
</script>
</body>
</html>