Using Next.js@12 & leaflet-geoman@2.7
I have a custom toolbar with a number of buttons to enable drawing (polygon, rectangle, marker), when I click a button to start drawing, the first vertex is created before I have a chance to move my cursor and click.
Here is the button. I think the click is propagating through to the map underneath the button? Is there a way to stop this? Menu Button is here:
<Menu.Item
icon={<IconRectangle size={14}/>}
onClick={() => {
map.pm.enableDraw('Rectangle', {
tooltips: false
})
}}>
Rectangle
</Menu.Item>