Fix map basemap tiles and add hurricane click-to-map feature
Publish Container / publish (push) Successful in 2m18s
Publish Container / publish (push) Successful in 2m18s
- Replace CARTO basemap tiles (now require API key) with OpenFreeMap vector tiles (positron for light, liberty for dark) — no key needed - Add click handlers on hurricane panel cards to fly to storm on map - Add flyToHurricane(): switches to map tab, enables hurricane overlay, flies to storm coords, shows popup with storm details - Add /api/hurricanes/track proxy to fetch NHC GIS 5-day forecast track line and render it as a dashed overlay on the map Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
de9cb41d8b
commit
8b9d3639af
2 files changed
+84
-14
No files matched your search
@@ -511,6 +511,23 @@ app.get('/api/hurricanes', async (_req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/hurricanes/track', async (req, res) => {
|
||||
const { stormId } = req.query;
|
||||
if (!stormId || !/^[a-z]{2}\d{6}$/i.test(stormId)) {
|
||||
return res.json({ type: 'FeatureCollection', features: [] });
|
||||
}
|
||||
try {
|
||||
const id = stormId.toUpperCase();
|
||||
const r = await fetchWithRetry(
|
||||
`https://www.nhc.noaa.gov/gis/json/${id}_5day_lin.json`,
|
||||
{ attempts: 2, timeoutMs: 8000, fetchOptions: { headers: { 'User-Agent': 'weather-app-v2 (nate@necloud.us)', Accept: 'application/json' } } }
|
||||
);
|
||||
res.json(await r.json());
|
||||
} catch {
|
||||
res.json({ type: 'FeatureCollection', features: [] });
|
||||
}
|
||||
});
|
||||
|
||||
// ── Wildfire perimeter proxy (NIFC) ───────────────────────────────────────────
|
||||
const wfCache = { data: null, at: 0 };
|
||||
app.get('/api/wildfires', async (_req, res) => {
|
||||
|
||||
Reference in new issue
Block a user