<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>批量逆地理编码</title>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<textarea></textarea>
<button>查询</button>
<script>
$('button').click(function () {
var a = $('textarea').val();
a.split('纬度').map((item, index) => {
if (item.split('经度').length === 2) {
const x = item.split('经度')[1].trim();
const y = item.split('经度')[0].trim();
$.ajax({
async: true,
url: 'http://api.map.baidu.com/reverse_geocoding/v3/',
type: 'GET',
dataType: 'jsonp',
data: {
ak: 百度key,
output: 'json',
coordtype: 'wgs84ll',
location: x + ',' + y,
},
success: function (v) {
console.log(x, y, v.result.formatted_address);
},
});
}
});
});
</script>
</body>
</html>

1、效果

批量逆地理编码 百度地图api_前端

2、数据来源(从excel里制作复制过来)

批量逆地理编码 百度地图api_json_02

3、结果

批量逆地理编码 百度地图api_json_03

​百度地图api​