From 23396ad4df3a6fbee3a4bf16381d9fd25a5d3b69 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 2 Jul 2024 10:42:25 +0200 Subject: [PATCH] fix: allow to search a French departement in Overpass importer And make it configurable in the same time. --- umap/static/umap/js/modules/importers/overpass.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/modules/importers/overpass.js b/umap/static/umap/js/modules/importers/overpass.js index 8bd7f058..05567db0 100644 --- a/umap/static/umap/js/modules/importers/overpass.js +++ b/umap/static/umap/js/modules/importers/overpass.js @@ -38,6 +38,9 @@ export class Importer { this.map = map this.name = options.name || 'Overpass' 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' } @@ -47,7 +50,7 @@ export class Importer { const container = DomUtil.create('div') container.innerHTML = TEMPLATE this.autocomplete = new Autocomplete(container.querySelector('#area'), { - url: 'https://photon.komoot.io/api?q={q}&osm_tag=place', + url: this.searchUrl, placeholder: translate( 'Type area name, or let empty to load data in current map view' ),