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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top