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

Cut layers with Polylines instead of Polygons #325

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hey,

Can I somehow cut polygon into two polygons using two points? Now, if I try to cut using Point1 -> Point2 -> Point1 then nothing happens (pm:cut not fires). As I understand it is because two points do not form polygon. If so is there any solution for this?

Thanks!

codeofsumit commented 6 years ago

Hi @dyachkov, thanks for the feature request - that is not possible yet. I'm changing the title to reflect this feature request and close the issue for more people to vote on it so I can prioritize building new features.

Dastnbek commented 5 years ago

Hi! How can I use cancel methods of cutting and dragging mode ?

codeofsumit commented 5 years ago

@Dastnbek Cancel? Do you mean "undo" by any chance? If yes, you have to implement that yourself. Listen to the leaflet.pm events when cutting/dragging occur, save the current state of your polygon. When you user clicks your "undo" button, replace the new layers coords with your saved one

codeofsumit commented 4 years ago

Alright, this feature took us many many many weeks (and was quite expensive). Thats why this is currently only released inside Leaflet-Geoman Pro. https://geoman.io/leaflet-geoman-pro

See the Splitting Feature in Action: https://twitter.com/TweetsOfSumit/status/1295697712600449025

We hope to make this feature available to the OSS community in the future as well!