fix: editing objects correctly!
@@ -1026,9 +1026,16 @@ editor = {
var sidebarcontent = $('#sidebar').find('.content');
var geometry_field = sidebarcontent.find('input[name=geometry]');
+ var options;
if (geometry_field.length) {
var form = geometry_field.closest('form');
if (editor._editing_layer !== null) {
+ options = editor._editing_layer.options;
+ editor._editing_layer.remove();
+ editor._editing_layer = L.geoJSON(JSON.parse(geometry_field.val()), {
+ style: function() { return options; },
+ pointToLayer: editor._point_to_layer,
+ }).getLayers()[0].addTo(editor._geometries_layer);
editor._editing_layer.enableEdit();
if (editor._editing_layer.editor._resizeLatLng !== undefined) {
editor._editing_layer.editor._resizeLatLng.__vertex._icon.style.display = 'none';
