fix(search): pan + mark when opening a building by BAG number#252
Merged
Conversation
Searching by BAG number resolved and opened the building, but the map never moved and no marker dropped: the direct-BAG branch had no coordinate source (the geocoder stopped returning building coordinates on navigation, and the address path was the only one fixed to pan). Surface the building footprint centroid (residence point preferred, centroid fallback) through the geolocation adapter, and rework the direct-BAG branch to mirror the address path: drop a marker + pan from the resolved coordinates, reflect the resolved address in the box, and navigate by the canonical PAND id. Center is set only after navigation completes so the URL writeback doesn't cancel the route push. Refs Laixer/FunderMaps#986 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Why
Closes part of Laixer/FunderMaps#986 — "the searchbar must support searching by BAG number." The BAG-direct path already resolved and opened the building, but the map never panned and no marker dropped. Since commit
b5e51b4("the TS API geocoder no longer returns building coordinates"), the map only pans whenmapCenterLatLon/mapMarkerLatLonare set explicitly at the source. The PDOK address path was fixed to do that (from PDOK'scentroide_ll); the direct-BAG path was never given a coordinate source, so it opened the panel but left the map where it was. It also navigated by the raw typed id and threw away the lookup result.What
building.latitude/building.longitudeon the geolocation data (residence point preferred, building centroid fallback — see the paired API PR fix(geocoder): return building centroid from /building-info FunderMapsApi#71). Nothing else watches these fields, so the map-click flow is unaffected.lookupBuilding→openBuilding) now mirrors the working address path — drops a marker + pans from the resolved coordinates, reflects the resolved address in the search box, and navigates by the canonical PAND id.mapCenterLatLonis set only afternavigateToBuildingresolves, because the center change triggers a URL writeback inmapCenterRoutingthat would otherwise push the old route and cancel the navigation (same ordering ashandleSelectBuilding).nulland fall through to PDOK suggestions, unchanged.Verification (E2E on the guest)
vue-tsc --noEmitclean;pnpm buildgreen.NL.IMBAG.PAND.*form, and a bogus id:","mislabel);null→ falls through to PDOK without crashing.Depends on
Laixer/FunderMapsApi#71 for the centroid fields. The adapter degrades gracefully against an un-upgraded API (falls back to residence coords, i.e. today's behavior), so there's no hard deploy ordering.
🤖 Generated with Claude Code