高德地图SDK(定位)  V2.6.5
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>
12 
19 typedef void (^AMapLocatingCompletionBlock)(CLLocation *location, AMapLocationReGeocode *regeocode, NSError *error);
20 
21 @protocol AMapLocationManagerDelegate;
22 
23 #pragma mark - AMapLocationManager
24 
26 @interface AMapLocationManager : NSObject
27 
29 @property (nonatomic, weak) id<AMapLocationManagerDelegate> delegate;
30 
32 @property(nonatomic, assign) CLLocationDistance distanceFilter;
33 
35 @property(nonatomic, assign) CLLocationAccuracy desiredAccuracy;
36 
38 @property(nonatomic, assign) BOOL pausesLocationUpdatesAutomatically;
39 
41 @property(nonatomic, assign) BOOL allowsBackgroundLocationUpdates;
42 
44 @property(nonatomic, assign) NSInteger locationTimeout;
45 
47 @property(nonatomic, assign) NSInteger reGeocodeTimeout;
48 
50 @property (nonatomic, assign) BOOL locatingWithReGeocode;
51 
52 // 逆地址语言类型,默认是AMapLocationRegionLanguageDefault
53 @property (nonatomic, assign) AMapLocationReGeocodeLanguage reGeocodeLanguage;
54 
56 @property (nonatomic, readonly, copy) NSSet *monitoredRegions;
57 
59 @property (nonatomic, assign) BOOL detectRiskOfFakeLocation;
60 
65 + (BOOL)headingAvailable;
66 
70 - (void)startUpdatingHeading;
71 
75 - (void)stopUpdatingHeading;
76 
81 
88 - (BOOL)requestLocationWithReGeocode:(BOOL)withReGeocode completionBlock:(AMapLocatingCompletionBlock)completionBlock;
89 
93 - (void)startUpdatingLocation;
94 
98 - (void)stopUpdatingLocation;
99 
104 - (void)startMonitoringForRegion:(AMapLocationRegion *)region __attribute__((deprecated("请使用AMapGeoFenceManager")));
105 
110 - (void)stopMonitoringForRegion:(AMapLocationRegion *)region __attribute__((deprecated("请使用AMapGeoFenceManager")));
111 
116 - (void)requestStateForRegion:(AMapLocationRegion *)region __attribute__((deprecated("请使用AMapGeoFenceManager")));
117 
118 @end
119 
120 #pragma mark - AMapLocationManagerDelegate
121 
123 @protocol AMapLocationManagerDelegate <NSObject>
124 
125 @optional
126 
134 - (void)amapLocationManager:(AMapLocationManager *)manager doRequireLocationAuth:(CLLocationManager*)locationManager;
135 
141 - (void)amapLocationManager:(AMapLocationManager *)manager didFailWithError:(NSError *)error;
142 
148 - (void)amapLocationManager:(AMapLocationManager *)manager didUpdateLocation:(CLLocation *)location;
149 
156 - (void)amapLocationManager:(AMapLocationManager *)manager didUpdateLocation:(CLLocation *)location reGeocode:(AMapLocationReGeocode *)reGeocode;
157 
163 - (void)amapLocationManager:(AMapLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status;
164 
170 - (BOOL)amapLocationManagerShouldDisplayHeadingCalibration:(AMapLocationManager *)manager;
171 
177 - (void)amapLocationManager:(AMapLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading;
178 
184 - (void)amapLocationManager:(AMapLocationManager *)manager didStartMonitoringForRegion:(AMapLocationRegion *)region __attribute__((deprecated("请使用AMapGeoFenceManager")));
185 
191 - (void)amapLocationManager:(AMapLocationManager *)manager didEnterRegion:(AMapLocationRegion *)region __attribute__((deprecated("请使用AMapGeoFenceManager")));
192 
198 - (void)amapLocationManager:(AMapLocationManager *)manager didExitRegion:(AMapLocationRegion *)region __attribute__((deprecated("请使用AMapGeoFenceManager")));
199 
206 - (void)amapLocationManager:(AMapLocationManager *)manager didDetermineState:(AMapLocationRegionState)state forRegion:(AMapLocationRegion *)region __attribute__((deprecated("请使用AMapGeoFenceManager")));
207 
214 - (void)amapLocationManager:(AMapLocationManager *)manager monitoringDidFailForRegion:(AMapLocationRegion *)region withError:(NSError *)error __attribute__((deprecated("请使用AMapGeoFenceManager")));
215 
216 @end
AMapLocationRegionState
AMapLocation Region State.
Definition: AMapLocationCommonObj.h:34
BOOL allowsBackgroundLocationUpdates
是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Lo...
Definition: AMapLocationManager.h:41
CLLocationAccuracy desiredAccuracy
设定期望的定位精度。单位米,默认为 kCLLocationAccuracyBest。定位服务会尽可能去获取满足desiredAccuracy...
Definition: AMapLocationManager.h:35
AMapLocationRegion类,该类提供范围类的基本信息,并无具体实现,不要直接使用。
Definition: AMapLocationRegionObj.h:17
NSInteger locationTimeout
指定单次定位超时时间,默认为10s。最小值是2s。注意单次定位请求前设置。注意: 单次定位超时时间从确定了定...
Definition: AMapLocationManager.h:44
NSSet * monitoredRegions
获取被监控的region集合。
Definition: AMapLocationManager.h:56
逆地理信息
Definition: AMapLocationCommonObj.h:50
NSInteger reGeocodeTimeout
指定单次定位逆地理超时时间,默认为5s。最小值是2s。注意单次定位请求前设置。
Definition: AMapLocationManager.h:47
void(^ AMapLocatingCompletionBlock)(CLLocation *location, AMapLocationReGeocode *regeocode, NSError *error)
AMapLocatingCompletionBlock 单次定位返回Block.
Definition: AMapLocationManager.h:19
void stopUpdatingHeading()
停止获取设备朝向
id< AMapLocationManagerDelegate > delegate
实现了 AMapLocationManagerDelegate 协议的类指针。
Definition: AMapLocationManager.h:29
BOOL detectRiskOfFakeLocation
检测是否存在虚拟定位风险,默认为NO,不检测。 注意:设置为YES时,单次定位通过 AMapLocatingCompletionBl...
Definition: AMapLocationManager.h:59
void startUpdatingHeading()
开始获取设备朝向,如果设备支持方向识别,则会通过代理回调方法
AMapLocationReGeocodeLanguage reGeocodeLanguage
Definition: AMapLocationManager.h:53
void dismissHeadingCalibrationDisplay()
停止设备朝向校准显示
AMapLocationReGeocodeLanguage
AMapLocation Region Language.
Definition: AMapLocationCommonObj.h:42
BOOL locatingWithReGeocode
连续定位是否返回逆地理信息,默认NO。
Definition: AMapLocationManager.h:50
void startUpdatingLocation()
开始连续定位。调用此方法会cancel掉所有的单次定位请求。
AMapLocationManager类。初始化之前请设置 AMapServices 中的apikey(例如:[AMapServices sharedServices]...
Definition: AMapLocationManager.h:26
CLLocationDistance distanceFilter
设定定位的最小更新距离。单位米,默认为 kCLDistanceFilterNone,表示只要检测到设备位置发生变化就会更新...
Definition: AMapLocationManager.h:32
BOOL headingAvailable()
设备是否支持方向识别
void stopUpdatingLocation()
停止连续定位。调用此方法会cancel掉所有的单次定位请求,可以用来取消单次定位。
BOOL pausesLocationUpdatesAutomatically
指定定位是否会被系统自动暂停。默认为NO。
Definition: AMapLocationManager.h:38
© 2017 高德信息技术有限公司 版权所有,保留所有权利。