Parcourir la source

根据不同登录账号显示不同地图(所有2.5D地图)

JX.LI il y a 2 ans
Parent
commit
b706b20a07

+ 427 - 85
src/components/supermap-2.5d.vue

@@ -1,18 +1,20 @@
 <template>
-  <div id="cesiumContainer" style="width: 100%; height: 100%;background: none;">
-    <!--地图top 显示 开始-->
-    <transition name='fade'>
-      <div class="map-tit" v-show="mapshow">
-        <div class="top-tit">
-          <i class="iconfont sj-icon-jkzx"></i>
-          <span><img src="../assets/images/close.svg" @click="mapshow=false" /></span>
+  <div id="supermap3D" style="width: 100%; height: 100%;background: none;overflow-y: auto;">
+    <div id="cesiumContainer" style="width: 100%; height: 100%;background: none;">
+      <!--地图top 显示 开始-->
+      <transition name='fade'>
+        <div class="map-tit" v-show="mapshow">
+          <div class="top-tit">
+            <i class="iconfont sj-icon-jkzx"></i>
+            <span><img src="../assets/images/close.svg" @click="mapshow=false" /></span>
+          </div>
+          <div class="map-txt" v-html="bindPopupHtml">
+          </div>
+          <div id="super2" />
         </div>
-        <div class="map-txt" v-html="bindPopupHtml">
-        </div>
-        <div id="super2" />
-      </div>
-    </transition>
-    <!--地图top 显示 结束-->
+      </transition>
+      <!--地图top 显示 结束-->
+    </div>
   </div>
 </template>
 
@@ -64,21 +66,166 @@
           mapData: null,
           mapName: null
         },
-        showLayer:null,
-        clickTime: new Date().getTime()
+        showLayer: null,
+        clickTime: new Date().getTime(),
+        cacheData: {
+          ProvinceRoad: "",
+          CountyRoad: "",
+          StateRoad: "",
+          ShuiXi: "",
+          XianJie: "",
+          XiangZhenJie: "",
+          Cun: "",
+        },
+        supermapUrls: [
+          [
+            "/3D-sipingchangjing/rest/realspace/datas/siping_2m@spyx4326", //底图
+            "/3D-local3DCache-0608XinBanQingXieShiJing/rest/realspace", //3D模型(二级图层)
+            "/map-mvt-shuixiMian/restjsr/v1/vectortile/maps/shuixi_Mian", //水系图
+            "/map-mvt-lindi/restjsr/v1/vectortile/maps/lindi", //林地图
+            "/map-mvt-nongtian/restjsr/v1/vectortile/maps/nongtian", //农田图
+            "/map-mvt-roadXian/restjsr/v1/vectortile/maps/road_Xian", //路网图
+            "/3D-road_Name_S/rest/realspace", //路网名称
+            "ProvinceRoad_L@SiPing#1", //名称图层叠加
+            "CountyRoad_L@SiPing#1", //名称图层叠加
+            "StateRoad_L@SiPing#1", //名称图层叠加
+            "/3D-shuixi_Name/rest/realspace", //水系名称
+            "ShuiXi@SiPing#1", //水系名称叠加
+            "/map-SIPING/rest/maps/XianJie_XiangZhenJie", //乡镇街界限
+            "/3D-Name_he/rest/realspace", //乡镇街名称
+            "XianJie@SiPing#1", //县界名称
+            "XiangZhenJie@SiPing#2", //乡镇街名称
+            "Cun@SiPing#1", //村名称
+          ],
+          [
+            "/3D-shuangliaoYX/rest/realspace/datas/siping_2m_shuangliao@spyx4326",
+            "/3D-shuangliaoYX/rest/realspace/datas/shuangliao@spyx4326",
+            "/map-mvt-shuiximianshuangliao/restjsr/v1/vectortile/maps/shuixi_mian_shuangliao",
+            "/map-mvt-lindishuangliao/restjsr/v1/vectortile/maps/lindi_shuangliao",
+            "/map-mvt-nongtianshuangliao/restjsr/v1/vectortile/maps/nongtian_shuangliao",
+            "/map-mvt-roadxianshuangliao/restjsr/v1/vectortile/maps/road_xian_shuangliao",
+            "/3D-road_Name_S_shuangliao/rest/realspace",
+            "ProvinceRoad_L_shuangliao@Road#1",
+            "CountyRoad_L_shuangliao@Road#1",
+            "StateRoad_L_shuangliao@Road#1",
+            "/3D-shuixi_Name_shuangliao/rest/realspace",
+            "ShuiXi_shuangliao@Road#1",
+            "/map-SIPING/rest/maps/xiangzhenjie_shuangliao",
+            "/3D-Name_he_shuangliao/rest/realspace",
+            "shuangliaoshi@gengdi#1",
+            "XiangZhenJie_shuangliao@gengdi#1",
+            "Cun_shuangliao@SiPing#1",
+          ],
+          [
+            "/3D-lishuYX/rest/realspace/datas/siping_2m_lishu@spyx4326",
+            "/3D-lishuYX/rest/realspace/datas/lishu_1@spyx4326",
+            "/map-mvt-shuiximianlishu/restjsr/v1/vectortile/maps/shuixi_mian_lishu",
+            "/map-mvt-lindilishu/restjsr/v1/vectortile/maps/lindi_lishu",
+            "/map-mvt-nongtianlishu/restjsr/v1/vectortile/maps/nongtian_lishu",
+            "/map-mvt-roadxianlishu/restjsr/v1/vectortile/maps/road_xian_lishu",
+            "/3D-road_Name_S_lishu/rest/realspace",
+            "ProvinceRoad_L_lishu@Road#1",
+            "CountyRoad_L_lishu@Road#1",
+            "StateRoad_L_lishu@Road#1",
+            "/3D-shuixi_Name_lishu/rest/realspace",
+            "ShuiXi_lishu@Road#1",
+            "/map-SIPING/rest/maps/xiangzhenjie_lishu",
+            "/3D-Name_he_lishu/rest/realspace",
+            "lishushi@gengdi#1",
+            "XiangZhenJie_lishu@gengdi#1",
+            "Cun_lishu@SiPing#1",
+          ],
+          [
+            "/3D-tiexiYX/rest/realspace/datas/siping_2m_tiexi@spyx4326",
+            "/3D-local3DCache-0608XinBanQingXieShiJing/rest/realspace",
+            "/map-mvt-shuiximiantiexi/restjsr/v1/vectortile/maps/shuixi_mian_tiexi",
+            "/map-mvt-linditiexi/restjsr/v1/vectortile/maps/lindi_tiexi",
+            "/map-mvt-nongtiantiexi/restjsr/v1/vectortile/maps/nongtian_tiexi",
+            "/map-mvt-roadxiantiexi/restjsr/v1/vectortile/maps/road_xian_tiexi",
+            "/3D-road_Name_S_tiexi/rest/realspace",
+            "ProvinceRoad_L_tiexi@Road#1",
+            "CountyRoad_L_tiexi@Road#1",
+            "StateRoad_L_tiexi@Road#1",
+            "/3D-shuixi_Name_tiexi/rest/realspace",
+            "ShuiXi_tiexi@Road#1",
+            "/map-SIPING/rest/maps/xiangzhenjie_tiexi",
+            "/3D-Name_he_tiexi/rest/realspace",
+            "tiexishi@gengdi#1",
+            "XiangZhenJie_tiexi@gengdi#1",
+            "Cun_tiexi@SiPing#1",
+          ],
+          [
+            "/3D-tiedongYX/rest/realspace/datas/siping_2m_tiedong@spyx4326",
+            "/3D-tiedongYX/rest/realspace/datas/tiedong@spyx4326",
+            "/map-mvt-shuiximiantiedong/restjsr/v1/vectortile/maps/shuixi_mian_tiedong",
+            "/map-mvt-linditiedong/restjsr/v1/vectortile/maps/lindi_tiedong",
+            "/map-mvt-nongtiantiedong/restjsr/v1/vectortile/maps/nongtian_tiedong",
+            "/map-mvt-roadxiantiedong/restjsr/v1/vectortile/maps/road_xian_tiedong",
+            "/3D-road_Name_S_tiedong/rest/realspace",
+            "ProvinceRoad_L_tiedong@Road#1",
+            "CountyRoad_L_tiedong@Road#1",
+            "StateRoad_L_tiedong@Road#1",
+            "/3D-shuixi_Name_tiedong/rest/realspace",
+            "ShuiXi_tiedong@Road#1",
+            "/map-SIPING/rest/maps/xiangzhenjie_tiedong",
+            "/3D-Name_he_tiedong/rest/realspace",
+            "tiedongshi@gengdi#1",
+            "XiangZhenJie_tiedong@gengdi#1",
+            "Cun_tiedong@SiPing#1",
+          ],
+          [
+            "/3D-yitongYX/rest/realspace/datas/siping_2m_yitong@spyx4326",
+            "/3D-yitongYX/rest/realspace/datas/yitong@spyx4326",
+            "/map-mvt-shuiximianyitong/restjsr/v1/vectortile/maps/shuixi_mian_yitong",
+            "/map-mvt-lindiyitong/restjsr/v1/vectortile/maps/lindi_yitong",
+            "/map-mvt-nongtianyitong/restjsr/v1/vectortile/maps/nongtian_yitong",
+            "/map-mvt-roadxianyitong/restjsr/v1/vectortile/maps/road_xian_yitong",
+            "/3D-road_Name_S_yitong/rest/realspace",
+            "ProvinceRoad_L_yitong@Road#1",
+            "CountyRoad_L_yitong@Road#1",
+            "StateRoad_L_yitong@Road#1",
+            "/3D-shuixi_Name_yitong/rest/realspace",
+            "ShuiXi_yitong@Road#1",
+            "/map-SIPING/rest/maps/xiangzhenjie_yitong",
+            "/3D-Name_he_yitong/rest/realspace",
+            "yitongshi@gengdi#1",
+            "XiangZhenJie_yitong@gengdi#1",
+            "Cun_yitong@SiPing#1",
+          ],
+        ],
       }
     },
     watch: {},
     created() {
-      this.superMapInfo();
+      // this.superMapInfo();
     },
     mounted() {
-         this.showLayer = this.showLayer != undefined ? this.showLayer:false;
+      this.showLayer = this.showLayer != undefined ? this.showLayer : false;
     },
     props: {
-        showLayer: [Boolean],
+      showLayer: [Boolean],
     },
     methods: {
+      //初始化地图数据
+      removeAllviewer(num, index) {
+        if (index != -1) {
+          $('#cesiumContainer').remove();
+          $('#supermap3D').append(
+            "<div id=\"cesiumContainer\" style=\"width: 100%; height: 100%;background: none;\" >\n" +
+            "  </div>")
+        }
+        let that = this;
+        // that.removeAllMvt();
+        // that.viewer.imageryLayers.remove(this.layer);
+        // that.road_name.then(function (layers) {
+        //   that.viewer.scene.layers.find(that.cacheData.XianJie).visible = false;//文字图层
+        //   that.viewer.scene.layers.find(that.cacheData.XiangZhenJie).visible = false;//文字图层
+        //   that.viewer.scene.layers.find(that.cacheData.Cun).visible = false;//文字图层
+        // });
+        // that.layer_xianjie.show=false;
+
+        that.superMapInfo(num);
+      },
       choseMeasuringAreaAll() {
         if (this.handlerDis != null) {
           this.handlerDis.clear()
@@ -257,14 +404,15 @@
           this.graphicsBoxEntity = null
         }
       },
-      superMapInfo() {
+      superMapInfo(index) {
         getConfigKey('superMap.iServer').then(response => {
           this.superMapRootUrl = response.msg;
-          this.onload();
+          this.onload(index);
         })
       },
-      onload() {
+      onload(index) {
         let that = this;
+        const withinData = this.supermapUrls[index];
         //1.添加地形数据
         that.viewer = new Cesium.Viewer('cesiumContainer', {
           //创建地形服务提供者的实例,url为SuperMap iServer发布的TIN地形服务
@@ -287,46 +435,240 @@
 
         //2.添加SuperMap iServer发布的影像服务
         let layer = that.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
-          url: that.superMapRootUrl + "/3D-sipingchangjing/rest/realspace/datas/siping_2m@spyx4326",
+          url: that.superMapRootUrl + withinData[0],
         }));
+        if (index == 0) { //全部
+          //飞行值坐标点,每3秒推进一级
+          //heading-代表镜头左右方向,正值为右,负值为左
+          //pitch-代表镜头上下方向,正值为上,负值为下.
+          //roll-代表镜头左右倾斜,正值,向右倾斜,负值向左倾斜
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(124.49980650138238, 43.428263986216815, 950000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
 
-        //飞行值坐标点,每3秒推进一级
-        //heading-代表镜头左右方向,正值为右,负值为左
-        //pitch-代表镜头上下方向,正值为上,负值为下.
-        //roll-代表镜头左右倾斜,正值,向右倾斜,负值向左倾斜
-        setTimeout(function() {
-          that.viewer.camera.flyTo({
-            destination: Cesium.Cartesian3.fromDegrees(124.49980650138238, 43.428263986216815, 950000),
-            orientation: {
-              // heading :  Cesium.Math.toRadians(346.4202942851978),
-              // pitch : Cesium.Math.toRadians(-56.74026687972041),
-              // roll : Cesium.Math.toRadians(0)
-            }
-          });
+          }, 3000);
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(124.49980650138238, 43.428263986216815, 650000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
 
-        }, 3000);
-        setTimeout(function() {
-          that.viewer.camera.flyTo({
-            destination: Cesium.Cartesian3.fromDegrees(124.49980650138238, 43.428263986216815, 650000),
-            orientation: {
-              // heading :  Cesium.Math.toRadians(346.4202942851978),
-              // pitch : Cesium.Math.toRadians(-56.74026687972041),
-              // roll : Cesium.Math.toRadians(0)
-            }
-          });
+          }, 3000);
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(124.49980650138238, 43.428263986216815, 350000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
 
-        }, 3000);
-        setTimeout(function() {
-          that.viewer.camera.flyTo({
-            destination: Cesium.Cartesian3.fromDegrees(124.49980650138238, 43.428263986216815, 350000),
-            orientation: {
-              // heading :  Cesium.Math.toRadians(346.4202942851978),
-              // pitch : Cesium.Math.toRadians(-56.74026687972041),
-              // roll : Cesium.Math.toRadians(0)
-            }
-          });
+          }, 3000);
+        } else if (index == 1) { //双辽
+          //飞行值坐标点,每3秒推进一级
+          //heading-代表镜头左右方向,正值为右,负值为左
+          //pitch-代表镜头上下方向,正值为上,负值为下.
+          //roll-代表镜头左右倾斜,正值,向右倾斜,负值向左倾斜
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(123.77896424451833, 43.70521317451045, 950000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
 
-        }, 3000);
+          }, 3000);
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(123.77896424451833, 43.70521317451045, 650000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(123.77896424451833, 43.70521317451045, 200000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+        } else if (index == 2) { //梨树
+          //飞行值坐标点,每3秒推进一级
+          //heading-代表镜头左右方向,正值为右,负值为左
+          //pitch-代表镜头上下方向,正值为上,负值为下.
+          //roll-代表镜头左右倾斜,正值,向右倾斜,负值向左倾斜
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(124.28276991763133, 43.46361757293432, 950000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(124.28276991763133, 43.46361757293432, 650000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(124.28276991763133, 43.46361757293432, 200000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+        } else if (index == 3) { //铁西
+          //飞行值坐标点,每3秒推进一级
+          //heading-代表镜头左右方向,正值为右,负值为左
+          //pitch-代表镜头上下方向,正值为上,负值为下.
+          //roll-代表镜头左右倾斜,正值,向右倾斜,负值向左倾斜
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(124.35516104252032, 43.220384847557234, 1050000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(124.35516104252032, 43.220384847557234, 550000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(124.35516104252032, 43.220384847557234, 50000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+
+        } else if (index == 4) { //铁东
+          //飞行值坐标点,每3秒推进一级
+          //heading-代表镜头左右方向,正值为右,负值为左
+          //pitch-代表镜头上下方向,正值为上,负值为下.
+          //roll-代表镜头左右倾斜,正值,向右倾斜,负值向左倾斜
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(124.54435750508439, 43.04539078139383, 950000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(124.54435750508439, 43.04539078139383, 650000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(124.54435750508439, 43.04539078139383, 100000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+
+        } else if (index == 5) { //伊通
+          //飞行值坐标点,每3秒推进一级
+          //heading-代表镜头左右方向,正值为右,负值为左
+          //pitch-代表镜头上下方向,正值为上,负值为下.
+          //roll-代表镜头左右倾斜,正值,向右倾斜,负值向左倾斜
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(125.34420717245336, 43.35653920782364, 950000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(125.34420717245336, 43.35653920782364, 650000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+          setTimeout(function() {
+            that.viewer.camera.flyTo({
+              destination: Cesium.Cartesian3.fromDegrees(125.34420717245336, 43.35653920782364, 150000),
+              orientation: {
+                // heading :  Cesium.Math.toRadians(346.4202942851978),
+                // pitch : Cesium.Math.toRadians(-56.74026687972041),
+                // roll : Cesium.Math.toRadians(0)
+              }
+            });
+
+          }, 3000);
+
+        }
 
         //开始加载专题图等数据,8秒后开始执行
         setTimeout(function() {
@@ -363,7 +705,7 @@
           //   show:true,
           // });
           //
-          if(that.showLayer){
+          if (that.showLayer) {
             //6.路网
             let road = that.superMapRootUrl + "/map-mvt-roadXian/restjsr/v1/vectortile/maps/road_Xian";
             that.mvtMap3 = that.scene.addVectorTilesMap({
@@ -385,16 +727,19 @@
 
           //9.添加县界和乡镇界
           let layer_xianjie = that.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
-            url: that.superMapRootUrl + "/map-SIPING/rest/maps/XianJie_XiangZhenJie",
+            url: that.superMapRootUrl + withinData[12],
           }));
 
           //10.添加区县乡镇村名称
           let layer_xiangzhenjie_name = that.superMapRootUrl + '/3D-Name_he/rest/realspace';
           that.scene.open(layer_xiangzhenjie_name);
+          that.cacheData.XianJie = withinData[14]
+          that.cacheData.XiangZhenJie = withinData[15]
+          that.cacheData.Cun = withinData[16]
           that.road_name.then(function(layers) {
-            let xianJie_textLayer = that.scene.layers.find('XianJie@SiPing#1'); //区县文字图层
-            let xiangZhenJie_textLayer = that.scene.layers.find('XiangZhenJie@SiPing#2'); //乡镇文字图层
-            let cun_textLayer = that.scene.layers.find('Cun@SiPing#1'); //村文字图层
+            let xianJie_textLayer = that.scene.layers.find(withinData[14]);//区县文字图层
+            let xiangZhenJie_textLayer = that.scene.layers.find(withinData[15]);//乡镇文字图层
+            let cun_textLayer = that.scene.layers.find(withinData[16]);//村文字图层
             //关闭避让
             xianJie_textLayer.isOverlapDisplayed = true;
             xiangZhenJie_textLayer.isOverlapDisplayed = true;
@@ -402,11 +747,11 @@
           });
 
         }, 3000);
-        that.viewer.selectedEntityChanged.addEventListener(function (entity) {
-          if(entity != undefined && Reflect.has(entity,'layerID')){
-            that.queryParams.name  = entity.pickResult[entity.layerID][0].feature.properties.Name;
-            that.queryParams.mapData  = entity.pickResult[entity.layerID][0].feature.properties.SmUserID;
-            that.queryParams.mapName  = entity.pickResult[entity.layerID][0].feature.properties.layer;
+        that.viewer.selectedEntityChanged.addEventListener(function(entity) {
+          if (entity != undefined && Reflect.has(entity, 'layerID')) {
+            that.queryParams.name = entity.pickResult[entity.layerID][0].feature.properties.Name;
+            that.queryParams.mapData = entity.pickResult[entity.layerID][0].feature.properties.SmUserID;
+            that.queryParams.mapName = entity.pickResult[entity.layerID][0].feature.properties.layer;
             getDeviceList(that.queryParams).then(res => {
               const treeLabels = [{
                 "id": null,
@@ -416,7 +761,7 @@
                 "parentLabelCode": ""
               }];
               const labelChannels = [];
-              for (let i in res.data){
+              for (let i in res.data) {
                 treeLabels.push({
                   "id": null,
                   "labelCode": res.data[i].cameraCode,
@@ -426,26 +771,23 @@
                 })
                 labelChannels.push({
                   "labelCode": res.data[i].cameraCode,
-                  "channelDates": [
-                    {
-                      "channelCode": res.data[i].cameraCode,
-                      "channelName": res.data[i].cameraName,
-                      "channelSn": null,
-                      "cameraType": "1",
-                      "online": "1",
-                      "cameraCode": "1"
-                    }
-                  ]
+                  "channelDates": [{
+                    "channelCode": res.data[i].cameraCode,
+                    "channelName": res.data[i].cameraName,
+                    "channelSn": null,
+                    "cameraType": "1",
+                    "online": "1",
+                    "cameraCode": "1"
+                  }]
                 })
               }
-              const dianshiqiang = [
-                {
-                  "switchTab": "2",
-                  "treeLabels": treeLabels,
-                  "labelChannels": labelChannels
-                }
-              ]
-              that.$emit('fatherMethod', dianshiqiang,res.data[0].longitude,res.data[0].latitude,res.data[0].userList);
+              const dianshiqiang = [{
+                "switchTab": "2",
+                "treeLabels": treeLabels,
+                "labelChannels": labelChannels
+              }]
+              that.$emit('fatherMethod', dianshiqiang, res.data[0].longitude, res.data[0].latitude, res.data[0]
+                .userList);
             });
           }
         });

+ 30 - 2
src/views/datacenter.vue

@@ -86,8 +86,8 @@ import supermap from '@/components/supermap' //超图
 import vheader from '@/components/v-header.vue' //一体化共用头部
 import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
 import eventLocation from '@/components/eventLocation.vue' //事件定位弹窗
-import TVWall from '@/components/TVWall.vue' //电视墙弹窗
-
+import TVWall from '@/components/TVWall.vue' //
+import {getUserProfile} from "@/api/system/user"; //资源底色控制文件
 import pointDetails from './pointDetails.vue' //点位详情页面
 
 // import echarts from 'echarts'
@@ -109,6 +109,13 @@ export default {
     /** ----------------------------------底部按钮公用组件结束------------------------------------- */
   },
   mounted() {
+      // 初始化地图数据
+      this.getSuperMapUrl();
+    
+      setTimeout(() => {
+        // this.getResource()
+        this.fireControlViewList();
+      }, 2000)
     this.getResource();
     // this.dataChat();
   },
@@ -141,6 +148,27 @@ export default {
   },
 
   methods: {
+        //初始化地图数据
+        getSuperMapUrl(){
+          getUserProfile().then(response => {
+            let mapDeptId=response.mapDeptId
+            let num = 0;
+            if (mapDeptId == "365") {
+              num = 0;
+            } else if (mapDeptId == "369") {
+              num = 1;
+            } else if (mapDeptId == "371") {
+              num = 2;
+            } else if (mapDeptId == "373") {
+              num = 3;
+            } else if (mapDeptId == "372") {
+              num = 4;
+            } else if (mapDeptId == "370") {
+              num = 5;
+            }
+            this.$refs.supermap.removeAllviewer(num, -1);
+          });
+        },
     /** ----------------------------------底部按钮公用组件开始------------------------------------- */
     showDialog(click) {
       if (click == 'eventLocation') {

+ 26 - 0
src/views/forest.vue

@@ -472,6 +472,7 @@
     selectResourcesByLabel
   } from "@/api/resources"
 
+import {getUserProfile} from "@/api/system/user";
   import {
     selectConfigKey
   } from "@/api/system/config";
@@ -501,6 +502,9 @@
       /** ----------------------------------底部按钮公用组件结束------------------------------------- */
     },
     mounted() {
+      
+          // 初始化地图数据
+          this.getSuperMapUrl();
       this.getBaseInfo()
       this.getTodayEvents(this.getCurrentDataStr())
       this.getDeptEventCount(this.getCurrentDataStr())
@@ -610,6 +614,28 @@
     },
     /** ----------------------------------weosocket结束------------------------------------- */
     methods: {
+      
+          //初始化地图数据
+          getSuperMapUrl(){
+            getUserProfile().then(response => {
+              let mapDeptId=response.mapDeptId
+              let num = 0;
+              if (mapDeptId == "365") {
+                num = 0;
+              } else if (mapDeptId == "369") {
+                num = 1;
+              } else if (mapDeptId == "371") {
+                num = 2;
+              } else if (mapDeptId == "373") {
+                num = 3;
+              } else if (mapDeptId == "372") {
+                num = 4;
+              } else if (mapDeptId == "370") {
+                num = 5;
+              }
+              this.$refs.supermap.removeAllviewer(num, -1);
+            });
+          },
       // 根据名称筛选资源点位
       searchByName() {
         this.$modal.msgSuccess("正在查询,请稍后...");

+ 26 - 0
src/views/leader.vue

@@ -158,6 +158,8 @@
     getRyList,
     getRyListByJob
   } from "@/api/forest"; //电视墙弹窗
+  
+import {getUserProfile} from "@/api/system/user";
   let echarts = require('echarts')
   export default {
     components: {
@@ -203,6 +205,9 @@
       /** ----------------------------------底部按钮公用组件结束------------------------------------- */
     },
     mounted() {
+      
+          // 初始化地图数据
+          this.getSuperMapUrl();
       this.bottomMenuList() //获取底部公共组件消息和任务
     },
     watch: {
@@ -218,6 +223,27 @@
       }
     },
     methods: {
+    //初始化地图数据
+    getSuperMapUrl(){
+      getUserProfile().then(response => {
+        let mapDeptId=response.mapDeptId
+        let num = 0;
+        if (mapDeptId == "365") {
+          num = 0;
+        } else if (mapDeptId == "369") {
+          num = 1;
+        } else if (mapDeptId == "371") {
+          num = 2;
+        } else if (mapDeptId == "373") {
+          num = 3;
+        } else if (mapDeptId == "372") {
+          num = 4;
+        } else if (mapDeptId == "370") {
+          num = 5;
+        }
+        this.$refs.supermap.removeAllviewer(num, -1);
+      });
+    },
       /** ----------------------------------底部按钮公用组件开始------------------------------------- */
       bottomMenuList() {
         this.$refs.bottomMenu.selectMessageList() //获取消息列表

+ 25 - 0
src/views/monitor.vue

@@ -237,6 +237,7 @@ import DHWs from "@/dahua/lib/DHWs";
 let echarts = require("echarts");
 import Cookies from "js-cookie";
 
+import {getUserProfile} from "@/api/system/user";
 export default {
   components: {
     supermap,
@@ -259,6 +260,9 @@ export default {
     /** ----------------------------------底部按钮公用组件结束------------------------------------- */
   },
   mounted() {
+    // 初始化地图数据
+    this.getSuperMapUrl();
+
     this.selectKeyAreaList();
     this.getTreeselect();
     this.bottomMenuList(); //获取底部公共组件消息和任务
@@ -360,6 +364,27 @@ export default {
     },
   },
   methods: {
+    //初始化地图数据
+    getSuperMapUrl(){
+      getUserProfile().then(response => {
+        let mapDeptId=response.mapDeptId
+        let num = 0;
+        if (mapDeptId == "365") {
+          num = 0;
+        } else if (mapDeptId == "369") {
+          num = 1;
+        } else if (mapDeptId == "371") {
+          num = 2;
+        } else if (mapDeptId == "373") {
+          num = 3;
+        } else if (mapDeptId == "372") {
+          num = 4;
+        } else if (mapDeptId == "370") {
+          num = 5;
+        }
+        this.$refs.supermap.removeAllviewer(num, -1);
+      });
+    },
     // setcgqValue: function() {
     //   let that = this
     //   for (let i = 0; i < that.visuForestCloudCameraBOListSearch.length; i++) {

+ 24 - 0
src/views/resources.vue

@@ -120,6 +120,7 @@
   import resourcesdialog from "@/views/resourcesdialog.vue"; //事件详情弹窗
   /** ----------------------------------摄像头预览开始------------------------------------- */
   import {getHaiKangVideoServer} from "@/api/haikang/haikang";
+import {getUserProfile} from "@/api/system/user";
 
   /** ----------------------------------摄像头预览结束------------------------------------- */
 export default {
@@ -139,6 +140,8 @@ export default {
     /** ----------------------------------底部按钮公用组件结束------------------------------------- */
   },
   mounted() {
+    // 初始化地图数据
+    this.getSuperMapUrl();
     this.getResourcesCount();
     this.selectResources();
     this.bottomMenuList(); //获取底部公共组件消息和任务
@@ -168,6 +171,27 @@ export default {
     };
   },
   methods: {
+    //初始化地图数据
+    getSuperMapUrl(){
+      getUserProfile().then(response => {
+        let mapDeptId=response.mapDeptId
+        let num = 0;
+        if (mapDeptId == "365") {
+          num = 0;
+        } else if (mapDeptId == "369") {
+          num = 1;
+        } else if (mapDeptId == "371") {
+          num = 2;
+        } else if (mapDeptId == "373") {
+          num = 3;
+        } else if (mapDeptId == "372") {
+          num = 4;
+        } else if (mapDeptId == "370") {
+          num = 5;
+        }
+        this.$refs.supermap.removeAllviewer(num, -1);
+      });
+    },
     // 根据名称筛选资源点位
     searchByName() {
       this.$modal.msgSuccess("正在查询,请稍后...");