wwf
18 小时以前 38712ae83223cb244020e255fc37e1ce35775c45
src/views/h5/signup/BaiduMap.vue
@@ -32,8 +32,6 @@
  });
  return baiduMapPromise;
}
import { getCurrentPosition } from '@/utils/tool.js'
export default {
  name: 'BaiduMap',
  props: {
@@ -58,6 +56,15 @@
      this.map = null;
    }
  },
  watch: {
    center: {
      handler: function(val) {
        const newPoint = new BMapGL.Point(val.lng, val.lat);
        this.map.map.setCenter(newPoint)
      },
      deep: true
    }
  },
  methods: {
    loadMap() {
      loadBaiduMapScript()
@@ -78,6 +85,7 @@
      map.enableScrollWheelZoom();
      this.map = map;
      this.$emit('ready', map);
      this.$emit('getMapStatus', 'success')
      this.getUserPosition()
    },
    async getUserPosition() {