fix
pyt
2025-03-18 a160568ae67ab21f7bd7fadc606ca7477ef0141c
H5/pages/location/location.vue
@@ -34,7 +34,8 @@
<script>
   import {
      searchLocation
      searchLocation,
      geoconv
   } from './service'
   export default {
      data() {
@@ -111,13 +112,9 @@
         navigator.geolocation.getCurrentPosition(success, error, options);
         function success(position) {
            uni.request({
               url: `https://api.map.baidu.com/geoconv/v2/?coords=${position.coords.longitude},${position.coords.latitude}&model=2&ak=3mHKIXMArjgIkgADzOlTYp4XssNSNkwr`,
               method: 'GET',
               success: (res) => {
                  const latitude = res.data.result[0].y;
                  const longitude = res.data.result[0].x;
                  var point = new BMapGL.Point(longitude, latitude); // 创建点坐标
            geoconv({coords:`${position.coords.longitude},${position.coords.latitude}`}).then(res=>{
               const latitude = res.data[0].y;
               const longitude = res.data[0].x;
                  that.map.enableScrollWheelZoom(true);
                  that.map.centerAndZoom(point, 12);
                  var marker = new BMapGL.Marker(point);
@@ -131,8 +128,7 @@
                        return item
                     })
                  })
               },
            });
            })
         }
         function error(err) {