Browse Source

可视化bug

彭宇 3 years ago
parent
commit
bc92f75437
2 changed files with 13 additions and 9 deletions
  1. 10 6
      src/components/supermap.vue
  2. 3 3
      src/components/vBottomMenu.vue

+ 10 - 6
src/components/supermap.vue

@@ -37,7 +37,8 @@
         latLngGroup: [],
         isEditableLayers: false,//绘图控件
         drawControl: null,//绘图控件
-        deckglLayer: null//图层Layer
+        deckglLayer: null,//图层Layer
+        deckglLayerLists: []//图层Layer(多图层)
       }
     },
     watch: {
@@ -742,13 +743,16 @@
         this.map.setZoom(level)
       },
       layerSwitching: function(url, isClear) {//图层切换  url 图层地址   isClear  是否清除图层
-        if (isClear) {
-          if (this.deckglLayer != null) {
-            this.deckglLayer.remove()
-          }
-        }
+        // if (isClear) {
+        //   if (this.deckglLayerLists != null) {
+        //     for (let i = 0; i < this.deckglLayerLists.length; i++) {
+        //       this.deckglLayerLists[i].remove()
+        //     }
+        //   }
+        // }
         this.deckglLayer = window.L.supermap.tiledMapLayer(url, {})
         this.map.addLayer(this.deckglLayer)
+        this.deckglLayerLists.push(this.deckglLayer);
       }
     }
   }

+ 3 - 3
src/components/vBottomMenu.vue

@@ -4,8 +4,8 @@
 			@click.stop="showDialog(fastMenu.click)">
 			<a><i :class="fastMenu.icon"></i>{{fastMenu.name}}
 				<div v-if="showChild && fastMenu.click == 'layerSwitching'" class="nav-child">
-					<el-button type="primary" @click.stop="choseLayerSwitching('http://121.37.83.100:8090/iserver/services/map-sipingshi/rest/maps/tiedong_lunkuo')" class="nav-child-btn">铁东</el-button>
-					<el-button type="primary" @click.stop="choseLayerSwitching('http://121.37.83.100:8090/iserver/services/map-sipingshi/rest/maps/tiexi_lunkuo')" class="nav-child-btn">铁西</el-button>
+					<el-button type="primary" plain @click.stop="choseLayerSwitching('http://121.37.83.100:8090/iserver/services/map-sipingshi/rest/maps/tiedong_lunkuo')" class="nav-child-btn">铁东</el-button>
+					<el-button type="primary" plain @click.stop="choseLayerSwitching('http://121.37.83.100:8090/iserver/services/map-sipingshi/rest/maps/tiexi_lunkuo')" class="nav-child-btn">铁西</el-button>
 <!--					<el-button type="danger" icon="el-icon-close" style="position: absolute;right: 0;top: 0;width: 1rem;height: 1rem;padding:0;"-->
 <!--						@click.stop="closeChild"></el-button>-->
 				</div>
@@ -41,7 +41,7 @@
 						icon: 'iconfont sj-icon-lbzy',
 						click: ''
 					},
-					
+
 					{
 						name: '林场',
 						icon: 'iconfont sj-icon-lczy',