1
我設置了一個自定義按鈕,按照How to click a button and start a new polygon without using the Leaflet.draw UI和How to initiate the draw function without toolbar?來啓動繪圖。但是,一旦有人點擊這個自定義按鈕,我無法弄清楚如何模仿Cancel
按鈕的行爲,這樣我可以有類似leaflet.draw中的「取消」按鈕觸發了什麼功能/事件?
<input type="button" onclick="stopEdits()" value="Click to Stop Drawing">
function stopEdits() {
//Cancel Drawing
}