【UNIAPP】微信小程序接入腾讯地图 路线规划时,setData报错

原因:语法不兼容,修改转换成vue的写法

// 设置polyline属性,将路线显示出来,将解压坐标第一个数据作为起点

 

# 微信小程序写法
that.setData({
    latitude: pl[0].latitude,
    longitude: pl[0].longitude,
    polyline: [{
          points: pl,
          color: '#FF0000DD',
          width: 4
  }]
}),

 

# uniapp写法

  that.latitude = pl[0].latitude,
  that.longitude = pl[0].longitude,
  that.polyline= [{
      points: pl,
      color: '#FF0000DD',
      width: 4
}]

 

 

 

 

 

 

posted @ 2021-01-27 12:08  PythonNew_Mr.Wang  Views(841)  Comments(0)    收藏  举报