ll
liukangdong
2025-03-03 3aa3e034d30b201dde95d9bc33e5b1250dd8f256
admin/src/views/operation/components/AMap.vue
@@ -10,7 +10,7 @@
        <!-- <el-button plain @click="reset">重新绘制</el-button> -->
        <!-- <el-button plain  type="danger" @click="deleteObj">删除</el-button> -->
      </div>
      <div id="container" style="width: 100%; height: 100%"></div>
      <div id="containera" style="width: 100%; height: 100%"></div>
    </div>
  </GlobalWindow>
</template>
@@ -38,8 +38,24 @@
  },
  methods: {
    initMap() {
      map = new TMap.Map("container", {
        zoom: 15, // 设置地图缩放级别
      // navigator.geolocation.getCurrentPosition(
      //   (position) => {
      //     const { latitude, longitude } = position.coords
      //     console.log(`当前定位: 纬度 ${latitude}, 经度 ${longitude}`)
      //   },
      //   (error) => {
      //     console.error("定位失败:", error.message)
      //   },
      //   {
      //     enableHighAccuracy: true, // 提高定位精度
      //     timeout: 5000, // 超时时间
      //     maximumAge: 0 // 禁用缓存
      //   }
      // )
      console.log('-----')
      map = new TMap.Map("containera", {
        zoom: 16, // 设置地图缩放级别
        center: new TMap.LatLng(31.722763, 117.385480) // 设置地图中心点坐标
      })
      var tempList = []