1
This commit is contained in:
@@ -743,16 +743,11 @@ func GetCyclingLine(sLng, sLat, uLng, uLat float64) (polyLineList []string, dist
|
|||||||
return nil, 0, 0, err
|
return nil, 0, 0, err
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("==============:path %s", utils.Format4Output(path, false))
|
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, ";")...)
|
polyLineList = append(polyLineList, strings.Split(v.Path, ";")...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user