From: Sarah Hoffmann Date: Sat, 10 Apr 2021 09:02:18 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/commitdiff_plain/13812cb6b3f93966bffebfe118d2d7fa8623e137?hp=45915dbf47b183a79d26b3785d4dc8a3cfa2e29f Merge remote-tracking branch 'upstream/master' --- diff --git a/src/components/Header.svelte b/src/components/Header.svelte index 9fef1f9..514fe20 100644 --- a/src/components/Header.svelte +++ b/src/components/Header.svelte @@ -4,10 +4,22 @@ 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; + + 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; + }); + });