【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
}]

 

 

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM