Browse Source

feature_20250827_地图添加搜索当前范围功能

zhujindu 3 months ago
parent
commit
687ddbf3c4
2 changed files with 9 additions and 3 deletions
  1. BIN
      src/assets/searchLocation.png
  2. 9 3
      src/views/deviceOutside/rangeStore.vue

BIN
src/assets/searchLocation.png


+ 9 - 3
src/views/deviceOutside/rangeStore.vue

@@ -178,7 +178,7 @@
         class="mapimg"
         style="bottom: 286px" />
       <!-- 获取当前中心位置数据 -->
-      <img src="./../../assets/sbpm.png" @click="getLocationData" class="mapimg" />
+      <img src="./../../assets/searchLocation.png" @click="getLocationData" class="mapimg" />
       <div v-if="show" class="mapStoreList">
         <van-icon
           name="close"
@@ -977,8 +977,13 @@ export default {
       this.getposition();
     },
     getLocationData() {
-      this.lon = this.currentCenter.lng;
-      this.lat = this.currentCenter.lat;
+      let currentCenter = this.CJ02BD(34.62200241805427, 112.45384320079718);
+      this.lon = currentCenter.lon;
+      this.lat = currentCenter.lat;
+
+      // this.lon = this.currentCenter.lng;
+      // this.lat = this.currentCenter.lat;
+      console.log(this.lon, this.lat);
       this.getUserOutPlaList();
     },
     getStoreTypeList() {
@@ -1126,6 +1131,7 @@ export default {
       // this.getMapposition(e, '2', this.$route.query.tabVal);
       var input = [e.target.re.lat, e.target.re.lng];
       this.currentCenter = new TMap.LatLng(Number(input[0]), Number(input[1]));
+      console.log(e);
       console.log(`当前中心点纬度: ${this.currentCenter.lat}, 经度: ${this.currentCenter.lng}`);
     },
     zoomend(e) {