X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/6ab65d8875eeb387471c463ec3eb38cc3b6b2a07..152e6d847003cb0b2b4505f79531941dc98e9e95:/src/components/ReverseBar.svelte diff --git a/src/components/ReverseBar.svelte b/src/components/ReverseBar.svelte index 87fa56f..c7f081d 100644 --- a/src/components/ReverseBar.svelte +++ b/src/components/ReverseBar.svelte @@ -3,7 +3,6 @@ import { zoomLevels } from '../lib/helpers.js'; import { map_store } from '../lib/stores.js'; - import { get } from 'svelte/store'; export let api_request_params = {}; @@ -24,6 +23,16 @@ document.querySelector('input[name=lon]').value = lat; document.querySelector('form').submit(); } + + // common mistake is to copy&paste latitude and longitude into the 'lat' search box + function maybeSplitLatitude(e) { + var coords_split = e.target.value.split(','); + 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]); + } + } +
@@ -36,7 +45,8 @@ type="text" class="form-control form-control-sm" placeholder="latitude" - value="{api_request_params.lat || ''}" /> + value="{api_request_params.lat || ''}" + on:change={maybeSplitLatitude} />