文章詳情頁
騰訊地圖小程序SDK,success返回的數據無法取出
瀏覽:99日期:2022-06-24 10:41:14
問題描述
騰訊地圖小程序SDK,計算兩個地點的距離,success返回的數據無法取出
that.setDate ,前端頁面顯示正常,可是data里面的數據沒有修改
app.data.**,通過app()依然無法修改
wx.setStorage ,取出的緩存數據一直是上一次緩存的數據
希望哪位大神解答下,要怎么取出這個值
問題解答
回答1:qqmapsdk.calculateDistance({
from: {
latitude: that.data.start.location.lat,
longitude: that.data.start.location.lng
},
to: [{
latitude: that.data.end.location.lat,
longitude: that.data.end.location.lng
}],
success: function (res) {
let myDistance = res.result.elements[0].distance
console.log(res.result.elements[0].distance,"00獲取的距離是")
wx.setStorage({
key: 'myDistance',
data: res.result.elements[0].distance,
})
}
上一條:微博2輸入框一些問題下一條:html的qq快捷登錄怎么搞?求個源碼
排行榜
