X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/bdb214b388f5d9dae7f06c8205780284b7b20a11..daea333875ff6b51d99dea24997019e573e201c2:/src/components/Map.svelte diff --git a/src/components/Map.svelte b/src/components/Map.svelte index 1ef199c..7b13187 100644 --- a/src/components/Map.svelte +++ b/src/components/Map.svelte @@ -28,7 +28,8 @@ ], zoom: Nominatim_Config.Map_Default_Zoom }); - if (typeof Nominatim_Config.Map_Default_Bounds !== 'undefined' && Nominatim_Config.Map_Default_Bounds) { + if (typeof Nominatim_Config.Map_Default_Bounds !== 'undefined' + && Nominatim_Config.Map_Default_Bounds) { map.fitBounds(Nominatim_Config.Map_Default_Bounds); } @@ -126,13 +127,16 @@ if (viewbox) { let coords = viewbox.split(','); // ,,, 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; @@ -183,9 +187,9 @@
-
show map bounds
+>show map bounds