-
Notifications
You must be signed in to change notification settings - Fork 0
/
globepage.html
256 lines (205 loc) · 5.55 KB
/
globepage.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>The Urban Digital Twins Observatory</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<!-- Replace your_access_token with your Mapbox access token -->
<script src='https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.mapboxgl-popup {
max-width: 80%;
color: #371d6d;
font: 8px/12px 'Helvetica Neue', Arial, Helvetica, sans-serif;
}
/* Style the menu bar */
/* Reset default styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Set body font and background color */
body {
font-family: sans-serif;
background-color: #000;
color: #fff;
}
/* Create a responsive grid layout */
.grid {
display: flex;
flex-wrap: wrap;
}
.grid > * {
width: 100%;
}
@media (min-width: 600px) {
.grid > * {
width: 50%;
}
}
@media (min-width: 900px) {
.grid > * {
width: 33.3333%;
}
}
/* Style the header and navigation */
header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px;
}
header h1 {
margin: 0;
font-size: 2em;
text-transform: uppercase;
letter-spacing: 2px;
}
nav ul {
display: flex;
list-style: none;
}
nav li {
margin: 0 10px;
}
nav a {
color: #fff;
text-decoration: none;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 1px;
transition: color 0.2s;
}
nav a:hover {
color: #0af;
}
/* Style the main content */
main {
padding: 20px;
}
/* Style the footer */
footer {
display: flex;
bottom: 0;
align-items: center;
justify-content: space-between;
background-color: #111;
color: #fff;
padding: 20px;
}
/* Add hover effects to buttons */
button {
background-color: #0af;
border: none;
color: #fff;
cursor: pointer;
padding: 10px 20px;
font-size: 1em;
transition: background-color 0.2s;
}
button:hover {
background-color: #00f;
}
/* Add responsive design styles */
@media (max-width: 600px) {
nav ul {
flex-direction: column;
}
nav li {
margin: 10px 0;
}
}
section {
padding-top: 20px;
padding-bottom: 40px;
}
header img {
width: 200px;
float: left;
margin-right: 10px;
}
#map {
width: 100%; /* Make the map fill the container */
height: 100%;
top: 80px;
bottom: 50px;
}
</style>
</head>
<body>
<header>
<!-- img src="logo.png" alt="Urban Digital Twin Observatory Logo"> -->
<h1>The Urban Digital Twin Observatory</h1>
<nav>
<ul>
<li><a href="index.html#about">About</a></li>
<li><a href="index.html#guide">Guide</a></li>
<li><a href="index.html#initiatives">Initiatives</a></li>
<li><a href="index.html">Globe</a></li>
<li><a href="index.html#contact">Contact</a></li>
</ul>
</nav>
</header>
<main>
<div id='map'></div>
</div>
</main>
<footer>
<!-- Add footer content here -->
</footer>
</body>
</html>
<script>
// Initialize the map with your access token and any other options you want to set
mapboxgl.accessToken = 'pk.eyJ1IjoiYnJ1bm9hdmlsYTUiLCJhIjoiY2xjaG8wYXdrMDc1cjNwcGc0eHFzMzFjNCJ9.-9d_9l2VbCQYaBc81rGhFA';
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://styles/brunoavila5/clchoqkp7000215p105biswev', // style URL
center: [-25, 20], // starting position [lng, lat]
zoom: 2 // starting zoom
});
// Add zoom and rotation controls to the map.
map.addControl(new mapboxgl.NavigationControl());
map.on('style.load', () => {
map.setFog({
color: 'rgb(186, 210, 235)', // Lower atmosphere
'high-color': 'rgb(36, 92, 223)', // Upper atmosphere
'horizon-blend': 0.005, // Atmosphere thickness (default 0.2 at low zooms)
'space-color': 'rgb(11, 11, 25)', // Background color
'star-intensity': 0.3 // Background star brightness (default 0.35 at low zoooms )
});
});
map.on('click', (event) => {
// If the user clicked on one of your markers, get its information.
const features = map.queryRenderedFeatures(event.point, {
layers: ['symbols'] // replace with your layer name
});
if (!features.length) {
return;
}
const feature = features[0];
const popup = new mapboxgl.Popup({ offset: [0, -15] })
.setLngLat(feature.geometry.coordinates)
.setHTML(
`<h3>${feature.properties.Initiative}</h3>
<p>City/Region: ${feature.properties.City}</p>
<p>Country: ${feature.properties.Country}</p>
<p>Region: ${feature.properties.Region}</p>
<p>Scale: ${feature.properties.Scale}</p>
<p>Ownership: ${feature.properties.Ownership}</p>
<p>Operator: ${feature.properties.Operator}</p>
<p>Main Use Cases: ${feature.properties.MainUseCases}</p>
<p><a href=${feature.properties.Reference} target="_blank">Reference</a></p>
<p><a href=${feature.properties.Website} target="_blank">Direct Website (if existant)</a></p>`
)
// If wanted, an image can be added in the poup e.g. src=${feature.properties.Image}
// <img src='https://www.esri.com/content/dam/esrisites/en-us/digital-twin/assets/digital-twin-banner-foreground.png' width="250" height="150" alt="image">
.addTo(map);
});
</script>
</body>
</html>