Using multi-stop navigation
Multi-stop navigation has been introduced with the release of 4.5.0. This allows users to be navigated to multiple stops within a single route.
Querying a multi-stop route
let query = MPDirectionsQuery(
originPoint: .init(latitude: 57.05800975, longitude: 9.949916517, z: 0),
destinationPoint: .init(latitude: 57.058278, longitude: 9.9512196, z: 10)
)
query.stopsPoints = [
MPPoint(latitude: 57.0582701, longitude: 9.9508396, z: 0.0),
MPPoint(latitude: 57.0580431, longitude: 9.9505475, z: 0.0),
MPPoint(latitude: 57.0580843, longitude: 9.9506085, z: 10.0),
]
query.optimizeRoute = true
if let route = try await MPMapsIndoors.shared.directionsService.routingWith(query: query) {
print(route)
}Showing and configuring a multi-stop route on the map


Last updated
Was this helpful?