! format func EarthDistance params from lat, lng1... to lng1, lat1...

This commit is contained in:
gazebo
2019-01-25 11:41:33 +08:00
parent 367fff9321
commit f3b7a0e84e
3 changed files with 5 additions and 5 deletions

View File

@@ -132,7 +132,7 @@ func ConvertDistanceToLogLat(lng, lat, distance, angle float64) (newLng, newLat
}
// 返回结果单元为公里
func EarthDistance(lat1, lng1, lat2, lng2 float64) float64 {
func EarthDistance(lng1, lat1, lng2, lat2 float64) float64 {
radius := 6378.137
rad := math.Pi / 180.0
lat1 = lat1 * rad