fix xml output for osm attributes

This commit is contained in:
vcoppe
2024-10-08 12:04:07 +02:00
parent 45f6c405c0
commit 193c77e51a
2 changed files with 5 additions and 4 deletions

View File

@@ -155,7 +155,7 @@
let surface = point.extensions.surface ? point.extensions.surface : 'unknown';
let highway = point.extensions.highway ? point.extensions.highway : 'unknown';
let sacScale = point.extensions.sac_scale;
let mtbScale = point.extensions['mtb:scale'];
let mtbScale = point.extensions.mtb_scale;
let labels = [
` ${$_('quantities.distance')}: ${getDistanceWithUnits(point.x, false)}`,
@@ -455,7 +455,7 @@
return getHighwayColor(
context.p0.raw.extensions.highway,
context.p0.raw.extensions.sac_scale,
context.p0.raw.extensions['mtb:scale']
context.p0.raw.extensions.mtb_scale
);
}

View File

@@ -96,8 +96,9 @@ function getTags(message: string): { [key: string]: string } {
const fields = message.split(" ");
let tags: { [key: string]: string } = {};
for (let i = 0; i < fields.length; i++) {
let tag = fields[i].split("=");
tags[tag[0]] = tag[1];
let [key, value] = fields[i].split("=");
key = key.replace(/:/g, '_');
tags[key] = value;
}
return tags;
}