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;
+ });
+ });
</script>
<style>
<!-- Left-aligned links -->
<ul class="navbar-nav mr-auto">
<li class="nav-item {view === 'search' ? 'active' : ''}">
- <PageLink page="search" extra_classes="nav-link ">Search</PageLink>
+ <PageLink page="search" extra_classes="nav-link">Search</PageLink>
</li>
<li class="nav-item {view === 'reverse' ? 'active' : ''}">
- <ReverseLink extra_classes="nav-link ">Reverse</ReverseLink>
+ <ReverseLink lat={map_lat} lon={map_lon} extra_classes="nav-link">Reverse</ReverseLink>
</li>
<li class="nav-item {view === 'details' ? 'active' : ''}">
- <PageLink page="details" extra_classes="nav-link ">Search By ID</PageLink>
+ <PageLink page="details" extra_classes="nav-link">Search By ID</PageLink>
</li>
</ul>
</div>
<!-- Right aligned links -->
<ul class="navbar-nav">
<li class="nav-item {view === 'about' ? 'active' : ''}">
- <PageLink page="about" extra_classes="nav-link ">About & Help</PageLink>
+ <PageLink page="about" extra_classes="nav-link">About & Help</PageLink>
</li>
</ul>
</nav>