Skip to content

fix: wind field no longer goes blank when panning a rotated map#1097

Draft
msupino wants to merge 2 commits into
devfrom
fix/windfield-pan-blank
Draft

fix: wind field no longer goes blank when panning a rotated map#1097
msupino wants to merge 2 commits into
devfrom
fix/windfield-pan-blank

Conversation

@msupino

@msupino msupino commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Follow-up to #1094 (positions + direction on rotated maps, already merged to dev).

Bug: with the map rotated, panning/zooming made the wind field vanish and stay blank.

Cause: leaflet-velocity re-projects onto a stale canvas position after a move and redraws an empty field (the canvas element stays, but nothing is drawn). Clean re-positioning doesn't restore it; only a fresh field build does.

Fix: extract buildLayer() (the initial-render path) and recreate the layer on moveend/zoomend/rotate/rotateend while the map is rotated. North-up moves keep Leaflet's native handling (no particle reset). rAF-coalesced so a dial drag rebuilds once per frame.

Test: pan a rotated map, assert the velocity canvas still has drawn pixels (was 0). Full suite 982 passed.

On a rotated map leaflet-velocity re-projects onto a stale canvas
position after a pan/zoom and redraws an empty field. Recreate the layer
(buildLayer, same path as the initial render) on moveend/zoomend/rotate/
rotateend while the map is rotated; north-up moves keep Leaflet's native
handling (no particle reset). New test pans a rotated map and asserts the
field stays drawn. Full suite 982 passed.
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview deployed

Open PR preview →

https://msupino.github.io/NavigationApp/branch/fix/windfield-pan-blank/

Commit: 2e114a8

@msupino msupino marked this pull request as ready for review July 4, 2026 16:02
@github-actions github-actions Bot enabled auto-merge (squash) July 4, 2026 16:02
@msupino msupino marked this pull request as draft July 4, 2026 16:02
auto-merge was automatically disabled July 4, 2026 16:02

Pull request was converted to draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant