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: {