// web浏览器定位,需要在https下使用(http下无效)
let that = this
try {
navigator.geolocation.getCurrentPosition(
(position) => {
console.log(position)
that.queryData.latitude = position.coords.latitude
that.queryData.longitude = position.coords.longitude
},
(err) => {
alert('err', err)
console.log('getCurrentPosition==>err==>', err)
}
)
} catch (error) {
alert('error', error)
console.log('error===--==>', error)
} finally { }