map context menu with coordinates, closes #149

This commit is contained in:
vcoppe
2025-01-25 12:31:12 +01:00
parent e02a22eaea
commit d19e702084
5 changed files with 41 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ import MapPopupComponent from "./MapPopup.svelte";
export type PopupItem<T = Waypoint | TrackPoint | any> = {
item: T;
fileId?: string;
hide?: () => void;
};
export class MapPopup {
@@ -30,6 +31,8 @@ export class MapPopup {
}
setItem(item: PopupItem | null) {
if (item)
item.hide = () => this.hide();
this.item.set(item);
if (item === null) {
this.hide();