类 TencentLocationUtils
- java.lang.Object
-
- com.tencent.map.geolocation.TencentLocationUtils
-
public class TencentLocationUtils extends java.lang.Object工具类.- 从以下版本开始:
- 4.0
-
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static booleancontains(TencentLocation center, double radius, TencentLocation aPoint)判断一片圆形区域是否包含指定的坐标点.static doubledistanceBetween(double aLatitude, double aLongitude, double bLatitude, double bLongitude)返回两个位置之间的距离, 位置分别为 (aLatitude, aLatitude) 和 (bLatitude, bLongitude).static doubledistanceBetween(TencentLocation aLoc, TencentLocation bLoc)返回两个位置之间的距离.static booleanisFromGps(TencentLocation location)判断是否 GPS 定位.static booleanisFromNetwork(TencentLocation location)判断是否 网络 定位.static booleanisSupportGps(android.content.Context context)判断设备是否有GPS模块可支持GPS定位
-
-
-
方法详细资料
-
distanceBetween
public static double distanceBetween(TencentLocation aLoc, TencentLocation bLoc)
返回两个位置之间的距离.- 参数:
aLoc- 一个位置bLoc- 另一个位置- 返回:
- 距离, 单位 m(米)
- 抛出:
java.lang.NullPointerException- 任一参数为 null
-
distanceBetween
public static double distanceBetween(double aLatitude, double aLongitude, double bLatitude, double bLongitude)返回两个位置之间的距离, 位置分别为 (aLatitude, aLatitude) 和 (bLatitude, bLongitude).- 参数:
aLatitude- 第一个位置的纬度aLongitude- 第一个位置的经度bLatitude- 第二个位置的纬度bLongitude- 第二个位置的经度- 返回:
- 距离, 单位 m(米)
-
contains
public static boolean contains(TencentLocation center, double radius, TencentLocation aPoint)
判断一片圆形区域是否包含指定的坐标点.- 参数:
center- 区域的中心点radius- 区域的半径, 单位 m(米)aPoint- 待判断的位置- 返回:
- true 如果包含该位置, 否则返回 false
-
isFromGps
public static boolean isFromGps(TencentLocation location)
判断是否 GPS 定位.
-
isFromNetwork
public static boolean isFromNetwork(TencentLocation location)
判断是否 网络 定位.
-
isSupportGps
public static boolean isSupportGps(android.content.Context context)
判断设备是否有GPS模块可支持GPS定位
-
-