OnTheRoad 1.0.1

OnTheRoad 1.0.1

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
释放最后发布2017年11月

Matt Smollinger维护。



OnTheRoad 1.0.1

  • TrailBehind, Inc.和Mapzen

iOS上的On The Road CircleCI

这是Valhalla项目的官方客户端(https://github.com/valhalla)。它目前提供了一个在多个点之间拉取航线的的实现,并基于来自TrailBehind公司为他们的GaiaGPS产品所做的(https://www.gaiagps.com/)工作。

推荐安装方法

我们推荐使用CocoaPods(https://cocoapods.org.cn/)来安装库。它只依赖于Foundation和UIKit。

pod 'OnTheRoad'

示例用法

这里有一个示例,展示了如何使用On The Road非常简单。请确保阅读(文档),以查看所有您在发起请求时可以定制的属性。

路线

多个点之间的路线

  OTRRoutingController *router = [[OTRRoutingController alloc] init];

  OTRRoutingPoint *loc1 = [OTRRoutingPoint pointWithCoordinate:OTRGeoPointMake(40.74433, -73.9903) type:OTRRoutingPointTypeBreak];
  OTRRoutingPoint *loc2 = [OTRRoutingPoint pointWithCoordinate:OTRGeoPointMake(40.734807, -73.984770) type:OTRRoutingPointTypeThrough];
  OTRRoutingPoint *loc3 = [OTRRoutingPoint pointWithCoordinate:OTRGeoPointMake(40.732172, -73.998674) type:OTRRoutingPointTypeThrough];
  OTRRoutingPoint *loc4 = [OTRRoutingPoint pointWithCoordinate:OTRGeoPointMake(40.741050, -73.996142) type:OTRRoutingPointTypeBreak];
  NSArray *locations = [NSArray arrayWithObjects:loc1, loc2, loc3, loc4, nil];

  NSDictionary *costingOptions = [NSDictionary dictionaryWithObjectsAndKeys:@"use_ferry", @"0", nil];

  NSDictionary *directionsOptions = [NSDictionary dictionaryWithObjectsAndKeys:@"units", @"miles", @"language", @"fr-FR", nil];

  [router requestRouteWithLocations:locations costingModel:OTRRoutingCostingModelAuto costingOption:costingOptions directionsOptions:directionsOptions callback:^(OTRRoutingResult * _Nullable result, id  _Nullable invalidationToken, NSError * _Nullable error) {
    if (result) {
      // plot maneuvers on map
    }
  }];

关于完整的成本指导选项列表,请务必查看(逐点引导文档)。

报告问题

我们欢迎使用Github Issue tracker报告问题。但是,在报告错误之前,请先查看当前开放的问题,以避免问题跟踪器频繁变动。

贡献

请发送您想要的所有PR!我们强制执行良好的测试覆盖率,所以在提交拉取请求之前,请确保所有新的代码都是可覆盖的,并且在本地测试通过。