mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 20:02:36 +02:00
fix: allow to search a French departement in Overpass importer
And make it configurable in the same time.
This commit is contained in:
parent
2d1c4ad3c0
commit
23396ad4df
1 changed files with 4 additions and 1 deletions
|
@ -38,6 +38,9 @@ export class Importer {
|
||||||
this.map = map
|
this.map = map
|
||||||
this.name = options.name || 'Overpass'
|
this.name = options.name || 'Overpass'
|
||||||
this.baseUrl = options?.url || 'https://overpass-api.de/api/interpreter'
|
this.baseUrl = options?.url || 'https://overpass-api.de/api/interpreter'
|
||||||
|
this.searchUrl =
|
||||||
|
options?.searchUrl ||
|
||||||
|
'https://photon.komoot.io/api?q={q}&layer=county&layer=city&layer=state'
|
||||||
this.id = 'overpass'
|
this.id = 'overpass'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +50,7 @@ export class Importer {
|
||||||
const container = DomUtil.create('div')
|
const container = DomUtil.create('div')
|
||||||
container.innerHTML = TEMPLATE
|
container.innerHTML = TEMPLATE
|
||||||
this.autocomplete = new Autocomplete(container.querySelector('#area'), {
|
this.autocomplete = new Autocomplete(container.querySelector('#area'), {
|
||||||
url: 'https://photon.komoot.io/api?q={q}&osm_tag=place',
|
url: this.searchUrl,
|
||||||
placeholder: translate(
|
placeholder: translate(
|
||||||
'Type area name, or let empty to load data in current map view'
|
'Type area name, or let empty to load data in current map view'
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue