- don't translate coordinate when lng and lat are zero in CoordinateConvert

This commit is contained in:
gazebo
2019-02-12 17:42:39 +08:00
parent 00c87cec35
commit 87d31889da

View File

@@ -161,6 +161,9 @@ func (a *API) CoordinateConvert(lng, lat float64, coordsys string) (retLng, retL
if coordsys == "" || coordsys == CoordSysAutonavi {
return lng, lat, nil
}
if lng == 0.0 && lat == 0.0 {
return 0.0, 0.0, nil
}
params := map[string]interface{}{
"locations": fmt.Sprintf("%.6f,%.6f", lng, lat),
"coordsys": coordsys,