2 import { mapState } from '../state/MapState.svelte.js';
4 let visible = $state(false);
6 const view_on_osm_link = $derived(
7 `https://openstreetmap.org/#map=${mapState.zoom}/${mapState.center.lat.toFixed(5)}/${mapState.center.lng.toFixed(5)}`
10 const view_on_overpass_link = $derived(
11 `https://overpass-turbo.eu/?lat=${mapState.center.lat.toFixed(5)}&lon=${mapState.center.lng.toFixed(5)}`
14 function coordToString(c) {
15 return c ? `${c.lat.toFixed(5)},${c.lng.toFixed(5)}` : '-';
19 <div id="map-position">
21 <div id="map-position-inner">
22 map center: {coordToString(mapState.center)}
23 <a target="_blank" rel="noreferrer" href="{view_on_osm_link}">view on osm.org</a>,
24 <a target="_blank" rel="noreferrer" href="{view_on_overpass_link}">overpass</a>
26 map zoom: {mapState.zoom}
28 viewbox: {mapState.viewboxStr}
30 last click: {coordToString(mapState.lastClick)}
32 mouse position: {coordToString(mapState.mousePos)}
34 <div id="map-position-close"><a href="#hide" onclick={() => visible = false}>hide</a></div>
36 <button id="show-map-position"
37 class="btn btn-sm btn-outline-secondary"
38 onclick={() => visible = true}>
52 background-color: rgba(255, 255, 255, 0.7);
65 @media (max-width: 768px) {
72 .btn-outline-secondary {
73 background-color: white;
76 .btn-outline-secondary:hover {