创建时间:2024-03-29
import { jsonp } from 'vue-jsonp';//根据经纬度 获取 详细地址
const getAddrDetails = (info: any) => {
let url = 'https://apis.map.qq.com/ws/geocoder/v1';
let key = `xxxx`;
let location = `${info.lat},${info.lng}`;
jsonp(url, {
location,
key,
output: 'jsonp',
callbackName: 'jsonp_func',
}).then((res: any) => {
if (res.status === 0) {
let { province, city, district, street } = res.result.address_component;
console.log(province, city, district, street )
}
});
};