mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
Merge pull request #2087 from umap-project/overpass-autocomplete-context
feat: add more context in overpass importer autocomplete results
This commit is contained in:
commit
6a8be34dcc
1 changed files with 11 additions and 1 deletions
|
@ -25,10 +25,20 @@ class Autocomplete extends SingleMixin(BaseAjax) {
|
|||
}
|
||||
|
||||
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({
|
||||
// Overpass convention to get their id from an osm one.
|
||||
value: item.properties.osm_id + 3600000000,
|
||||
label: `${item.properties.name}`,
|
||||
label: labels.join(', '),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue