|
高德地图SDK(定位)
V2.12.2
|
#import <AMapLocationManager.h>
Instance Methods | |
| (void) | - amapLocationManager:doRequireTemporaryFullAccuracyAuth:completion: |
| 触发前提条件:1、plist配置NSLocationTemporaryUsageDescriptionDictionary。2、locationAccuracyMode设置为AMapLocationFullAndReduceAccuracy/AMapLocationFullAccuracy。3、当前用户已授权过定位权限,且为模糊定位权限。触发时机:满足前提条件时,再次发起定位请求会调用代理的此方法。此方法实现调用申请临时精确定位权限API即可: Preconditions for triggering: 1. Configure NSLayoutTemporaryUsageDescriptionDictionary for plist. 2. Set locationAccuracyMode to AMapLayoutFullAndReduceAccuracy/AMapLayoutFullAccuracy. 3. The current user has already been granted location permission, and it is a fuzzy location permission. Trigger timing: When the prerequisite is met, initiating a location request again will call this method of the proxy. This method can be used to call the temporary precise positioning permission API for application: [manager requestTemporaryFullAccuracyAuthorizationWithPurposeKey:"PurposeKey" completion:^(NSError *error){ if(completion){ completion(error); } }]; (必须调用,不然无法正常获取临时精确定位权限) (Must be called, otherwise temporary precise location permission cannot be obtained normally) More... | |
| (void) | - amapLocationManager:doRequireLocationAuth: |
| 当plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription,并且[CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined,会调用代理的此方法。 此方法实现调用申请后台权限API即可:[locationManager requestAlwaysAuthorization] (必须调用,不然无法正常获取定位权限) When plist is configured with NSLayoutAlwaysUsabusageDescription or NSLayoutAlwaysAndWhenUseUsageDescription, and [CLStationManager authorizeStatus]==kCLAauthorizedStatusNotDetermined, this method of the proxy will be called. This method can be used to call the application backend permission API: [locationManager requestAlwaysAuthorization] (must be called, otherwise location permission cannot be obtained properly) More... | |
| (void) | - amapLocationManager:didFailWithError: |
| 当定位发生错误时,会调用代理的此方法。 When a positioning error occurs, this method of the agent will be called. More... | |
| (void) | - amapLocationManager:didUpdateLocation: |
| 连续定位回调函数.注意:本方法已被废弃,如果实现了amapLocationManager:didUpdateLocation:reGeocode:方法,则本方法将不会回调。 Continuous positioning callback function.Note: This method has been deprecated, if the amapLocationManager:didUpdateLocation:reGeocode: method is implemented, this method will not be called. More... | |
| (void) | - amapLocationManager:didUpdateLocation:reGeocode: |
| 连续定位回调函数.注意:如果实现了本方法,则定位信息不会通过amapLocationManager:didUpdateLocation:方法回调。 Continuous positioning callback function. Note: If this method is implemented, the location information will not be called back through the amapLocationManager:didUpdateLocation: method. More... | |
| (void) | - amapLocationManager:didChangeAuthorizationStatus: |
| 定位权限状态改变时回调函数。注意:iOS13及之前版本回调 Callback function when the location permission status changes. Note: Callback for iOS13 and earlier versions More... | |
| (void) | - amapLocationManager:locationManagerDidChangeAuthorization: |
| 定位权限状态改变时回调函数。注意:iOS14及之后版本回调 Callback function when location permission status changes. Note: Callback for iOS 14 and later versions More... | |
| (BOOL) | - amapLocationManagerShouldDisplayHeadingCalibration: |
| 是否显示设备朝向校准 Whether to display device orientation calibration More... | |
| (void) | - amapLocationManager:didUpdateHeading: |
| 设备方向改变时回调函数 Callback function when device orientation changes More... | |
| (void) | - amapLocationManager:didStartMonitoringForRegion: |
| 开始监控region回调函数 Start monitoring region callback function More... | |
| (void) | - amapLocationManager:didEnterRegion: |
| 进入region回调函数 Enter region callback function More... | |
| (void) | - amapLocationManager:didExitRegion: |
| 离开region回调函数 Leave region callback function More... | |
| (void) | - amapLocationManager:didDetermineState:forRegion: |
| 查询region状态回调函数 Query region status callback function More... | |
| (void) | - amapLocationManager:monitoringDidFailForRegion:withError: |
| 监控region失败回调函数 Region monitoring failure callback function More... | |
AMapLocationManagerDelegate 协议定义了发生错误时的错误回调方法,连续定位的回调方法等。 The protocol defines the error callback method when an error occurs, the callback method for continuous positioning, etc.
|
optional |
定位权限状态改变时回调函数。注意:iOS13及之前版本回调 Callback function when the location permission status changes. Note: Callback for iOS13 and earlier versions
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| status | 定位权限状态。 Location permission status. |
|
optional |
查询region状态回调函数 Query region status callback function
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| state | 查询的region的状态。 Query the status of the region. |
| region | 查询的region。 The region being queried. |
|
optional |
进入region回调函数 Enter region callback function
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| region | 进入的region。 Entered region. |
|
optional |
离开region回调函数 Leave region callback function
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| region | 离开的region。 Departure region. |
|
optional |
当定位发生错误时,会调用代理的此方法。 When a positioning error occurs, this method of the agent will be called.
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| error | 返回的错误,参考 CLError 。 For the returned error, refer to CLError. |
|
optional |
开始监控region回调函数 Start monitoring region callback function
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| region | 开始监控的region。 The region to start monitoring. |
|
optional |
设备方向改变时回调函数 Callback function when device orientation changes
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| newHeading | 设备朝向。 Device orientation. |
|
optional |
连续定位回调函数.注意:本方法已被废弃,如果实现了amapLocationManager:didUpdateLocation:reGeocode:方法,则本方法将不会回调。 Continuous positioning callback function.Note: This method has been deprecated, if the amapLocationManager:didUpdateLocation:reGeocode: method is implemented, this method will not be called.
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| location | 定位结果。 Positioning result. |
|
optional |
连续定位回调函数.注意:如果实现了本方法,则定位信息不会通过amapLocationManager:didUpdateLocation:方法回调。 Continuous positioning callback function. Note: If this method is implemented, the location information will not be called back through the amapLocationManager:didUpdateLocation: method.
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| location | 定位结果。 Positioning result. |
| reGeocode | 逆地理信息。 Reverse geocoding. |
|
optional |
当plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription,并且[CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined,会调用代理的此方法。 此方法实现调用申请后台权限API即可:[locationManager requestAlwaysAuthorization] (必须调用,不然无法正常获取定位权限) When plist is configured with NSLayoutAlwaysUsabusageDescription or NSLayoutAlwaysAndWhenUseUsageDescription, and [CLStationManager authorizeStatus]==kCLAauthorizedStatusNotDetermined, this method of the proxy will be called. This method can be used to call the application backend permission API: [locationManager requestAlwaysAuthorization] (must be called, otherwise location permission cannot be obtained properly)
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| locationManager | 需要申请后台定位权限的locationManager。 The locationManager that needs to request background location permission. |
|
optional |
触发前提条件:1、plist配置NSLocationTemporaryUsageDescriptionDictionary。2、locationAccuracyMode设置为AMapLocationFullAndReduceAccuracy/AMapLocationFullAccuracy。3、当前用户已授权过定位权限,且为模糊定位权限。触发时机:满足前提条件时,再次发起定位请求会调用代理的此方法。此方法实现调用申请临时精确定位权限API即可: Preconditions for triggering: 1. Configure NSLayoutTemporaryUsageDescriptionDictionary for plist. 2. Set locationAccuracyMode to AMapLayoutFullAndReduceAccuracy/AMapLayoutFullAccuracy. 3. The current user has already been granted location permission, and it is a fuzzy location permission. Trigger timing: When the prerequisite is met, initiating a location request again will call this method of the proxy. This method can be used to call the temporary precise positioning permission API for application: [manager requestTemporaryFullAccuracyAuthorizationWithPurposeKey:"PurposeKey" completion:^(NSError *error){ if(completion){ completion(error); } }]; (必须调用,不然无法正常获取临时精确定位权限) (Must be called, otherwise temporary precise location permission cannot be obtained normally)
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| locationManager | 需要申请临时精确定位权限的locationManager。 A locationManager that requires temporary precise location permissions. |
| completion | 临时精确定位权限API回调结果,error: 直接返回系统error即可。 Temporary precise location permission API callback result, error: directly return the system error. |
|
optional |
定位权限状态改变时回调函数。注意:iOS14及之后版本回调 Callback function when location permission status changes. Note: Callback for iOS 14 and later versions
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| locationManager | 定位CLLocationManager类,可通过locationManager.authorizationStatus获取定位权限,通过locationManager.accuracyAuthorization获取定位精度权限 locationManager 定位CLLocationManager类,可通过locationManager.authorizationStatus获取定位权限,通过locationManager.accuracyAuthorization获取定位精度权限 |
|
optional |
监控region失败回调函数 Region monitoring failure callback function
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |
| region | 失败的region。 Failed region. |
| error | 错误信息,参考 AMapLocationErrorCode 。 Error message, refer to AMapLocationErrorCode. |
|
optional |
是否显示设备朝向校准 Whether to display device orientation calibration
| manager | 定位 AMapLocationManager 类。 Locate the AMapLocationManager class. |