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]
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.url = `https://www.openstreetmap.org/api/0.6/${osm_type}/${osm_id}/full`
importer.submit()
}
})
el.appendChild(tools)
this._formatResult(feature, el)