geohash and message query stuff
This commit is contained in:
@@ -2,8 +2,10 @@
|
||||
import { onMount } from 'svelte';
|
||||
import MapView from '$lib/components/MapView.svelte';
|
||||
|
||||
let latitude = $state();
|
||||
let longitude = $state();
|
||||
import { getNearbyMessages } from '$lib/firebase/messages.js';
|
||||
|
||||
let lat = $state();
|
||||
let lng = $state();
|
||||
let error = $state();
|
||||
|
||||
onMount(() => {
|
||||
@@ -13,20 +15,22 @@
|
||||
}
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(position) => {
|
||||
latitude = position.coords.latitude;
|
||||
longitude = position.coords.longitude;
|
||||
lat = position.coords.latitude;
|
||||
lng = position.coords.longitude;
|
||||
},
|
||||
() => {
|
||||
error = "Location access denied. Please enable location to use Overheard.";
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
{#if error}
|
||||
<p class="error">{error}</p>
|
||||
{:else if latitude && longitude}
|
||||
<MapView {latitude} {longitude} />
|
||||
{:else if lat && lng}
|
||||
<MapView {lat} {lng} />
|
||||
{:else}
|
||||
<p class="loading">Looking for you...</p>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user