Open wp0spark opened 4 years ago
I was looking around for issues with using L.Polygon.intersects() with a polygon that has an interior polygon/donut.
I have been using the intersects() method to see if any polygon that is drawn or loaded and added to the draw toolbar does not intersect itself. I attached a code snippet as an example.
`
// drawnLayers is the featureGroup for editing that is set up when creating the L.Control.Draw object
const layers = drawnLayers .getLayers()
for (const layer of layers) {
if (layer.intersects()) {
alert('One of your polygons intersects itself');
}
}
`
Do you have an example of using the intersects () method