使用腾讯地图,百度和高德不在使用

This commit is contained in:
邹宗楠
2024-07-31 11:09:07 +08:00
parent d6e1893671
commit 4cf9001c9a
20 changed files with 287 additions and 212 deletions

View File

@@ -57,14 +57,14 @@ func getStorePageInfo(ctx *jxcontext.Context, handler partner.IPurchasePlatformN
func updatePageShopCityDistrictInfo(ctx *jxcontext.Context, storePageInfo *model.PageShop, cityCode int) {
if !(storePageInfo.Lng != 0 && storePageInfo.Lat != 0) {
storePageInfo.Lng, storePageInfo.Lat, storePageInfo.DistrictCode = api.AutonaviAPI.GetCoordinateFromAddress(storePageInfo.Address, utils.Int2Str(cityCode))
storePageInfo.Lng, storePageInfo.Lat, storePageInfo.DistrictCode, _, _ = api.TencentMapAPI.GetCoordinateFromAddress(storePageInfo.Address, utils.Int2Str(cityCode))
if storePageInfo.DistrictCode == 0 && cityCode != 0 {
if place, err := dao.GetPlaceByCode(dao.GetDB(), cityCode); err == nil {
storePageInfo.Lng, storePageInfo.Lat, storePageInfo.DistrictCode = api.AutonaviAPI.GetCoordinateFromAddress(storePageInfo.Address, utils.Int2Str(place.ParentCode))
storePageInfo.Lng, storePageInfo.Lat, storePageInfo.DistrictCode, _, _ = api.TencentMapAPI.GetCoordinateFromAddress(storePageInfo.Address, utils.Int2Str(place.ParentCode))
}
}
} else if storePageInfo.DistrictCode == 0 {
storePageInfo.DistrictCode = api.AutonaviAPI.GetCoordinateDistrictCode(storePageInfo.Lng, storePageInfo.Lat)
storePageInfo.DistrictCode = api.TencentMapAPI.GetCoordinateDistrictCode(storePageInfo.Lng, storePageInfo.Lat)
}
if storePageInfo.CityCode == 0 {
if storePageInfo.DistrictCode != 0 {