|
|
@ -534,18 +534,20 @@ public class CommonServiceImpl implements CommonService { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public JSONObject findByLatAndLng(String lng, String lat) throws Exception { |
|
|
|
public JSONObject findByLatAndLng(String lng, String lat) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap<>();//参数
|
|
|
|
//参数
|
|
|
|
map.put("ak", "SfrwGH7INvjPq7BwCrYrioBQZm9XXxrR");//申请百度开放平台KEY(ak)
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
map.put("output", "json");// 输出Json数据
|
|
|
|
//申请百度开放平台KEY(ak)
|
|
|
|
map.put("extensions_town", "true");// 行政区划返回乡镇级数据(town),仅国内召回乡镇数据
|
|
|
|
map.put("ak", "SfrwGH7INvjPq7BwCrYrioBQZm9XXxrR"); |
|
|
|
map.put("coordtype", "wgs84ll"); // GPS 经纬度类型
|
|
|
|
// 输出Json数据
|
|
|
|
map.put("location", lat+","+lng+"");//百度经纬度
|
|
|
|
map.put("output", "json"); |
|
|
|
|
|
|
|
// 行政区划返回乡镇级数据(town),仅国内召回乡镇数据
|
|
|
|
String url = "http://api.map.baidu.com/reverse_geocoding/v3/"; |
|
|
|
map.put("extensions_town", "true"); |
|
|
|
|
|
|
|
// GPS 经纬度类型
|
|
|
|
System.out.println("请求经纬度========" + map); |
|
|
|
map.put("coordtype", "wgs84ll"); |
|
|
|
|
|
|
|
//百度经纬度
|
|
|
|
return HttpsUtils.doGet(url , map); |
|
|
|
map.put("location", lat+","+lng+""); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return HttpsUtils.doGet("http://api.map.baidu.com/reverse_geocoding/v3/" , map); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|