From 7a2bf9fc4cc86a732b391c018dcb13d0f5eaf516 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 7 Mar 2025 17:58:56 +0100 Subject: [PATCH] fixup: let the importer deal with getting the OSM url in search Co-authored-by: David Larlet --- umap/static/umap/js/umap.controls.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index 8d25eba2..c2aa03e7 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -454,15 +454,11 @@ U.Search = L.PhotonSearch.extend({ } const osm_type = types[feature.properties.osm_type] if (!osm_type || !osm_id) return - const url = `https://www.openstreetmap.org/api/0.6/${osm_type}/${osm_id}/full` - const response = await this.map._umap.request.get(url) - if (response?.ok) { - const importer = this.map._umap.importer - importer.build() - importer.format = 'osm' - importer.raw = await response.text() - importer.submit() - } + const importer = this.map._umap.importer + importer.build() + importer.format = 'osm' + importer.url = `https://www.openstreetmap.org/api/0.6/${osm_type}/${osm_id}/full` + importer.submit() }) el.appendChild(tools) this._formatResult(feature, el)