com.tencent.map.geolocation
类 TencentLocationUtils

java.lang.Object
  继承者 com.tencent.map.geolocation.TencentLocationUtils

public class TencentLocationUtils
extends java.lang.Object

工具类.

从以下版本开始:
4.0
作者:
kingcmchen@tencent.com

方法摘要
static boolean contains(TencentLocation center, double radius, TencentLocation aPoint)
          判断一片圆形区域是否包含指定的坐标点.
static double distanceBetween(double aLatitude, double aLongitude, double bLatitude, double bLongitude)
          返回两个位置之间的距离, 位置分别为 (aLatitude, aLatitude) 和 (bLatitude, bLongitude).
static double distanceBetween(TencentLocation aLoc, TencentLocation bLoc)
          返回两个位置之间的距离.
static boolean isFromGps(TencentLocation location)
          判断是否 GPS 定位.
static boolean isFromNetwork(TencentLocation location)
          判断是否 网络 定位.
static boolean isSupportGps(Context context)
          判断设备是否有GPS模块可支持GPS定位
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

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(Context context)
判断设备是否有GPS模块可支持GPS定位