Question

I am using https://github.com/Leaflet/Leaflet.draw I am only drawing polygons with different colors. When I enter Edit mode all polygons revert to a single color (no fill, as seen here https://github.com/Leaflet/Leaflet.draw/blob/master/src/edit/handler/EditToolbar.Edit.js#L9 ):


"// Make sure that Polylines are not filled if (!(layer instanceof L.Circle) && !(layer instanceof L.Polygon) && !(layer instanceof L.Rectangle)) { pathOptions.fill = false; }"


I can not find how to keep (or modify) the colors while edit mode is on because the polygons sometimes overlap and are really hard to see when they all have the same color. Thank you!


Edited: L.EditToolbar.prototype.options.edit.selectedPathOptions.color can be used to modify the edit color for all, I would like to set individual colors.

Was it helpful?

Solution

This was a missing feature in Leaflet Draw. Added after my comment there. https://github.com/Leaflet/Leaflet.draw/issues/295

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top