Try fixing wasm module
This commit is contained in:
parent
4409c8093d
commit
762e694f01
2
web-frontend/src/routes/+layout.svelte
Normal file
2
web-frontend/src/routes/+layout.svelte
Normal file
@ -0,0 +1,2 @@
|
||||
hi
|
||||
<slot />
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user