diff --git a/web-frontend/src/routes/app/+page.svelte b/web-frontend/src/routes/app/+page.svelte index 95f3e93..b9bb760 100644 --- a/web-frontend/src/routes/app/+page.svelte +++ b/web-frontend/src/routes/app/+page.svelte @@ -28,7 +28,7 @@ try { latlng = e.latlng; addr = getxpin(wasm.call.EncodedAddress.from_lat_lon(latlng.lat, latlng.lng)); - console.log(latlng, addr); + addrInputValue = addr.address; popup .setLatLng({ lat: addr.latLon[0], @@ -69,15 +69,18 @@ } }); - let outputValue = ''; + let outputValue = ' '; const input = () => { try { if (browser) { - addr = getxpin(wasm.call.EncodedAddress.from_address(addr)); - let latlng = new leaflet.LatLng(outputValue[0], outputValue[1]); + addr = getxpin(wasm.call.EncodedAddress.from_address(addrInputValue)); + console.log("New addr", addr); + let latlng = new leaflet.LatLng(addr.latLon[0], addr.latLon[1]); map.panTo(latlng, 20); - leaflet.popup().setLatLng(latlng).setContent(`${outputValue}
hi`).openOn(map); + leaflet.popup().setLatLng(latlng).setContent(`${addr.address}`).openOn(map); map.setView(latlng); + + outputValue = " "; } } catch (e) { console.error(e);