Leaflet.draw icon indicating copy to clipboard operation
Leaflet.draw copied to clipboard

Edit polygon does not take care of allowIntersection

Open unix-world opened this issue 8 years ago • 3 comments
trafficstars

When drawing a polygon, the option allowIntersection appears to work correctly. But thereafter when I edit the polygon the option allowIntersection does not work as expected, I mean on edit polygon I am able to intersect the lines which is not correct and expected as long as I set in draw to explicit not allow this !

unix-world avatar Apr 24 '17 09:04 unix-world

same here

federicoalvarez-github avatar Jun 21 '17 20:06 federicoalvarez-github

You have to set in the options.

let options = {
    edit: {
        poly: {
            allowIntersection: false
        }
    }
}

victor-accarini avatar Dec 21 '17 20:12 victor-accarini

I set it in Edit.Poly.js I modified a little bit to use drawError here

L.EditToolbar = L.Toolbar.extend({
     statics: {
       TYPE: "edit"
     },
     options: {
       edit: {
         selectedPathOptions: {
         }
       },
       remove: {},
       poly: {
         allowIntersection: false,
         drawError: {
         }
       },
       featureGroup: null
     },
     ....
   })

TecSoon avatar Nov 03 '21 12:11 TecSoon