Browse Source

增加删除

SunZehao 7 months ago
parent
commit
911fb30cba
1 changed files with 12 additions and 1 deletions
  1. 12 1
      src/views/mapAnalysis/index.vue

+ 12 - 1
src/views/mapAnalysis/index.vue

@@ -132,6 +132,17 @@ const initMap = () => {
 
     console.log('editmove====>>>', e)
   })
+
+  map.on(L.Draw.Event.DELETED, function (e) {
+    console.log('deleted====>>>', e)
+    for (let i in e.layers._layers) {
+      drawLayers.value.forEach((it, index) => {
+        if (it.layer._leaflet_id.toString() === i) {
+          drawLayers.value.splice(index, 1)
+        }
+      })
+    }
+  })
 }
 const initDrawTooltip = () => {
   L.drawLocal.draw.handlers.polygon = {
@@ -221,7 +232,7 @@ onMounted(() => {
   background: #fff
   overflow-y: auto
   .title
-    font-size: 16px
+    font-size: 15px
     font-weight: bold
   .detailMsg
     margin: 10px 0