fixes wp marker removal
This commit is contained in:
@@ -72,6 +72,7 @@ export function createMarkerFromWaypoint(waypoint: Waypoint, onDragEnd?: (marker
|
||||
marker.on("dragend", () => onDragEnd(marker, waypoint.id,));
|
||||
}
|
||||
|
||||
waypoint.marker = marker
|
||||
return marker;
|
||||
}
|
||||
|
||||
|
||||
@@ -402,9 +402,12 @@
|
||||
}
|
||||
|
||||
function deleteWaypoint(index: number) {
|
||||
$formData.expand!.waypoints?.splice(index, 1);
|
||||
const wp = $formData.expand!.waypoints?.splice(index, 1);
|
||||
$formData.waypoints.splice(index, 1);
|
||||
$formData.expand!.waypoints = $formData.expand!.waypoints;
|
||||
|
||||
wp?.[0]?.marker?.remove();
|
||||
|
||||
// updateTrailOnMap();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user