Bug fix in intent (lon/lat may be negative)

This commit is contained in:
Eric van der Vlist 2023-01-28 21:29:13 +01:00
parent 2d73eb0886
commit 93d13b749a
1 changed files with 2 additions and 1 deletions

View File

@ -92,8 +92,9 @@ const Map: Component = () => {
console.log({ caller: 'Intent receiver', intent });
const url = new URL(intent.data);
const q = url.search;
const [, lat, lon] = q.match(/q=([0-9.]+),([0-9.]+)/);
const [, lat, lon] = q.match(/q=([0-9.-]+),([0-9.-]+)/);
const zoom = Math.min(18, getState().zoom);
console.log({ caller: 'Intent receiver', intent, url, lat, lon, zoom });
navigate(
`/map/${getState().provider}/${lon}/${lat}/${zoom}/${
getState().rotation