X-Git-Url: https://git.openstreetmap.org/nominatim-ui.git/blobdiff_plain/c061d3fd3d4c9135fdbda0af273d9fc0dc5b5535..8258a52336c84b5bce8352334f5e356543df1b57:/src/components/SearchSectionReverse.svelte diff --git a/src/components/SearchSectionReverse.svelte b/src/components/SearchSectionReverse.svelte index 108e3b6..70174b6 100644 --- a/src/components/SearchSectionReverse.svelte +++ b/src/components/SearchSectionReverse.svelte @@ -7,8 +7,11 @@ export let lat = ''; export let lon = ''; export let zoom = ''; + export let api_request_params = {}; function gotoCoordinates(newlat, newlon, newzoom) { + if (newlat === null || newlon === null) return; + let params = new URLSearchParams(); params.set('lat', newlat); params.set('lon', newlon); @@ -27,55 +30,86 @@ // common mistake is to copy&paste latitude and longitude into the 'lat' search box function maybeSplitLatitude(e) { - var coords_split = e.target.value.split(','); + var coords_split = e.target.value.split(/,|%2C/); if (coords_split.length === 2) { document.querySelector('input[name=lat]').value = L.Util.trim(coords_split[0]); document.querySelector('input[name=lon]').value = L.Util.trim(coords_split[1]); } } + function set_api_param(e) { + document.querySelector('input[name=' + e.target.dataset.apiParam + ']').value = e.target.value; + } -
- +
+
+
- + +
+
+
+
+
- {#each zoomLevels() as zoomTitle, i} {/each} - +
+ +
+
+ +
+ Advanced options +
    +
  • + + +
  • +
+
+