- don't translate coordinate when lng and lat are zero in CoordinateConvert
This commit is contained in:
@@ -161,6 +161,9 @@ func (a *API) CoordinateConvert(lng, lat float64, coordsys string) (retLng, retL
|
|||||||
if coordsys == "" || coordsys == CoordSysAutonavi {
|
if coordsys == "" || coordsys == CoordSysAutonavi {
|
||||||
return lng, lat, nil
|
return lng, lat, nil
|
||||||
}
|
}
|
||||||
|
if lng == 0.0 && lat == 0.0 {
|
||||||
|
return 0.0, 0.0, nil
|
||||||
|
}
|
||||||
params := map[string]interface{}{
|
params := map[string]interface{}{
|
||||||
"locations": fmt.Sprintf("%.6f,%.6f", lng, lat),
|
"locations": fmt.Sprintf("%.6f,%.6f", lng, lat),
|
||||||
"coordsys": coordsys,
|
"coordsys": coordsys,
|
||||||
|
|||||||
Reference in New Issue
Block a user