geoman-io / leaflet-geoman

🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers
https://geoman.io
MIT License
2.21k stars 433 forks source link

How to call action draw polygon/ polyline/ Text , edit or remove in new button custom on the app? #1196

Closed hoangdangcodecomplete closed 2 years ago

hoangdangcodecomplete commented 2 years ago

Hi, I'm currently making an app and using geoman I feel it's great. Now what I'm doing is customizing the external buttons and calling actions inside the map like drawing shapes, deleting, and editing each shape. Can you guide me to do it? Screen Shot 2022-07-06 at 10 30 02

Thank you

Falke-Design commented 2 years ago

You need to enable drawing after clicking on a button: map.pm.enableDraw('Text'), map.pm.enableDraw('Line'), map.pm.enableDraw('Polygon')