Allow adding extra tags

This commit is contained in:
Robin van der Linde 2024-04-29 01:07:02 +02:00
parent 8332650ea3
commit 943db6b02d
Signed by untrusted user: Robin-van-der-Linde
GPG key ID: 53956B3252478F0D
13 changed files with 57 additions and 70 deletions

View file

@ -23,6 +23,7 @@
let maintag = helperArgs[0].toString()
let tag = key
let addExtraTags = helperArgs[1].split(";")
const path = `${tag}s/${maintag.split("=")[0]}/${maintag.split("=")[1]}`
@ -132,6 +133,11 @@
})
}
// If we have layer-defined extra tags, also add them
addExtraTags.forEach((extraTag) => {
tags[extraTag.split("=")[0]] = extraTag.split("=")[1]
})
// Finally, set the extra tags
extraTags.setData(tags)
}

View file

@ -24,6 +24,10 @@ export default class NameSuggestionIndexValidator extends Validator {
"main",
"The main tag to give suggestions for, e.g. `amenity=restaurant`.",
],
[
"addExtraTags",
"Extra tags to add to the suggestions, e.g. `nobrand=yes`.",
],
]
),
]),