leaflet-area-selection icon indicating copy to clipboard operation
leaflet-area-selection copied to clipboard

How to adjust the completed polygon?

Open mmrp5 opened this issue 6 months ago • 1 comments

Let's suppose, I completed the polygon by joining the points or by double clicking. Now, I want to enter in to the adjust polygon mode again by double clicking , or by any means. Is it possible?

mmrp5 avatar Jul 17 '25 22:07 mmrp5

What you are asking requires a bit of programming, not an out-of-the_box feature, but it should be doable.

When a polygon is completed, it goes out of the plugin control, but is still a Leaflet element so you can work on it. You can fine an example here:

https://github.com/bopen/leaflet-area-selection/blob/dabc22fd8c57b9eebf27bbc642ea3cff51128e58/example/src/index.js#L50 Nobody stops you from adding a new event handler (double-click) on the newly created polygon variable.

What to do in the event handler? You have to manually reactivate the drawing phase of the plugin, then you can add selection points manually by notifying the as:point-add event.

Example here: https://github.com/bopen/leaflet-area-selection/tree/main?tab=readme-ov-file#configuration

keul avatar Jul 18 '25 07:07 keul