diff --git a/public/bbox-finder.html b/public/bbox-finder.html index a9b3e073c73838e543aaf4e9ead6be871b969f2a..f25beb03a3a8a68644cea3385e4639f5c21863c9 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);