public final class BDLocation
extends java.lang.Object
implements com.baidu.location.utils.VersionConfig, android.os.Parcelable
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
BDLOCATION_BD09_TO_GCJ02 |
static java.lang.String |
BDLOCATION_BD09LL_TO_GCJ02 |
static java.lang.String |
BDLOCATION_GCJ02_TO_BD09 |
static java.lang.String |
BDLOCATION_GCJ02_TO_BD09LL |
static java.lang.String |
BDLOCATION_WGS84_TO_GCJ02 |
static android.os.Parcelable.Creator<BDLocation> |
CREATOR |
static int |
GPS_ACCURACY_BAD
GPS 质量判断差
|
static int |
GPS_ACCURACY_GOOD
GPS 质量判断好
|
static int |
GPS_ACCURACY_MID
GPS 质量判断中等
|
static int |
GPS_ACCURACY_UNKNOWN
GPS 质量判断未知
|
static int |
GPS_RECTIFY_INDOOR |
static int |
GPS_RECTIFY_NONE |
static int |
GPS_RECTIFY_OUTDOOR |
static int |
INDOOR_LOCATION_NEARBY_SURPPORT_TRUE
该区域附近(40m)支持室内定位
|
static int |
INDOOR_LOCATION_SOURCE_BLUETOOTH
支持蓝牙室内定位
|
static int |
INDOOR_LOCATION_SOURCE_MAGNETIC
支持地磁室内定位
|
static int |
INDOOR_LOCATION_SOURCE_SMALLCELLSTATION
支持小基站室内定位
|
static int |
INDOOR_LOCATION_SOURCE_UNKNOWN
未知类型
|
static int |
INDOOR_LOCATION_SOURCE_WIFI
支持wifi室内定位
|
static int |
INDOOR_LOCATION_SURPPORT_FALSE
该区域不支持室内定位
|
static int |
INDOOR_LOCATION_SURPPORT_TRUE
该区域支持室内定位
|
static int |
INDOOR_NETWORK_STATE_HIGH
该室内定位位置网络状况优
|
static int |
INDOOR_NETWORK_STATE_LOW
该室内定位位置网络质量差
|
static int |
INDOOR_NETWORK_STATE_MIDDLE
该室内定位位置网络状况良
|
static int |
LOCATION_WHERE_IN_CN
定位位置在国内
|
static int |
LOCATION_WHERE_OUT_CN
定位位置在国外
|
static int |
LOCATION_WHERE_UNKNOW
定位位置未知
|
static int |
MOCK_GPS_PROBABILITY_HIGH
此定位点作弊概率高
|
static int |
MOCK_GPS_PROBABILITY_LOW
此定位点作弊概率低
|
static int |
MOCK_GPS_PROBABILITY_MIDDLE
此定位点作弊概率中
|
static int |
MOCK_GPS_PROBABILITY_UNKNOW
此定位点作弊概率未知
|
static int |
MOCK_GPS_PROBABILITY_ZERO
此定位点作弊概率为0
|
static int |
OPERATORS_TYPE_MOBILE
中国移动运营商
|
static int |
OPERATORS_TYPE_TELECOMU
中国电信运营商
|
static int |
OPERATORS_TYPE_UNICOM
中国联通运营商
|
static int |
OPERATORS_TYPE_UNKONW
未知的运营商
|
static int |
TypeCacheLocation
定位结果描述:缓存定位结果,目前该功能已经取消,由离线定位来代替
|
static int |
TypeCriteriaException
定位结果描述:无法定位结果,一般由于定位SDK内部检测到没有有效的定位依据,比如在飞行模式下就会返回该定位类型, 一般关闭飞行模式或者打开wifi就可以再次定位成功
|
static int |
TypeGpsLocation
定位结果描述:GPS定位结果 ,GPS定位结果需要手机打开GPS开关或者设置手机为高精度定位模式,GPS定位结果需要一定的搜星时间才能获得, 连接网络的情况下会加速GPS定位速度
|
static int |
TypeNetWorkException
定位结果描述:网络连接失败,一般由于手机无有效网络连接导致,请检查手机是否能够正常上网
|
static int |
TypeNetWorkLocation
定位结果描述:网络定位结果 ,表示网络定位成功,属于有效的定位结果
|
static int |
TypeNone
定位结果描述:无效定位结果,一般由于定位SDK内部逻辑异常时出现
|
static int |
TypeOffLineLocation
定位结果描述:离线定位成功结果 ,一般由于手机网络不通,会请求定位SDK内部的离线定位策略,这种定位也属于有效的定位结果
|
static int |
TypeOffLineLocationFail
定位结果描述:离线定位失败结果 ,一般由于手机网络不通,会请求定位SDK内部的离线定位策略但失败了,这种定位也属于无效的定位结果
|
static int |
TypeOffLineLocationNetworkFail
定位结果描述:离线定位成功结果 ,已取消
|
static int |
TypeServerCheckKeyError
定位结果描述:server校验KEY失败,请确认KEY合法
|
static int |
TypeServerDecryptError
定位结果描述:server解密定位请求失败,请检查SO文件是否加载正常
|
static int |
TypeServerError
定位结果描述:server定位失败,没有对应的位置信息
|
static int |
USER_INDDOR_TRUE
定位在室内
|
static int |
USER_INDOOR_FALSE
定位在室外
|
static int |
USER_INDOOR_UNKNOW
定位是否在室内未知
|
构造器和说明 |
---|
BDLocation() |
BDLocation(BDLocation x) |
BDLocation(java.lang.String JSONStr) |
限定符和类型 | 方法和说明 |
---|---|
int |
describeContents() |
java.lang.String |
getAdCode()
获取城市adcode
|
com.baidu.location.Address |
getAddress() |
java.lang.String |
getAddrStr()
获取详细地址信息
|
double |
getAltitude()
获取高度信息,目前只有是GPS定位结果时或者设置LocationClientOption.setIsNeedAltitude(true)时才有效,单位米
|
java.lang.String |
getBuildingID()
获取buildingid信息,目前只在百度支持室内定位的地方有返回,默认null
|
java.lang.String |
getBuildingName()
获取buildingname信息,目前只在百度支持室内定位的地方有返回,默认null
|
java.lang.String |
getCity()
获取城市
|
java.lang.String |
getCityCode()
获取城市编码
|
java.lang.String |
getCoorType()
获取所用坐标系,以locationClientOption里设定的坐标系为准(wgs84,gcj02,bd09,bd09ll)
|
java.lang.String |
getCountry()
获取国家
|
java.lang.String |
getCountryCode()
获取国家编码
|
long |
getDelayTime() |
float |
getDerect()
已过时。
|
float |
getDirection()
gps定位结果时,行进的方向,单位度
|
double |
getDisToRealLocation()
获取虚假位置和真实位置之间的距离,单位米
|
java.lang.String |
getDistrict()
获取区/县信息
|
android.location.Location |
getExtraLocation(java.lang.String key) |
java.lang.String |
getFloor()
获取楼层信息,目前只在百度支持室内定位的地方有返回,默认null
|
double[] |
getFusionLocInfo(java.lang.String key)
results of IndoorFusionLoc:
|
int |
getGpsAccuracyStatus()
如果是GPS位置,获得当前由百度自有算法判断的GPS质量
, #GPS_ACCURACY_GOOD , #GPS_ACCURACY_MID, #GPS_ACCURACY_UNKNOWN |
float |
getGpsBiasProb() |
int |
getGpsCheckStatus() |
int |
getIndoorLocationSource()
|
int |
getIndoorLocationSurpport()
|
java.lang.String |
getIndoorLocationSurpportBuidlingID()
返回支持室内定位的buildingid
|
java.lang.String |
getIndoorLocationSurpportBuidlingName()
返回支持室内定位的building名称
|
int |
getIndoorNetworkState()
|
java.lang.String |
getIndoorSurpportPolygon() |
double |
getLatitude()
获取纬度坐标
|
java.lang.String |
getLocationDescribe()
获取位置语义化信息,没有的话返回NULL
|
java.lang.String |
getLocationID()
返回位置ID数据
|
int |
getLocationWhere()
获取当前定位是国内还是国外
|
int |
getLocType()
获取定位类型: 参考 定位结果描述 相关的字段
|
java.lang.String |
getLocTypeDescription()
获取定位类型相关描述信息
|
double |
getLongitude()
获取经度坐标
|
int |
getMockGpsProbability()
|
int |
getMockGpsStrategy()
获取当前定位所命中的防作弊策略
|
java.lang.String |
getNetworkLocationType()
在网络定位结果的情况下,获取网络定位结果是通过基站定位得到的还是通过wifi定位得到的还是GPS得结果
|
double |
getNrlLat() |
double |
getNrlLon() |
java.lang.String |
getNrlResult() |
int |
getOperators()
已过时。
不再获取READ_PHONE_STATE权限导致无法实现功能
|
java.util.List<Poi> |
getPoiList()
仅在开发者设置需要POI信息时才会返回,在网络不通或无法获取时有可能返回null
|
PoiRegion |
getPoiRegion()
返回定位位置相对poi的位置关系,仅在开发者设置需要POI信息时才会返回,在网络不通或无法获取时有可能返回null
|
java.lang.String |
getProvince()
获取省份
|
float |
getRadius()
获取定位精度,默认值0.0f
|
BDLocation |
getReallLocation()
当返回的GPS定位结果是虚拟时,可通过此方法获取真实位置
|
java.lang.String |
getRetFields(java.lang.String key)
wifi direction, degree.
|
java.lang.String |
getRoadLocString()
返回道路定位字符串
|
int |
getSatelliteNumber()
gps定位结果时,获取gps锁定用的卫星数
|
java.lang.String |
getSemaAptag()
已过时。
|
float |
getSpeed()
获取速度,仅gps定位结果时有速度信息,单位公里/小时,默认值0.0f
|
java.lang.String |
getStreet()
获取街道信息
|
java.lang.String |
getStreetNumber()
获取街道号码
|
java.lang.String |
getTime()
server返回的当前定位时间
|
java.lang.String |
getTown()
获取镇信息
|
int |
getUserIndoorState()
返回用户室内外状态,
, #USER_INDOOR_FALSE , #USER_INDOOR_UNKNOW |
java.lang.String |
getVdrJsonString() |
boolean |
hasAddr()
是否有地址信息
|
boolean |
hasAltitude()
是否包含高度信息
|
boolean |
hasRadius()
是否包含半径信息
|
boolean |
hasSateNumber() |
boolean |
hasSpeed()
是否包含速度信息
|
boolean |
isCellChangeFlag()
仅在getloctype == TypeOffLineLocationNetworkFail起作用。
|
boolean |
isIndoorLocMode()
是否处于室内定位模式
|
boolean |
isInIndoorPark()
根据服务端判断结果判断当前是否处于室内停车场内部
|
boolean |
isNrlAvailable() |
int |
isParkAvailable()
暂未对外开放
|
void |
setAddr(com.baidu.location.Address addr) |
void |
setAddrStr(java.lang.String mAddrStr) |
void |
setAltitude(double altitude) |
void |
setBuildingID(java.lang.String bldgid) |
void |
setBuildingName(java.lang.String buildingName) |
void |
setCoorType(java.lang.String coorType) |
void |
setDelayTime(long time) |
void |
setDirection(float direction) |
void |
setDisToRealLocation(double disToRealLocation)
设置虚假位置和真实位置之间的距离,单位米
|
void |
setExtraLocation(java.lang.String key,
android.location.Location value) |
void |
setFloor(java.lang.String f) |
void |
setFusionLocInfo(java.lang.String key,
double[] value)
results of IndoorFusionLoc:
|
void |
setGpsAccuracyStatus(int status) |
void |
setGpsBiasProb(float value) |
void |
setGpsCheckStatus(int status) |
void |
setIndoorLocationSource(int value) |
void |
setIndoorLocationSurpport(int value) |
void |
setIndoorLocMode(boolean indoormode) |
void |
setIndoorNetworkState(int value) |
void |
setIndoorSurpportPolygon(java.lang.String value) |
void |
setIsInIndoorPark(boolean result) |
void |
setLatitude(double latitude) |
void |
setLocationDescribe(java.lang.String locationDescribe) |
void |
setLocationID(java.lang.String data) |
void |
setLocationWhere(int where) |
void |
setLocType(int locType) |
void |
setLocTypeDescription(java.lang.String description) |
void |
setLongitude(double longitude) |
void |
setMockGpsProbability(int mockGpsProbability)
设置当前定位作弊概率
|
void |
setMockGpsStrategy(int mockGpsTrategy)
设置当前定位命中何种防作弊策略
|
void |
setNetworkLocationType(java.lang.String NetworkLocationType) |
void |
setNrlData(java.lang.String data) |
void |
setOperators(int operation) |
void |
setParkAvailable(int state) |
void |
setPoiList(java.util.List<Poi> poiList) |
void |
setPoiRegion(PoiRegion region) |
void |
setRadius(float radius) |
void |
setReallLocation(BDLocation realLocation)
当前定位存在作弊的可能,设置当时的真实位置
|
void |
setRetFields(java.lang.String key,
java.lang.String value)
wifi direction, degree.
|
void |
setRoadLocString(float direction,
float prob) |
void |
setSatelliteNumber(int satelliteNumber) |
void |
setSpeed(float speed) |
void |
setTime(java.lang.String time) |
void |
setUserIndoorState(int value) |
void |
setVdrJsonValue(java.lang.String data) |
java.lang.String |
toString() |
void |
writeToParcel(android.os.Parcel dest,
int arg1) |
public static final int TypeNone
public static final int TypeGpsLocation
public static final int TypeCriteriaException
public static final int TypeNetWorkException
public static final int TypeOffLineLocation
public static final int TypeOffLineLocationFail
public static final int TypeOffLineLocationNetworkFail
public static final int TypeNetWorkLocation
public static final int TypeCacheLocation
public static final int TypeServerError
public static final int TypeServerDecryptError
public static final int TypeServerCheckKeyError
public static final int LOCATION_WHERE_UNKNOW
public static final int LOCATION_WHERE_IN_CN
public static final int LOCATION_WHERE_OUT_CN
public static final int USER_INDOOR_UNKNOW
public static final int USER_INDDOR_TRUE
public static final int USER_INDOOR_FALSE
public static final int INDOOR_LOCATION_NEARBY_SURPPORT_TRUE
public static final int INDOOR_LOCATION_SURPPORT_TRUE
public static final int INDOOR_LOCATION_SURPPORT_FALSE
public static final int INDOOR_LOCATION_SOURCE_UNKNOWN
public static final int INDOOR_LOCATION_SOURCE_WIFI
public static final int INDOOR_LOCATION_SOURCE_MAGNETIC
public static final int INDOOR_LOCATION_SOURCE_BLUETOOTH
public static final int INDOOR_LOCATION_SOURCE_SMALLCELLSTATION
public static final int INDOOR_NETWORK_STATE_HIGH
public static final int INDOOR_NETWORK_STATE_MIDDLE
public static final int INDOOR_NETWORK_STATE_LOW
public static final int OPERATORS_TYPE_UNKONW
public static final int OPERATORS_TYPE_MOBILE
public static final int OPERATORS_TYPE_UNICOM
public static final int OPERATORS_TYPE_TELECOMU
public static final int GPS_ACCURACY_GOOD
public static final int GPS_ACCURACY_MID
public static final int GPS_ACCURACY_BAD
public static final int GPS_ACCURACY_UNKNOWN
public static final int MOCK_GPS_PROBABILITY_HIGH
public static final int MOCK_GPS_PROBABILITY_MIDDLE
public static final int MOCK_GPS_PROBABILITY_LOW
public static final int MOCK_GPS_PROBABILITY_ZERO
public static final int MOCK_GPS_PROBABILITY_UNKNOW
public static final java.lang.String BDLOCATION_GCJ02_TO_BD09
public static final java.lang.String BDLOCATION_GCJ02_TO_BD09LL
public static final java.lang.String BDLOCATION_BD09_TO_GCJ02
public static final java.lang.String BDLOCATION_BD09LL_TO_GCJ02
public static final java.lang.String BDLOCATION_WGS84_TO_GCJ02
public static final int GPS_RECTIFY_NONE
public static final int GPS_RECTIFY_INDOOR
public static final int GPS_RECTIFY_OUTDOOR
public static final android.os.Parcelable.Creator<BDLocation> CREATOR
public BDLocation()
public BDLocation(BDLocation x)
public BDLocation(java.lang.String JSONStr)
public java.util.List<Poi> getPoiList()
public void setPoiList(java.util.List<Poi> poiList)
public PoiRegion getPoiRegion()
public void setPoiRegion(PoiRegion region)
public boolean isCellChangeFlag()
public int getUserIndoorState()
, #USER_INDOOR_FALSE , #USER_INDOOR_UNKNOW
public void setUserIndoorState(int value)
public int getIndoorLocationSurpport()
public java.lang.String getIndoorLocationSurpportBuidlingName()
public java.lang.String getIndoorLocationSurpportBuidlingID()
public void setIndoorLocationSurpport(int value)
public int getIndoorNetworkState()
public void setIndoorNetworkState(int value)
public int getIndoorLocationSource()
public void setIndoorLocationSource(int value)
public java.lang.String getIndoorSurpportPolygon()
public void setIndoorSurpportPolygon(java.lang.String value)
public java.lang.String getTime()
public void setTime(java.lang.String time)
public java.lang.String getRoadLocString()
public java.lang.String getNrlResult()
public void setNrlData(java.lang.String data)
public long getDelayTime()
public void setDelayTime(long time)
public float getGpsBiasProb()
public void setGpsBiasProb(float value)
public void setRoadLocString(float direction, float prob)
public java.lang.String getLocationID()
public void setLocationID(java.lang.String data)
public double getLatitude()
public void setLatitude(double latitude)
public double getLongitude()
public void setLongitude(double longitude)
public double getAltitude()
public void setAltitude(double altitude)
public float getSpeed()
public void setSpeed(float speed)
public float getRadius()
public void setRadius(float radius)
public java.lang.String getCoorType()
public void setCoorType(java.lang.String coorType)
public void setAddrStr(java.lang.String mAddrStr)
public void setIsInIndoorPark(boolean result)
public boolean isInIndoorPark()
public boolean hasAltitude()
public boolean hasSpeed()
public boolean hasRadius()
public void setLocType(int locType)
public int getLocType()
public java.lang.String getLocTypeDescription()
public void setLocTypeDescription(java.lang.String description)
public void setSatelliteNumber(int satelliteNumber)
public int getSatelliteNumber()
@Deprecated public float getDerect()
public float getDirection()
public void setDirection(float direction)
public boolean hasSateNumber()
public boolean hasAddr()
public com.baidu.location.Address getAddress()
public void setAddr(com.baidu.location.Address addr)
public java.lang.String getAddrStr()
public java.lang.String getProvince()
public java.lang.String getCity()
public java.lang.String getAdCode()
public java.lang.String getCityCode()
public java.lang.String getCountry()
public java.lang.String getCountryCode()
public java.lang.String getDistrict()
public java.lang.String getTown()
public java.lang.String getStreet()
public java.lang.String getStreetNumber()
public java.lang.String getLocationDescribe()
public void setLocationDescribe(java.lang.String locationDescribe)
public java.lang.String getFloor()
public void setFloor(java.lang.String f)
public java.lang.String getBuildingID()
public void setBuildingID(java.lang.String bldgid)
public java.lang.String getBuildingName()
public void setBuildingName(java.lang.String buildingName)
public int isParkAvailable()
public void setParkAvailable(int state)
public boolean isIndoorLocMode()
public void setIndoorLocMode(boolean indoormode)
public int getLocationWhere()
public void setLocationWhere(int where)
public int getGpsAccuracyStatus()
, #GPS_ACCURACY_GOOD , #GPS_ACCURACY_MID, #GPS_ACCURACY_UNKNOWN
public void setGpsAccuracyStatus(int status)
@Deprecated public java.lang.String getSemaAptag()
public java.lang.String getNetworkLocationType()
public void setNetworkLocationType(java.lang.String NetworkLocationType)
public int getOperators()
public void setOperators(int operation)
public int describeContents()
describeContents
在接口中 android.os.Parcelable
public void setGpsCheckStatus(int status)
public int getGpsCheckStatus()
public void writeToParcel(android.os.Parcel dest, int arg1)
writeToParcel
在接口中 android.os.Parcelable
public java.lang.String getRetFields(java.lang.String key)
public void setRetFields(java.lang.String key, java.lang.String value)
public android.location.Location getExtraLocation(java.lang.String key)
public double getNrlLat()
public double getNrlLon()
public boolean isNrlAvailable()
public void setExtraLocation(java.lang.String key, android.location.Location value)
public double[] getFusionLocInfo(java.lang.String key)
public void setFusionLocInfo(java.lang.String key, double[] value)
public java.lang.String getVdrJsonString()
public void setVdrJsonValue(java.lang.String data)
public java.lang.String toString()
toString
在类中 java.lang.Object
public void setDisToRealLocation(double disToRealLocation)
disToRealLocation
- public double getDisToRealLocation()
public void setMockGpsStrategy(int mockGpsTrategy)
mockGpsTrategy
- public int getMockGpsStrategy()
public void setMockGpsProbability(int mockGpsProbability)
mockGpsProbability
- public int getMockGpsProbability()
public void setReallLocation(BDLocation realLocation)
realLocation
- public BDLocation getReallLocation()