根据经纬度获取地址

public static JSONObject dizhi(String ak,String longitude,String latitude,String output){
String URL = "https://api.map.baidu.com/geocoder/v2/?ak="+ak+"&location="+latitude+","+longitude+"&output="+output;
JSONObject httpsRequest = CommonUtil.httpsRequest(URL, "GET","");
JSONObject jsonObject = httpsRequest.getJSONObject("result").getJSONObject("addressComponent");
// String province = jsonObject.getString("province");
// String city = jsonObject.getString("city");
// String district = jsonObject.getString("district");
// String street = jsonObject.getString("street");
// String snumber = jsonObject.getString("street_number");
return jsonObject;
}

posted @ 2018-07-24 17:41  zcy1995  阅读(589)  评论(0编辑  收藏  举报