This commit is contained in:
邹宗楠
2024-07-04 17:16:32 +08:00
parent 11ff90eafa
commit 0b7b24dde2

View File

@@ -744,20 +744,20 @@ func GetCyclingLine(sLng, sLat, uLng, uLat float64) (polyLineList []string, dist
return nil, 0, 0, err return nil, 0, 0, err
} }
polyLine := make([]string, 0, 0) //polyLine := make([]string, 0, 0)
if path != nil && len(path.Routes) != 0 { if path != nil && len(path.Routes) != 0 {
distance = int64(path.Routes[0].Distance) // 距离 distance = int64(path.Routes[0].Distance) // 距离
duration = int64(path.Routes[0].Duration) // 时间 duration = int64(path.Routes[0].Duration) // 时间
for _, v := range path.Routes[0].Steps { for _, v := range path.Routes[0].Steps {
polyLine = append(polyLine, strings.Split(v.Path, ";")...) polyLineList = append(polyLineList, strings.Split(v.Path, ";")...)
} }
} }
polyLineList, _ = baiDuCoord2Gaode(polyLine) //polyLineList, err = baiDuCoord2Gaode(polyLine)
if err != nil { //if err != nil {
polyLineList = polyLine // polyLineList = polyLine
} //}
return return
} }