Improvements to wikidata element

This commit is contained in:
Pieter Vander Vennet 2024-02-28 02:13:56 +01:00
parent 6897b88817
commit b795273974
3 changed files with 4 additions and 6 deletions

View file

@ -69,11 +69,10 @@ export default class InputHelpers {
) {
const inputHelperOptions = props
const args = inputHelperOptions.args ?? []
const searchKey = <string>args[0] ?? "name"
const searchKey: string = <string>args[0] ?? "name"
const searchFor = <string>(
(inputHelperOptions.feature?.properties[searchKey]?.toLowerCase() ?? "")
)
const searchFor: string = searchKey.split(";").map(k => inputHelperOptions.feature?.properties[k]?.toLowerCase())
.find(foundValue => !!foundValue) ?? ""
let searchForValue: UIEventSource<string> = new UIEventSource(searchFor)
const options: any = args[1]