+
+
+
diff --git a/web-frontend/src/routes/encode/+page.svelte b/web-frontend/src/routes/app/+page.svelte
similarity index 84%
rename from web-frontend/src/routes/encode/+page.svelte
rename to web-frontend/src/routes/app/+page.svelte
index e44049c..377eb9d 100644
--- a/web-frontend/src/routes/encode/+page.svelte
+++ b/web-frontend/src/routes/app/+page.svelte
@@ -4,7 +4,8 @@
import { onMount, onDestroy } from 'svelte';
import AddressInput from '$lib/AddressInput.svelte';
import { browser } from '$app/environment';
- import leaflet from 'leaflet';
+ let leaflet;
+ // import leaflet from 'leaflet';
import Map from '$lib/Map.svelte';
@@ -19,6 +20,7 @@
};
onMount(async () => {
+ leaflet = await import('leaflet');
wasm = await getWasm();
if (browser) {
@@ -48,11 +50,13 @@
let outputValue = '';
const input = () => {
try {
- outputValue = wasm.call.address_to_lat_lon(addr);
- let latlng = new leaflet.LatLng(outputValue[0], outputValue[1]);
- map.panTo(latlng, 20);
- leaflet.popup().setLatLng(latlng).setContent(`${outputValue}
hi`).openOn(map);
- map.setView(latlng);
+ if (browser) {
+ outputValue = wasm.call.address_to_lat_lon(addr);
+ let latlng = new leaflet.LatLng(outputValue[0], outputValue[1]);
+ map.panTo(latlng, 20);
+ leaflet.popup().setLatLng(latlng).setContent(`${outputValue}
hi`).openOn(map);
+ map.setView(latlng);
+ }
} catch (e) {
console.error(e);
outputValue = `${e}`;
diff --git a/web-frontend/src/routes/decode/+page.svelte b/web-frontend/src/routes/decode/+page.svelte
deleted file mode 100644
index eecd672..0000000
--- a/web-frontend/src/routes/decode/+page.svelte
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-Decode
-
-Status: {wasm.status}
-WasmError: {wasm.error}
-OutputValue: {outputValue}
-Input value: {inputValue}
-
-
-
-