reset to previous commit

This commit is contained in:
karelleketers 2021-07-26 15:39:27 +02:00
parent d5b614fc44
commit 196d40084d
90 changed files with 4953 additions and 1922 deletions

View file

@ -83,7 +83,8 @@ export default class SimpleMetaTagger {
},
(feature => {
const units = State.state.layoutToUse.data.units ?? [];
const units = State.state?.layoutToUse?.data?.units ?? [];
let rewritten = false;
for (const key in feature.properties) {
if (!feature.properties.hasOwnProperty(key)) {
continue;
@ -95,16 +96,23 @@ export default class SimpleMetaTagger {
const value = feature.properties[key]
const [, denomination] = unit.findDenomination(value)
let canonical = denomination?.canonicalValue(value) ?? undefined;
console.log("Rewritten ", key, " from", value, "into", canonical)
if(canonical === undefined && !unit.eraseInvalid) {
if(canonical === value){
break;
}
console.log("Rewritten ", key, ` from '${value}' into '${canonical}'`)
if (canonical === undefined && !unit.eraseInvalid) {
break;
}
feature.properties[key] = canonical;
rewritten = true;
break;
}
}
if(rewritten){
State.state.allElements.getEventSourceById(feature.id).ping();
}
})
)