Spaces:
Running
Running
Update index.html
Browse files- index.html +11 -25
index.html
CHANGED
|
@@ -154,31 +154,17 @@
|
|
| 154 |
.arcDashAnimateTime(() => 2000);
|
| 155 |
|
| 156 |
// Borders
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
const g = f.geometry; if (!g) continue;
|
| 169 |
-
if (g.type === 'Polygon') g.coordinates.forEach(pushRing);
|
| 170 |
-
else if (g.type === 'MultiPolygon') g.coordinates.forEach(poly => poly.forEach(pushRing));
|
| 171 |
-
}
|
| 172 |
-
globe
|
| 173 |
-
.polygonsData([]) // remove polygon meshes
|
| 174 |
-
.pathsData(paths) // draw borders as lines
|
| 175 |
-
.pathColor(() => '#ffffff') // solid white
|
| 176 |
-
.pathStroke(0.12) // thickness in angular degrees
|
| 177 |
-
.pathPointAlt(() => 0.002) // lift slightly off the surface
|
| 178 |
-
.pathResolution(3); // keep interpolation modest for perf
|
| 179 |
-
})
|
| 180 |
-
.catch(err => showErr(`Failed to load borders: ${err.message}`));
|
| 181 |
-
|
| 182 |
|
| 183 |
|
| 184 |
// Orbit controls tuning (zoom/rotate)
|
|
|
|
| 154 |
.arcDashAnimateTime(() => 2000);
|
| 155 |
|
| 156 |
// Borders
|
| 157 |
+
fetch('https://unpkg.com/three-globe/example/datasets/ne_110m_admin_0_countries.geojson')
|
| 158 |
+
.then(r => r.json())
|
| 159 |
+
.then(({ features }) => {
|
| 160 |
+
globe
|
| 161 |
+
.polygonsData(features)
|
| 162 |
+
.polygonCapColor(() => 'rgba(0,0,0,0)') // transparent fill
|
| 163 |
+
.polygonSideColor(() => 'rgba(0,0,0,0)') // no sides
|
| 164 |
+
.polygonStrokeColor(() => 'rgba(255,255,255,0.25)')
|
| 165 |
+
.polygonAltitude(() => 0.002); // small lift to avoid z-fighting
|
| 166 |
+
})
|
| 167 |
+
.catch(() => {/* ignore */});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
|
| 169 |
|
| 170 |
// Orbit controls tuning (zoom/rotate)
|