Skip to content

4.0.0

Choose a tag to compare

@ianthetechie ianthetechie released this 04 Sep 07:41
· 21 commits to main since this release

Added

  • Support for the OSRM format and navigation aids
  • BREAKING: To support the new format, the response type of directions APIs has changed

You will now need to match against the response enum,
which has variants for each response.
This enables you to build your apps in a type-safe manner.
Here is an example:

let req = RouteRequest(units: .mi,
                       format: .osrm,
                       bannerInstructions: true,
                       filters: AnnotationFilters(action: .include, attributes: [
                           .speedLimit,
                       ]),
                       id: "route",
                       locations: [
                           RoutingWaypoint(lat: locationA.lat, lon: locationA.lon),
                           RoutingWaypoint(lat: locationB.lat, lon: locationB.lon),
                       ],
                       costing: .auto,
                       costingOptions: CostingOptions(auto: AutoCostingOptions(useHighways: 0.3)))
guard case let .typeOsrmRouteResponse(res) = try await RoutingAPI.route(routeRequest: req) else {
    XCTFail("Expected an OSRM format route response")
    return
}