查询终端行驶里程 最后更新时间: 2021年01月22日
通过下面的代码查询某个终端在最近12小时内的行驶里程:
AMapTrackQueryTrackDistanceRequest *request = [[AMapTrackQueryTrackDistanceRequest alloc] init];
request.serviceID = self.trackManager.serviceID;
request.terminalID = self.trackManager.terminalID;
request.startTime = ([[NSDate date] timeIntervalSince1970] - 12*60*60) * 1000;
request.endTime = [[NSDate date] timeIntervalSince1970] * 1000;
[self.trackManager AMapTrackQueryTrackDistance:request];
- (void)onQueryTrackDistanceDone:(AMapTrackQueryTrackDistanceRequest *)request response:(AMapTrackQueryTrackDistanceResponse *)response
{
//查询成功
NSLog(@"onQueryTrackDistanceDone%@", response.formattedDescription);
}
- (void)didFailWithError:(NSError *)error associatedRequest:(id)request {
if ([request isKindOfClass:[AMapTrackQueryTrackDistanceRequest class]]) {
//查询失败
}
}