fixes waypoint move after save bug

This commit is contained in:
Christian Beutel
2024-12-05 01:17:51 +01:00
parent a39c880272
commit 8adaa52f81
3 changed files with 24 additions and 16 deletions

View File

@@ -31,6 +31,9 @@
export let showFullscreen: boolean = false;
export let showTerrain: boolean = false;
export let fitBounds: "animate" | "instant" | "off" = "instant";
export let onMarkerDragEnd:
| ((marker: M.Marker, wpId?: string) => void)
| undefined = undefined;
export let elevationProfileContainer: string | HTMLDivElement | undefined =
undefined;
@@ -488,7 +491,7 @@
return;
}
for (const waypoint of trails[activeTrail]?.expand.waypoints ?? []) {
const marker = createMarkerFromWaypoint(waypoint);
const marker = createMarkerFromWaypoint(waypoint, onMarkerDragEnd);
marker.addTo(map);
markers.push(marker);
}