我用的是腾讯地图,来获取逆解析
1.首先要去腾讯地图申请key 腾讯位置服务 - 立足生态,连接未来 进入这个网址
2.
2. 点击 创建应用
// 获取当前城市的定位
getLocation() {
let vm = this;
uni.getLocation({
type: "wgs84",
success(res) {
const latitude = res.latitude;
const longitude = res.longitude;
uni.request({
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=你申请的key`,
success: function(res) {
const city = res.data.result.address_component.city;
if (city !== vm.cityName) {