TencentLocationSDK_iOS_v3.1
TencentLBSLocationManager类 参考
类 TencentLBSLocationManager 继承关系图:

构造函数

(void) - requestWhenInUseAuthorization
 
(void) - requestAlwaysAuthorization
 
(BOOL) - requestLocationWithCompletionBlock:
 
(BOOL) - requestLocationWithRequestLevel:locationTimeout:completionBlock:
 
(void) - cancelRequestLocation
 
(void) - startUpdatingLocation
 
(void) - stopUpdatingLocation
 
(void) - startUpdatingHeading
 
(void) - stopUpdatingHeading
 
(void) - dismissHeadingCalibrationDisplay
 

属性

NSString * apiKey
 
id< TencentLBSLocationManagerDelegate > delegate
 
CLLocationDistance distanceFilter
 
CLLocationAccuracy desiredAccuracy
 
BOOL pausesLocationUpdatesAutomatically
 
BOOL allowsBackgroundLocationUpdates
 
CLActivityType activityType
 
CLLocationDegrees headingFilter
 
CLDeviceOrientation headingOrientation
 
TencentLBSRequestLevel requestLevel
 
TencentLBSLocationCoordinateType coordinateType
 
NSInteger poiUpdateInterval
 

函数文档

◆ cancelRequestLocation()

- (void) cancelRequestLocation

取消单次定位

◆ dismissHeadingCalibrationDisplay()

- (void) dismissHeadingCalibrationDisplay

停止展示定位朝向校准提示

◆ requestLocationWithCompletionBlock:()

- (BOOL) requestLocationWithCompletionBlock: (TencentLBSLocatingCompletionBlock)  completionBlock

单次定位

该方法为下面方法的一层封装。 level默认是TencentLBSRequestLevelPoi timeout默认是10s

◆ requestLocationWithRequestLevel:locationTimeout:completionBlock:()

- (BOOL) requestLocationWithRequestLevel: (TencentLBSRequestLevel)  level
locationTimeout: (NSTimeInterval)  timeout
completionBlock: (TencentLBSLocatingCompletionBlock)  completionBlock 

单次定位

注意:不能连续调用该接口,需在上一次返回之后才能再次发起调用。该接口兼容iOS 7.0及以上,因iOS 9.0系统提供单次定位能力,故在9.0以上会调用系统单次定位接口,9.0之前SDK完成封装。可以通过调用cancelRequestLocation来取消。

参数
level可以根据此参数来对应的获取POI信息
timeout表示获取POI的超时时间。
completionBlock单次定位完成后的Block

◆ startUpdatingHeading()

- (void) startUpdatingHeading

开启更新定位朝向

◆ startUpdatingLocation()

- (void) startUpdatingLocation

开始连续定位

◆ stopUpdatingHeading()

- (void) stopUpdatingHeading

结束更新定位朝向

◆ stopUpdatingLocation()

- (void) stopUpdatingLocation

停止连续定位

属性说明

◆ activityType

- (CLActivityType) activityType
readwritenonatomicassign

用户的活动类型

设置用户的活动类型。默认值为 CLActivityTypeOther

◆ allowsBackgroundLocationUpdates

- (BOOL) allowsBackgroundLocationUpdates
readwritenonatomicassign

是否允许后台定位。默认为 NO。 iOS 9.0 以上用户需要设置该选项并且在info.list里面Background Modes 中的 Location updates 处于选中状态才可以使用后台定位权限。iOS 9.0之前可以直接申请总是使用的权限来获得后台定位。

设置为 YES 的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。

◆ apiKey

- (NSString*) apiKey
readwritenonatomiccopy

API Key, 在使用定位SDK服务之前需要先绑定key。

◆ coordinateType

- (TencentLBSLocationCoordinateType) coordinateType
readwritenonatomicassign

返回的TencentLBSLocation的location字段的坐标类型。默认为TencentLBSLocationCoordinateTypeGCJ02。

在一次定位过程中,只允许设置一次,不允许重复设置

◆ delegate

- (id<TencentLBSLocationManagerDelegate>) delegate
readwritenonatomicweak

实现了 TencentLBSLocationManagerDelegate 协议的类指针。

◆ desiredAccuracy

- (CLLocationAccuracy) desiredAccuracy
readwritenonatomicassign

设定定位精度。默认为 kCLLocationAccuracyBest 。

◆ distanceFilter

- (CLLocationDistance) distanceFilter
readwritenonatomicassign

设定定位的最小更新距离。默认为 kCLDistanceFilterNone。

◆ headingFilter

- (CLLocationDegrees) headingFilter
readwritenonatomicassign

设置当朝向改变时,每隔多少度调用一次 只有当设备方向的改变值超过该属性值时才激发delegate的方法。

◆ headingOrientation

- (CLDeviceOrientation) headingOrientation
readwritenonatomicassign

设置设备当前的朝向

◆ pausesLocationUpdatesAutomatically

- (BOOL) pausesLocationUpdatesAutomatically
readwritenonatomicassign

指定定位是否会被系统自动暂停。默认为 YES 。

◆ poiUpdateInterval

- (NSInteger) poiUpdateInterval
readwritenonatomicassign

指定POI的更新间隔。 默认是10s

◆ requestLevel

- (TencentLBSRequestLevel) requestLevel
readwritenonatomicassign

连续定位的逆地理信息请求的Level。默认为TencentLBSRequestLevelGeo


该类的文档由以下文件生成: