X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/28125bc80474e4480f312e2e4695c38b3b27d39f..2ba00544d30017ad30570011b1a2bcc6a8da73a7:/src/components/Map.svelte?ds=sidebyside

diff --git a/src/components/Map.svelte b/src/components/Map.svelte
index dd2a1ae..7b13187 100644
--- a/src/components/Map.svelte
+++ b/src/components/Map.svelte
@@ -127,13 +127,16 @@
     if (viewbox) {
       let coords = viewbox.split(','); // <x1>,<y1>,<x2>,<y2>
       let bounds = L.latLngBounds([coords[1], coords[0]], [coords[3], coords[2]]);
-      L.rectangle(bounds, {
+      let viewbox_on_map = L.rectangle(bounds, {
         color: '#69d53e',
         weight: 3,
         dashArray: '5 5',
         opacity: 0.8,
-        fill: false
-      }).addTo(map);
+        fill: false,
+        interactive: false
+      });
+      map.addLayer(viewbox_on_map);
+      dataLayers.push(viewbox_on_map);
     }
 
     if (!aFeature) return;
@@ -184,9 +187,9 @@
 
 <MapPosition />
 <div id="map" use:mapAction />
-<div id="show-map-position" class="leaflet-bar btn btn-sm btn-outline-secondary"
+<button id="show-map-position" class="leaflet-bar btn btn-sm btn-outline-secondary"
       on:click|stopPropagation={show_map_position_click}
->show map bounds</div>
+>show map bounds</button>
 
 <style>
   #map {
