mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 22:54:42 +02:00
fix(map): atomic boundary transition when switching places
Remove the clear-then-set pattern when clicking a new labeled feature. Previously, clicking Kimberly after Twin Falls would: 1. Clear Twin Falls boundary 2. Set new place 3. Wait for API to return 4. Set Kimberly boundary This caused the old boundary to disappear before the new one was ready, requiring two clicks. Now when clicking a new labeled feature: 1. Set new place immediately 2. When API returns, updateBoundary(newData) replaces old data in-place The GeoJSON source only holds one dataset - setting new data naturally replaces old data. Explicit clear only needed when deselecting or clicking empty map. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
ac7cec972f
commit
68f0a8dff7
1 changed files with 1 additions and 2 deletions
|
|
@ -1280,8 +1280,7 @@ const MapView = forwardRef(function MapView(_, ref) {
|
|||
highlightedFeatureRef.current = null
|
||||
}
|
||||
setSelectedHighlight(map, null)
|
||||
// Clear old boundary before setting new place
|
||||
if (updateBoundaryRef.current) updateBoundaryRef.current(null)
|
||||
// Note: do not clear boundary here - new data replaces old when API returns
|
||||
|
||||
if (labelFeature) {
|
||||
// Clicked a labeled feature — snap to geometry and highlight
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue