-
Notifications
You must be signed in to change notification settings - Fork 0
/
weather_map.html
136 lines (135 loc) · 5.93 KB
/
weather_map.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Weather Map</title>
<link rel="stylesheet" href="css/weather_map.css">
<!-- Mapbox CSS -->
<script src="js/keys.js"></script>
<script src='https://api.mapbox.com/mapbox-gl-js/v2.14.1/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v2.14.1/mapbox-gl.css' rel='stylesheet'/>
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.7.0/mapbox-gl-geocoder.min.js'></script>
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.7.0/mapbox-gl-geocoder.css' type='text/css' />
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
</head>
<body>
<!--Navbar-->
<nav class="navbar navbar-expand-lg bg-primary">
<div class="container-fluid">
<a class="navbar-brand bg-primary text-white" href="#">Weather App</a>
<span id="current-city" class="navbar-text bg-primary text-white">
current city: San Antonio
</span>
</div>
</nav>
<!--Specify City-->
<form class="d-flex p-4" role="search">
<input class="form-control me-2" type="search" aria-label="Search">
<button class="btn btn-outline-success btn-primary bg-primary text-white" type="submit">Find</button>
</form>
<!-- The HTML element that serves as the Mapbox container -->
<div id="weather"></div>
<!--5-day Weather Forecast-->
<div id="fiveDay" class="row row-cols-1 row-cols-md-5 g-4 p-4">
<div class="col-sm-6 mb-3 mb-sm-0">
<div class="card">
<div id="date-1" class="card-header bg-transparent"></div>
<div id="max-min-1" class="card-body">
<h5 class="card-title"></h5>
</div>
<div class="card-footer bg-transparent">
<p id="desc-1" class = "card-text-description">Description:</p>
<p id="hum-1" class="card-text">Humidity:</p>
</div>
<div id="wind-1" class="card-footer bg-transparent">Wind:</div>
<div id="pressure-1" class="card-footer bg-transparent">Pressure:</div>
</div>
</div>
<div class="col-sm-6">
<div class="card">
<div id="date-2" class="card-header bg-transparent"></div>
<div id="max-min-2" class="card-body">
<h5 class="card-title"></h5>
</div>
<div class="card-footer bg-transparent">
<p id="desc-2" class = "card-text-description">Description:</p>
<p id="hum-2" class="card-text">Humidity:</p>
</div>
<div id="wind-2" class="card-footer bg-transparent">Wind:</div>
<div id="pressure-2" class="card-footer bg-transparent">Pressure:</div>
</div>
</div>
<div class="col-sm-6">
<div class="card">
<div id="date-3" class="card-header bg-transparent"></div>
<div id="max-min-3" class="card-body">
<h5 class="card-title"></h5>
</div>
<div class="card-footer bg-transparent">
<p id="desc-3" class = "card-text-description">Description:</p>
<p id="hum-3" class="card-text">Humidity:</p>
</div>
<div id="wind-3" class="card-footer bg-transparent">Wind:</div>
<div id="pressure-3" class="card-footer bg-transparent">Pressure:</div>
</div>
</div>
<div class="col-sm-6">
<div class="card">
<div id="date-4" class="card-header bg-transparent"></div>
<div id="max-min-4" class="card-body">
<h5 class="card-title"></h5>
</div>
<div class="card-footer bg-transparent">
<p id="desc-4" class = "card-text-description">Description:</p>
<p id="hum-4" class="card-text">Humidity:</p>
</div>
<div id="wind-4" class="card-footer bg-transparent">Wind:</div>
<div id="pressure-4" class="card-footer bg-transparent">Pressure:</div>
</div>
</div>
<div class="col-sm-6">
<div class="card">
<div id="date-5" class="card-header bg-transparent"></div>
<div id="max-min-5" class="card-body">
<h5 class="card-title"></h5>
</div>
<div class="card-footer bg-transparent">
<p id="desc-5" class = "card-text-description">Description:</p>
<p id="hum-5" class="card-text">Humidity:</p>
</div>
<div id="wind-5" class="card-footer bg-transparent">Wind:</div>
<div id="pressure-5" class="card-footer bg-transparent">Pressure:</div>
</div>
</div>
</div>
<!--Mapbox-->
<div id='map'></div>
<script>
mapboxgl.accessToken = MAPBOX_API_KEY;
const map = new mapboxgl.Map({
container: 'map', // container ID
style: 'mapbox://styles/mapbox/streets-v12', // style URL
zoom: 10, // starting zoom
center: [-98.4916, 29.4252] // [lng, lat]
});
const marker = new mapboxgl.Marker()
.setLngLat([-98.4916, 29.4260])
.addTo(map);
const geocoder = new MapboxGeocoder({
// Initialize the geocoder
accessToken: mapboxgl.accessToken, // Set the access token
mapboxgl: mapboxgl, // Set the mapbox-gl instance
marker: false // Do not use the default marker style
});
// Add the geocoder to the map
map.addControl(geocoder);
</script>
<!-- Custom JS -->
<script src="js/weather_map.js"></script>
<script src="js/weather-utils.js"></script>
<!--<script src="css/weather_map.css"></script>-->
<!--Bootstrap JS-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</body>
</html>