mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 11:52:38 +02:00
feat: add more context in overpass importer autocomplete results
This commit is contained in:
parent
33b0f6c318
commit
f3f61f5d98
1 changed files with 11 additions and 1 deletions
|
@ -25,10 +25,20 @@ class Autocomplete extends SingleMixin(BaseAjax) {
|
||||||
}
|
}
|
||||||
|
|
||||||
createResult(item) {
|
createResult(item) {
|
||||||
|
const labels = [item.properties.name]
|
||||||
|
if (item.properties.county) {
|
||||||
|
labels.push(item.properties.county)
|
||||||
|
}
|
||||||
|
if (item.properties.state) {
|
||||||
|
labels.push(item.properties.state)
|
||||||
|
}
|
||||||
|
if (item.properties.country) {
|
||||||
|
labels.push(item.properties.country)
|
||||||
|
}
|
||||||
return super.createResult({
|
return super.createResult({
|
||||||
// Overpass convention to get their id from an osm one.
|
// Overpass convention to get their id from an osm one.
|
||||||
value: item.properties.osm_id + 3600000000,
|
value: item.properties.osm_id + 3600000000,
|
||||||
label: `${item.properties.name}`,
|
label: labels.join(', '),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue