Add location to statistics
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import Nav from "$lib/navigation/nav.svelte";
|
||||
import { getApiUrl } from "$lib/scripts/upstream";
|
||||
import { featureDetect } from "$lib/scripts/featureDetect";
|
||||
import { getCurrentLocation } from "$lib/scripts/getLocation";
|
||||
const title = "Statistics";
|
||||
|
||||
async function getData() {
|
||||
@@ -132,6 +133,17 @@
|
||||
Failed to detect browser features: {error.message}
|
||||
{/await}
|
||||
|
||||
<h3>Detected Location</h3>
|
||||
{#await getCurrentLocation()}
|
||||
Fetching Location...
|
||||
{:then location}
|
||||
{location.latitude}, {location.longitude}
|
||||
<br />
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://www.openstreetmap.org/?mlat={location.latitude}&mlon={location.longitude}&zoom=12">View on Map</a>
|
||||
{:catch error}
|
||||
{error.message}
|
||||
{/await}
|
||||
|
||||
<Nav />
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user