彭宇 2 роки тому
батько
коміт
c6271712ba
2 змінених файлів з 15 додано та 16 видалено
  1. 15 14
      src/components/supermap.vue
  2. 0 2
      src/views/eventdetailsdialog.vue

+ 15 - 14
src/components/supermap.vue

@@ -249,20 +249,21 @@
 					if (this.isAggregationMyGroup != undefined && this.isAggregationMyGroup != false) {
 						this.isAggregationMyGroup.clearLayers()
 					}
-					this.map.removeLayer(this.isAggregationLayers)
-					this.isAggregationLayers = []
-					this.radiusLayers = []
-					this.isAggregationLayers = window.L.markerClusterGroup({
-						//设置为true时显示聚类所占据的范围
-						showCoverageOnHover: true,
-						//设置为true时会向低一级聚类缩放
-						zoomToBoundsOnClick: true,
-						//增加点位时增加聚合动画(否则会出问题)
-						animateAddingMarkers: true,
-						//最大缩放级别点击聚合图标展开图标
-						spiderfyOnMaxZoom: true
-					})
-
+          if(this.isAggregationLayers!=null&&this.isAggregationLayers.length>0){
+            this.map.removeLayer(this.isAggregationLayers)
+            this.isAggregationLayers = []
+            this.radiusLayers = []
+            this.isAggregationLayers = window.L.markerClusterGroup({
+              //设置为true时显示聚类所占据的范围
+              showCoverageOnHover: true,
+              //设置为true时会向低一级聚类缩放
+              zoomToBoundsOnClick: true,
+              //增加点位时增加聚合动画(否则会出问题)
+              animateAddingMarkers: true,
+              //最大缩放级别点击聚合图标展开图标
+              spiderfyOnMaxZoom: true
+            })
+          }
 				} else {
 					if (this.myGroup != undefined && this.myGroup != false) {
 						this.myGroup.clearLayers()

+ 0 - 2
src/views/eventdetailsdialog.vue

@@ -275,8 +275,6 @@ export default {
       // 获取父级的宽高
       const width = parseInt(window.getComputedStyle(canvasBox).width)
       const height = parseInt(window.getComputedStyle(canvasBox).height)
-      console.log(width)
-      console.log(height)
 
       // 宽高 * 2 并放大 2 倍 是为了防止图片模糊
       canvas.width = width * 2