Calling <Infos/> when receiving location intent.
This commit is contained in:
1 parent
93d13b749a
commit
a42c6d99a1
2 files changed
+10
-3
No files matched your search
@@ -50,6 +50,7 @@ import MVT from 'ol/format/MVT.js';
|
||||
import style from '../gpx/styles';
|
||||
import ClusterableVectorTileSourceProxy from '../../lib/ClusterableVectorTileSourceProxy';
|
||||
import { Overlays } from '../overlays/Overlays';
|
||||
import { WindowSharp } from '@suid/icons-material';
|
||||
|
||||
const [getState, setState] = createSignal({
|
||||
lon: 0,
|
||||
@@ -93,13 +94,17 @@ const Map: Component = () => {
|
||||
const url = new URL(intent.data);
|
||||
const q = url.search;
|
||||
const [, lat, lon] = q.match(/q=([0-9.-]+),([0-9.-]+)/);
|
||||
const zoom = Math.min(18, getState().zoom);
|
||||
const zoom = Math.max(18, getState().zoom);
|
||||
console.log({ caller: 'Intent receiver', intent, url, lat, lon, zoom });
|
||||
navigate(
|
||||
`/map/${getState().provider}/${lon}/${lat}/${zoom}/${
|
||||
getState().rotation
|
||||
}`
|
||||
);
|
||||
clickHandler({
|
||||
map: false,
|
||||
originalEvent: { x: window.innerWidth / 2, y: window.innerHeight / 2 },
|
||||
});
|
||||
});
|
||||
} else {
|
||||
console.log({
|
||||
|
||||
Reference in new issue
Block a user