Playing with URL hashes
This commit is contained in:
1 parent
27a04f8a5d
commit
c17f47bb67
2 files changed
+11
-22
No files matched your search
@@ -1,10 +1,8 @@
|
||||
import { Button, Grid, IconButton } from '@suid/material';
|
||||
import { Button, IconButton } from '@suid/material';
|
||||
import { Feature } from 'ol';
|
||||
import { Geometry } from 'ol/geom';
|
||||
import { getLength } from 'ol/sphere';
|
||||
import { Component, createSignal, For, Show } from 'solid-js';
|
||||
import { useI18n } from '@solid-primitives/i18n';
|
||||
import EditIcon from '@suid/icons-material/Edit';
|
||||
import TravelExploreIcon from '@suid/icons-material/TravelExplore';
|
||||
import AddLocationAltIcon from '@suid/icons-material/AddLocationAlt';
|
||||
import OpenInNewIcon from '@suid/icons-material/OpenInNew';
|
||||
@@ -22,9 +20,7 @@ import {
|
||||
} from '../map-tile-provider/MapTileProvider';
|
||||
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,
|
||||
@@ -48,7 +44,7 @@ const level2Key = (feature: Feature) =>
|
||||
export const clickHandler = (event: any) => {
|
||||
hierarchy = {};
|
||||
|
||||
const map = event.map || getMap();
|
||||
const map = event.map;
|
||||
const pixel = [event.originalEvent.x, event.originalEvent.y];
|
||||
const features = map.getFeaturesAtPixel(pixel, { hitTolerance: 30 });
|
||||
setLocation(toLonLat(map.getCoordinateFromPixel(pixel)));
|
||||
|
||||
Reference in new issue
Block a user