geohash and message query stuff

This commit is contained in:
2026-06-05 21:09:34 +09:00
parent d5ddff9912
commit 8dcdd7a0e4
6 changed files with 1106 additions and 15 deletions

View File

@@ -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}