Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added via_waypoint index extension for mapbox and valhalla flavor #6

Merged
merged 4 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Kotlin CI with Gradle
name: Kotlin

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/apple.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: Swift

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ publishing {

groupId = "com.osrm"
artifactId = "api"
version = "0.0.6"
version = "0.0.7"
}
}
}
7 changes: 6 additions & 1 deletion apple/Sources/OSRM/Models/RouteLeg.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ public struct RouteLeg: Codable, Hashable {
public var summary: String?
public var steps: [RouteStep]?
public var annotation: Annotation?
/** A valhalla and mapbox extension for via waypoints. */
public var viaWaypoints: [String]?

public init(distance: Double? = nil, duration: Double? = nil, weight: Double? = nil, summary: String? = nil, steps: [RouteStep]? = nil, annotation: Annotation? = nil) {
public init(distance: Double? = nil, duration: Double? = nil, weight: Double? = nil, summary: String? = nil, steps: [RouteStep]? = nil, annotation: Annotation? = nil, viaWaypoints: [String]? = nil) {
self.distance = distance
self.duration = duration
self.weight = weight
self.summary = summary
self.steps = steps
self.annotation = annotation
self.viaWaypoints = viaWaypoints
}

public enum CodingKeys: String, CodingKey, CaseIterable {
Expand All @@ -36,6 +39,7 @@ public struct RouteLeg: Codable, Hashable {
case summary
case steps
case annotation
case viaWaypoints = "via_waypoints"
}

// Encodable protocol methods
Expand All @@ -48,5 +52,6 @@ public struct RouteLeg: Codable, Hashable {
try container.encodeIfPresent(summary, forKey: .summary)
try container.encodeIfPresent(steps, forKey: .steps)
try container.encodeIfPresent(annotation, forKey: .annotation)
try container.encodeIfPresent(viaWaypoints, forKey: .viaWaypoints)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@
}
],
"summary" : "AK 1",
"via_waypoints" : [

],
"weight" : 56.002
}
],
Expand Down
7 changes: 7 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ components:
$ref: '#/components/schemas/RouteStep'
annotation:
$ref: '#/components/schemas/Annotation'
via_waypoints:
type: array
nullable: true
default: null
description: A Mapbox and Valhalla extension which indicates which waypoints are passed through rather than creating a new leg.
items:
type: string
RouteStep:
type: object
properties:
Expand Down