liuyg
2021-12-16 997262e44f7f9e8d0cde869cfd026ef8c0850efd
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);