使用百度地图对gps经纬度进行转换转换为百度地图坐标

vue yekong 1235℃
    getjwd(x, y, index) {
      // 获取经纬度
      var that = this;
      console.log('获取经纬度')
      var ggPoint = new BMap.Point(x, y);
      var convertor = new BMap.Convertor();
      var pointArr = [];
      pointArr.push(ggPoint);
      console.log(x)
      console.log(y)
      convertor.translate(pointArr, 1, 5, function (data) {
        console.log(data)
        that.list[index].lng = data.points[0].lng
        that.list[index].lat = data.points[0].lat
      })
    },
    // 获取经纬度
    maxScreenMapData() {
      var that = this;
      that.list.forEach((type, index) => {
        console.log(type)
        console.log('当前')
        that.getjwd(type.lng, type.lat, index)
      });
      maxScreenMapData({}).then(res => {
        that.list = res
        that.list.forEach((type, index) => {
          that.getjwd(type.lng, type.lat, index)
        });
        console.log(that.list)
      }).catch(err => {

      })
    },
喜欢 (0)