Spaces:
Running
Running
Update index.html
Browse files- index.html +260 -359
index.html
CHANGED
@@ -3,418 +3,319 @@
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>GCP
|
7 |
<script src="https://cesium.com/downloads/cesiumjs/releases/1.117/Build/Cesium/Cesium.js"></script>
|
8 |
<link href="https://cesium.com/downloads/cesiumjs/releases/1.117/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
|
9 |
<style>
|
10 |
-
html, body {
|
11 |
width: 100%;
|
12 |
height: 100%;
|
13 |
margin: 0;
|
14 |
padding: 0;
|
15 |
-
overflow: hidden;
|
16 |
font-family: sans-serif;
|
17 |
}
|
18 |
-
#cesiumContainer {
|
19 |
-
width: 100%;
|
20 |
-
height: 100%;
|
21 |
-
/* visibility: visible !important; Ensure it's not hidden by other styles */
|
22 |
-
/* background-color: lightblue; Add a temporary background to see if the div itself is rendered */
|
23 |
-
}
|
24 |
#controls {
|
25 |
position: absolute;
|
26 |
top: 10px;
|
27 |
left: 10px;
|
28 |
-
background: rgba(40, 40, 40, 0.
|
29 |
-
padding: 12px;
|
30 |
-
border-radius: 8px;
|
31 |
-
color: white;
|
32 |
-
z-index: 10; /* Ensure it's above the map */
|
33 |
-
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
|
34 |
-
}
|
35 |
-
#controls label {
|
36 |
-
margin-right: 8px;
|
37 |
-
font-weight: bold;
|
38 |
-
}
|
39 |
-
#acceleratorSearch {
|
40 |
-
padding: 8px;
|
41 |
-
border-radius: 4px;
|
42 |
-
border: 1px solid #555;
|
43 |
-
background-color: #333;
|
44 |
-
color: white;
|
45 |
-
width: 250px; /* Adjust as needed */
|
46 |
-
}
|
47 |
-
#infoBox {
|
48 |
-
position: absolute;
|
49 |
-
bottom: 20px; /* Increased spacing */
|
50 |
-
left: 10px;
|
51 |
-
background: rgba(40, 40, 40, 0.85);
|
52 |
padding: 15px;
|
53 |
border-radius: 8px;
|
54 |
color: white;
|
|
|
|
|
55 |
z-index: 10;
|
56 |
-
max-width: 350px; /* Slightly wider */
|
57 |
-
display: none; /* Hidden by default */
|
58 |
-
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
|
59 |
}
|
60 |
-
#
|
61 |
margin-top: 0;
|
62 |
-
margin-bottom: 10px;
|
63 |
-
border-bottom: 1px solid #555;
|
64 |
-
padding-bottom: 5px;
|
65 |
}
|
66 |
-
#
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
list-style-type: none;
|
71 |
-
padding-left: 0;
|
72 |
-
max-height: 150px; /* Prevent very long lists */
|
73 |
-
overflow-y: auto; /* Add scroll for long lists */
|
74 |
}
|
75 |
-
#
|
76 |
-
|
77 |
}
|
78 |
</style>
|
79 |
</head>
|
80 |
<body>
|
81 |
<div id="cesiumContainer"></div>
|
82 |
<div id="controls">
|
83 |
-
<
|
84 |
-
<
|
85 |
-
|
86 |
-
<div id="infoBox">
|
87 |
-
<h3>Location Details</h3>
|
88 |
-
<p id="locationName"></p>
|
89 |
-
<p><strong>Region ID(s):</strong> <span id="regionId"></span></p>
|
90 |
-
<p><strong>Zone(s):</strong> <span id="zoneId"></span></p>
|
91 |
-
<p><strong>Available Accelerators here:</strong></p>
|
92 |
-
<ul id="acceleratorList"></ul>
|
93 |
</div>
|
94 |
|
95 |
<script>
|
96 |
-
// ---
|
97 |
-
|
98 |
-
"Council Bluffs, Iowa, USA": { lat: 41.2619, lon: -95.8608 },
|
99 |
-
"Eemshaven, Netherlands": { lat: 53.442, lon: 6.83 },
|
100 |
-
"Changhua County, Taiwan": { lat: 24.0706, lon: 120.5417 },
|
101 |
-
"Columbus, Ohio, USA": { lat: 39.9612, lon: -82.9988 },
|
102 |
-
"Dallas, Texas, USA": { lat: 32.7767, lon: -96.7970 },
|
103 |
-
"The Dalles, Oregon, USA": { lat: 45.5946, lon: -121.1787 },
|
104 |
-
"Las Vegas, Nevada, USA": { lat: 36.1699, lon: -115.1398 },
|
105 |
-
"St. Ghislain, Belgium": { lat: 50.446, lon: 3.82 },
|
106 |
-
"Jurong West, Singapore": { lat: 1.3398, lon: 103.7053 },
|
107 |
-
"Moncks Corner, South Carolina, USA": { lat: 33.1913, lon: -80.0195 },
|
108 |
-
"Ashburn, Virginia, USA": { lat: 39.0438, lon: -77.4874 },
|
109 |
-
"Tokyo, Japan": { lat: 35.6895, lon: 139.6917 },
|
110 |
-
"Sydney, Australia": { lat: -33.8688, lon: 151.2093 },
|
111 |
-
"Toronto, Ontario, Canada": { lat: 43.6532, lon: -79.3832 },
|
112 |
-
"Seoul, South Korea": { lat: 37.5665, lon: 126.9780 },
|
113 |
-
"Mumbai, India": { lat: 19.0760, lon: 72.8777 },
|
114 |
-
"London, UK": { lat: 51.5074, lon: -0.1278 },
|
115 |
-
"Frankfurt, Germany": { lat: 50.1109, lon: 8.6821 },
|
116 |
-
"Salt Lake City, Utah, USA": { lat: 40.7608, lon: -111.8910 },
|
117 |
-
"Hong Kong": { lat: 22.3193, lon: 114.1694 },
|
118 |
-
"Jakarta, Indonesia": { lat: -6.2088, lon: 106.8456 },
|
119 |
-
"Warsaw, Poland": { lat: 52.2297, lon: 21.0122 },
|
120 |
-
"Tel Aviv, Israel": { lat: 32.0853, lon: 34.7818 },
|
121 |
-
"Osasco, São Paulo, Brazil": { lat: -23.5325, lon: -46.7917 },
|
122 |
-
"Montréal, Québec, Canada": { lat: 45.5017, lon: -73.5673 },
|
123 |
-
"Los Angeles, California, USA": { lat: 34.0522, lon: -118.2437 },
|
124 |
-
"Zurich, Switzerland": { lat: 47.3769, lon: 8.5417 },
|
125 |
-
"Dammam, Saudi Arabia": { lat: 26.4207, lon: 50.0888 }
|
126 |
-
};
|
127 |
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
{ accelerator: "TPU v2",
|
132 |
-
{ accelerator: "TPU v2",
|
133 |
-
|
134 |
-
|
135 |
-
{ accelerator: "TPU v3",
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
{ accelerator: "TPU v5e",
|
140 |
-
{ accelerator: "TPU v5e",
|
141 |
-
{ accelerator: "TPU v5e",
|
142 |
-
{ accelerator: "TPU v5e",
|
143 |
-
{ accelerator: "TPU v5e",
|
144 |
-
{ accelerator: "TPU v5e",
|
145 |
-
{ accelerator: "TPU v5e",
|
146 |
-
|
147 |
-
{ accelerator: "TPU v5p",
|
148 |
-
{ accelerator: "TPU
|
149 |
-
|
150 |
-
{ accelerator: "TPU v6e",
|
151 |
-
{ accelerator: "TPU v6e",
|
152 |
-
{ accelerator: "
|
153 |
-
{ accelerator: "
|
154 |
-
|
155 |
-
{ accelerator: "H100 A3 Mega",
|
156 |
-
{ accelerator: "H100 A3 Mega",
|
157 |
-
{ accelerator: "H100 A3 Mega",
|
158 |
-
{ accelerator: "H100 A3 Mega",
|
159 |
-
{ accelerator: "H100 A3 Mega",
|
160 |
-
{ accelerator: "H100 A3 Mega",
|
161 |
-
{ accelerator: "H100 A3
|
162 |
-
{ accelerator: "H100 A3
|
163 |
-
{ accelerator: "H100 A3
|
164 |
-
|
165 |
-
{ accelerator: "H100 A3 High",
|
166 |
-
{ accelerator: "H100 A3 High",
|
167 |
-
{ accelerator: "H100 A3 High",
|
168 |
-
{ accelerator: "H100 A3 High",
|
169 |
-
{ accelerator: "H100 A3
|
170 |
-
{ accelerator: "H100 A3
|
171 |
-
{ accelerator: "H100 A3
|
172 |
-
{ accelerator: "H100 A3
|
173 |
-
|
174 |
-
{ accelerator: "H100 A3 Edge",
|
175 |
-
{ accelerator: "
|
176 |
-
{ accelerator: "
|
177 |
-
{ accelerator: "
|
178 |
-
{ accelerator: "
|
179 |
-
{ accelerator: "
|
180 |
-
|
181 |
-
{ accelerator: "A100 A2
|
182 |
-
{ accelerator: "A100 A2
|
183 |
-
{ accelerator: "A100 A2
|
184 |
-
{ accelerator: "A100 A2
|
185 |
-
{ accelerator: "A100 A2
|
186 |
-
|
187 |
-
{ accelerator: "A100 40GB A2 Standard",
|
188 |
-
{ accelerator: "A100 40GB A2 Standard",
|
189 |
-
{ accelerator: "A100 40GB A2 Standard",
|
190 |
-
{ accelerator: "
|
191 |
-
{ accelerator: "
|
192 |
-
{ accelerator: "
|
193 |
-
{ accelerator: "
|
194 |
-
{ accelerator: "
|
195 |
-
{ accelerator: "
|
196 |
-
{ accelerator: "
|
197 |
-
|
198 |
-
{ accelerator: "G2 (L4)",
|
199 |
-
{ accelerator: "G2 (L4)",
|
200 |
-
{ accelerator: "G2 (L4)",
|
201 |
-
{ accelerator: "G2 (L4)",
|
202 |
-
{ accelerator: "G2 (L4)",
|
203 |
-
{ accelerator: "G2 (L4)",
|
204 |
-
{ accelerator: "G2 (L4)",
|
205 |
-
{ accelerator: "G2 (L4)",
|
206 |
-
{ accelerator: "G2 (L4)",
|
207 |
-
{ accelerator: "G2 (L4)",
|
208 |
-
{ accelerator: "
|
209 |
-
{ accelerator: "
|
210 |
-
{ accelerator: "
|
211 |
-
{ accelerator: "
|
212 |
-
{ accelerator: "
|
213 |
-
{ accelerator: "
|
214 |
-
{ accelerator: "
|
215 |
-
{ accelerator: "
|
216 |
-
|
217 |
-
{ accelerator: "N1+T4",
|
218 |
-
{ accelerator: "N1+T4",
|
219 |
-
{ accelerator: "N1+T4",
|
220 |
-
{ accelerator: "N1+T4",
|
221 |
-
{ accelerator: "N1+T4",
|
222 |
-
{ accelerator: "N1+T4",
|
223 |
-
{ accelerator: "N1+T4",
|
224 |
-
{ accelerator: "N1+T4",
|
225 |
-
{ accelerator: "N1+T4",
|
226 |
-
{ accelerator: "N1+T4",
|
227 |
-
{ accelerator: "N1+T4",
|
228 |
-
{ accelerator: "N1+T4",
|
229 |
-
{ accelerator: "N1+T4",
|
230 |
-
{ accelerator: "N1+
|
231 |
-
{ accelerator: "N1+
|
232 |
-
{ accelerator: "N1+
|
233 |
-
{ accelerator: "N1+
|
234 |
-
{ accelerator: "N1+
|
235 |
-
{ accelerator: "N1+
|
236 |
-
{ accelerator: "N1+
|
237 |
-
{ accelerator: "N1+
|
238 |
-
{ accelerator: "N1+
|
239 |
-
|
240 |
-
{ accelerator: "N1+
|
241 |
-
{ accelerator: "N1+
|
242 |
-
{ accelerator: "N1+
|
243 |
-
{ accelerator: "N1+
|
244 |
-
{ accelerator: "N1+
|
245 |
-
|
246 |
-
{ accelerator: "N1+
|
247 |
-
{ accelerator: "N1+
|
248 |
-
{ accelerator: "N1+
|
249 |
-
{ accelerator: "N1+P100", region: "asia-east1", zones: "a, c", location: "Changhua County, Taiwan" },
|
250 |
-
{ accelerator: "N1+P100", region: "australia-southeast1", zones: "c", location: "Sydney, Australia" },
|
251 |
-
{ accelerator: "N1+P100", region: "europe-west1", zones: "b, d", location: "St. Ghislain, Belgium" },
|
252 |
-
{ accelerator: "N1+P100", region: "europe-west4", zones: "a", location: "Eemshaven, Netherlands" },
|
253 |
-
// N1+P4
|
254 |
-
{ accelerator: "N1+P4", region: "us-central1", zones: "a, c", location: "Council Bluffs, Iowa, USA" },
|
255 |
-
{ accelerator: "N1+P4", region: "us-east4", zones: "a, b, c", location: "Ashburn, Virginia, USA" },
|
256 |
-
{ accelerator: "N1+P4", region: "northamerica-northeast1", zones: "a, b, c", location: "Montréal, Québec, Canada" },
|
257 |
-
{ accelerator: "N1+P4", region: "us-west2", zones: "b, c", location: "Los Angeles, California, USA" },
|
258 |
-
{ accelerator: "N1+P4", region: "asia-southeast1", zones: "b, c", location: "Jurong West, Singapore" },
|
259 |
-
{ accelerator: "N1+P4", region: "australia-southeast1", zones: "a, b", location: "Sydney, Australia" },
|
260 |
-
{ accelerator: "N1+P4", region: "europe-west4", zones: "b, c", location: "Eemshaven, Netherlands" },
|
261 |
];
|
262 |
|
263 |
-
//
|
264 |
-
const
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
if (!groupedLocations[item.location]) {
|
271 |
-
groupedLocations[item.location] = {
|
272 |
-
lat: locations[item.location].lat,
|
273 |
-
lon: locations[item.location].lon,
|
274 |
name: item.location,
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
|
|
279 |
}
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
|
|
|
|
|
|
284 |
});
|
285 |
-
groupedLocations[item.location].regions.add(item.region);
|
286 |
-
item.zones.split(',').map(z => z.trim()).forEach(z => groupedLocations[item.location].zones.add(z));
|
287 |
});
|
288 |
|
289 |
-
|
290 |
-
try {
|
291 |
-
viewer = new Cesium.Viewer('cesiumContainer', {
|
292 |
-
// Simplified for basic rendering. Add back features like terrainProvider later.
|
293 |
-
animation: false,
|
294 |
-
timeline: false,
|
295 |
-
geocoder: false,
|
296 |
-
homeButton: true, // Keep home button for now
|
297 |
-
sceneModePicker: true, // Useful for switching between 3D, 2.5D, 2D
|
298 |
-
baseLayerPicker: true, // Allows changing base map
|
299 |
-
navigationHelpButton: false,
|
300 |
-
fullscreenButton: true,
|
301 |
-
infoBox: false // We are using a custom info box
|
302 |
-
});
|
303 |
-
console.log("Cesium Viewer initialized successfully.");
|
304 |
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
})
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
|
|
|
|
|
|
|
|
317 |
|
|
|
|
|
|
|
|
|
318 |
|
319 |
-
const acceleratorSearchInput = document.getElementById('acceleratorSearch');
|
320 |
-
const infoBoxEl = document.getElementById('infoBox');
|
321 |
-
const locationNameEl = document.getElementById('locationName');
|
322 |
-
const regionIdEl = document.getElementById('regionId');
|
323 |
-
const zoneIdEl = document.getElementById('zoneId');
|
324 |
-
const acceleratorListEl = document.getElementById('acceleratorList');
|
325 |
|
326 |
-
|
|
|
|
|
327 |
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
position: Cesium.Cartesian3.fromDegrees(locData.lon, locData.lat),
|
336 |
-
point: {
|
337 |
-
pixelSize: 10,
|
338 |
-
color: Cesium.Color.ORANGERED, // Changed color for better visibility
|
339 |
-
outlineColor: Cesium.Color.WHITE,
|
340 |
-
outlineWidth: 2,
|
341 |
-
disableDepthTestDistance: Number.POSITIVE_INFINITY // Ensures point is visible even if behind terrain
|
342 |
-
},
|
343 |
-
label: {
|
344 |
-
text: locData.name,
|
345 |
-
font: '12pt Segoe UI, sans-serif', // More readable font
|
346 |
-
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
|
347 |
-
outlineWidth: 3,
|
348 |
-
outlineColor: Cesium.Color.BLACK,
|
349 |
-
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
350 |
-
pixelOffset: new Cesium.Cartesian2(0, -15), // Adjusted offset
|
351 |
-
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0.0, 10000000.0) // Hide label when far away
|
352 |
-
},
|
353 |
-
properties: {
|
354 |
-
name: locData.name,
|
355 |
-
accelerators: locData.accelerators, // Array of {type, region, zones}
|
356 |
-
// The following are consolidated for the location, specific assignments are in accelerators array
|
357 |
-
all_regions_at_location: Array.from(locData.regions).join(', '),
|
358 |
-
all_zones_at_location: Array.from(locData.zones).sort().join(', ')
|
359 |
-
}
|
360 |
-
});
|
361 |
-
locationEntities.push(entity);
|
362 |
});
|
|
|
363 |
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
});
|
|
|
|
|
379 |
|
380 |
-
|
381 |
-
const pickedObject = viewer.scene.pick(movement.position);
|
382 |
-
infoBoxEl.style.display = 'none';
|
383 |
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
const acceleratorsAtLocation = properties.accelerators.getValue(); // Array of {type, region, zones}
|
388 |
-
|
389 |
-
locationNameEl.textContent = locationName;
|
390 |
-
acceleratorListEl.innerHTML = ''; // Clear previous list
|
391 |
|
392 |
-
|
393 |
-
|
394 |
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
acc.zones.split(',').map(z => z.trim()).forEach(zone => uniqueZonesForDisplay.add(zone));
|
402 |
-
});
|
403 |
-
} else {
|
404 |
-
acceleratorListEl.innerHTML = '<li>No specific accelerator data.</li>';
|
405 |
-
}
|
406 |
-
|
407 |
-
regionIdEl.textContent = Array.from(uniqueRegionsForDisplay).join(', ') || 'N/A';
|
408 |
-
zoneIdEl.textContent = Array.from(uniqueZonesForDisplay).sort().join(', ') || 'N/A';
|
409 |
-
|
410 |
-
infoBoxEl.style.display = 'block';
|
411 |
|
412 |
-
|
413 |
-
|
|
|
|
|
414 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
}
|
416 |
-
}
|
417 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
418 |
|
419 |
</script>
|
420 |
</body>
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>GCP Accelerator Map</title>
|
7 |
<script src="https://cesium.com/downloads/cesiumjs/releases/1.117/Build/Cesium/Cesium.js"></script>
|
8 |
<link href="https://cesium.com/downloads/cesiumjs/releases/1.117/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
|
9 |
<style>
|
10 |
+
html, body, #cesiumContainer {
|
11 |
width: 100%;
|
12 |
height: 100%;
|
13 |
margin: 0;
|
14 |
padding: 0;
|
15 |
+
overflow: hidden;
|
16 |
font-family: sans-serif;
|
17 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
#controls {
|
19 |
position: absolute;
|
20 |
top: 10px;
|
21 |
left: 10px;
|
22 |
+
background: rgba(40, 40, 40, 0.8);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
padding: 15px;
|
24 |
border-radius: 8px;
|
25 |
color: white;
|
26 |
+
max-height: 90vh;
|
27 |
+
overflow-y: auto;
|
28 |
z-index: 10;
|
|
|
|
|
|
|
29 |
}
|
30 |
+
#controls h3 {
|
31 |
margin-top: 0;
|
|
|
|
|
|
|
32 |
}
|
33 |
+
#controls label {
|
34 |
+
display: block;
|
35 |
+
margin-bottom: 8px;
|
36 |
+
cursor: pointer;
|
|
|
|
|
|
|
|
|
37 |
}
|
38 |
+
#controls input[type="checkbox"] {
|
39 |
+
margin-right: 8px;
|
40 |
}
|
41 |
</style>
|
42 |
</head>
|
43 |
<body>
|
44 |
<div id="cesiumContainer"></div>
|
45 |
<div id="controls">
|
46 |
+
<h3>Filter by Accelerator</h3>
|
47 |
+
<div id="acceleratorFilters">
|
48 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
</div>
|
50 |
|
51 |
<script>
|
52 |
+
// --- Cesium Ion Access Token (Replace with your own) ---
|
53 |
+
Cesium.Ion.defaultAccessToken = 'YOUR_CESIUM_ION_ACCESS_TOKEN'; // Optional
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
+
// --- Datacenter Data ---
|
56 |
+
// (Latitude and Longitude are approximate and need to be verified/corrected)
|
57 |
+
const rawData = [
|
58 |
+
{ accelerator: "TPU v2", regionId: "us-central1", zones: "b, c, f", location: "Council Bluffs, Iowa, USA", lat: 41.2619, lon: -95.8514 },
|
59 |
+
{ accelerator: "TPU v2", regionId: "europe-west4", zones: "a", location: "Eemshaven, Netherlands", lat: 53.4427, lon: 6.8442 },
|
60 |
+
{ accelerator: "TPU v2", regionId: "asia-east1", zones: "c", location: "Changhua County, Taiwan", lat: 24.0716, lon: 120.5469 },
|
61 |
+
// ... (Duplicate TPU v2 entries were present, consolidated by location for mapping)
|
62 |
+
{ accelerator: "TPU v3", regionId: "us-central1", zones: "a, b, f", location: "Council Bluffs, Iowa, USA", lat: 41.2619, lon: -95.8514 },
|
63 |
+
{ accelerator: "TPU v3", regionId: "europe-west4", zones: "a", location: "Eemshaven, Netherlands", lat: 53.4427, lon: 6.8442 },
|
64 |
+
// ... (Duplicate TPU v3 entries)
|
65 |
+
{ accelerator: "TPU v4", regionId: "us-central2", zones: "b", location: "Council Bluffs, Iowa, USA (?)", lat: 41.2619, lon: -95.8514 }, // Note: Location was marked with (?)
|
66 |
+
{ accelerator: "TPU v5e", regionId: "us-central1", zones: "a", location: "Council Bluffs, Iowa, USA", lat: 41.2619, lon: -95.8514 },
|
67 |
+
{ accelerator: "TPU v5e", regionId: "us-east5", zones: "a, b, c", location: "Columbus, Ohio, USA", lat: 39.9612, lon: -82.9988 },
|
68 |
+
{ accelerator: "TPU v5e", regionId: "us-south1", zones: "a", location: "Dallas, Texas, USA", lat: 32.7767, lon: -96.7970 },
|
69 |
+
{ accelerator: "TPU v5e", regionId: "us-west1", zones: "c", location: "The Dalles, Oregon, USA", lat: 45.5946, lon: -121.1787 },
|
70 |
+
{ accelerator: "TPU v5e", regionId: "us-west4", zones: "a", location: "Las Vegas, Nevada, USA", lat: 36.1699, lon: -115.1398 },
|
71 |
+
{ accelerator: "TPU v5e", regionId: "europe-west1", zones: "b", location: "St. Ghislain, Belgium", lat: 50.4377, lon: 3.8203 },
|
72 |
+
{ accelerator: "TPU v5e", regionId: "asia-southeast1", zones: "b", location: "Jurong West, Singapore", lat: 1.3521, lon: 103.8198 }, // Using general Singapore coords
|
73 |
+
{ accelerator: "TPU v5p", regionId: "us-east5", zones: "a", location: "Columbus, Ohio, USA", lat: 39.9612, lon: -82.9988 },
|
74 |
+
{ accelerator: "TPU v5p", regionId: "europe-west4", zones: "b", location: "Eemshaven, Netherlands", lat: 53.4427, lon: 6.8442 },
|
75 |
+
{ accelerator: "TPU v6e", regionId: "us-east1", zones: "d", location: "Moncks Corner, South Carolina, USA", lat: 33.1957, lon: -79.9906 },
|
76 |
+
{ accelerator: "TPU v6e", regionId: "us-east5", zones: "b", location: "Columbus, Ohio, USA", lat: 39.9612, lon: -82.9988 },
|
77 |
+
{ accelerator: "TPU v6e", regionId: "europe-west4", zones: "a", location: "Eemshaven, Netherlands", lat: 53.4427, lon: 6.8442 },
|
78 |
+
{ accelerator: "TPU v6e", regionId: "asia-northeast1", zones: "b", location: "Tokyo, Japan", lat: 35.6895, lon: 139.6917 },
|
79 |
+
{ accelerator: "H100 A3 Mega", regionId: "us-central1", zones: "a, b*, c", location: "Council Bluffs, Iowa, USA", lat: 41.2619, lon: -95.8514, notes: "b: Limited capacity, contact TAM" },
|
80 |
+
{ accelerator: "H100 A3 Mega", regionId: "us-east4", zones: "a, b, c", location: "Ashburn, Virginia, USA", lat: 39.0438, lon: -77.4874 },
|
81 |
+
{ accelerator: "H100 A3 Mega", regionId: "us-west1", zones: "a, b", location: "The Dalles, Oregon, USA", lat: 45.5946, lon: -121.1787 },
|
82 |
+
{ accelerator: "H100 A3 Mega", regionId: "us-west4", zones: "a", location: "Las Vegas, Nevada, USA", lat: 36.1699, lon: -115.1398 },
|
83 |
+
{ accelerator: "H100 A3 Mega", regionId: "asia-northeast1", zones: "b", location: "Tokyo, Japan", lat: 35.6895, lon: 139.6917 },
|
84 |
+
{ accelerator: "H100 A3 Mega", regionId: "asia-southeast1", zones: "b, c", location: "Jurong West, Singapore", lat: 1.3521, lon: 103.8198 },
|
85 |
+
{ accelerator: "H100 A3 Mega", regionId: "australia-southeast1", zones: "c*", location: "Sydney, Australia", lat: -33.8688, lon: 151.2093, notes: "Limited capacity, contact TAM" },
|
86 |
+
{ accelerator: "H100 A3 Mega", regionId: "europe-west1", zones: "b*, c*", location: "St. Ghislain, Belgium", lat: 50.4377, lon: 3.8203, notes: "Limited capacity, contact TAM" },
|
87 |
+
{ accelerator: "H100 A3 Mega", regionId: "europe-west4", zones: "b, c", location: "Eemshaven, Netherlands", lat: 53.4427, lon: 6.8442 },
|
88 |
+
{ accelerator: "H100 A3 High", regionId: "us-central1", zones: "a, c", location: "Council Bluffs, Iowa, USA", lat: 41.2619, lon: -95.8514 },
|
89 |
+
{ accelerator: "H100 A3 High", regionId: "us-east4", zones: "a, b", location: "Ashburn, Virginia, USA", lat: 39.0438, lon: -77.4874 },
|
90 |
+
{ accelerator: "H100 A3 High", regionId: "us-east5", zones: "a", location: "Columbus, Ohio, USA", lat: 39.9612, lon: -82.9988 },
|
91 |
+
{ accelerator: "H100 A3 High", regionId: "us-west1", zones: "a, b", location: "The Dalles, Oregon, USA", lat: 45.5946, lon: -121.1787 },
|
92 |
+
{ accelerator: "H100 A3 High", regionId: "us-west4", zones: "a", location: "Las Vegas, Nevada, USA", lat: 36.1699, lon: -115.1398 },
|
93 |
+
{ accelerator: "H100 A3 High", regionId: "asia-northeast1", zones: "b", location: "Tokyo, Japan", lat: 35.6895, lon: 139.6917 },
|
94 |
+
{ accelerator: "H100 A3 High", regionId: "asia-southeast1", zones: "b, c", location: "Jurong West, Singapore", lat: 1.3521, lon: 103.8198 },
|
95 |
+
{ accelerator: "H100 A3 High", regionId: "europe-west1", zones: "b*", location: "St. Ghislain, Belgium", lat: 50.4377, lon: 3.8203, notes: "Limited capacity, contact TAM" },
|
96 |
+
{ accelerator: "H100 A3 Edge", regionId: "northamerica-northeast2", zones: "c", location: "Toronto, Ontario, Canada", lat: 43.6532, lon: -79.3832 },
|
97 |
+
{ accelerator: "H100 A3 Edge", regionId: "asia-northeast1", zones: "b", location: "Tokyo, Japan", lat: 35.6895, lon: 139.6917 },
|
98 |
+
{ accelerator: "H100 A3 Edge", regionId: "asia-northeast3", zones: "a, c", location: "Seoul, South Korea", lat: 37.5665, lon: 126.9780 },
|
99 |
+
{ accelerator: "H100 A3 Edge", regionId: "asia-south1", zones: "c", location: "Mumbai, India", lat: 19.0760, lon: 72.8777 },
|
100 |
+
{ accelerator: "H100 A3 Edge", regionId: "europe-west2", zones: "b", location: "London, UK", lat: 51.5074, lon: -0.1278 },
|
101 |
+
{ accelerator: "H100 A3 Edge", regionId: "europe-west3", zones: "a", location: "Frankfurt, Germany", lat: 50.1109, lon: 8.6821 },
|
102 |
+
{ accelerator: "A100 A2 Ultra", regionId: "us-central1", zones: "a, c", location: "Council Bluffs, Iowa, USA", lat: 41.2619, lon: -95.8514 },
|
103 |
+
{ accelerator: "A100 A2 Ultra", regionId: "us-east4", zones: "c", location: "Ashburn, Virginia, USA", lat: 39.0438, lon: -77.4874 },
|
104 |
+
{ accelerator: "A100 A2 Ultra", regionId: "us-east5", zones: "b", location: "Columbus, Ohio, USA", lat: 39.9612, lon: -82.9988 },
|
105 |
+
{ accelerator: "A100 A2 Ultra", regionId: "asia-southeast1", zones: "c", location: "Jurong West, Singapore", lat: 1.3521, lon: 103.8198 },
|
106 |
+
{ accelerator: "A100 A2 Ultra", regionId: "europe-west4", zones: "a, b, c", location: "Eemshaven, Netherlands", lat: 53.4427, lon: 6.8442 },
|
107 |
+
{ accelerator: "A100 40GB A2 Standard", regionId: "us-central1", zones: "a*, b*, c*, f*", location: "Council Bluffs, Iowa, USA", lat: 41.2619, lon: -95.8514, notes: "a2-megagpu-16g only" },
|
108 |
+
{ accelerator: "A100 40GB A2 Standard", regionId: "us-east1", zones: "b", location: "Moncks Corner, South Carolina, USA", lat: 33.1957, lon: -79.9906 },
|
109 |
+
{ accelerator: "A100 40GB A2 Standard", regionId: "us-west1", zones: "b", location: "The Dalles, Oregon, USA", lat: 45.5946, lon: -121.1787 },
|
110 |
+
{ accelerator: "A100 40GB A2 Standard", regionId: "us-west3", zones: "b", location: "Salt Lake City, Utah, USA", lat: 40.7608, lon: -111.8910 },
|
111 |
+
{ accelerator: "A100 40GB A2 Standard", regionId: "us-west4", zones: "b", location: "Las Vegas, Nevada, USA", lat: 36.1699, lon: -115.1398 },
|
112 |
+
{ accelerator: "A100 40GB A2 Standard", regionId: "asia-northeast1", zones: "a, c", location: "Tokyo, Japan", lat: 35.6895, lon: 139.6917 },
|
113 |
+
{ accelerator: "A100 40GB A2 Standard", regionId: "asia-northeast3", zones: "a, b", location: "Seoul, South Korea", lat: 37.5665, lon: 126.9780 },
|
114 |
+
{ accelerator: "A100 40GB A2 Standard", regionId: "asia-southeast1", zones: "b, c*", location: "Jurong West, Singapore", lat: 1.3521, lon: 103.8198, notes: "c: a2-megagpu-16g only" },
|
115 |
+
{ accelerator: "A100 40GB A2 Standard", regionId: "me-west1", zones: "a, c", location: "Tel Aviv, Israel", lat: 32.0853, lon: 34.7818 },
|
116 |
+
{ accelerator: "A100 40GB A2 Standard", regionId: "europe-west4", zones: "a*, b*", location: "Eemshaven, Netherlands", lat: 53.4427, lon: 6.8442, notes: "a2-megagpu-16g only" },
|
117 |
+
{ accelerator: "G2 (L4)", regionId: "us-central1", zones: "a, b, c", location: "Council Bluffs, Iowa, USA", lat: 41.2619, lon: -95.8514 },
|
118 |
+
{ accelerator: "G2 (L4)", regionId: "us-east1", zones: "b, c, d", location: "Moncks Corner, South Carolina, USA", lat: 33.1957, lon: -79.9906 },
|
119 |
+
{ accelerator: "G2 (L4)", regionId: "us-east4", zones: "a", location: "Ashburn, Virginia, USA", lat: 39.0438, lon: -77.4874 },
|
120 |
+
{ accelerator: "G2 (L4)", regionId: "us-west1", zones: "a, b, c", location: "The Dalles, Oregon, USA", lat: 45.5946, lon: -121.1787 },
|
121 |
+
{ accelerator: "G2 (L4)", regionId: "us-west4", zones: "a, c", location: "Las Vegas, Nevada, USA", lat: 36.1699, lon: -115.1398 },
|
122 |
+
{ accelerator: "G2 (L4)", regionId: "northamerica-northeast2", zones: "a", location: "Toronto, Ontario, Canada", lat: 43.6532, lon: -79.3832 },
|
123 |
+
{ accelerator: "G2 (L4)", regionId: "asia-east1", zones: "a, b, c", location: "Changhua County, Taiwan", lat: 24.0716, lon: 120.5469 },
|
124 |
+
{ accelerator: "G2 (L4)", regionId: "asia-northeast1", zones: "a, b, c", location: "Tokyo, Japan", lat: 35.6895, lon: 139.6917 },
|
125 |
+
{ accelerator: "G2 (L4)", regionId: "asia-northeast3", zones: "a, b", location: "Seoul, South Korea", lat: 37.5665, lon: 126.9780 },
|
126 |
+
{ accelerator: "G2 (L4)", regionId: "asia-south1", zones: "a, b, c", location: "Mumbai, India", lat: 19.0760, lon: 72.8777 },
|
127 |
+
{ accelerator: "G2 (L4)", regionId: "asia-southeast1", zones: "a, b, c", location: "Jurong West, Singapore", lat: 1.3521, lon: 103.8198 },
|
128 |
+
{ accelerator: "G2 (L4)", regionId: "australia-southeast1", zones: "a", location: "Sydney, Australia", lat: -33.8688, lon: 151.2093 },
|
129 |
+
{ accelerator: "G2 (L4)", regionId: "europe-west1", zones: "b, c", location: "St. Ghislain, Belgium", lat: 50.4377, lon: 3.8203 },
|
130 |
+
{ accelerator: "G2 (L4)", regionId: "europe-west2", zones: "a, b", location: "London, UK", lat: 51.5074, lon: -0.1278 },
|
131 |
+
{ accelerator: "G2 (L4)", regionId: "europe-west3", zones: "a, b", location: "Frankfurt, Germany", lat: 50.1109, lon: 8.6821 },
|
132 |
+
{ accelerator: "G2 (L4)", regionId: "europe-west4", zones: "a, b, c", location: "Eemshaven, Netherlands", lat: 53.4427, lon: 6.8442 },
|
133 |
+
{ accelerator: "G2 (L4)", regionId: "europe-west6", zones: "b, c", location: "Zurich, Switzerland", lat: 47.3769, lon: 8.5417 },
|
134 |
+
{ accelerator: "G2 (L4)", regionId: "me-central2", zones: "a", location: "Dammam, Saudi Arabia", lat: 26.4207, lon: 50.0888 },
|
135 |
+
{ accelerator: "N1+T4", regionId: "us-central1", zones: "a, b, f", location: "Council Bluffs, Iowa, USA", lat: 41.2619, lon: -95.8514 },
|
136 |
+
{ accelerator: "N1+T4", regionId: "us-east1", zones: "c, d", location: "Moncks Corner, South Carolina, USA", lat: 33.1957, lon: -79.9906 },
|
137 |
+
{ accelerator: "N1+T4", regionId: "us-east4", zones: "a, b", location: "Ashburn, Virginia, USA", lat: 39.0438, lon: -77.4874 },
|
138 |
+
{ accelerator: "N1+T4", regionId: "us-west1", zones: "a, b", location: "The Dalles, Oregon, USA", lat: 45.5946, lon: -121.1787 },
|
139 |
+
{ accelerator: "N1+T4", regionId: "us-west3", zones: "b", location: "Salt Lake City, Utah, USA", lat: 40.7608, lon: -111.8910 },
|
140 |
+
{ accelerator: "N1+T4", regionId: "us-west4", zones: "a, b", location: "Las Vegas, Nevada, USA", lat: 36.1699, lon: -115.1398 },
|
141 |
+
{ accelerator: "N1+T4", regionId: "northamerica-northeast1", zones: "c", location: "Montréal, Québec, Canada", lat: 45.5017, lon: -73.5673 },
|
142 |
+
{ accelerator: "N1+T4", regionId: "asia-east1", zones: "a, c", location: "Changhua County, Taiwan", lat: 24.0716, lon: 120.5469 },
|
143 |
+
{ accelerator: "N1+T4", regionId: "asia-east2", zones: "a, c", location: "Hong Kong", lat: 22.3193, lon: 114.1694 },
|
144 |
+
{ accelerator: "N1+T4", regionId: "asia-northeast1", zones: "a, c", location: "Tokyo, Japan", lat: 35.6895, lon: 139.6917 },
|
145 |
+
{ accelerator: "N1+T4", regionId: "asia-northeast3", zones: "b, c", location: "Seoul, South Korea", lat: 37.5665, lon: 126.9780 },
|
146 |
+
{ accelerator: "N1+T4", regionId: "asia-south1", zones: "a, b", location: "Mumbai, India", lat: 19.0760, lon: 72.8777 },
|
147 |
+
{ accelerator: "N1+T4", regionId: "asia-southeast1", zones: "a, b, c", location: "Jurong West, Singapore", lat: 1.3521, lon: 103.8198 },
|
148 |
+
{ accelerator: "N1+T4", regionId: "asia-southeast2", zones: "a", location: "Jakarta, Indonesia", lat: -6.2088, lon: 106.8456 },
|
149 |
+
{ accelerator: "N1+T4", regionId: "australia-southeast1", zones: "a, c", location: "Sydney, Australia", lat: -33.8688, lon: 151.2093 },
|
150 |
+
{ accelerator: "N1+T4", regionId: "europe-central2", zones: "b, c", location: "Warsaw, Poland", lat: 52.2297, lon: 21.0122 },
|
151 |
+
{ accelerator: "N1+T4", regionId: "europe-west1", zones: "b, c, d", location: "St. Ghislain, Belgium", lat: 50.4377, lon: 3.8203 },
|
152 |
+
{ accelerator: "N1+T4", regionId: "europe-west2", zones: "a, b", location: "London, UK", lat: 51.5074, lon: -0.1278 },
|
153 |
+
{ accelerator: "N1+T4", regionId: "europe-west3", zones: "b", location: "Frankfurt, Germany", lat: 50.1109, lon: 8.6821 },
|
154 |
+
{ accelerator: "N1+T4", regionId: "europe-west4", zones: "a, b, c", location: "Eemshaven, Netherlands", lat: 53.4427, lon: 6.8442 },
|
155 |
+
{ accelerator: "N1+T4", regionId: "me-west1", zones: "b, c", location: "Tel Aviv, Israel", lat: 32.0853, lon: 34.7818 },
|
156 |
+
{ accelerator: "N1+T4", regionId: "southamerica-east1", zones: "a, c", location: "Osasco, São Paulo, Brazil", lat: -23.5329, lon: -46.7920 },
|
157 |
+
{ accelerator: "N1+V100", regionId: "us-central1", zones: "a, b, c, f", location: "Council Bluffs, Iowa, USA", lat: 41.2619, lon: -95.8514 },
|
158 |
+
{ accelerator: "N1+V100", regionId: "us-east1", zones: "c", location: "Moncks Corner, South Carolina, USA", lat: 33.1957, lon: -79.9906 },
|
159 |
+
{ accelerator: "N1+V100", regionId: "us-west1", zones: "a, b", location: "The Dalles, Oregon, USA", lat: 45.5946, lon: -121.1787 },
|
160 |
+
{ accelerator: "N1+V100", regionId: "asia-east1", zones: "c", location: "Changhua County, Taiwan", lat: 24.0716, lon: 120.5469 },
|
161 |
+
{ accelerator: "N1+V100", regionId: "europe-west4", zones: "a, b, c", location: "Eemshaven, Netherlands", lat: 53.4427, lon: 6.8442 },
|
162 |
+
{ accelerator: "N1+P100", regionId: "us-central1", zones: "c, f", location: "Council Bluffs, Iowa, USA", lat: 41.2619, lon: -95.8514 },
|
163 |
+
{ accelerator: "N1+P100", regionId: "us-east1", zones: "b, c", location: "Moncks Corner, South Carolina, USA", lat: 33.1957, lon: -79.9906 },
|
164 |
+
{ accelerator: "N1+P100", regionId: "us-west1", zones: "a, b", location: "The Dalles, Oregon, USA", lat: 45.5946, lon: -121.1787 },
|
165 |
+
{ accelerator: "N1+P100", regionId: "asia-east1", zones: "a, c", location: "Changhua County, Taiwan", lat: 24.0716, lon: 120.5469 },
|
166 |
+
{ accelerator: "N1+P100", regionId: "australia-southeast1", zones: "c", location: "Sydney, Australia", lat: -33.8688, lon: 151.2093 },
|
167 |
+
{ accelerator: "N1+P100", regionId: "europe-west1", zones: "b, d", location: "St. Ghislain, Belgium", lat: 50.4377, lon: 3.8203 },
|
168 |
+
{ accelerator: "N1+P100", regionId: "europe-west4", zones: "a", location: "Eemshaven, Netherlands", lat: 53.4427, lon: 6.8442 },
|
169 |
+
{ accelerator: "N1+P4", regionId: "us-central1", zones: "a, c", location: "Council Bluffs, Iowa, USA", lat: 41.2619, lon: -95.8514 },
|
170 |
+
{ accelerator: "N1+P4", regionId: "us-east4", zones: "a, b, c", location: "Ashburn, Virginia, USA", lat: 39.0438, lon: -77.4874 },
|
171 |
+
{ accelerator: "N1+P4", regionId: "northamerica-northeast1", zones: "a, b, c", location: "Montréal, Québec, Canada", lat: 45.5017, lon: -73.5673 },
|
172 |
+
{ accelerator: "N1+P4", regionId: "us-west2", zones: "b, c", location: "Los Angeles, California, USA", lat: 34.0522, lon: -118.2437 },
|
173 |
+
{ accelerator: "N1+P4", regionId: "asia-southeast1", zones: "b, c", location: "Jurong West, Singapore", lat: 1.3521, lon: 103.8198 },
|
174 |
+
{ accelerator: "N1+P4", regionId: "australia-southeast1", zones: "a, b", location: "Sydney, Australia", lat: -33.8688, lon: 151.2093 },
|
175 |
+
{ accelerator: "N1+P4", regionId: "europe-west4", zones: "b, c", location: "Eemshaven, Netherlands", lat: 53.4427, lon: 6.8442 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
];
|
177 |
|
178 |
+
// --- Process Data ---
|
179 |
+
const locationsMap = new Map(); // Key: location string, Value: { lat, lon, accelerators: Set<string>, details: [] }
|
180 |
+
|
181 |
+
rawData.forEach(item => {
|
182 |
+
const locationKey = `${item.location}_${item.lat}_${item.lon}`; // Unique key for location
|
183 |
+
if (!locationsMap.has(locationKey)) {
|
184 |
+
locationsMap.set(locationKey, {
|
|
|
|
|
|
|
|
|
185 |
name: item.location,
|
186 |
+
lat: item.lat,
|
187 |
+
lon: item.lon,
|
188 |
+
accelerators: new Set(),
|
189 |
+
details: []
|
190 |
+
});
|
191 |
}
|
192 |
+
const locData = locationsMap.get(locationKey);
|
193 |
+
locData.accelerators.add(item.accelerator);
|
194 |
+
locData.details.push({
|
195 |
+
accelerator: item.accelerator,
|
196 |
+
regionId: item.regionId,
|
197 |
+
zones: item.zones,
|
198 |
+
notes: item.notes || ''
|
199 |
});
|
|
|
|
|
200 |
});
|
201 |
|
202 |
+
const uniqueAccelerators = [...new Set(rawData.map(item => item.accelerator))].sort();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
|
204 |
+
// --- Initialize Cesium Viewer ---
|
205 |
+
const viewer = new Cesium.Viewer('cesiumContainer', {
|
206 |
+
terrainProvider: Cesium.createWorldTerrain(), // Optional: Needs Ion account or self-hosted terrain
|
207 |
+
// imageryProvider: new Cesium.IonImageryProvider({ assetId: YOUR_IMAGERY_ASSET_ID }), // Optional
|
208 |
+
animation: false,
|
209 |
+
baseLayerPicker: true,
|
210 |
+
fullscreenButton: false,
|
211 |
+
geocoder: false,
|
212 |
+
homeButton: false,
|
213 |
+
infoBox: true, // Enable InfoBox for entity details
|
214 |
+
sceneModePicker: true,
|
215 |
+
selectionIndicator: true,
|
216 |
+
timeline: false,
|
217 |
+
navigationHelpButton: false,
|
218 |
+
scene3DOnly: true,
|
219 |
+
});
|
220 |
|
221 |
+
// Optional: Improve visual quality
|
222 |
+
viewer.scene.globe.enableLighting = true;
|
223 |
+
viewer.scene.fog.enabled = true;
|
224 |
+
viewer.scene.skyAtmosphere.show = true;
|
225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
|
227 |
+
// --- Create Filters and Entities ---
|
228 |
+
const filtersContainer = document.getElementById('acceleratorFilters');
|
229 |
+
const entities = []; // To store references to Cesium entities
|
230 |
|
231 |
+
function createEntity(locationData) {
|
232 |
+
let description = `<h3>${locationData.name}</h3><hr><ul>`;
|
233 |
+
locationData.details.forEach(detail => {
|
234 |
+
description += `<li><b>${detail.accelerator}</b>
|
235 |
+
<br/>Region: ${detail.regionId} (Zones: ${detail.zones})
|
236 |
+
${detail.notes ? `<br/><em>Note: ${detail.notes}</em>` : ''}
|
237 |
+
</li>`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
});
|
239 |
+
description += '</ul>';
|
240 |
|
241 |
+
const entity = viewer.entities.add({
|
242 |
+
name: locationData.name,
|
243 |
+
position: Cesium.Cartesian3.fromDegrees(locationData.lon, locationData.lat),
|
244 |
+
billboard: {
|
245 |
+
image: 'data:image/svg+xml;base64,' + btoa(`
|
246 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="48" height="48">
|
247 |
+
<circle cx="12" cy="12" r="10" fill="#007bff" stroke="white" stroke-width="1.5"/>
|
248 |
+
<circle cx="12" cy="12" r="4" fill="white"/>
|
249 |
+
</svg>
|
250 |
+
`), // Simple blue dot SVG marker
|
251 |
+
width: 24,
|
252 |
+
height: 24,
|
253 |
+
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
254 |
+
},
|
255 |
+
description: description,
|
256 |
+
label: {
|
257 |
+
text: locationData.name,
|
258 |
+
font: '12pt sans-serif',
|
259 |
+
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
|
260 |
+
outlineWidth: 2,
|
261 |
+
outlineColor: Cesium.Color.BLACK,
|
262 |
+
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
263 |
+
pixelOffset: new Cesium.Cartesian2(0, -26), // Offset label above billboard
|
264 |
+
showBackground: true,
|
265 |
+
backgroundColor: new Cesium.Color(0.1, 0.1, 0.1, 0.7),
|
266 |
+
backgroundPadding: new Cesium.Cartesian2(7,5)
|
267 |
+
},
|
268 |
+
_accelerators: locationData.accelerators // Store accelerators for filtering
|
269 |
});
|
270 |
+
entities.push(entity);
|
271 |
+
}
|
272 |
|
273 |
+
locationsMap.forEach(createEntity);
|
|
|
|
|
274 |
|
275 |
+
// --- Filtering Logic ---
|
276 |
+
uniqueAccelerators.forEach(accel => {
|
277 |
+
const checkboxId = `filter-${accel.replace(/\s+|\(|\)|\+/g, '-')}`; // Create valid ID
|
|
|
|
|
|
|
|
|
278 |
|
279 |
+
const label = document.createElement('label');
|
280 |
+
label.htmlFor = checkboxId;
|
281 |
|
282 |
+
const checkbox = document.createElement('input');
|
283 |
+
checkbox.type = 'checkbox';
|
284 |
+
checkbox.id = checkboxId;
|
285 |
+
checkbox.value = accel;
|
286 |
+
checkbox.checked = true; // Default to show all
|
287 |
+
checkbox.addEventListener('change', updateEntityVisibility);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
288 |
|
289 |
+
label.appendChild(checkbox);
|
290 |
+
label.appendChild(document.createTextNode(accel));
|
291 |
+
filtersContainer.appendChild(label);
|
292 |
+
});
|
293 |
|
294 |
+
function updateEntityVisibility() {
|
295 |
+
const selectedAccelerators = [];
|
296 |
+
filtersContainer.querySelectorAll('input[type="checkbox"]:checked').forEach(cb => {
|
297 |
+
selectedAccelerators.push(cb.value);
|
298 |
+
});
|
299 |
+
|
300 |
+
entities.forEach(entity => {
|
301 |
+
if (selectedAccelerators.length === 0) {
|
302 |
+
entity.show = false; // Hide if no filters selected
|
303 |
+
} else {
|
304 |
+
// Show if the entity has AT LEAST ONE of the selected accelerators
|
305 |
+
const hasSelectedAccelerator = Array.from(entity._accelerators).some(accel => selectedAccelerators.includes(accel));
|
306 |
+
entity.show = hasSelectedAccelerator;
|
307 |
}
|
308 |
+
});
|
309 |
+
}
|
310 |
+
|
311 |
+
// Initial call to set visibility based on default checked states
|
312 |
+
updateEntityVisibility();
|
313 |
+
|
314 |
+
// Fly to a general overview
|
315 |
+
viewer.camera.flyTo({
|
316 |
+
destination: Cesium.Cartesian3.fromDegrees(-30, 20, 25000000), // Adjust as needed
|
317 |
+
duration: 3
|
318 |
+
});
|
319 |
|
320 |
</script>
|
321 |
</body>
|