]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - src/components/SearchSectionReverse.svelte
detail page: fix display when keywords from API are empty (#153)
[nominatim-ui.git] / src / components / SearchSectionReverse.svelte
index d996f440d2faca35b6f81dc20b75316e652cb379..186190202216aca5843f194f76db25e58cd2118f 100644 (file)
@@ -9,6 +9,8 @@
   export let zoom = '';
 
   function gotoCoordinates(newlat, newlon, newzoom) {
+    if (newlat === null || newlon === null) return;
+
     let params = new URLSearchParams();
     params.set('lat', newlat);
     params.set('lon', newlon);
@@ -44,6 +46,7 @@
            type="text"
            class="form-control form-control-sm"
            placeholder="latitude"
+           pattern="^-?\d+(\.\d+)?$"
            bind:value={lat}
            on:change={maybeSplitLatitude} />
   </div>
@@ -60,6 +63,7 @@
            type="text"
            class="form-control form-control-sm"
            placeholder="longitude"
+           pattern="^-?\d+(\.\d+)?$"
            bind:value={lon} />
   </div>
   <div class="form-group">