提交
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -63,7 +64,7 @@ public class GeoMapUtil {
|
||||
JSONObject addressComponent = geoJson.getJSONObject("addressComponent");
|
||||
// 根据实际响应结构解析省市区街道信息,此处仅为示例
|
||||
String province = (String) addressComponent.get("province");
|
||||
String city = (String) addressComponent.get("city");
|
||||
String city = addressComponent.get("city") instanceof String?(String) addressComponent.get("city"):province;
|
||||
String district = (String) addressComponent.get("district");
|
||||
String township = (String) addressComponent.get("township");
|
||||
String address = geoJson.getString("formatted_address");
|
||||
|
||||
Reference in New Issue
Block a user