mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
feat: make expression persistent in the overpass importer (#2339)
In other words: fill in the "tags" input with the latest typed expression. Otherwise, when making tries with overpass imports, one have to type it again and again (it's available through the autocomplete, though, but it's not obvious and it's less friendly IMHO).
This commit is contained in:
commit
b7c77b9c9f
1 changed files with 5 additions and 0 deletions
|
@ -53,11 +53,15 @@ export class Importer {
|
||||||
'https://photon.komoot.io/api?q={q}&layer=county&layer=city&layer=state'
|
'https://photon.komoot.io/api?q={q}&layer=county&layer=city&layer=state'
|
||||||
this.id = 'overpass'
|
this.id = 'overpass'
|
||||||
this.boundaryChoice = null
|
this.boundaryChoice = null
|
||||||
|
this.expression = null
|
||||||
}
|
}
|
||||||
|
|
||||||
async open(importer) {
|
async open(importer) {
|
||||||
const container = DomUtil.create('div')
|
const container = DomUtil.create('div')
|
||||||
container.innerHTML = TEMPLATE
|
container.innerHTML = TEMPLATE
|
||||||
|
if (this.expression) {
|
||||||
|
container.querySelector('[name=tags]').value = this.expression
|
||||||
|
}
|
||||||
this.autocomplete = new Autocomplete(container.querySelector('#area'), {
|
this.autocomplete = new Autocomplete(container.querySelector('#area'), {
|
||||||
url: this.searchUrl,
|
url: this.searchUrl,
|
||||||
placeholder: translate(
|
placeholder: translate(
|
||||||
|
@ -80,6 +84,7 @@ export class Importer {
|
||||||
Alert.error(translate('Expression is empty'))
|
Alert.error(translate('Expression is empty'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.expression = form.tags
|
||||||
let tags = form.tags
|
let tags = form.tags
|
||||||
if (!tags.startsWith('[')) tags = `[${tags}]`
|
if (!tags.startsWith('[')) tags = `[${tags}]`
|
||||||
let area = '{south},{west},{north},{east}'
|
let area = '{south},{west},{north},{east}'
|
||||||
|
|
Loading…
Reference in a new issue