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 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);
70 #pragma mark - BMKLocationManager 77 @property (nonatomic, weak, nullable) id<BMKLocationManagerDelegate>
delegate;
115 - (BOOL)requestLocationWithReGeocode:(BOOL)withReGeocode withNetworkState:(BOOL)withNetWorkState completionBlock:(BMKLocatingCompletionBlock _Nonnull)completionBlock;
157 + (CLLocationCoordinate2D) BMKLocationCoordinateConvert:(CLLocationCoordinate2D) coordinate SrcType:(BMKLocationCoordinateType)srctype DesType:(BMKLocationCoordinateType)destype;
165 + (BOOL) BMKLocationDataAvailableForCoordinate:(CLLocationCoordinate2D)coordinate withCoorType:(BMKLocationCoordinateType)coortype;
170 #pragma mark - BMKLocationManagerDelegate 206 - (BOOL)BMKLocationManagerShouldDisplayHeadingCalibration:(
BMKLocationManager * _Nonnull)manager;
214 didUpdateHeading:(CLHeading * _Nullable)heading;
223 didUpdateNetworkState:(BMKLocationNetworkState)state orError:(NSError * _Nullable)error;
BMKLocationCoordinateType coordinateType
设定定位坐标系类型。默认为 BMKLocationCoordinateTypeGCJ02。
Definition: BMKLocationManager.h:89
void stopUpdatingLocation()
停止连续定位。调用此方法会cancel掉所有的单次定位请求,可以用来取消单次定位。
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停止设备朝向事件回调。
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
BOOL headingAvailable()
该方法返回设备是否支持设备朝向事件回调。
描述百度iOS 定位数据
Definition: BMKLocation.h:27
NSInteger reGeocodeTimeout
指定单次定位逆地理超时时间,默认为10s。最小值是2s。注意单次定位请求前设置。
Definition: BMKLocationManager.h:102
CLLocationDistance distanceFilter
设定定位的最小更新距离。默认为 kCLDistanceFilterNone。
Definition: BMKLocationManager.h:80
BMKLocationManagerDelegate 协议定义了发生错误时的错误回调方法,连续定位的回调方法等。 ...
Definition: BMKLocationManager.h:174
BOOL allowsBackgroundLocationUpdates
是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Lo...
Definition: BMKLocationManager.h:96
void startUpdatingLocation()
开始连续定位。调用此方法会cancel掉所有的单次定位请求。