// 获取用户的地理位置,
getLocation() {
const that = this
uni.getLocation({
type: ‘gcj02’,
altitude: true,
success(res) {
console.log(res)
// console.log(‘当前位置的经度:’ + res.longitude);
// console.log(‘当前位置的纬度:’ + res.latitude);
that.latitude = res.latitude;
that.longitude = res.longitude;
that.nearby_search();
// that.getsLocation(that.longitude, that.latitude);
//判断是否开启经纬度转度分秒wechat=1为度分秒
if (that.wechat == 1) {
that.formatDegree(that.latitude);//纬度转度分秒
// console.log(that.formatDegree(that.latitude));
that.latitude = that.formatDegree(that.latitude);
that.formatDegree(that.longitude);//经度转度分秒
that.longitude = that.formatDegree(that.longitude);
}
var lng =