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 { onMount, onDestroy } from 'svelte';
|
||||||
import { browser } from '$app/environment';
|
import { browser } from '$app/environment';
|
||||||
|
|
||||||
|
// let init = require(this_algorithm-wasm);
|
||||||
|
|
||||||
let mapElement;
|
let mapElement;
|
||||||
let map;
|
let map;
|
||||||
let wasm;
|
// let wasm;
|
||||||
let latlng = { lat: '', lng: '' };
|
let latlng = { lat: '', lng: '' };
|
||||||
let addr = '';
|
let addr = '';
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
await init().then(() => {
|
||||||
|
console.log('Loaded. Example:', address_from_lat_lon(51.505, -0.09));
|
||||||
|
});
|
||||||
|
|
||||||
if (browser) {
|
if (browser) {
|
||||||
const leaflet = await import('leaflet');
|
const leaflet = await import('leaflet');
|
||||||
|
|
||||||
@ -49,17 +55,6 @@
|
|||||||
|
|
||||||
<h1>Welcome to SvelteKit</h1>
|
<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>
|
<p>Current cursor: {addr} => ({latlng.lat}, {latlng.lng})</p>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user