clean tool

This commit is contained in:
vcoppe committed 2026-10-04 20:38:46 +02:00
1 parent c04367dd86
commit c6bd5b06e8
4 files changed
+422 -69

No files matched your search

+23
View File
@@ -494,6 +494,29 @@ class Engine {
return this.run((w) => w.delete_waypoint(fileId, waypointId));
}
/**
* Removes the trackpoints and/or waypoints of the selection inside (or outside) a rectangle.
* Resolves to `false` when nothing was removed.
*/
clean(
bounds: { west: number; south: number; east: number; north: number },
inside: boolean,
trackpoints: boolean,
waypoints: boolean
) {
return this.run((w) =>
w.clean(
bounds.west,
bounds.south,
bounds.east,
bounds.north,
inside ? w.CleanType.Inside : w.CleanType.Outside,
trackpoints,
waypoints
)
);
}
/** A trackpoint of a segment, `undefined` if it does not exist. */
trackpoint(fileId: string, segmentId: string, index: number): TrackpointDetails | undefined {
return this.wasm?.trackpoint(fileId, segmentId, index);