This commit is contained in:
邹宗楠
2023-10-27 18:19:46 +08:00
parent 3b97347fe8
commit d53146b640

View File

@@ -743,16 +743,11 @@ func GetCyclingLine(sLng, sLat, uLng, uLat float64) (polyLineList []string, dist
return nil, 0, 0, err
}
globals.SugarLogger.Debugf("==============:path %s", utils.Format4Output(path, false))
//if err := json.Unmarshal([]byte(data.(map[string]interface{})), path); err != nil {
// return nil, 0, 0, err
//}
if path.Status != model.NO {
return nil, 0, 0, fmt.Errorf("%d,%s", path.Status, path.Message)
}
distance = int64(path.Result.Routes[0].Distance) // 距离
duration = int64(path.Result.Routes[0].Duration) // 时间
for _, v := range path.Result.Routes[0].Steps {
distance = int64(path.Routes[0].Distance) // 距离
duration = int64(path.Routes[0].Duration) // 时间
for _, v := range path.Routes[0].Steps {
polyLineList = append(polyLineList, strings.Split(v.Path, ";")...)
}