From 77ec03d84524c0ad795a505ef4756b01f1c050ae Mon Sep 17 00:00:00 2001 From: DIAMOND <276397553@qq.com> Date: Mon, 18 Dec 2023 16:03:03 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=9B=B4=E6=8D=A2=E5=9C=B0=E5=9B=BE=E6=8F=90?= =?UTF-8?q?=E4=BE=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2.处理mitt事件 --- src/views/earthMap/edit/EarthComp.vue | 15 +- .../monitorArea/components/VCEarthViewer.vue | 985 ++++++++++-------- 2 files changed, 570 insertions(+), 430 deletions(-) diff --git a/src/views/earthMap/edit/EarthComp.vue b/src/views/earthMap/edit/EarthComp.vue index 667935e..9e5ce14 100644 --- a/src/views/earthMap/edit/EarthComp.vue +++ b/src/views/earthMap/edit/EarthComp.vue @@ -627,6 +627,9 @@ this.clearAlarmModel(eventSerialNum) } }) + $mitt.on('fly', function (callback) { + that.fly(callback) + }) } @@ -841,7 +844,7 @@ }); } - async fly() { + async fly(callback:any = null) { let position, rotation, viewDistance, duration; // let parentData = @@ -866,6 +869,11 @@ rotation = [data.rotationX, data.rotationY, data.rotationZ]; viewDistance = data.viewDistance; duration = data.duration ? data.duration : 0; + // 处理mitt事件 + if(callback){ + callback(position,rotation,viewDistance,duration); + return + } this._earth.camera.flyTo(position, viewDistance, rotation, duration); // 地图复原事件 window.$flyTo = this.flyTo = () => { @@ -877,6 +885,11 @@ rotation = [parentData[0].rotationX, parentData[0].rotationY, parentData[0].rotationZ]; viewDistance = parentData[0].viewDistance; duration = parentData[0].duration; + // 处理mitt事件 + if(callback){ + callback(position,rotation,viewDistance,duration); + return + } // 先飞入到能看见红旗 this._earth.camera.flyTo(position, viewDistance, rotation, duration); // 地图复原事件 diff --git a/src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue b/src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue index 7e5fbbb..c7982ec 100644 --- a/src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue +++ b/src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue @@ -5,33 +5,21 @@ 功能概述:引入vc-drawings地图绘制插件,实现区域绘制并编辑保存数据,注意数据格式!注意数据格式!注意数据格式! -->