How to delete all another polygons? #862
Unanswered
vodnicearv
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
-
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