This commit is contained in:
vcoppe
2026-10-04 17:29:57 +02:00
parent 594d714b7f
commit c536e6247b
8 changed files with 89 additions and 82 deletions
@@ -99,12 +99,10 @@
link,
};
if (target) {
// the engine changes the selected waypoint
await engine.selectWaypoints(target.fileId, [target.id]);
await engine.updateWaypoint(waypoint);
engine.updateWaypoint(target.fileId, target.id, waypoint);
} else {
// it goes in the selected files
await engine.newWaypoint(waypoint);
engine.newWaypoint(waypoint);
}
reset();
+4 -2
View File
@@ -449,10 +449,12 @@ class Engine {
);
}
/** Changes the selected waypoints. Empty strings remove the field. */
updateWaypoint(waypoint: NewWaypoint) {
/** Changes a waypoint, selected or not. Empty strings remove the field. */
updateWaypoint(fileId: string, waypointId: string, waypoint: NewWaypoint) {
return this.run((w) =>
w.update_waypoint(
fileId,
waypointId,
waypoint.lng,
waypoint.lat,
waypoint.ele,