app端如果不想使用高德解析地址可以使用html5+的方式解析
uni.getLocation({
type: 'wgs84',
success: function (res) {
console.log('当前位置的经度:' + res.longitude)
console.log('当前位置的纬度:' + res.latitude)
let loacationObj = transformFromWGSToGCJ(res.latitude, res.longitude)
var point = new plus.maps.Point(
loacationObj.longitude,
loacationObj.latitude
)
plus.maps.Map.reverseGeocode(
point,
{},
function (event) {
var address = event.address // 转换后的地理位置
var point = event.coord // 转换后的坐标信息
var coordType = event.coordType // 转换后的坐标系类型
console.log(address, 'address')
},
function (e) {}
)
},
})
transformFromWGSToGCJ提高获取的经纬度精度,网上下载的,需要的可以说