高德地图API使用(根据地址查经纬度,计算二个坐标之间的距离) 根据地址查经纬度: https://restapi.amap.com/v3/geocode/geo?address=广西壮族自治区南宁市西乡塘区衡阳西路34号&output=JSON&key=38f05ba13d4324325 返回:
{ "status": "1", "info": "OK", "infocode": "10000", "count": "1", "geocodes": [ { "formatted_address": "广西壮族自治区南宁市西乡塘区衡阳西路34号", "country": "中国", "province": "广西壮族自治区", "citycode": "0771", "city": "南宁市", "district": "西乡塘区", "township": [], "neighborhood": { "name": [], "type": [] }, "building": { "name": [], "type": [] }, "adcode": "450107", "street": "衡阳西路", "number": "34号", "location": "108.304040,22.830050", "level": "门址" } ] }
计算二个坐标之间的距离: https://restapi.amap.com/v3/distance?key=38f05ba13dd23432532&origins=108.310570,22.830544&destination=108.304345,22.793718&type=1 返回:
{ "status": "1", "info": "OK", "infocode": "10000", "count": "1", "results": [ { "origin_id": "1", "dest_id": "1", "distance": "6447", "duration": "1194" } ] }
标签:经纬度,二个,34,塘区,API,type,高德 From: https://www.cnblogs.com/niunan/p/18339708