in order to get a WeChat Mini Programs, you need to call the user location information later, but the values in the console outside wx.getLocation are all empty. How to write? Only the following console.log (latitude) can get the value obtained in it?
.
var latitude
var longitude
wx.getLocation({
type: "wgs84",
success: (res) => {
latitude = res.latitude
longitude = res.longitude
}
})
console.log(latitude)
.