diff --git a/src/components/gpx-record/GpxRecord.tsx b/src/components/gpx-record/GpxRecord.tsx index 3e04200..564ae50 100644 --- a/src/components/gpx-record/GpxRecord.tsx +++ b/src/components/gpx-record/GpxRecord.tsx @@ -19,6 +19,9 @@ import { import dispatch from '../../workers/dispatcher-main'; import { emptyTrk } from '../../db/trk'; import getUri from '../../lib/ids'; +import { setCurrentLocation } from '../get-location/GetLocation'; +import { getState } from '../map'; +import { useNavigate } from '@solidjs/router'; declare global { var $lastValidLocationTime: number; @@ -26,6 +29,7 @@ declare global { const GpxRecord: Component<{}> = (props) => { const [t] = useI18n(); + const navigate = useNavigate(); const [state, setState] = createSignal('stopped'); const [open, setOpen] = createSignal(false); const [watcherId, setWatcherId] = createSignal(); @@ -58,6 +62,11 @@ const GpxRecord: Component<{}> = (props) => { }, }, }); + setCurrentLocation({lon:location.longitude, lat:location.latitude}); + const state = getState(); + navigate( + `/map/${state.provider}/${location.longitude}/${location.latitude}/${state.zoom}/${state.rotation}` + ); } };