Open sbharadwaj92 opened 9 years ago
This is the easiest way I could think of (drawLayer is my editable layergroup)
//make hole
var makeHole = function(poly1, poly2){
poly1._holes = poly1._holes || [];
poly1._holes.push(poly2.getLatLngs());
return poly1;
};
var cookieCut= function(){
var layers = drawLayer.getLayers();
if (layers.length > 1){
newPoly = makeHole(layers[0], layers[1]);
newPoly.redraw();
}
};
jsfiddle here: https://jsfiddle.net/Sirenhound/cqbvgp09/
+1