fixup: let the importer deal with getting the OSM url in search
Some checks failed
Test & Docs / tests (postgresql, 3.10) (push) Has been cancelled
Test & Docs / tests (postgresql, 3.12) (push) Has been cancelled
Test & Docs / lint (push) Has been cancelled

Co-authored-by: David Larlet <david@larlet.fr>
This commit is contained in:
Yohan Boniface 2025-03-07 17:58:56 +01:00
parent b3e39bf654
commit 7a2bf9fc4c

View file

@ -454,15 +454,11 @@ U.Search = L.PhotonSearch.extend({
} }
const osm_type = types[feature.properties.osm_type] const osm_type = types[feature.properties.osm_type]
if (!osm_type || !osm_id) return if (!osm_type || !osm_id) return
const url = `https://www.openstreetmap.org/api/0.6/${osm_type}/${osm_id}/full` const importer = this.map._umap.importer
const response = await this.map._umap.request.get(url) importer.build()
if (response?.ok) { importer.format = 'osm'
const importer = this.map._umap.importer importer.url = `https://www.openstreetmap.org/api/0.6/${osm_type}/${osm_id}/full`
importer.build() importer.submit()
importer.format = 'osm'
importer.raw = await response.text()
importer.submit()
}
}) })
el.appendChild(tools) el.appendChild(tools)
this._formatResult(feature, el) this._formatResult(feature, el)