扫码关注官方订阅号
腾讯地图小程序SDK,计算两个地点的距离,success返回的数据无法取出
that.setDate ,前端页面显示正常,可是data里面的数据没有修改
app.data.**,通过app()依然无法修改
wx.setStorage ,取出的缓存数据一直是上一次缓存的数据
希望哪位大神解答下,要怎么取出这个值
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,
})
}
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
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,
})
}