Update urls
This commit is contained in:
parent
964ff0a043
commit
24e6cff9d5
@ -25,11 +25,15 @@ export function createUrlStore(ssrUrl) {
|
|||||||
updateHref();
|
updateHref();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
history.replaceStateNoNotification = function () {
|
||||||
|
originalReplaceState.apply(this, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
window.addEventListener('popstate', updateHref);
|
window.addEventListener('popstate', updateHref);
|
||||||
window.addEventListener('hashchange', updateHref);
|
window.addEventListener('hashchange', updateHref);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
subscribe: derived(href, ($href) => new URL($href)).subscribe
|
subscribe: derived(href, ($href) => new URL($href)).subscribe,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,8 +76,6 @@
|
|||||||
|
|
||||||
coordinateTypes = rustEnumToArray(wasm.call.CoordinateType);
|
coordinateTypes = rustEnumToArray(wasm.call.CoordinateType);
|
||||||
selectedCoordinateType = coordinateTypes[0];
|
selectedCoordinateType = coordinateTypes[0];
|
||||||
|
|
||||||
console.log('My url formats: ', urlFormats, wasm.call.CoordinateUrls);
|
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
leaflet = await import('leaflet');
|
leaflet = await import('leaflet');
|
||||||
@ -150,7 +148,7 @@
|
|||||||
coordinateInputValue = addr.allCoordinates[selectedCoordinateType];
|
coordinateInputValue = addr.allCoordinates[selectedCoordinateType];
|
||||||
}
|
}
|
||||||
|
|
||||||
history.replaceState(undefined, undefined, `#${addr.address.replaceAll(' ', '-')}`);
|
history.replaceStateNoNotification(undefined, undefined, `#${addr.address.replaceAll(' ', '-')}`);
|
||||||
|
|
||||||
map.panTo(latlng, 20);
|
map.panTo(latlng, 20);
|
||||||
leaflet.popup().setLatLng(latlng).setContent(`${addr.address}`).openOn(map);
|
leaflet.popup().setLatLng(latlng).setContent(`${addr.address}`).openOn(map);
|
||||||
|
Loading…
Reference in New Issue
Block a user