xieqy 1 year ago
parent
commit
d0d08bb471

+ 3 - 2
src/views/vmSubsystem/VideoOverview/widget.vue

@@ -238,8 +238,8 @@ export default class VideoOverview extends Vue {
     }
   }
   @Watch('cameraDataSourceList')
-  onCamearDsChange() {
-    if (this.cameraDataSourceList.length == this.cameraList.length) {
+  onCamearDsChange(val) {
+    if (val.length == this.cameraList.length && this.cameraDataSourceList.length != 0) {
       this.changeShowType()
     }
   }
@@ -248,6 +248,7 @@ export default class VideoOverview extends Vue {
   }
   @Watch('mapView', { immediate: true })
   onChangeMethod(val) {
+    if (!val) return
     this.debounce(() => {
       this.currentZoomLevel = this.mapView.getView().getZoom()
       this.getCameraType()

+ 1 - 0
src/views/vmSubsystem/common/maptool.ts

@@ -131,6 +131,7 @@ export default class maptool {
     clear() {
         if (this.vectorLayer) this.vectorLayer.getSource().clear()
         if (this.clusterLayer) {
+            this.clusterLayer.getSource().clear()
             this.view.removeLayer(this.clusterLayer)
             this.clusterLayer = null
         }