高德地图SDK(Track)
V1.4.2
|
#import <AMapTrackManager.h>
Instance Methods | |
(instancetype) | - initWithOptions: |
初始化方法 More... | |
(void) | - changeGatherAndPackTimeInterval:packTimeInterval: |
设定定位信息的采集周期和上传周期,注意:上传周期必须为采集周期的整数倍 More... | |
(void) | - startServiceWithOptions: |
开始Service,结果会通过onStartService:回调返回 More... | |
(void) | - stopService |
停止Service,结果会通过onStopService:回调返回 More... | |
(void) | - startGatherAndPack |
开始采集和上传,结果会通过onStartGatherAndPack:返回 More... | |
(void) | - stopGaterAndPack |
停止采集和上传,结果会通过onStopGatherAndPack:返回 More... | |
(BOOL) | - setLocalCacheMaxSize: |
设定允许的本地缓存最大值 More... | |
(void) | - cancelAllRequests |
取消所有未回调的请求,触发错误回调didFailWithError:associatedRequest:。 More... | |
(void) | - AMapTrackAddTerminal: |
增加Terminal接口 More... | |
(void) | - AMapTrackQueryTerminal: |
查询Terminal接口 More... | |
(void) | - AMapTrackAddTrack: |
增加Track接口 More... | |
(void) | - AMapTrackDeleteTrack: |
删除Track接口 More... | |
(void) | - AMapTrackQueryLastPoint: |
查询终端位置接口 More... | |
(void) | - AMapTrackQueryTrackDistance: |
查询轨迹行驶距离接口 More... | |
(void) | - AMapTrackQueryTrackHistoryAndDistance: |
查询轨迹历史数据和行驶距离接口 More... | |
(void) | - AMapTrackQueryTrackInfo: |
查询轨迹历史数据 More... | |
Properties | |
id< AMapTrackManagerDelegate > | delegate |
AMapTrackManager的delegate. More... | |
CLActivityType | activityType |
设定定位的活跃类型。默认为 CLActivityTypeAutomotiveNavigation 。 More... | |
CLLocationDistance | distanceFilter |
设定定位的最小更新距离。单位米,默认为 kCLDistanceFilterNone,表示只要检测到设备位置发生变化就会更新位置信息。 More... | |
CLLocationAccuracy | desiredAccuracy |
BOOL | pausesLocationUpdatesAutomatically |
指定定位是否会被系统自动暂停。默认为NO。 More... | |
BOOL | allowsBackgroundLocationUpdates |
是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。由于iOS系统限制,需要在定位未开始之前或定位停止之后,修改该属性的值才会有效果。 More... | |
NSUInteger | gatherInterval |
定位信息的采集周期,单位秒,默认2s,有效值范围[1, 60]。 More... | |
NSUInteger | packInterval |
定位信息的上传周期,单位秒,默认20s,有效值范围[5, 3000]。 More... | |
NSString * | serviceID |
当前的serviceID,初始化时指定。 More... | |
NSString * | terminalID |
当前的terminalID,startService时指定。 More... | |
NSString * | trackID |
当前的trackID。 More... | |
NSUInteger | cacheMaxSize |
本地缓存最大值 More... | |
NSInteger | timeout |
网络超时时间,单位秒,默认为30。 More... | |
- (void) AMapTrackAddTerminal: | (AMapTrackAddTerminalRequest *) | request |
增加Terminal接口
request | 查询选项。具体属性字段请参考 AMapTrackAddTerminalRequest 类。 |
- (void) AMapTrackAddTrack: | (AMapTrackAddTrackRequest *) | request |
增加Track接口
request | 查询选项。具体属性字段请参考 AMapTrackAddTrackRequest 类。 |
- (void) AMapTrackDeleteTrack: | (AMapTrackDeleteTrackRequest *) | request |
删除Track接口
request | 查询选项。具体属性字段请参考 AMapTrackDeleteTrackRequest 类。 |
- (void) AMapTrackQueryLastPoint: | (AMapTrackQueryLastPointRequest *) | request |
查询终端位置接口
request | 查询选项。具体属性字段请参考 AMapTrackQueryLastPointRequest 类。 |
- (void) AMapTrackQueryTerminal: | (AMapTrackQueryTerminalRequest *) | request |
查询Terminal接口
request | 查询选项。具体属性字段请参考 AMapTrackQueryTerminalRequest 类。 |
- (void) AMapTrackQueryTrackDistance: | (AMapTrackQueryTrackDistanceRequest *) | request |
查询轨迹行驶距离接口
request | 查询选项。具体属性字段请参考 AMapTrackQueryTrackDistanceRequest 类。 |
- (void) AMapTrackQueryTrackHistoryAndDistance: | (AMapTrackQueryTrackHistoryAndDistanceRequest *) | request |
查询轨迹历史数据和行驶距离接口
request | 查询选项。具体属性字段请参考 AMapTrackQueryTrackHistoryAndDistanceRequest 类。 |
- (void) AMapTrackQueryTrackInfo: | (AMapTrackQueryTrackInfoRequest *) | request |
查询轨迹历史数据
request | 查询选项。具体属性字段请参考 AMapTrackQueryTrackInfoRequest 类。 |
- (void) cancelAllRequests |
取消所有未回调的请求,触发错误回调didFailWithError:associatedRequest:。
- (void) changeGatherAndPackTimeInterval: | (NSInteger) | gatherTimeInterval | |
packTimeInterval: | (NSInteger) | packTimeInterval | |
设定定位信息的采集周期和上传周期,注意:上传周期必须为采集周期的整数倍
gatherTimeInterval | 定位信息的采集周期,单位秒,有效值范围[1, 60] |
packTimeInterval | 定位信息的上传周期,单位秒,有效值范围[5, 3000] |
- (instancetype) initWithOptions: | (AMapTrackManagerOptions *) | NS_DESIGNATED_INITIALIZER |
初始化方法
- (BOOL) setLocalCacheMaxSize: | (NSInteger) | cacheMaxSize |
设定允许的本地缓存最大值
cacheMaxSize | 本地缓存最大值,单位MB,默认+∞,有效值范围[50,+∞)。 |
- (void) startGatherAndPack |
开始采集和上传,结果会通过onStartGatherAndPack:返回
- (void) startServiceWithOptions: | (AMapTrackManagerServiceOption *) | options |
开始Service,结果会通过onStartService:回调返回
options | AMapTrackManagerServiceOption类实例 |
- (void) stopGaterAndPack |
停止采集和上传,结果会通过onStopGatherAndPack:返回
- (void) stopService |
停止Service,结果会通过onStopService:回调返回
|
readwritenonatomicassign |
设定定位的活跃类型。默认为 CLActivityTypeAutomotiveNavigation 。
|
readwritenonatomicassign |
是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。由于iOS系统限制,需要在定位未开始之前或定位停止之后,修改该属性的值才会有效果。
|
readnonatomicassign |
本地缓存最大值
|
readwritenonatomicweak |
AMapTrackManager的delegate.
|
readwritenonatomicassign |
设定期望的定位精度。单位米,默认为 kCLLocationAccuracyBest。定位服务会尽可能去获取满足desiredAccuracy的定位结果,但不保证一定会得到满足期望的结果。 注意:iOS14及以上版本,轨迹服务需要在精确定位权限下使用,如果该参数设置kCLLocationAccuracyReduced无效。
|
readwritenonatomicassign |
设定定位的最小更新距离。单位米,默认为 kCLDistanceFilterNone,表示只要检测到设备位置发生变化就会更新位置信息。
|
readnonatomicassign |
定位信息的采集周期,单位秒,默认2s,有效值范围[1, 60]。
|
readnonatomicassign |
定位信息的上传周期,单位秒,默认20s,有效值范围[5, 3000]。
|
readwritenonatomicassign |
指定定位是否会被系统自动暂停。默认为NO。
|
readnonatomicassign |
当前的serviceID,初始化时指定。
|
readnonatomicassign |
当前的terminalID,startService时指定。
|
readwritenonatomicassign |
网络超时时间,单位秒,默认为30。
|
readwritenonatomiccopy |
当前的trackID。