mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 10:44:23 +00:00
fix(tours): preserve map viewport during route updates
This commit is contained in:
@@ -1082,6 +1082,7 @@ function TripPlannerPageDesktop(): React.ReactElement | null {
|
||||
tripId={tripId}
|
||||
places={[]}
|
||||
route={tourMap.route}
|
||||
followSelection={false}
|
||||
onMapClick={canPlaceEdit && !tourPlanner.isSaving && (tourPlanner.mode.type === 'new-draft' || tourPlanner.mode.type === 'edit-saved')
|
||||
? ({ latlng }: { latlng: { lat: number; lng: number } }) => tourPlanner.addWaypoint(latlng.lat, latlng.lng)
|
||||
: undefined}
|
||||
@@ -1089,6 +1090,7 @@ function TripPlannerPageDesktop(): React.ReactElement | null {
|
||||
leftWidth={leftPanelPx}
|
||||
rightWidth={rightPanelPx}
|
||||
focusPoints={tourMap.focusPoints}
|
||||
focusKey={tourMap.focusKey}
|
||||
plannerWaypoints={tourPlanner.mode.type === 'new-draft' || tourPlanner.mode.type === 'edit-saved' ? tourPlanner.waypoints : []}
|
||||
selectedPlannerWaypointId={tourPlanner.mode.type === 'new-draft' || tourPlanner.mode.type === 'edit-saved' ? tourPlanner.selectedWaypointId : null}
|
||||
onPlannerWaypointClick={tourPlanner.setSelectedWaypointId}
|
||||
|
||||
@@ -101,6 +101,6 @@ export function useTripPlannerPage() {
|
||||
permissions: { canPlaceEdit, canDayEdit },
|
||||
tourPlanner,
|
||||
tourDetails: { openerRef: tourDetailOpenerRef, onSelectTour },
|
||||
tourMap: { route, focusPoints, captureViewport },
|
||||
tourMap: { route, focusPoints, focusKey: tourPlanner.mapFocusKey, captureViewport },
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user