騰訊地圖小程式SDK,計算兩個地點的距離,success回傳的資料無法取出
that.setDate ,前端頁面顯示正常,可是data裡面的資料沒有修改
app.data.**,透過app()依然無法修改
wx.setStorage ,取出的快取資料一直是上一次快取的資料
希望哪位大神解答下,要怎麼取出這個值
qqmapsdk.calculateDistance({
from: {
緯度: that.data.start.location.lat,
經度: that.data.start.location .lng
},
to: [{
緯度: that.data.end.location.lat,
經度: 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,
})
}
qqmapsdk.calculateDistance({
from: {
緯度: that.data.start.location.lat,
經度: that.data.start.location .lng
},
to: [{
緯度: that.data.end.location.lat,
經度: 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,
})
}
#