aa
This commit is contained in:
@@ -100,8 +100,21 @@ func (a *API) GetCoordinateFromAddressByPageAll(address string, cityCode int) (g
|
|||||||
getCoordinateFromAddressByPageAllResult.Lng = utils.Str2Float64(strs[0])
|
getCoordinateFromAddressByPageAllResult.Lng = utils.Str2Float64(strs[0])
|
||||||
getCoordinateFromAddressByPageAllResult.Lat = utils.Str2Float64(strs[1])
|
getCoordinateFromAddressByPageAllResult.Lat = utils.Str2Float64(strs[1])
|
||||||
}
|
}
|
||||||
getCoordinateFromAddressByPageAllResult.CityName = result["pois"].([]interface{})[0].(map[string]interface{})["cityname"].(string)
|
for _, v := range result["pois"].([]interface{}) {
|
||||||
getCoordinateFromAddressByPageAllResult.AdName = result["pois"].([]interface{})[0].(map[string]interface{})["adname"].(string)
|
if getCoordinateFromAddressByPageAllResult.CityName == "" {
|
||||||
|
if str, ok := v.(map[string]interface{})["cityname"].(string); ok {
|
||||||
|
getCoordinateFromAddressByPageAllResult.CityName = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if getCoordinateFromAddressByPageAllResult.AdName == "" {
|
||||||
|
if str, ok := v.(map[string]interface{})["adname"].(string); ok {
|
||||||
|
getCoordinateFromAddressByPageAllResult.AdName = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if getCoordinateFromAddressByPageAllResult.CityName != "" && getCoordinateFromAddressByPageAllResult.AdName != "" {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user