fix dnd bugs

This commit is contained in:
vcoppe
2024-06-05 15:20:28 +02:00
parent 5f7155090b
commit 69334d977d
2 changed files with 22 additions and 4 deletions

View File

@@ -289,16 +289,18 @@ export class GPXLayer {
showWaypointPopup(waypoint: Waypoint) {
let marker = this.markers[waypoint._data.index];
currentWaypoint.set(waypoint);
marker.setPopup(waypointPopup);
marker.togglePopup();
if (marker) {
currentWaypoint.set(waypoint);
marker.setPopup(waypointPopup);
marker.togglePopup();
}
}
hideWaypointPopup() {
let waypoint = get(currentWaypoint);
if (waypoint) {
let marker = this.markers[waypoint._data.index];
marker.getPopup()?.remove();
marker?.getPopup()?.remove();
}
}