mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
fixup: let the importer deal with getting the OSM url in search
Co-authored-by: David Larlet <david@larlet.fr>
This commit is contained in:
parent
b3e39bf654
commit
7a2bf9fc4c
1 changed files with 5 additions and 9 deletions
|
@ -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 response = await this.map._umap.request.get(url)
|
|
||||||
if (response?.ok) {
|
|
||||||
const importer = this.map._umap.importer
|
const importer = this.map._umap.importer
|
||||||
importer.build()
|
importer.build()
|
||||||
importer.format = 'osm'
|
importer.format = 'osm'
|
||||||
importer.raw = await response.text()
|
importer.url = `https://www.openstreetmap.org/api/0.6/${osm_type}/${osm_id}/full`
|
||||||
importer.submit()
|
importer.submit()
|
||||||
}
|
|
||||||
})
|
})
|
||||||
el.appendChild(tools)
|
el.appendChild(tools)
|
||||||
this._formatResult(feature, el)
|
this._formatResult(feature, el)
|
||||||
|
|
Loading…
Reference in a new issue