From 4bb521668702a11a30f8d88fccb0090f01946c7d Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sat, 25 Mar 2023 23:07:52 -0400 Subject: [PATCH] Fix location finding --- web-frontend/src/lib/Map.svelte | 2 +- web-frontend/src/routes/app/+page.svelte | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web-frontend/src/lib/Map.svelte b/web-frontend/src/lib/Map.svelte index 96d9163..fd21838 100644 --- a/web-frontend/src/lib/Map.svelte +++ b/web-frontend/src/lib/Map.svelte @@ -53,7 +53,7 @@ }); }); map.on('locationfound', (e) => { - dispatch('locationfound', e.detail); + dispatch('locationfound', e.latlng); }); // Add the location control diff --git a/web-frontend/src/routes/app/+page.svelte b/web-frontend/src/routes/app/+page.svelte index 08c7754..a1bd1d7 100644 --- a/web-frontend/src/routes/app/+page.svelte +++ b/web-frontend/src/routes/app/+page.svelte @@ -43,8 +43,8 @@ }; const locationfound = (e) => { - console.log('Updating current location event', e); - updateAddr(wasm.call.EncodedAddress.from_coordinate(`${e.latlng.lat}, ${e.latlng.lng}`), false); + console.log('Updating current location event', e.detail); + updateAddr(wasm.call.EncodedAddress.from_coordinate(`${e.detail.lat}, ${e.detail.lng}`), false); }; const onMapClick = (e) => {