百度地图的 Geocoder.getPoint 可以实现你的需求,其他各大地图开放平台应该也有类似的API const myGeo = new BMap.Geocoder(); myGeo.getPoint('北京市海淀区上地10街10号', (point) => { if (point) { //这个point就是解析地址获得的百度地图坐标系 console.log(point); //{lat: 40.057339, lng: 116.306941} } else { console.log('解析失败'); } }, '北京市');
百度地图的 Geocoder.getPoint 可以实现你的需求,其他各大地图开放平台应该也有类似的API