mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 14:44:51 +02:00
feat(search): add viewport bias for location-aware geocoding
- Add mapCenter state to store (lat/lon/zoom) - Track map center on moveend in MapView - Pass mapCenter to searchGeocode from SearchBar - Update searchGeocode API call to include viewport params Search results now prioritize locations near the current map view. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
ec6f4254b9
commit
b12ebe672e
4 changed files with 158 additions and 3 deletions
|
|
@ -40,6 +40,10 @@ export const useStore = create((set, get) => ({
|
|||
setUserLocation: (loc) => set({ userLocation: loc }),
|
||||
setGeoPermission: (p) => set({ geoPermission: p }),
|
||||
|
||||
// ── Map viewport (for search bias) ──
|
||||
mapCenter: null, // { lat, lon, zoom }
|
||||
setMapCenter: (center) => set({ mapCenter: center }),
|
||||
|
||||
// ── Mode ──
|
||||
mode: 'auto', // 'auto' | 'pedestrian' | 'bicycle'
|
||||
setMode: (mode) => set({ mode }),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue