zh
2024-11-25 e176ec0f4e2e35342bef6c909786c31d7fd8316f
src/views/components/Map/index.vue
@@ -1,6 +1,5 @@
<template>
  <div>
    <div :id="id" ref="contentRef" class="w-full h-full">
    <div :id="id" ref="contentRef" style="height: 100%; width: 100%">
      <div
        v-if="isShowControl"
        :class="controlPosition"
@@ -29,9 +28,8 @@
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
<script>
import Location from "@/assets/images/location.png";
import FileImg from "@/assets/images/file1.png";
import MinusImg from "@/assets/images/minus.png";
@@ -131,9 +129,10 @@
    initTianMap() {
      var T = window.T;
      setTimeout(async () => {
        this.map = new T.Map(this.id, {
          projection: "EPSG:4326",
        });
                // this.map = new T.Map(this.id, {
                //     projection: "EPSG:4326",
                // });
                this.map = new T.Map(this.id);
        this.map.centerAndZoom(
          new T.LngLat(this.defaultMaskInfo.lon, this.defaultMaskInfo.lat),
          this.zoom
@@ -157,7 +156,7 @@
        } else {
          this.$props.mapList.length && this.makeAllMask(this.$props.mapList);
        }
      }, 0);
            }, 1500);
    },
    zoomIn() {
@@ -263,8 +262,7 @@
        </div>
      </div>
      <div class="detail-info">
        <span class="truncate-content">总投资:${
          row.totalMoney ?? "暂无数据"
        <span class="truncate-content">总投资:${row.totalMoney ?? "暂无数据"
        }</span>
        <span class="truncate-content">
          项目状态:
@@ -316,6 +314,7 @@
    // 打标记
    makeMask(lon, lat, options) {
      const { markerOptions, labelOptions } = options;
      console.log("options", markerOptions, labelOptions);
      const icon = new T.Icon({
@@ -327,6 +326,7 @@
        icon,
        id: markerOptions?.id,
      });
      this.map && this.map.addOverLay(marker);
      const label = new T.Label({
        text: labelOptions.text,