-
Couldn't load subscription status.
- Fork 45
Description
Hello,
I've tried to update my app with leaflet 1.0.x and I'm facing up to an incompatibility between 2 plugins:
- leaflet-draw
- leaflet-pip
Since this commit in leaflet-pip, function is_poly is not anymore able to take into account polygons just created with leaflet-draw. I thought leaflet-draw created an incorrect polygon in this issue but I suspect now leaflet-pip is maybe not enough permissive.
I would suggest a PR which updates the is_poly function from your plugin:
function isPoly(l) {
if (l instanceof L.Polygon) return true;
return l.feature && l.feature.geometry && l.feature.geometry.type &&
['Polygon', 'MultiPolygon'].indexOf(l.feature.geometry.type) !== -1;
}
Indeed layer created by leaflet-draw has no l.feature && l.feature.geometry && l.feature.geometry.type attribute...
And maybe rollback entirely ff2b2f4 for is_poly:
function isPoly(l) {
return L.MultiPolygon && l instanceof L.MultiPolygon ||
l instanceof L.Polygon ||
l.feature && l.feature.geometry && l.feature.geometry.type &&
['Polygon', 'MultiPolygon'].indexOf(l.feature.geometry.type) !== -1;
}
What do you thinking about it ?
Fabien