mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-10 07:36:29 +00:00
clean tool
This commit is contained in:
1 parent
c04367dd86
commit
c6bd5b06e8
4 files changed
+422
-69
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user