]> git.openstreetmap.org Git - nominatim-ui.git/blob - src/components/UrlSubmitForm.svelte
reverse search: better initial zoom (#63)
[nominatim-ui.git] / src / components / UrlSubmitForm.svelte
1 <script>
2   import { serialize_form, clean_up_url_parameters } from '../lib/api_utils.js';
3   import { refresh_page } from '../lib/stores.js';
4
5   function handleSubmit(event) {
6     event.preventDefault();
7
8     var target_url = serialize_form(event.target);
9     target_url = clean_up_url_parameters(target_url);
10
11     window.history.pushState({}, '', '?' + target_url);
12     refresh_page();
13   }
14 </script>
15
16 <form on:submit={handleSubmit} class="form-inline" role="search" accept-charset="UTF-8" action="">
17     <slot></slot>
18 </form>