Ver código fonte

增加删除

SunZehao 7 meses atrás
pai
commit
911fb30cba
1 arquivos alterados com 12 adições e 1 exclusões
  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