From 555cc50e7d4029017feb4fbb33d257bfd52372dc Mon Sep 17 00:00:00 2001 From: vcoppe Date: Wed, 17 Jul 2024 23:30:02 +0200 Subject: [PATCH] add track name when exporting file with a single track --- gpx/src/io.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gpx/src/io.ts b/gpx/src/io.ts index 6a7d36f4..5da6b97f 100644 --- a/gpx/src/io.ts +++ b/gpx/src/io.ts @@ -96,6 +96,10 @@ export function buildGPX(file: GPXFile): string { } }; + if (gpx.trk.length === 1 && (gpx.trk[0].name === undefined || gpx.trk[0].name === '')) { + gpx.trk[0].name = gpx.metadata.name; + } + return builder.build({ "?xml": { attributes: {