无关风月
2024-07-11 eb6b6dbb35a9f029e0b7d269773685c19fd40976
cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/GaoDeMapUtil.java
@@ -13,17 +13,7 @@
import java.io.IOException;
public class GaoDeMapUtil {
//    public static void main(String[] args) {
//        // 地址名称
//        String address = "深圳市";
//        // 调用自己写好的封装方法
//        JSONObject positionObj = getLngAndLat(address);
//        String longitude = positionObj.getString("longitude");
//        String latitude = positionObj.getString("latitude");
//        System.out.println("经度:" + longitude);
//        System.out.println("纬度:" + latitude);
//
//    }
    /**
     * 根据地址查询经纬度
@@ -36,7 +26,7 @@
        CloseableHttpClient httpclient = HttpClients.createDefault();
        try {
            // 拼接请求高德的url
            HttpGet httpget = new HttpGet(address+"&sensor=false&key=AIzaSyCnvS7Xm3utDjc2fdd5Gvk5E1-bavcrzAA");
            HttpGet httpget = new HttpGet(address+"&sensor=false&key=77b37f0753049c4e712ea79a24e0719c");
            // 执行get请求.
            CloseableHttpResponse response = httpclient.execute(httpget);