浏览代码

事件详情预览摄像头

彭宇 2 年之前
父节点
当前提交
9ab30911d7
共有 2 个文件被更改,包括 32 次插入2 次删除
  1. 4 2
      src/components/supermap.vue
  2. 28 0
      src/views/eventdetailsdialog.vue

+ 4 - 2
src/components/supermap.vue

@@ -1045,7 +1045,9 @@ export default {
           _that.myGroup = window.L.layerGroup(_that.layers)
         }
       }
-      _that.map.addLayer(_that.myGroup)
+      if (_that.myGroup != undefined && _that.myGroup != false) {
+        _that.map.addLayer(_that.myGroup)
+      }
       _that.map.addLayer(_that.isAggregationLayers)
     },
     setMarkersByType: function(markersList, type) { //地图标点(根据类型,可取消落点 clearMByType方法)
@@ -1219,7 +1221,7 @@ export default {
     },
     dropLocation: function(lat, lng) { //落点定位
 
-      this.map.flyTo([lat, lng], 14, { duration: 2 })
+      this.map.flyTo([lat, lng], 13, { duration: 2 })
 
       // this.controlLevel(12)
       // setTimeout(() => {

+ 28 - 0
src/views/eventdetailsdialog.vue

@@ -1750,6 +1750,34 @@ export default {
             that.$refs.supermapDialog.dropLocation(res.data.catalogue[0].latitude, res.data.catalogue[0].longitude)
           }, 2000)
         }
+        if (res.data.centermonitorTCamera != null) {
+          let markersMap = {
+            lng: 124.59,
+            lat: 43.02,
+            icon: 'camera',
+            bindPopupHtml: '',
+            click: 'preview',
+            parameter: res.data.centermonitorTCamera.cameraCode,
+            keepBindPopup: false,
+            isAggregation: false,
+            radius: 0
+          }
+          markersMap.bindPopupHtml = '<div class="map-tip">' +
+            '<span>' +
+            '                  <div class="d-l-con">' +
+            '                  <div class="d-l-l-text">' +
+            '                  <h4>摄像头名称:' + res.data.centermonitorTCamera.cameraName + '</h4>' +
+            '                </div>' +
+            '                </div>' +
+            '                </span>' +
+            '<span>' +
+            '</div>'
+          markersMap.lng = res.data.centermonitorTCamera.longitude
+          markersMap.lat = res.data.centermonitorTCamera.latitude
+          setTimeout(() => {
+            that.$refs.supermapDialog.setMarkers([markersMap])
+          }, 2000)
+        }
       })
     },
     refreshEventDialog(eventCode) {