高德page修改
This commit is contained in:
@@ -54,10 +54,12 @@ func (a *API) GetCoordinateFromAddressByPage(address string) (lng, lat float64,
|
||||
"keywords": address,
|
||||
})
|
||||
if err == nil {
|
||||
str := result["pois"].([]interface{})[0].(map[string]interface{})["location"].(string)
|
||||
strs := strings.Split(str, ",")
|
||||
if len(strs) > 0 {
|
||||
return utils.Str2Float64(strs[0]), utils.Str2Float64(strs[1]), err
|
||||
if len(result["pois"].([]interface{})) > 0 {
|
||||
str := result["pois"].([]interface{})[0].(map[string]interface{})["location"].(string)
|
||||
strs := strings.Split(str, ",")
|
||||
if len(strs) > 0 {
|
||||
return utils.Str2Float64(strs[0]), utils.Str2Float64(strs[1]), err
|
||||
}
|
||||
}
|
||||
}
|
||||
return lng, lat, err
|
||||
|
||||
Reference in New Issue
Block a user