diff options
| author | copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> | 2026-03-13 11:40:26 +0000 |
|---|---|---|
| committer | copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> | 2026-03-13 11:40:26 +0000 |
| commit | c8d7ab720004ab4a10bf6feb98f7cf4ef450c1e0 (patch) | |
| tree | f3038dbb50ad1fce2579d7f107450645690d7cda /src/frontend/app/components | |
| parent | e691b6c9a2182ede263dd355d0d31f0f65c62380 (diff) | |
feat: map search field, pick-on-map returns to planner, geolocate + viewport fixes
Co-authored-by: arielcostas <94913521+arielcostas@users.noreply.github.com>
Diffstat (limited to 'src/frontend/app/components')
| -rw-r--r-- | src/frontend/app/components/shared/AppMap.tsx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/frontend/app/components/shared/AppMap.tsx b/src/frontend/app/components/shared/AppMap.tsx index d4ad557..f4c8658 100644 --- a/src/frontend/app/components/shared/AppMap.tsx +++ b/src/frontend/app/components/shared/AppMap.tsx @@ -163,14 +163,9 @@ export const AppMap = forwardRef<MapRef, AppMapProps>( const viewState = useMemo(() => { if (initialViewState) return initialViewState; - if (mapPositionMode === "gps" && mapState.userLocation) { - return { - latitude: getLatitude(mapState.userLocation), - longitude: getLongitude(mapState.userLocation), - zoom: 16, - }; - } - + // Prefer the last saved position for this path so navigation doesn't + // reset the map viewport. GPS mode is only used as a fallback when the + // user has never visited this path before. const pathState = mapState.paths[path]; if (pathState) { return { @@ -180,6 +175,14 @@ export const AppMap = forwardRef<MapRef, AppMapProps>( }; } + if (mapPositionMode === "gps" && mapState.userLocation) { + return { + latitude: getLatitude(mapState.userLocation), + longitude: getLongitude(mapState.userLocation), + zoom: 16, + }; + } + return { latitude: getLatitude(APP_CONSTANTS.defaultCenter), longitude: getLongitude(APP_CONSTANTS.defaultCenter), @@ -210,7 +213,6 @@ export const AppMap = forwardRef<MapRef, AppMapProps>( {showGeolocate && ( <GeolocateControl position="bottom-right" - trackUserLocation={true} positionOptions={{ enableHighAccuracy: false }} onGeolocate={(e) => { const { latitude, longitude } = e.coords; |
