UX: when clicking on the map, all (way) features within 20px are inspected and the closest one is inspected. Fixes #2261

This commit is contained in:
Pieter Vander Vennet 2024-11-18 21:38:30 +01:00
parent c34300fae1
commit 8680fce4e7
5 changed files with 76 additions and 22 deletions

View file

@ -1,6 +1,7 @@
import { Store, UIEventSource } from "../Logic/UIEventSource"
import { BBox } from "../Logic/BBox"
import { RasterLayerPolygon } from "./RasterLayers"
import { Feature } from "geojson"
export interface KeyNavigationEvent {
date: Date
@ -19,7 +20,10 @@ export interface MapProperties {
readonly allowRotating: UIEventSource<true | boolean>
readonly rotation: UIEventSource<number>
readonly pitch: UIEventSource<number>
readonly lastClickLocation: Store<{ lon: number; lat: number }>
readonly lastClickLocation: Store<{ lon: number; lat: number ; /**
* The nearest feature from a MapComplete layer
*/
nearestFeature?: Feature}>
readonly allowZooming: UIEventSource<true | boolean>
readonly useTerrain: Store<boolean>
readonly showScale: UIEventSource<boolean>