I'm using Leaflet.draw
to draw and edit polygons.
var drawControl = new L.Control.Draw({
edit: {
featureGroup: drawnItems,
edit: {
selectedPathOptions: {
maintainColor: true,
opacity: 0.3,
fill: true
}
},
},
draw: {
marker: false,
polyline: false,
rectangle: false,
circle: false,
circlemarker: false,
polygon: {
shapeOptions: { color: 'white', opacity: 0.3 },
allowIntersection: false
}
}
});
When I'm in Edit mode, I have a checkbox that should enable/disable the polygons filling. I've tried
drawControl.options.edit.edit.selectedPathOptions.fill = isChecked;
and
if (drawControl._toolbars.edit._activeMode.handler)
drawControl._toolbars.edit._activeMode.handler.options.selectedPathOptions.fill = isChecked;
but it doesn't change the filling state.
Is there a way to add or remove the filling while in edit mode?