A real-time interactive map displaying active weather alerts and natural hazards from the National Weather Service (NWS) and NASA EONET data sources.
- Real-time Alerts: Fetches active weather alerts from NWS/API and NASA EONET natural disasters
- Interactive Map: Leaflet-based map with multiple base layers (Default, Satellite, Topographic)
- Alert Clustering: Smart marker clustering that groups nearby alerts by type
- Severity Coloring: Visual indicators for alert severity (Extreme, Severe, Moderate, Minor)
- Icon Classification: Different icons for different hazard types (floods, storms, wildfires, earthquakes, etc.)
- Alert Details: Click markers for full alert information including event type, severity, urgency, and affected areas
- Glossary: Built-in searchable glossary of weather terms and disaster-related vocabulary
- Geolocation: Auto-centers map based on user location and nearest alerts
- Keyboard Shortcuts:
Shift+Ctrl+A(orShift+Cmd+Aon Mac): Show all alertsShift+Ctrl+H(orShift+Cmd+Hon Mac): Hide all alertsEscape: Close alert popups
- NWS (National Weather Service): Active weather alerts with detailed geographic zones
- NASA EONET (Earth Observation Natural Event Tracking): Natural disaster events including volcanic eruptions, earthquakes, floods, wildfires, etc. (UNOPERATIONAL AT THE MOMENT)
- Flooding & Water Hazards
- Severe Storms & High Winds
- Winter Weather & Snow
- Wildfires & Fire Danger
- Air Quality & Visibility
- Marine & Coastal Hazards
- Geological Hazards (Earthquakes, Avalanches, Volcanoes)
- Temperature Extremes
- And more...
- Open
index.htmlin a web browser - Map loads with real-time data from NWS and NASA APIs automatically
No server or build process required - runs entirely in the browser.
weather-alerts/
├── index.html # Main HTML page with map container and UI
├── script.js # Core application logic
├── style.css # Styling and layout
├── leaflet.markercluster.js # Marker clustering library
├── MarkerCluster.css # Clustering styles
├── MarkerCluster.Default.css # Clustering theme
├── configs/
│ ├── alertTypes.js # Predefined NWS alert types
│ ├── eonetCategories.js # NASA EONET event categories
│ └── glossary.json # Weather and disaster terminology
└── icons/ # SVG icons for different alert types
- Initialization: Loads Leaflet and marker clustering libraries
- Data Fetching:
- Fetches NWS alerts from
api.weather.gov/alerts/active - Fetches NASA EONET events from NASA API
- Fetches NWS alerts from
- Data Processing:
- Merges duplicate alerts with same event type and affected area
- Categorizes alerts based on event type
- Assigns appropriate icons and severity colors
- Map Rendering:
- Creates polygons for affected areas
- Places markers at centroids of alert areas
- Groups markers into clusters by type
- User Interface:
- Displays alert counter
- Provides toggles to show/hide alert groups
- Shows/hides all alerts buttons
- Offers searchable glossary of terms
Works on all modern browsers that support:
- ES6 JavaScript modules
- Fetch API
- Geolocation API
- Zone geometries are fetched in batches of 15 to prevent browser blocking
- Complex polygons with >100 points are simplified for rendering performance
- Zone data is cached to avoid duplicate fetches
- Clustering disabled at zoom level 15 for detailed views
- NWS API has no rate limits for public use
- NASA EONET API uses DEMO_KEY (limited requests; for production use own API key)
- Zone geometry fetches have 5-second timeout per request
- Modify alert category patterns in
script.jsto adjust alert grouping - Add custom base layers by editing the
baseLayersobject inscript.js - Customize icon mappings in
getIconForEvent()function - Update glossary terms in
configs/glossary.json
Map doesn't load: Check browser console for errors. Ensure libraries loaded (Leaflet, axios).
No alerts showing: APIs may be down or returning no data. Check network requests in browser DevTools.
Geolocation prompt: Browser will ask permission to access location. Allow to center map on your location.
Slow performance: Reduce zoom level or disable some alert categories to improve rendering.
This project uses:
- Leaflet (BSD 2-Clause License)
- Leaflet.markercluster (MIT License)
- OpenStreetMap data (ODbL)
- Esri satellite imagery
- MapTiler topographic maps
- National Weather Service for alert data
- NASA Earth Observation Natural Events Tracking for disaster data
- OpenStreetMap for map data
- Leaflet for interactive mapping functionality