open() {
var that = this
uni.getLocation({
type: 'gcj02',
geocode: true,
success: function(res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
uni.showToast({
icon: 'none',
duration: 10000,
title: res.longitude + "____" + res.latitude
})
that.address = res
that.latitude = res.latitude
that.longitude = res.longitude
},
fail(err) {
uni.showToast({
icon: 'none',
title: err,
duration: 10000
})
}
});
},
0 个回复