浏览代码

Merge remote-tracking branch 'origin/visu_emergency_01_siping_2.5d' into visu_emergency_01_siping_2.5d

wangzhe 2 年之前
父节点
当前提交
3a988ba51b
共有 2 个文件被更改,包括 6 次插入58 次删除
  1. 3 55
      src/components/supermap-2.5d.vue
  2. 3 3
      src/views/monitor.vue

+ 3 - 55
src/components/supermap-2.5d.vue

@@ -5,7 +5,7 @@
       <div class="map-tit" v-show="mapshow">
         <div class="top-tit">
           <i class="iconfont sj-icon-jkzx"></i>
-          <span @click="mapshow=false"><img src="../assets/images/close.svg"/></span>
+          <span @click="mapshow=false"><img src="../assets/images/close.svg" @click="mapshow=false"/></span>
         </div>
         <div class="map-txt" v-html="bindPopupHtml">
         </div>
@@ -93,7 +93,6 @@ export default {
     setMarkersRadius(makerList) {
       let that = this
       that.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)
-      clearInterval(that.aac)
       for (let i in makerList) {
         let longitude = makerList[i].lng;
         let latitude = makerList[i].lat;
@@ -113,7 +112,7 @@ export default {
         })
         that.markerboxEntityRadius.push(marker)
         //绘制摄像头的圈(覆盖范围)
-        that.viewer.entities.add({
+        let markerRadius = that.viewer.entities.add({
           position: Cesium.Cartesian3.fromDegrees(makerList[i].lng,makerList[i].lat,2),
           ellipse: {
             semiMinorAxis: makerList[i].radius,
@@ -125,6 +124,7 @@ export default {
             outlineWidth: 1,
           },
         });
+        that.markerboxEntityRadius.push(markerRadius)
       }
       that.viewer.scene.globe.depthTestAgainstTerrain = false
       that.createLeftClickDescription()
@@ -321,7 +321,6 @@ export default {
     setMarkers(makerList) {
       let that = this
       that.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)
-      clearInterval(that.aac)
       for (let i in makerList) {
         let longitude = makerList[i].lng
         let latitude = makerList[i].lat
@@ -385,57 +384,6 @@ export default {
       }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
     },
     /**
-     * 地图落点(传感器)
-     */
-    setMarkers_cgq(makerList){
-      let that = this;
-      that.handler = new Cesium.ScreenSpaceEventHandler(this.scene.canvas);
-
-      for (let i in makerList) {
-        let longitude = makerList[i].lng;
-        let latitude = makerList[i].lat;
-        that.viewer.entities.add({
-          name:"",
-          position: Cesium.Cartesian3.fromDegrees(longitude, latitude),
-          billboard: {
-            image: iconList[makerList[i].icon],
-            width: 48,
-            height: 48,
-            heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
-            disableDepthTestDistance:Number.POSITIVE_INFINITY
-          },
-          description: makerList[i].bindPopupHtml,
-          click: makerList[i].click,
-          parameter: makerList[i].parameter,
-        });
-      }
-      that.viewer.scene.globe.depthTestAgainstTerrain=false;
-      that.createLeftClickDescription_cgq();
-    },
-    /**
-     *鼠标左击事件是原来的气泡(传感器)
-     */
-    createLeftClickDescription_cgq() {
-      let that = this;
-      clearInterval(that.aac);
-      that.handler.setInputAction(function (movement) {
-        that.aac = setInterval(function (){
-          let color = "green";
-          let value = Math.random();
-          let up = "▲";
-          let down = "▼";
-          if(value>0.5){
-            color = "red";
-            value = value +""+ up;
-          }else{
-            value = value +""+ down;
-          }
-          let html = "<span style='color:"+color+"'>当前传感器数值:"+value+"</span>";
-          window.parent.frames[0].document.querySelector(".cesium-infoBox-description").innerHTML = html;
-        },1000);
-      }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
-    },
-    /**
      * 落点定位
      */
     dropLocation(lat, lng) {

+ 3 - 3
src/views/monitor.vue

@@ -405,7 +405,7 @@ export default {
       let markersList = [];
       getDlblistBydeptId(that.deptId).then(function (res) {
         that.loudspeakerNum = res.data.length
-      
+
       })
         .catch(function (error) {
           console.error(error);
@@ -417,7 +417,7 @@ export default {
       let markersList = [];
       getSensorListByDeptId(that.deptId).then(function (res) {
         that.sensorNum = res.data.length
-      
+
       })
         .catch(function (error) {
           console.error(error);
@@ -473,7 +473,7 @@ export default {
           }
           setTimeout(() => {
             that.$refs.supermap.clearM();
-            that.$refs.supermap.setMarkers_cgq(markersList);
+            that.$refs.supermap.setMarkers(markersList);
           }, 3000);
         } else {
           setTimeout(() => {