Forráskód Böngészése

聚合卡顿问题

彭宇 2 éve
szülő
commit
993a14b1e6
1 módosított fájl, 3 hozzáadás és 4 törlés
  1. 3 4
      src/components/supermap.vue

+ 3 - 4
src/components/supermap.vue

@@ -1006,7 +1006,7 @@ export default {
         })
         let markerClick = window.L.marker([markersList[i].lat, markersList[i].lng], {
           icon: icon
-        }).addTo(this.map)
+        })
         if (markersList[i].bindPopupHtml != null && markersList[i].bindPopupHtml !== '') {
           let html = markersList[i].bindPopupHtml
           if (keepBindPopup) {
@@ -1040,14 +1040,13 @@ export default {
         if (isAggregation) {
           _that.isAggregationLayers.addLayer(markerClick)
           _that.isAggregationMyGroup = window.L.layerGroup(_that.isAggregationLayers)
-          this.map.addLayer(_that.isAggregationLayers)
         } else {
           _that.layers.push(markerClick)
           _that.myGroup = window.L.layerGroup(_that.layers)
-          this.map.addLayer(_that.myGroup)
         }
-
       }
+      _that.map.addLayer(_that.myGroup)
+      _that.map.addLayer(_that.isAggregationLayers)
     },
     setMarkersByType: function(markersList, type) { //地图标点(根据类型,可取消落点 clearMByType方法)
       const _that = this