Try fixing wasm module

This commit is contained in:
Austen Adler 2023-03-01 07:28:29 -05:00
parent 4409c8093d
commit 762e694f01
2 changed files with 9 additions and 12 deletions

View File

@ -0,0 +1,2 @@
hi
<slot />

View File

@ -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 @@
<h1>Welcome to SvelteKit</h1>
<p>
Status:
{#await init()}
Setting up wasm...
{:then}
Ready
{:catch e}
{e}
{/await}
</p>
<p>Current cursor: {addr} => ({latlng.lat}, {latlng.lng})</p>
<main>