1. WeChat Mini Programs wants to get the current location, but calls wx.getLocation
to say that he has no permission. I think the map
component of the official website does not have the code for authorization.
2. Here is my code:
//getLaLo
getLaLo: function () {
wx.getLocation({
type: "wgs84",
success: function (res) {
var latitude = res.latitude
var longitude = res.longitude
var speed = res.speed
var accuracy = res.accuracy
console.log("this:",this)
this.setData({
la: latitude,
lo: longitude
})
},
fail: function(err) {
console.log(err)
},
})
3. Then this is the error message:
errMsg:"getLocation:fail no permission"
4. If you change it according to the answer, you will still report an error. I am also very desperate, you gods help Xiaobai