示例中心
功能在线体验
menu 导航 closed 关闭

高德 开发 iOS 猎鹰SDK 开发指南 轨迹查询 查询终端行驶里程

更新时间:2018年08月02日

通过下面的代码查询某个终端在最近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]]) {
            //查询失败
        }
    }


新用户
福利
示例
中心
常见
问题