Prechádzať zdrojové kódy

环保增加水利专题

wang_xy 1 rok pred
rodič
commit
39552f610d
2 zmenil súbory, kde vykonal 40 pridanie a 23 odobranie
  1. 31 22
      src/components/supermap-2.5d.vue
  2. 9 1
      src/views/forest.vue

+ 31 - 22
src/components/supermap-2.5d.vue

@@ -68,6 +68,7 @@
           mapData: null,
           mapName: null
         },
+        showLayer:null,
         clickTime: new Date().getTime(),
         cacheData: {
           ProvinceRoad: "",
@@ -205,8 +206,12 @@
     watch: {},
     created() {
     },
-    mounted() {},
-    props: {},
+    mounted() {
+      this.showLayer = this.showLayer != undefined ? this.showLayer:false;
+    },
+    props: {
+      showLayer: [Boolean],
+    },
     methods: {
       //初始化地图数据
       removeAllviewer(num, index) {
@@ -679,15 +684,29 @@
         //开始加载专题图等数据,8秒后开始执行
         setTimeout(function() {
           //3.水系
-          let shuixi = that.superMapRootUrl + withinData[2];
-          that.mvtMap0 = that.scene.addVectorTilesMap({
-            url: shuixi,
-            canvasWidth: 512,
-            name: 'mvt_map0',
-            viewer: that.viewer
-          });
-          that.mvtMap0.selectedColor = new Cesium.Color(6, 169, 254, 0.5);
-          that.mvtMap0.show = false;
+          if(that.showLayer){
+            let shuixi = that.superMapRootUrl + withinData[2];
+            that.mvtMap0 = that.scene.addVectorTilesMap({
+              url: shuixi,
+              canvasWidth: 512,
+              name: 'mvt_map0',
+              viewer: that.viewer
+            });
+            that.mvtMap0.selectedColor = new Cesium.Color(6, 169, 254, 0.5);
+            that.mvtMap0.show = false;
+            // 8.添加水系NAME
+            let shuixi_name_url = that.superMapRootUrl + withinData[10];
+            that.shuixi_name = that.scene.open(shuixi_name_url);
+            that.cacheData.ShuiXi = withinData[11]
+            that.shuixi_name.then(function (layers) {
+              let textlayer = that.scene.layers.find(withinData[11]);//文字图层
+              //加载后隐藏
+              textlayer.visible = false;
+              //关闭避让
+              textlayer.isOverlapDisplayed = true;
+            });
+          }
+
 
           // //4.林地
           // let lindi = that.superMapRootUrl+"/map-mvt-lindi/restjsr/v1/vectortile/maps/lindi";
@@ -725,17 +744,7 @@
           // let road_name_url = that.superMapRootUrl+'/3D-road_Name_S/rest/realspace';
           // that.road_name = that.scene.open(road_name_url);
           //
-          // 8.添加水系NAME
-          let shuixi_name_url = that.superMapRootUrl + withinData[10];
-          that.shuixi_name = that.scene.open(shuixi_name_url);
-          that.cacheData.ShuiXi = withinData[11]
-          that.shuixi_name.then(function (layers) {
-            let textlayer = that.scene.layers.find(withinData[11]);//文字图层
-            //加载后隐藏
-            textlayer.visible = false;
-            //关闭避让
-            textlayer.isOverlapDisplayed = true;
-          });
+
 
           //9.添加县界和乡镇界
           let layer_xianjie = that.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({

+ 9 - 1
src/views/forest.vue

@@ -671,7 +671,15 @@
       //     }
       //   })
       // },
-
+      fatherMethod(dianshiqiang, longitude, latitude, item) {
+        this.$refs.TVWalls.showTVWall(
+          dianshiqiang, {
+            longitude: longitude,
+            latitude: latitude,
+          },
+          item
+        );
+      },
       dropLocation(lat, lng,eventCode) {
         this.$refs.supermap.dropLocation(lat, lng,18)
         this.showEventDialog(eventCode)