-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapbox-2.html
49 lines (45 loc) · 1.5 KB
/
mapbox-2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- mobile view-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Second Map</title>
<!-- bootstrap icons-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<!-- bootstrap5-->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<!-- map stylesheet-->
<link href='https://api.mapbox.com/mapbox-gl-js/v2.7.0/mapbox-gl.css' rel='stylesheet' />
<!-- css style-->
<style>
#map {
width: 400px;
height: 300px;
}
</style>
</head>
<body>
<!--
Mini - Exercise 2
Create an HTML file called mapbox-2.html
In this file, create a Mapbox map that shows Washington D.C. and places a marker on the Lincoln Memorial.
Bonus: when the marker is dragged and released, display the coordinates in an h1
-->
<section id='map' class="card m-auto mt-5"></section>
<!--map script src-->
<script src='https://api.mapbox.com/mapbox-gl-js/v2.7.0/mapbox-gl.js'></script>
<script src="js/keys.js"></script>
<!-- JS -->
<script>
"use strict";
mapboxgl.accessToken = MAPBOX_API_TOKEN;
var map = new mapboxgl.Map({
container: 'map', // container ID
style: 'mapbox://styles/mapbox/streets-v11', // style URL
center: [-77.050636, 38.889248], // starting position [lng, lat]
zoom: 15// starting zoom
});
</script>
</body>
</html>