liujie
2026-06-09 c96fbe6b0aeb413a17c429133ee6d81d138144b9
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/GDMapGeocodingUtil.java
@@ -1,8 +1,9 @@
package com.xiaopeng.operation.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.xiaopeng.common.core.utils.HttpUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
@@ -16,7 +17,11 @@
@Lazy
public class GDMapGeocodingUtil {
    private String key = "66ae577f63898dae3016d599fda57221";
    @Value("${map.api-key}")
    private String key;
    @Value("${map.urls.reverse-geocode}")
    private String reverseGeocodeUrl;
@@ -30,7 +35,7 @@
     * @throws Exception
     */
    public Map<String, String> geocode(String lon, String lan) {
        String url = "https://restapi.amap.com/v3/geocode/regeo?key=" + key + "&location=" + lon + "," + lan;
        String url = reverseGeocodeUrl + "?key=" + key + "&location=" + lon + "," + lan;
        String forObject = HttpUtils.sendGet(url);
        JSONObject jsonObject = JSON.parseObject(forObject);
        Map<String, String> map = new HashMap<>();