| | |
| | | */ |
| | | public Map<String, String> geocode(String lon, String lan) throws Exception{ |
| | | String url = "https://restapi.amap.com/v3/geocode/regeo?key=" + key + "&location=" + lon + "," + lan; |
| | | System.err.println("根据经纬度获取行政区域信息[请求]---->" + url); |
| | | // System.err.println("根据经纬度获取行政区域信息[请求]---->" + url); |
| | | String forObject = restTemplate.getForObject(url, String.class); |
| | | System.err.println("根据经纬度获取行政区域信息[响应]---->" + forObject); |
| | | // System.err.println("根据经纬度获取行政区域信息[响应]---->" + forObject); |
| | | JSONObject jsonObject = JSON.parseObject(forObject); |
| | | Map<String, String> map = new HashMap<>(); |
| | | if(jsonObject.getString("status").equals("1")){ |