From 711885373a2780f92c44661854f78b8801ea44b4 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Wed, 19 May 2021 17:19:10 +0800 Subject: [PATCH] aa --- platformapi/autonavi/autonavi.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platformapi/autonavi/autonavi.go b/platformapi/autonavi/autonavi.go index ac1500d7..64d40013 100644 --- a/platformapi/autonavi/autonavi.go +++ b/platformapi/autonavi/autonavi.go @@ -443,7 +443,9 @@ func (a *API) GetCoordinateFromAddressAll(address string, cityInfo string) (getC getCoordinateFromAddressByPageAllResult.Lng = utils.Str2Float64WithDefault(locationList[0], 0) getCoordinateFromAddressByPageAllResult.Lat = utils.Str2Float64WithDefault(locationList[1], 0) } - getCoordinateFromAddressByPageAllResult.CityName = geocode["city"].(string) + if str, ok := geocode["city"].(string); ok { + getCoordinateFromAddressByPageAllResult.CityName = str + } if str, ok := geocode["district"].(string); ok { getCoordinateFromAddressByPageAllResult.AdName = str }