X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/6e68f11776a8f6f5a62b989f13ebf7438ef32476..1e52708ba183a23280db004e28284a0ce6f1b5a8:/src/components/Header.svelte diff --git a/src/components/Header.svelte b/src/components/Header.svelte index 4e6359a..97cbebd 100644 --- a/src/components/Header.svelte +++ b/src/components/Header.svelte @@ -4,10 +4,23 @@ import LastUpdated from './LastUpdated.svelte'; import Error from './Error.svelte'; - import { page } from '../lib/stores.js'; + import { map_store, page } from '../lib/stores.js'; $: view = $page.tab; $: page_title = Nominatim_Config.Page_Title; + $: reverse_only = Nominatim_Config.Reverse_Only; + + let map_lat; + let map_lon; + + map_store.subscribe(map => { + if (!map) return; + + map.on('move', function () { + map_lat = map.getCenter().lat; + map_lon = map.getCenter().lng; + }); + });