高德地图SDK(定位)  V2.12.2
AMapLocationManager.h
Go to the documentation of this file.
1 //
2 // AMapLocationManager.h
3 // AMapLocationKit
4 //
5 // Created by AutoNavi on 15/10/22.
6 // Copyright © 2015年 Amap. All rights reserved.
7 //
8 
9 #import <UIKit/UIKit.h>
10 #import <AMapFoundationKit/AMapServices.h>
13 
24 typedef void (^AMapLocatingCompletionBlock)(CLLocation *location, AMapLocationReGeocode *regeocode, NSError *error);
25 
27 
28 #pragma mark - AMapLocationManager
29 
32 @interface AMapLocationManager : NSObject
33 
36 @property (nonatomic, weak) id<AMapLocationManagerDelegate> delegate;
37 
40 @property(nonatomic, assign) CLLocationDistance distanceFilter;
41 
47 @property(nonatomic, assign) CLLocationAccuracy desiredAccuracy;
48 
51 @property(nonatomic, assign) BOOL pausesLocationUpdatesAutomatically;
52 
55 @property(nonatomic, assign) BOOL allowsBackgroundLocationUpdates;
56 
60 @property(nonatomic, assign) NSInteger locationTimeout;
61 
64 @property(nonatomic, assign) NSInteger reGeocodeTimeout;
65 
68 @property (nonatomic, assign) BOOL locatingWithReGeocode;
69 
70 // 注意:在使用导航功能前,请通过 [AMapServices sharedServices].regionLanguageType 来设置语言类型 (since 11.2.000)
71 //Note: Before using the navigation feature, please [AMapServices sharedServices].regionLanguageType to set the language type (since 11.2.000)
74 //@property (nonatomic, assign) AMapRegionLanguageType reGeocodeLanguage;
75 
78 @property (nonatomic, readonly, copy) NSSet *monitoredRegions;
79 
82 
83 @property (nonatomic, assign) BOOL detectRiskOfFakeLocation;
84 
85 
86 #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
87 
108 @property (nonatomic, assign) AMapLocationAccuracyMode locationAccuracyMode API_AVAILABLE(ios(14.0));
109 
115 @property (nonatomic, readonly) CLAccuracyAuthorization currentAuthorization API_AVAILABLE(ios(14.0));
116 
117 #endif
118 
125 + (BOOL)headingAvailable;
126 
131 - (void)startUpdatingHeading;
132 
137 - (void)stopUpdatingHeading;
138 
144 
155 - (BOOL)requestLocationWithReGeocode:(BOOL)withReGeocode completionBlock:(AMapLocatingCompletionBlock)completionBlock;
156 
161 - (void)startUpdatingLocation;
162 
167 - (void)stopUpdatingLocation;
168 
175 - (void)startMonitoringForRegion:(AMapLocationRegion *)region __attribute__((deprecated("Please use AMapGeoFenceManager")));
176 
183 - (void)stopMonitoringForRegion:(AMapLocationRegion *)region __attribute__((deprecated("Please use AMapGeoFenceManager")));
184 
191 - (void)requestStateForRegion:(AMapLocationRegion *)region __attribute__((deprecated("Please use AMapGeoFenceManager")));
192 
193 #pragma mark - Privacy 隐私合规 Privacy Compliance
202 + (void)updatePrivacyShow:(AMapPrivacyShowStatus)showStatus privacyInfo:(AMapPrivacyInfoStatus)containStatus;
209 + (void)updatePrivacyAgree:(AMapPrivacyAgreeStatus)agreeStatus;
210 
211 @end
212 
213 #pragma mark - AMapLocationManagerDelegate
214 
217 @protocol AMapLocationManagerDelegate <NSObject>
218 
219 @optional
220 
221 #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
222 
239 - (void)amapLocationManager:(AMapLocationManager *)manager doRequireTemporaryFullAccuracyAuth:(CLLocationManager*)locationManager completion:(void(^)(NSError *error))completion;
240 
241 #endif
242 
254 - (void)amapLocationManager:(AMapLocationManager *)manager doRequireLocationAuth:(CLLocationManager*)locationManager;
255 
264 - (void)amapLocationManager:(AMapLocationManager *)manager didFailWithError:(NSError *)error;
265 
274 - (void)amapLocationManager:(AMapLocationManager *)manager didUpdateLocation:(CLLocation *)location;
275 
286 - (void)amapLocationManager:(AMapLocationManager *)manager didUpdateLocation:(CLLocation *)location reGeocode:(AMapLocationReGeocode *)reGeocode;
287 
296 - (void)amapLocationManager:(AMapLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status;
297 
306 - (void)amapLocationManager:(AMapLocationManager *)manager locationManagerDidChangeAuthorization:(CLLocationManager*)locationManager;
307 
316 - (BOOL)amapLocationManagerShouldDisplayHeadingCalibration:(AMapLocationManager *)manager;
317 
326 - (void)amapLocationManager:(AMapLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading;
327 
336 - (void)amapLocationManager:(AMapLocationManager *)manager didStartMonitoringForRegion:(AMapLocationRegion *)region __attribute__((deprecated("Please use AMapGeoFenceManager")));
337 
346 - (void)amapLocationManager:(AMapLocationManager *)manager didEnterRegion:(AMapLocationRegion *)region __attribute__((deprecated("Please use AMapGeoFenceManager")));
347 
356 - (void)amapLocationManager:(AMapLocationManager *)manager didExitRegion:(AMapLocationRegion *)region __attribute__((deprecated("Please use AMapGeoFenceManager")));
357 
368 - (void)amapLocationManager:(AMapLocationManager *)manager didDetermineState:(AMapLocationRegionState)state forRegion:(AMapLocationRegion *)region __attribute__((deprecated("Please use AMapGeoFenceManager")));
369 
380 - (void)amapLocationManager:(AMapLocationManager *)manager monitoringDidFailForRegion:(AMapLocationRegion *)region withError:(NSError *)error __attribute__((deprecated("Please use AMapGeoFenceManager")));
381 
382 @end
AMapLocationRegionState
AMapLocation Region State.
Definition: AMapLocationCommonObj.h:36
AMapLocationAccuracyMode
AMapLocation Accuracy Mode.
Definition: AMapLocationCommonObj.h:43
void(^ AMapLocatingCompletionBlock)(CLLocation *location, AMapLocationReGeocode *regeocode, NSError *error)
AMapLocatingCompletionBlock 单次定位返回Block Single location return Block.
Definition: AMapLocationManager.h:24
Definition: AMapGeoFenceManager.h:36
Definition: AMapLocationManager.h:33
void startUpdatingLocation()
开始连续定位。调用此方法会cancel掉所有的单次定位请求。 Start continuous positioning. Calling this method will cancel all sing...
BOOL allowsBackgroundLocationUpdates
Definition: AMapLocationManager.h:55
id< AMapLocationManagerDelegate > delegate
Definition: AMapLocationManager.h:36
BOOL locatingWithReGeocode
Definition: AMapLocationManager.h:68
void stopUpdatingHeading()
停止获取设备朝向 Stop getting device orientation
CLLocationAccuracy desiredAccuracy
Definition: AMapLocationManager.h:47
NSSet * monitoredRegions
Definition: AMapLocationManager.h:78
BOOL pausesLocationUpdatesAutomatically
Definition: AMapLocationManager.h:51
void stopUpdatingLocation()
停止连续定位。调用此方法会cancel掉所有的单次定位请求,可以用来取消单次定位。 Stop continuous positioning. Calling this method will cance...
CLLocationDistance distanceFilter
Definition: AMapLocationManager.h:40
void dismissHeadingCalibrationDisplay()
停止设备朝向校准显示 Stop device orientation calibration display
AMapLocationAccuracyMode locationAccuracyMode(ios(14.0))
设置定位数据回调精度模式,默认为AMapLocationAccuracyFullAndReduce。 注意:如果定位时未获得定位权限,则首先会调用申请定位权限API,实际定位精度权限取决于用户的权限设...
BOOL headingAvailable()
设备是否支持方向识别 Does the device support direction recognition
NSInteger locationTimeout
Definition: AMapLocationManager.h:60
NSInteger reGeocodeTimeout
Definition: AMapLocationManager.h:64
CLAccuracyAuthorization currentAuthorization(ios(14.0))
获取当前定位精度权限。 Obtain the current location accuracy permission.
BOOL detectRiskOfFakeLocation
Definition: AMapLocationManager.h:83
void startUpdatingHeading()
开始获取设备朝向,如果设备支持方向识别,则会通过代理回调方法 Start obtaining device orientation. If the device supports orientation...
逆地理信息 reverse geocoding
Definition: AMapLocationCommonObj.h:53
Definition: AMapLocationRegionObj.h:19
Definition: AMapLocationManager.h:217
© 2017 高德信息技术有限公司 版权所有,保留所有权利。