reverses waypoint relation

This commit is contained in:
Christian Beutel
2025-09-12 17:48:41 +02:00
parent 9c628c6511
commit 73d20b1cbc
19 changed files with 238 additions and 115 deletions

View File

@@ -45,7 +45,7 @@ export async function gpx2trail(gpxString: string, fallbackName?: string, correc
wp.id = cryptoRandomString({ length: 15 });
wp.name = wpt.name ?? ""
wp.description = wpt.desc;
trail.expand!.waypoints?.push(wp);
trail.expand!.waypoints_via_trail?.push(wp);
}
const totals = gpx.features
@@ -108,7 +108,7 @@ export async function trail2gpx(trail: Trail, user?: AuthRecord) {
gpx.wpt = [];
}
for (const wp of gpxTrail.expand!.waypoints ?? []) {
for (const wp of gpxTrail.expand!.waypoints_via_trail ?? []) {
const gpxWpt = gpx.wpt.find((w) => w.$.lat == wp.lat && w.$.lon == wp.lon)
if (!gpxWpt) {
gpx.wpt.push(new GPXWaypoint({