From cf0774ee9fa92cf1d3c32ca166e065c0a3f26dc7 Mon Sep 17 00:00:00 2001 From: Joe TS Dell <thunyathep.s@outlook.com> Date: Thu, 6 Jul 2023 15:56:05 +0200 Subject: [PATCH] update --- public/bbox-finder.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/bbox-finder.html b/public/bbox-finder.html index a9b3e07..f25beb0 100644 --- a/public/bbox-finder.html +++ b/public/bbox-finder.html @@ -80,6 +80,7 @@ <img src="joeicon.png" alt="" width="20px"> BBOX Finder <i class="bi bi-bounding-box"></i></b> <br> + <button class="btn btn-secondary btn-sm" onclick="startDraw()">DRAW</button><br> <span id="calculated_area">[Hint: Draw a bbox using tool on the right-bottom menu.]</span> </p> </div> @@ -112,7 +113,10 @@ var drawnItems = new L.FeatureGroup(); map.addLayer(drawnItems); - + // https://stackoverflow.com/questions/15775103/leaflet-draw-mapping-how-to-initiate-the-draw-function-without-toolbar + startDraw = function () { + new L.Draw.Rectangle(map, drawControl.options.rectangle).enable() + } // Set the title to show on the polygon button L.drawLocal.draw.toolbar.buttons.polygon = 'Draw a polygon!'; L.Control.geocoder().addTo(map); -- GitLab