How to delete all another polygons? #862
Unanswered
valeriu-dev
asked this question in
Questions & Help
Replies: 2 comments
-
You can do this with regular leaflet. Something like this: this.map.on('pm:create', e => {
this.map.eachLayer(layer, () => {
if(!e.target !== layer) {
layer.remove();
}
})
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
@codeofsumit Thank You! My working code is:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, need to remove all another polygons when user add a new polygon on map.
Or limit count of polygons to 1.
Can someone tell me how to do this?
I tried: this.map.pm.Draw.Polygon._removeLastVertex() but get an error:

Beta Was this translation helpful? Give feedback.
All reactions