Closed CORN-EZ closed 2 months ago
i also used this code to make sure i don't have groups
function addNonGroupLayers(sourceLayer, targetGroup) {
if (sourceLayer instanceof L.LayerGroup) {
sourceLayer.eachLayer(function(layer) {
addNonGroupLayers(layer, targetGroup);
});
} else {
targetGroup.addLayer(sourceLayer);
}
}
The problem was solved, if I understood correctly, the problem was that I had previously written data to the database in a different format
and he didn't want to build next
I've looked into similar questions, but apparently I'm missing something (https://github.com/Leaflet/Leaflet.draw/issues/398, https://github.com/Leaflet/Leaflet.draw/issues/364, https://github.com/Leaflet/Leaflet.draw/issues/187, https://github.com/Leaflet/Leaflet.draw/issues/253 https://stackoverflow.com/questions/53463078/leaflet-draw-cannot-read-property-enable-of-undefined-adding-control-to-geoj https://stackoverflow.com/questions/24018630/how-to-save-a-completed-polygon-points-leaflet-draw-to-mysql-table)
When I create a figure, I attach a bindpopup to it with a button that saves the figure in the database.
I have a layer, activating which I request saved figures from the database, they are successfully loaded, drawn, I place them in drawitems, but at the same time I do not have the ability to edit newly added layers
I DON'T UNDERSTAND T_T