You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
async function saveText(layerId) {
var layer = drawnItems.getLayer(layerId);
var textareaValue = document.querySelector('.leaflet-popup-content textarea').value;
var type = layer instanceof L.Marker ? 'Point' : 'Polygon';
var coordinates = type === 'Point' ? layer.getLatLng() : layer.getLatLngs();
var shape = layer.toGeoJSON()
var shape_for_db = JSON.stringify(shape);
var data = {
type: type,
coordinate: shape_for_db,
comment: textareaValue,
};
fetch(`${http}://${IP}:/mark/save-mark/`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data)
})
}
I've looked into similar questions, but apparently I'm missing something
(#398, #364, #187, #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
The text was updated successfully, but these errors were encountered: