handle gpx style attributes without the namespace

This commit is contained in:
vcoppe
2025-01-01 20:01:46 +01:00
parent a853c45ec7
commit bae0a3f93b
3 changed files with 33 additions and 7 deletions

View File

@@ -21,6 +21,19 @@ export function parseGPX(gpxData: string): GPXFile {
// Transform the simple <power> tag to the more complex <gpxpx:PowerExtension> tag, the nested <gpxpx:PowerInWatts> tag is then handled by the tagValueProcessor
return 'gpxpx:PowerExtension';
}
// Add the gpx_style namespace to the line style tags
if (tagName === 'line') {
return 'gpx_style:line';
}
if (tagName === 'color') {
return 'gpx_style:color';
}
if (tagName === 'opacity') {
return 'gpx_style:opacity';
}
if (tagName === 'width') {
return 'gpx_style:width';
}
return tagName;
},
parseTagValue: false,