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

Question: How can I manipulate layers with external data? #1038

Closed franciscoeymardneto closed 2 years ago

franciscoeymardneto commented 2 years ago

For example, I have polygon and circle data in my database and I must add this data to my map. In addition, you can edit and delete either on the map or on the database.

Falke-Design commented 2 years ago

You need to add the layers in the default leaflet way or over geojson.

When you listen on layer.on('pm:edit',(e)=>{console.log(e)}) you can get the new latlngs When you listen on layer.on('pm:remove',(e)=>{console.log(e)}) you can catch the removed layer