feat: loading indicator, gray-tile fix, polygon click-to-zoom#60
Merged
madhavcodez merged 1 commit intomainfrom Apr 15, 2026
Merged
feat: loading indicator, gray-tile fix, polygon click-to-zoom#60madhavcodez merged 1 commit intomainfrom
madhavcodez merged 1 commit intomainfrom
Conversation
Install InvalidateSizeHandler that runs map.invalidateSize() 100ms after mount and watches for container size changes via ResizeObserver, so tiles render correctly on initial load, sidebar toggles, and window resizes. Render a thin pulsing blue bar at the top of the map while either /locations or /image-pairs is in flight so the UI feels responsive during larger fetches. Make damage polygons clickable: onClick fires map.flyTo(centroid, zoom=18) with a 0.8s animation so users can drill into any building from the overview. Closes #42 Closes #57 Closes #46
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Three related map-polish fixes: no more gray tiles on first load, a loading indicator during fetches, and smooth zoom into any damage polygon you click.
1. Gray-tile fix (
InvalidateSizeHandler)Leaflet measures the container once on mount, and if the container is still being laid out that measurement is wrong, giving you a map of gray squares until you resize the window. Now we run
map.invalidateSize()100ms after mount AND install aResizeObserverso tiles re-measure correctly on every sidebar toggle and window resize — the fix covers the full lifecycle, not just the initial paint.2. Loading indicator
A thin pulsing blue bar flashes across the top of the map whenever
/locationsor/image-pairsis in flight, so the UI feels responsive during larger fetches instead of appearing frozen.3. Polygon click-to-zoom
Click any damage polygon (red, orange, yellow, green) and the map smoothly flies to its centroid at zoom 18 over 0.8s. The popup with classification details still opens alongside.
How to verify
Closes #42
Closes #57
Closes #46