From 75c24c7a60d95b3b52726f2425dff977a7ddfcea Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Tue, 22 Nov 2022 16:28:52 +0800
Subject: [PATCH] 点击显示范围并定位

---
 src/components/map/index.vue |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index f995d5d..71dc931 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -315,6 +315,10 @@
             that.removeMxTileset(params.titlesetName, params.incident)
         })
 
+        this.$EventBus.$on('flytoLayer', (params) => {
+            that.flytoLayer(params.layerName, params.duration)
+        })
+
     },
 
     methods: {
@@ -581,6 +585,15 @@
         // sdTilesetLayer
 
         /**
+        * 飞到指定图层
+        * @param {*} layerName 图层名称
+        * @param {*} duration 时间
+        */
+        flytoLayer (layerName, duration = 3) {
+            global.viewer.flyTo(layersObjcect[layerName], duration)
+        },
+
+        /**
          * 添加模型
          * @param {*} titlesetName 图层名称
          * @param {*} titlesetUrl 模型地址

--
Gitblit v1.9.3