Skip to content

Commit

Permalink
Merge pull request #2087 from umap-project/overpass-autocomplete-context
Browse files Browse the repository at this point in the history
feat: add more context in overpass importer autocomplete results
  • Loading branch information
yohanboniface committed Sep 3, 2024
2 parents 7f1e008 + f3f61f5 commit 6a8be34
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion umap/static/umap/js/modules/importers/overpass.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(', '),
})
}
}
Expand Down

0 comments on commit 6a8be34

Please sign in to comment.