From 762e694f011f0046349c4e7ac3af817a89eda1bd Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Wed, 1 Mar 2023 07:28:29 -0500 Subject: [PATCH] Try fixing wasm module --- web-frontend/src/routes/+layout.svelte | 2 ++ web-frontend/src/routes/+page.svelte | 19 +++++++------------ 2 files changed, 9 insertions(+), 12 deletions(-) create mode 100644 web-frontend/src/routes/+layout.svelte diff --git a/web-frontend/src/routes/+layout.svelte b/web-frontend/src/routes/+layout.svelte new file mode 100644 index 0000000..04843aa --- /dev/null +++ b/web-frontend/src/routes/+layout.svelte @@ -0,0 +1,2 @@ +hi + diff --git a/web-frontend/src/routes/+page.svelte b/web-frontend/src/routes/+page.svelte index b371574..15c7aad 100644 --- a/web-frontend/src/routes/+page.svelte +++ b/web-frontend/src/routes/+page.svelte @@ -3,13 +3,19 @@ import { onMount, onDestroy } from 'svelte'; import { browser } from '$app/environment'; + // let init = require(this_algorithm-wasm); + let mapElement; let map; - let wasm; + // let wasm; let latlng = { lat: '', lng: '' }; let addr = ''; onMount(async () => { + await init().then(() => { + console.log('Loaded. Example:', address_from_lat_lon(51.505, -0.09)); + }); + if (browser) { const leaflet = await import('leaflet'); @@ -49,17 +55,6 @@

Welcome to SvelteKit

-

- Status: - {#await init()} - Setting up wasm... - {:then} - Ready - {:catch e} - {e} - {/await} -

-

Current cursor: {addr} => ({latlng.lat}, {latlng.lng})