Prechádzať zdrojové kódy

地图增加图层点击弹出四长摄像头

wang_xy 2 rokov pred
rodič
commit
6007c841b4

+ 7 - 0
src/api/components/supermap.js

@@ -6,6 +6,13 @@ export function getSuperMap(codes) {
     method: 'get'
   })
 }
+export function getDeviceList(param) {
+  return request({
+    url: '/center-data/level/getDeviceList',
+    method: 'get',
+    params:param
+  })
+}
 
 export const iconList = {
   'marker': require('@/assets/images/cameraType/marker.png'),

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 715 - 651
src/components/TVWalls.vue


+ 27 - 20
src/components/supermap-2.5d.vue

@@ -65,14 +65,19 @@
           mapData: null,
           mapName: null
         },
+        showLayer:null
       }
     },
     watch: {},
     created() {
       this.superMapInfo();
     },
-    mounted() {},
-    props: {},
+    mounted() {
+      this.showLayer = this.showLayer != undefined ? this.showLayer:false;
+    },
+    props: {
+      showLayer: [Boolean],
+    },
     methods: {
       choseMeasuringAreaAll() {
         if (this.handlerDis != null) {
@@ -292,15 +297,17 @@
           // });
           //
           //5.农田
-          let nongtian = that.superMapRootUrl + "/map-mvt-nongtian/restjsr/v1/vectortile/maps/nongtian";
-          that.mvtMap2 = that.scene.addVectorTilesMap({
-            url: nongtian,
-            canvasWidth: 512,
-            name: 'mvt_map2',
-            viewer: that.viewer,
-            selectedColor: new Cesium.Color(250, 236, 246, 1.0),
-            show: true,
-          });
+          if(that.showLayer){
+            let nongtian = that.superMapRootUrl + "/map-mvt-nongtian/restjsr/v1/vectortile/maps/nongtian";
+            that.mvtMap2 = that.scene.addVectorTilesMap({
+              url: nongtian,
+              canvasWidth: 512,
+              name: 'mvt_map2',
+              viewer: that.viewer,
+              selectedColor: new Cesium.Color(250, 236, 246, 1.0),
+              show: true,
+            });
+          }
           //
           // //6.路网
           // let road = that.superMapRootUrl+"/map-mvt-roadXian/restjsr/v1/vectortile/maps/road_Xian";
@@ -328,15 +335,15 @@
           //10.添加区县乡镇村名称
           let layer_xiangzhenjie_name = that.superMapRootUrl + '/3D-Name_he/rest/realspace';
           that.scene.open(layer_xiangzhenjie_name);
-          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'); //村文字图层
-            //关闭避让
-            xianJie_textLayer.isOverlapDisplayed = true;
-            xiangZhenJie_textLayer.isOverlapDisplayed = true;
-            cun_textLayer.isOverlapDisplayed = true;
-          });
+          // 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'); //村文字图层
+          //   //关闭避让
+          //   xianJie_textLayer.isOverlapDisplayed = true;
+          //   xiangZhenJie_textLayer.isOverlapDisplayed = true;
+          //   cun_textLayer.isOverlapDisplayed = true;
+          // });
 
         }, 3000);
 

+ 13 - 1
src/views/forest.vue

@@ -117,7 +117,7 @@
       <!--      <supermap ref="supermap" style="width: 100%;height: 100vh;" class="indexSupermapClass" :mapDiv="'forestMap'"-->
       <!--                :dynamicPlotting="false" :mapSite="{ doubleClickZoom: false }" :codes="['9fa5']" :isSideBySide="false"-->
       <!--                @showEventDialog="showEventDialog"></supermap>-->
-      <supermap ref="supermap" style="width: 100%;height: 100vh;" @showEventDialog="showEventDialog"></supermap>
+      <supermap ref="supermap" style="width: 100%;height: 100vh;" @showEventDialog="showEventDialog" :showLayer="true" @fatherMethod="fatherMethod"></supermap>
       <!-- 右侧 -->
       <div class="rightbar rightbar-index" ref="right">
         <div class="right-item1">
@@ -425,6 +425,7 @@
       @showDialog="showDialog"></firespread>
     <eventLocation ref="eventLocation"></eventLocation>
     <TVWall ref="TVWall"></TVWall>
+    <TVWalls ref="TVWalls"></TVWalls>
   </div>
 </template>
 
@@ -456,6 +457,7 @@
   import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
   import eventLocation from '@/components/eventLocation.vue' //事件定位弹窗
   import TVWall from '@/components/TVWall.vue' //电视墙弹窗
+  import TVWalls from '@/components/TVWalls.vue' //电视墙弹窗
   import eventdetailsdialog from '@/views/eventdetailsdialog.vue' //事件详情弹窗
   import firespread from '@/views/firespread.vue' //事件详情弹窗
   import chart from "./from/dvCapsuleChart.vue";
@@ -489,6 +491,7 @@
       vBottomMenu,
       eventLocation,
       TVWall,
+      TVWalls,
       dateChoose,
       eventdetailsdialog,
       firespread
@@ -1159,6 +1162,15 @@
           }]
         })
       },
+      fatherMethod(dianshiqiang, longitude, latitude, item) {
+        this.$refs.TVWalls.showTVWall(
+          dianshiqiang, {
+            longitude: longitude,
+            latitude: latitude,
+          },
+          item
+        );
+      },
       getBaseInfo() {
         //左侧获取部门信息
         getBaseInfo().then(res => {