10 #import <Foundation/Foundation.h> 11 #import <CoreLocation/CoreLocation.h> 12 #import "BMKLocationReGeocode.h" 13 #import "BMKLocation.h" 18 typedef NS_ENUM(NSUInteger, BMKLocationCoordinateType)
20 BMKLocationCoordinateTypeBMK09LL = 0,
21 BMKLocationCoordinateTypeBMK09MC,
22 BMKLocationCoordinateTypeWGS84,
23 BMKLocationCoordinateTypeGCJ02
29 typedef NS_ENUM(
int, BMKLocationNetworkState) {
30 BMKLocationNetworkStateUnknown = 0,
31 BMKLocationNetworkStateWifi,
32 BMKLocationNetworkStateWifiHotSpot,
33 BMKLocationNetworkStateMobile2G,
34 BMKLocationNetworkStateMobile3G,
35 BMKLocationNetworkStateMobile4G
42 FOUNDATION_EXPORT NSErrorDomain
const _Nonnull BMKLocationErrorDomain;
45 typedef NS_ENUM(NSInteger, BMKLocationErrorCode)
47 BMKLocationErrorUnKnown = 0,
48 BMKLocationErrorLocFailed = 1,
49 BMKLocationErrorDenied = 2,
50 BMKLocationErrorNetWork = 3,
51 BMKLocationErrorHeadingFailed = 4,
52 BMKLocationErrorGetExtraNetworkFailed = 5,
53 BMKLocationErrorGetExtraParseFailed = 6,
54 BMKLocationErrorFailureAuth = 7,
64 typedef void (^BMKLocatingCompletionBlock)(
BMKLocation * _Nullable location, BMKLocationNetworkState state , NSError * _Nullable error);
68 @protocol BMKLocationManagerDelegate;
70 #pragma mark - BMKLocationManager 77 @property (nonatomic, weak, nullable) id<BMKLocationManagerDelegate>
delegate;
112 @property(nonatomic, retain, nullable) NSString *
userID;
124 - (BOOL)requestLocationWithReGeocode:(BOOL)withReGeocode withNetworkState:(BOOL)withNetWorkState completionBlock:(BMKLocatingCompletionBlock _Nonnull)completionBlock;
176 + (CLLocationCoordinate2D) BMKLocationCoordinateConvert:(CLLocationCoordinate2D) coordinate SrcType:(BMKLocationCoordinateType)srctype DesType:(BMKLocationCoordinateType)destype;
184 + (BOOL) BMKLocationDataAvailableForCoordinate:(CLLocationCoordinate2D)coordinate withCoorType:(BMKLocationCoordinateType)coortype;
189 #pragma mark - BMKLocationManagerDelegate 193 @protocol BMKLocationManagerDelegate <NSObject>
225 - (BOOL)BMKLocationManagerShouldDisplayHeadingCalibration:(
BMKLocationManager * _Nonnull)manager;
233 didUpdateHeading:(CLHeading * _Nullable)heading;
242 didUpdateNetworkState:(BMKLocationNetworkState)state orError:(NSError * _Nullable)error;
void tryIndoorLocation()
该方法为BMKLocationManager尝试使用高精度室内定位。在特定的室内场景下会有更高精度的定位回调,只在室内...
BMKLocationCoordinateType coordinateType
设定定位坐标系类型。默认为 BMKLocationCoordinateTypeGCJ02。
Definition: BMKLocationManager.h:89
void stopUpdatingLocation()
停止连续定位。调用此方法会cancel掉所有的单次定位请求,可以用来取消单次定位。
void stopIndoorLocation()
该方法为BMKLocationManager会关闭高精度室内定位,只在室内定位版本生效。
void requestNetworkState()
请求网络状态结果回调。
BMKLocationManager类。初始化之前请设置 BMKLocationAuth 中的APIKey,否则将无法正常使用服务.
Definition: BMKLocationManager.h:74
id< BMKLocationManagerDelegate > delegate
实现了 BMKLocationManagerDelegate 协议的类指针。
Definition: BMKLocationManager.h:77
CLLocationAccuracy desiredAccuracy
设定定位精度。默认为 kCLLocationAccuracyBest。
Definition: BMKLocationManager.h:83
void stopUpdatingHeading()
该方法为BMKLocationManager停止设备朝向事件回调。
BOOL isNeedNewVersionReGeocode
定位sdk-v1.3之后,开发者可以选择是否需要最新版本rgc数据,默认是不需要NO;YES的情况下,定位sdk会实时返...
Definition: BMKLocationManager.h:108
NSInteger locationTimeout
指定单次定位超时时间,默认为10s。最小值是2s。注意单次定位请求前设置。注意: 单次定位超时时间从确定了定...
Definition: BMKLocationManager.h:99
BOOL pausesLocationUpdatesAutomatically
指定定位是否会被系统自动暂停。默认为NO。
Definition: BMKLocationManager.h:92
void startUpdatingHeading()
该方法为BMKLocationManager开始设备朝向事件回调。
CLActivityType activityType
设定定位类型。默认为 CLActivityTypeAutomotiveNavigation。
Definition: BMKLocationManager.h:86
BOOL locatingWithReGeocode
连续定位是否返回逆地理信息,默认YES。
Definition: BMKLocationManager.h:105
NSString * userID
开发者可以指定该用户的id,用于后续统一识别用户,便于查找问题
Definition: BMKLocationManager.h:112
BOOL headingAvailable()
该方法返回设备是否支持设备朝向事件回调。
描述百度iOS 定位数据
Definition: BMKLocation.h:27
NSInteger reGeocodeTimeout
指定单次定位逆地理超时时间,默认为10s。最小值是2s。注意单次定位请求前设置。
Definition: BMKLocationManager.h:102
CLLocationDistance distanceFilter
设定定位的最小更新距离。默认为 kCLDistanceFilterNone。
Definition: BMKLocationManager.h:80
BOOL allowsBackgroundLocationUpdates
是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Lo...
Definition: BMKLocationManager.h:96
void startUpdatingLocation()
开始连续定位。调用此方法会cancel掉所有的单次定位请求。