微信小程序手动获取自己位置wx.chooseLocation

1.用户发布门店信息的时候需要自己上传自己的门店位置,这个一直困扰着我

0.1定位不准确

0.2不够智能

用微信里面自己的api    wx.chooseLocation(OBJECT)

这种方式

微信小程序手动获取自己位置wx.chooseLocation

// 地图选择
wx.chooseLocation({
success: function (res) {
// success
console.log(res,"location")
console.log(res.name)
console.log(res.latitude)
console.log(res.longitude)
that.setData({
roomname:res.name
})
},
fail: function () {
// fail
},
complete: function () {
// complete
}
})