Latest 1.0.1
Homepage https://github.com/mapzen/on-the-road_ios
License MIT
Platforms ios 9.0
Authors ,

On The Road for iOS CircleCI

This is the official client for the Valhalla project (https://github.com/valhalla). It currently provides a basic implementation for pulling a route between multiple points, and is based on the work done by the good folks from TrailBehind for their GaiaGPS product (https://www.gaiagps.com/).

Recommended Installation Method

We recommend using CocoaPods (https://cocoapods.org/) to install the library. It only relies on Foundation and UIKit.

pod 'OnTheRoad'

Example Usage

Here is an example which shows how easy it is to use On The Road. Be sure to read the documentation to see all the properties you can customize when making requests.

Route

Route between multiple points:

  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
    }
  }];

For a full list of costing and directions options, be sure to check the turn by turn documentation.

Reporting Issues

We welcome issues to be reported using the Github Issue tracker. However please review the currently open issues before reporting a bug to avoid issue tracker churn.

Contributing

Please send any and all PRs you want! We do enforce good test coverage, so please make sure all your new code is covered, and that tests pass locally before submitting a pull request!

Latest podspec

{
    "name": "OnTheRoad",
    "version": "1.0.1",
    "summary": "Request routes from Valhalla routing services, include Mapzen's Turn-by-Turn routing service.",
    "description": "Valhalla is an open source routing engine and accompanying libraries for use with OpenStreetMap data (https://github.com/valhalla/valhalla). Valhalla also includes tools like time+distance matrix computation and tour optimization (Traveling Salesman).nnMapzen Turn-by-Turn is a navigation service for the world, based on open data, and utilizes the Valhalla tool suite. Add routing to your app and let your users go anywhere on the planet, whether by foot, bike, car, bus, train, or ferry.nnThe Mapzen Turn-by-Turn API makes it easy to let navigation find its way into your apps, based on road network data from OpenStreetMap and public transit feeds from Transitland. Whether your users need multiple locations, points along a route, custom routing options, or multimodal routing, our API is ready to help.",
    "homepage": "https://github.com/mapzen/on-the-road_ios",
    "license": "MIT",
    "authors": {
        "TrailBehind, Inc.": "[email protected]",
        "Mapzen": "[email protected]"
    },
    "social_media_url": "http://twitter.com/mapzen",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/mapzen/on-the-road_ios.git",
        "tag": "v1.0.1"
    },
    "source_files": "OTRRouting/*.{h,m,c}"
}

Pin It on Pinterest

Share This