Calling <Infos/> when receiving location intent.

This commit is contained in:
vdv committed 2023-01-28 21:51:28 +01:00
1 parent 93d13b749a
commit a42c6d99a1
2 files changed
+10 -3

No files matched your search

+4 -2
View File
@@ -24,6 +24,7 @@ import style from '../gpx/styles';
import OsmFindAll from './OsmFindAll';
import { eventNames } from 'pouchdb-browser';
import { toLonLat } from 'ol/proj';
import { getMap } from '../map';
const Item = styled(Paper)(({ theme }) => ({
...theme.typography.body2,
@@ -47,9 +48,10 @@ const level2Key = (feature: Feature) =>
export const clickHandler = (event: any) => {
hierarchy = {};
const map = event.map || getMap();
const pixel = [event.originalEvent.x, event.originalEvent.y];
const features = event.map.getFeaturesAtPixel(pixel, { hitTolerance: 30 });
setLocation(toLonLat(event.map.getCoordinateFromPixel(pixel)));
const features = map.getFeaturesAtPixel(pixel, { hitTolerance: 30 });
setLocation(toLonLat(map.getCoordinateFromPixel(pixel)));
console.log({ caller: 'Infos.tsx / clickHandler', features, event });
selectedFeatures.map((feature) => {
if (feature.set) {