From 39853d620fc99924d579c7f4a034a362660944cb Mon Sep 17 00:00:00 2001 From: tk Date: Sat, 12 Oct 2024 11:36:32 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afeat=20=E6=8C=87=E7=82=B9=E5=9B=BE=E6=A0=87=20?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=BC=B9=E5=87=BA=20=E2=80=98=E6=B0=94?= =?UTF-8?q?=E6=B3=A1=E8=AF=B4=E6=98=8E=E2=80=99=20=E3=80=90=E5=8E=9F=20=20?= =?UTF-8?q?=E5=9B=A0=E3=80=91=EF=BC=9A=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B?= =?UTF-8?q?=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91?= =?UTF-8?q?=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- src/components/MapBox.vue | 5 +++++ src/views/layout/components/main/planes/index.vue | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/MapBox.vue b/src/components/MapBox.vue index 88ee9e5..22ae424 100644 --- a/src/components/MapBox.vue +++ b/src/components/MapBox.vue @@ -570,6 +570,11 @@ export default { draggable: false// 关闭拖拽 }) .setLngLat(lonLat) + .setPopup( + new mapboxgl.Popup({ offset: 32 }).setHTML( + '

指点

' + ) + ) // 添加弹出窗口 .addTo(this.map) }, /** diff --git a/src/views/layout/components/main/planes/index.vue b/src/views/layout/components/main/planes/index.vue index df1633e..67a73f2 100644 --- a/src/views/layout/components/main/planes/index.vue +++ b/src/views/layout/components/main/planes/index.vue @@ -23,7 +23,7 @@ 关闭 飞至 + @click="publishFun(`{guidedMode:{lon:${guidedLonLat.lon},lat:${guidedLonLat.lat},alt:${guidedAlt}}`); isReserveGuidedMaker = true; dialogVisible = false">飞至 @@ -46,6 +46,7 @@ export default { dialogVisible: false, // 弹出框 显隐 guidedLonLat: {}, // 点飞 的经纬度 guidedAlt: '', // 点飞的高度 + isReserveGuidedMaker: false, // 关闭指点飞行操作窗口时 标记是否删除图标 mapBoxKey: '', // 初始化一个变量用于控制map-box组件的重新渲染 planesId: this.$route.params.id, localCount: 0 // 本地存储计数器 @@ -85,7 +86,7 @@ export default { methods: { /** 弹出框 关闭事件回调 */ closeCallback () { - if (this.dialogItem === 'guidedBox') { // 关闭点飞窗口时 + if (this.dialogItem === 'guidedBox' && this.isReserveGuidedMaker === false) { // 关闭点飞窗口时 this.$refs.mapbox.delGuidedMarker()// 删除所有点飞的地图标记 } this.dialogVisible = false @@ -96,6 +97,7 @@ export default { }, // 地图长按事件 记录地图经纬度 handleLongPress (lonLat) { + this.isReserveGuidedMaker = false this.dialogTitle = '点飞' this.dialogVisible = true this.dialogItem = 'guidedBox'