-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapbox-3.html
More file actions
48 lines (41 loc) · 1.53 KB
/
mapbox-3.html
File metadata and controls
48 lines (41 loc) · 1.53 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Third Mapbox Mini Exercise</title>
<link href='https://api.mapbox.com/mapbox-gl-js/v2.4.1/mapbox-gl.css' rel='stylesheet' />
<style>
#map {
width: 800px;
height: 800px;
}
</style>
</head>
<body>
<h1>Marker Coordinates: <span id="coordinates"></span></h1>
<div id="map"></div>
<script src='https://api.mapbox.com/mapbox-gl-js/v2.4.1/mapbox-gl.js'></script>
<script src="js/mapbox-geocode-utils.js"></script>
<script src="js/keys.js"></script>
<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: [-98.4916, 29.4252], // starting position [lng, lat]
zoom: 10 // starting zoom
});
// geocode('Whitefish, Montana', MAPBOX_API_TOKEN).then(function(results) {
// console.log(results);
// map.setCenter(results);
// });
//
// reverseGeocode({lng: -157.8060, lat: 21.2620}, MAPBOX_API_TOKEN).then(function(results) {
// console.log(results);
// });
</script>
</body>
</html>
<!--Instructions for third mini exercise-->
<!--Create a file called mapbox-3.html centered on San Antonio that is re-centered over whitefish, montana using the coordinates from geocoding the physical address. use reverse geocoding with the reverseGeocode function to determine what is at 21.2620 latitude and -157.8060 longitude.-->