From 79a0340b0a66ab97d755d29ad5497b0a299b79f9 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Mon, 14 Aug 2023 15:12:13 +0700 Subject: [PATCH] Fix edit location --- edit-mode/function/activityLocation.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/edit-mode/function/activityLocation.js b/edit-mode/function/activityLocation.js index 1d35491..dc6dbca 100644 --- a/edit-mode/function/activityLocation.js +++ b/edit-mode/function/activityLocation.js @@ -21,11 +21,6 @@ var drawControl = new L.Control.Draw({ circle:false, polyline: false }, - edit:{ - featureGroup:drawnItems, - edit:false, - delete:false - } }); var drawnControlEdit = new L.Control.Draw({ @@ -72,8 +67,11 @@ function openActivityMap(id) // console.log("cek data geojson", datageojson); if (datageojson.type === 'FeatureCollection') { datageojson.features.forEach(feature => { - let layer = L.geoJSON(feature); - addDrawnLayer(layer) + let lGeoJson = L.geoJSON(feature); + let layers = lGeoJson.getLayers(); + layers.forEach(layer => { + addDrawnLayer(layer) + }); }); } else { if(datageojson.properties.radius){ @@ -91,7 +89,6 @@ function openActivityMap(id) } } actionLocationAc = "edit"; - drawControl.remove(); map.addControl(drawnControlEdit); }else{ currentGeoJson = "";