Weather Panel Loading Fix

Date: 2026-10-08
Commit: e6499a87667671a5887cdb9b5f5ff495b2c2f455

Root Cause

The CARTO basemap removal edit introduced a call to map.attributionControl.clearAttribution() — a method that does not exist in Leaflet 1.9.4. The Leaflet attribution control only exposes addAttribution() and removeAttribution().

This caused a TypeError: map.attributionControl.clearAttribution is not a function at runtime, which crashed the entire weather-panel.js IIFE immediately after L.map() was created. Because the crash happened inside initRadar() (which is called before loadConditions()), both the radar and the conditions/risk panel were stuck on "Loading…" — no JS after the crash point executed.

What Was Changed

In weather-panel.js:

  1. Replaced map.attributionControl.clearAttribution() with map.attributionControl.removeAttribution('Map data © ...') — the correct Leaflet API to strip the default OSM credit string.
  2. Improved the radar .catch() to log errors to console instead of silently swallowing them.
  3. Improved the conditions .catch() to log errors and display "Weather unavailable." in the panel instead of leaving "Loading current conditions…" indefinitely.

Verification

Other CARTO References Found

None found in any other file. The only CARTO reference was the now-removed tile layer in weather-panel.js and a stale CSS comment in site.css (comment only, no functional impact — already patched).