public class LocationUtils extends Object
Constructor and Description |
---|
LocationUtils() |
Modifier and Type | Method and Description |
---|---|
static List<Double> |
getDistance(LocationIPO locationIPO,
List<LocationIPO> locationIPOList)
通过经纬度获取距离(单位:米)
|
static double |
getDistance(LocationIPO locationIPO1,
LocationIPO locationIPO2)
通过经纬度获取距离(单位:米)
|
static int |
getNearestLngAndLat(LocationIPO locationIPO,
List<LocationIPO> locationIPOList)
获得距离当前位置最近的经纬度
|
public static double getDistance(LocationIPO locationIPO1, LocationIPO locationIPO2)
说明(如:高德地图,重庆市政府坐标)
106.550464,29.563761
106.550464 经度
29.563761 纬度
注:lng 经度
注:lat 纬度
locationIPO1
- 位置1locationIPO2
- 位置1public static List<Double> getDistance(LocationIPO locationIPO, List<LocationIPO> locationIPOList)
locationIPO
- 位置locationIPOList
- 位置数组public static int getNearestLngAndLat(LocationIPO locationIPO, List<LocationIPO> locationIPOList)
返回locations数组中最小值的下标
locationIPO
- 位置locationIPOList
- 位置数组Copyright © 2022 Pivotal Software, Inc.. All rights reserved.