Closed ismaildervisoglu closed 6 years ago
Hi @ismaildervisoglu, hmm from the top of my head I would approach it like this:
I would draw an invisible polygon to set the area where you want the drawings to be made. Whenever the user draws, I would leverage the leaflet.pm events to constantly check if the currently drawn shape is within that boundry polygon. For the comparison, I would use the library turf.
This is a similar way how I disallow polygon self-intersection for example.
Hope this helps!
By the way, I'm also building a tool for more advanced geo editing like changing styles and so on. It's Geoman and I will release version 1.0 soon. You can check the current beta already here though: https//geoman.io
@codeofsumit I want the drawings to be made within a certain area. To do this, I tried to set the boundary with the setMaxBounds function on the map object, but it didn't work. How could I do that?