X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/c061d3fd3d4c9135fdbda0af273d9fc0dc5b5535..003455660fb466c182229397b72a01bf06a30f0f:/src/components/PageLink.svelte?ds=inline

diff --git a/src/components/PageLink.svelte b/src/components/PageLink.svelte
index bccddf2..df124f7 100644
--- a/src/components/PageLink.svelte
+++ b/src/components/PageLink.svelte
@@ -1,12 +1,19 @@
 <script>
-import { refresh_page } from '../lib/stores.js';
+  import { refresh_page } from '../lib/stores.js';
 
-export let page;
-export let extra_classes = '';
+  export let page;
+  export let params_hash = {};
+  export let extra_classes = '';
+  let href = page + '.html';
 
-function handleClick() {
-  refresh_page(page);
-}
+  function handleClick() {
+    refresh_page(page, new URLSearchParams(params_hash));
+  }
+
+  $: {
+    let param_str = new URLSearchParams(params_hash).toString();
+    href = page + '.html' + (param_str ? '?' : '') + param_str;
+  }
 </script>
 
-<a on:click|preventDefault|stopPropagation={handleClick} href="{page}.html" class={extra_classes}><slot></slot></a>
+<a on:click|preventDefault|stopPropagation={handleClick} href={href} class={extra_classes}><slot></slot></a>
