diff --git a/src/components/MapBox.vue b/src/components/MapBox.vue
index 31cd946..363719b 100644
--- a/src/components/MapBox.vue
+++ b/src/components/MapBox.vue
@@ -24,7 +24,9 @@ export default {
takeoffLonLats: [], // 航线 第一个航点 起点 最后一个航点
isflow: false, // 飞机经纬度变化时是否跟随飞机
currentStyleIndex: 0, // 当前选中的地图样式索引
- guidedMarker: null // 指点飞行地图标记
+ guidedMarker: null, // 指点飞行地图标记
+ styleSwitcherControlRef: null, // 地图样式切换控件引用
+ fullscreenControlRef: null // 全屏控件引用(enableZoom)
}
},
props: {
@@ -85,6 +87,38 @@ export default {
}
},
watch: {
+ /** 动态开关地图样式切换控件 */
+ enableSwitch (val) {
+ if (!this.map) return
+ if (val) {
+ if (!this.styleSwitcherControlRef) {
+ const control = new MapboxStyleSwitcherControl(this.mapStyleList, 'iconfont icon-duozhang f-s-20', this.currentStyleIndex)
+ this.map.addControl(control, 'top-right')
+ this.styleSwitcherControlRef = control
+ }
+ } else {
+ if (this.styleSwitcherControlRef) {
+ try { this.map.removeControl(this.styleSwitcherControlRef) } catch (e) { /* noop */ }
+ this.styleSwitcherControlRef = null
+ }
+ }
+ },
+ /** 动态开关全屏控件(enableZoom) */
+ enableZoom (val) {
+ if (!this.map) return
+ if (val) {
+ if (!this.fullscreenControlRef) {
+ const control = new CustomFullscreenControl(this.handleResize)
+ this.map.addControl(control, 'top-right')
+ this.fullscreenControlRef = control
+ }
+ } else {
+ if (this.fullscreenControlRef) {
+ try { this.map.removeControl(this.fullscreenControlRef) } catch (e) { /* noop */ }
+ this.fullscreenControlRef = null
+ }
+ }
+ }
},
async mounted () {
// 等待 异步 加载 后端地图源 地址
@@ -211,18 +245,19 @@ export default {
// 地图比例
if (this.enblueScale) {
- this.map.addControl(new mapboxgl.ScaleControl(), 'bottom-right')
+ this.map.addControl(new mapboxgl.ScaleControl(), 'bottom-left')
}
// 全屏 并再之后 刷新地图
if (this.enableZoom) {
- this.map.addControl(new CustomFullscreenControl(this.handleResize), 'top-right')
+ this.fullscreenControlRef = new CustomFullscreenControl(this.handleResize)
+ this.map.addControl(this.fullscreenControlRef, 'top-right')
}
// 地图样式选择控件
// 自定义地图样式列表
if (this.enableSwitch) {
- const styleSwitcherControl = new MapboxStyleSwitcherControl(this.mapStyleList, 'iconfont icon-duozhang f-s-20', this.currentStyleIndex)
- this.map.addControl(styleSwitcherControl, 'top-right')
+ this.styleSwitcherControlRef = new MapboxStyleSwitcherControl(this.mapStyleList, 'iconfont icon-duozhang f-s-20', this.currentStyleIndex)
+ this.map.addControl(this.styleSwitcherControlRef, 'top-right')
}
// 飞机跟随
diff --git a/src/components/VideoBox.vue b/src/components/VideoBox.vue
index 7392a2f..decd985 100644
--- a/src/components/VideoBox.vue
+++ b/src/components/VideoBox.vue
@@ -1,258 +1,116 @@
-
-
-
-
-
-
-
-
- {{ getPlaneMode }}
-
-
-
-
-
-
-
- {{ fixType }} {{ satCount }}颗
-
-
-
-
-
-
-
- {{ voltagBattery }}V
-
-
-
-
-
-
-
- {{ currentBattery }}A
-
-
-
-
-
-
-
- {{ positionAlt }}米
-
-
-
-
-
-
-
- {{ groundSpeed }}米/秒
-
-
-
-
-
-
-
-
- {{ hookstatus || '' }} {{ loadweight ? loadweight + '克' : '' }}
-
-
-
+
-
diff --git a/src/views/layout/components/main/planes/index.vue b/src/views/layout/components/main/planes/index.vue
index de3ac3b..f53ea85 100644
--- a/src/views/layout/components/main/planes/index.vue
+++ b/src/views/layout/components/main/planes/index.vue
@@ -1,16 +1,70 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ {{ mainView === 'map' ? '切到视频' : '切到地图' }}
+
+
+ {{ pipVisible ? '隐藏小窗' : '显示小窗' }}
+
+
+
@@ -46,6 +100,7 @@
-
+