| | |
| | | @Component |
| | | public class GDMapGeocodingUtil { |
| | | |
| | | private String key = "c473445a931ee8c42eef8b63fc3602c5"; |
| | | private String key = "8fc6a7da12d64696e9727605d81f72de"; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | |
| | | */ |
| | | 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("=========="+lon+"============"+lan); |
| | | |
| | | String forObject = restTemplate.getForObject(url, String.class); |
| | | JSONObject jsonObject = JSON.parseObject(forObject); |
| | | Map<String, String> map = new HashMap<>(); |
| | | System.err.println("=========="+jsonObject); |
| | | |
| | | // gdInterfaceService.saveData("https://restapi.amap.com/v3/geocode/regeo", "经纬度转行政区域"); |
| | | |