getlocation: function (){}真机测试无效 怎么解决啊
getlocation: function () {
wx.getLocation({
type: ‘gcj02’,
success: function (res) {
var latitude = res.latitude
var longitude = res.longitude
var speed = res.speed
var accuracy = res.accuracy
console.log(“latitude:” + latitude)
console.log(“longitude:” + longitude)
console.log(“speed:” + speed)
console.log(“accuracy:” + accuracy)
wx.openLocation({
latitude: latitude,
longitude: longitude,
scale: 11
})
}
})
}
真机 测试 没有反应 求大神帮助