From 997262e44f7f9e8d0cde869cfd026ef8c0850efd Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 16 Dec 2021 11:18:57 +0800
Subject: [PATCH] 增加弹窗中跳转地图并显示当前建筑弹窗
---
src/components/mobileCortrolButtom/index.vue | 51 +++++++++++++++++++++++++++++++++++++--------------
1 files changed, 37 insertions(+), 14 deletions(-)
diff --git a/src/components/mobileCortrolButtom/index.vue b/src/components/mobileCortrolButtom/index.vue
index 1f6020a..52ab5a0 100644
--- a/src/components/mobileCortrolButtom/index.vue
+++ b/src/components/mobileCortrolButtom/index.vue
@@ -8,10 +8,12 @@
<i class="el-icon-s-flag icon"></i>
</span>
<el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="西东大街">西东大街</el-dropdown-item>
- <el-dropdown-item command="长江路">长江路</el-dropdown-item>
- <el-dropdown-item command="科技园">科技园</el-dropdown-item>
- <el-dropdown-item command="逸夫楼">逸夫楼</el-dropdown-item>
+ <el-dropdown-item
+ v-for="(item, index) in flagList"
+ :key="index"
+ :command="item"
+ >{{ item.name }}</el-dropdown-item
+ >
</el-dropdown-menu>
</el-dropdown>
</div>
@@ -28,7 +30,27 @@
export default {
name: "mobileCortrolButtom",
data() {
- return {};
+ return {
+ DC: "",
+ flagList: [
+ {
+ name: "西东大街",
+ position: [121.49500690245499, 31.23791479409691],
+ },
+ {
+ name: "长江路",
+ position: [121.52498934134815, 31.227021231622302],
+ },
+ {
+ name: "科技园",
+ position: [121.48624368075255, 31.197575925580797],
+ },
+ {
+ name: "逸夫楼",
+ position: [121.52391709005656, 31.276115901927575],
+ },
+ ],
+ };
},
computed: {
...mapGetters(["mviewer"]),
@@ -39,17 +61,18 @@
mounted() {},
methods: {
handleCommand(command) {
+ let that = this;
console.log(command, "定位");
// 定位
- // this.mviewer.zoomToPosition(
- // new DC.Position(
- // e.wgs84Position.lng,
- // e.wgs84Position.lat - 0.016,
- // 1530,
- // 0,
- // -45
- // )
- // );
+ this.mviewer.zoomToPosition(
+ new that.DC.Position(
+ command.position[0],
+ command.position[1] - 0.012,
+ 1530,
+ 0,
+ -45
+ )
+ );
},
openBigPopupAfter() {
this.$store.commit("MSET_BIGPOPUPAFTER", true);
--
Gitblit v1.9.3