Compare commits

...

2 commits

Author SHA1 Message Date
86543619e8 Update map render
Some checks failed
ci/woodpecker/push/build Pipeline failed
2023-12-12 19:08:56 +01:00
e396ca0dc9 Add tab aria role 2023-12-12 19:08:47 +01:00
2 changed files with 9 additions and 9 deletions

View file

@ -41,7 +41,7 @@
<button id="desc">Descrizione</button>
<button id="map">Mappa</button>
</div>
<div class="tab" bind:this={ref}>
<div class="tab" bind:this={ref} role="tab">
<svelte:component this={component} route={route} />
</div>
</div>

View file

@ -12,6 +12,9 @@
let longitude;
let accuracy;
const errorMessage = "Geolocation not available";
const attribution = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';
const openStreetMapTile = 'https://tile.openstreetmap.org/{z}/{x}/{y}.png';
let errored = false;
const watchPosition = async () => {
@ -59,15 +62,11 @@
});
map.setView(pianelloCoordinates, 13);
map.setMaxBounds(map.getBounds());
leaflet
.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution:
'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
})
.addTo(map);
.tileLayer(openStreetMapTile, {attribution})
.addTo(map);
}
onMount(async () => {
@ -83,10 +82,11 @@
}
});
</script>
{#if !errored}
<div id="map" in:fade bind:this={mapElement} />
<div id="map" in:fade bind:this={mapElement} />
{:else}
{errorMessage}
{errorMessage}
{/if}
<style>