4.0 pre-release. This is a test release of 4.0. 4.0 is the first version that can show Home Assistant's vector map under the radar. It is developed on its own branch. 3.13.0 is the current stable release. Bug fixes go to both. Each 4.0 alpha, beta and release candidate starts with this note.
What 4.0 changes. It adds a second file,
weather-radar-card-maplibre.js, next to the card. HACS installs it. A manual install must copy it. It also changes what the re-centre button does when a marker is tracked (see Breaking changes). All other new features are off until you turn them on.How to install a pre-release. In HACS, open the card and turn on Show beta versions. To go back, select 3.13.0 in the same place. Report problems at https://github.com/jpettitt/weather-radar-card/issues.
Fixed
- iPhone Safari ran out of memory with the radar loop. Leaflet blends every map tile with a mode meant for a Chromium seam bug, and on WebKit that gives each tile its own device-resolution buffer: about 12 MB per radar tile on a 3x phone, 730 MB for a 13-frame loop, so iOS ended the page at its 2 GB limit on a pinch. On Safari the card now lets WebKit draw tiles straight from the decoded image.
- Fast pinch zoom on a phone. During a pinch, Leaflet created tiles for every zoom level the gesture crossed, for all radar frames at once: up to 560 tile images in 85 map layers until the gesture ended. The radar frames now keep scaling their current tiles during a zoom and load the new zoom once it settles, as Leaflet does for its own layers on mobile. The canvas that draws NWS alerts and wildfire perimeters, the pane that holds fire icons and wind barbs, and the lightning canvas leave the page while the map zooms and come back once the map has been still for a second; the hazard overlays rebuild on that same quiet moment instead of on Leaflet's move-end, and the alerts layer does nothing at all while the map moves: no redraw on a state update or a refresh, and no zone shape is fetched or decoded until the map is still. Leaflet scaled the canvas with a CSS transform on every touch move and animated every icon on the snap-back, which crashed Safari on an iPhone whenever one of those overlays was on.
- Mobile browser crash on a preset switch with NWS alerts on. With every alert category on, the alerts layer held 3 million polygon vertices, mostly marine advisories, and re-projected all of them on each zoom: a 150 to 200 MB memory spike per switch. Zone outlines are now simplified to about 220 m before they are cached (six times fewer vertices, invisible below zoom 11), drawn at half a pixel of detail for the current zoom (about ten times fewer again at zoom 3), and only the alerts that touch the view are built as map polygons. A view change while an alert popup is open waits for the popup to close.
- NWS alerts never loaded after a blocked zone burst. On a cold cache with every category on, the card requested 2,100 zone shapes at once, NWS blocked the address, and every 60 s refresh re-sent the same burst. Zone shapes are now fetched 24 at a time, alerts in view first, and the next request does not wait for the shape to be written to the browser's cache. After a block the card waits 5 s, doubling to 5 min, and resumes at half speed until shapes arrive again.
- Alerts on some NWS zones never got a shape. NWS publishes some zones (Michigan's, for example) as a GeometryCollection, which the card skipped and requested again every minute. They are drawn now.
- Alert fetch failures are no longer silent. When the NWS alerts list or some zone shapes fail to load, a banner says so while the card retries. Before, the only sign was a console message and a retry backoff of up to 30 minutes.
Earlier
4.0.0-alpha2 fixed blank frames after a preset switch. 4.0.0-alpha1 added the vector map, view presets and layer toggles; its notes list the breaking changes. 3.13.0 is the current stable release. All are included here.
Full Changelog: v4.0.0-alpha2...v4.0.0-alpha3