From f3f61f5d980bb8887f2c2ea35f1720400dbb821e Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 2 Sep 2024 17:01:04 +0200 Subject: [PATCH] feat: add more context in overpass importer autocomplete results --- umap/static/umap/js/modules/importers/overpass.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/modules/importers/overpass.js b/umap/static/umap/js/modules/importers/overpass.js index 3f1dacaf7..28ccc52a1 100644 --- a/umap/static/umap/js/modules/importers/overpass.js +++ b/umap/static/umap/js/modules/importers/overpass.js @@ -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(', '), }) } }