This commit is contained in:
parent
e396ca0dc9
commit
86543619e8
1 changed files with 8 additions and 8 deletions
|
@ -12,6 +12,9 @@
|
||||||
let longitude;
|
let longitude;
|
||||||
let accuracy;
|
let accuracy;
|
||||||
const errorMessage = "Geolocation not available";
|
const errorMessage = "Geolocation not available";
|
||||||
|
const attribution = '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';
|
||||||
|
const openStreetMapTile = 'https://tile.openstreetmap.org/{z}/{x}/{y}.png';
|
||||||
|
|
||||||
let errored = false;
|
let errored = false;
|
||||||
|
|
||||||
const watchPosition = async () => {
|
const watchPosition = async () => {
|
||||||
|
@ -59,14 +62,10 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
map.setView(pianelloCoordinates, 13);
|
map.setView(pianelloCoordinates, 13);
|
||||||
|
|
||||||
map.setMaxBounds(map.getBounds());
|
map.setMaxBounds(map.getBounds());
|
||||||
|
|
||||||
leaflet
|
leaflet
|
||||||
.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
.tileLayer(openStreetMapTile, {attribution})
|
||||||
attribution:
|
|
||||||
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
||||||
})
|
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +82,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if !errored}
|
{#if !errored}
|
||||||
<div id="map" in:fade bind:this={mapElement} />
|
<div id="map" in:fade bind:this={mapElement} />
|
||||||
{:else}
|
{:else}
|
||||||
|
|
Loading…
Reference in a new issue