Merge remote-tracking branch 'origin/mark' into yonghui
This commit is contained in:
@@ -580,8 +580,10 @@ func getAddressInfoFromCoord(db *dao.DaoDB, lng, lat float64) (formattedAddress
|
|||||||
regeoInfo, err := api.AutonaviAPI.GeoCodeRegeoSingle(lng, lat, 0, false, nil, 0, 0)
|
regeoInfo, err := api.AutonaviAPI.GeoCodeRegeoSingle(lng, lat, 0, false, nil, 0, 0)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
formattedAddress = regeoInfo.FormattedAddress
|
formattedAddress = regeoInfo.FormattedAddress
|
||||||
districtCode = int(utils.Str2Int64(regeoInfo.AddressComponent.Adcode))
|
districtCode = int(utils.Str2Int64WithDefault(regeoInfo.AddressComponent.Adcode, 0))
|
||||||
if districtInfo, err2 := dao.GetPlaceByCode(db, districtCode); err2 == nil {
|
if districtCode == 0 {
|
||||||
|
err = fmt.Errorf("坐标lng:%f,lat:%f找不到位置信息", lng, lat)
|
||||||
|
} else if districtInfo, err2 := dao.GetPlaceByCode(db, districtCode); err2 == nil {
|
||||||
cityCode = districtInfo.ParentCode
|
cityCode = districtInfo.ParentCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user