美团配送,高德
This commit is contained in:
@@ -504,6 +504,17 @@ func (a *API) GetCoordinateTownInfo(lng, lat float64) (townName, townCode string
|
||||
return townName, townCode
|
||||
}
|
||||
|
||||
func (a *API) GetCoordinateCityInfo(lng, lat float64) (cityName, cityCode string) {
|
||||
result, err := a.GetCoordinateAreaInfo(lng, lat)
|
||||
// baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
|
||||
if err == nil {
|
||||
addressComponent := result["regeocode"].(map[string]interface{})["addressComponent"].(map[string]interface{})
|
||||
cityName = utils.Interface2String(addressComponent["city"])
|
||||
cityCode = utils.Interface2String(addressComponent["citycode"])
|
||||
}
|
||||
return cityName, cityCode
|
||||
}
|
||||
|
||||
// 这里的District指的是地点,不是实际上的区,具体级别看level
|
||||
// 这个函数返回的可能不是同级别的地点
|
||||
func (a *API) GetDistricts(subDistrict int, keywords string) (districtList []*District, err error) {
|
||||
|
||||
Reference in New Issue
Block a user