See Route Element Details
iOS v4
class ShowRouteController: UITableViewController {
var route: MPRoute?let origin = MPPoint(latitude: 57.057917, longitude: 9.950361, z: 0)!
let destination = MPPoint(latitude: 57.058038, longitude: 9.950509, z: 1)!
let directionsQuery = MPDirectionsQuery(originPoint: origin, destination: destination)
route = try await MPMapsIndoors.shared.directionsService.routingWith(query: directionsQuery)override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if let steps = route?.legs[1].steps {
return steps.count + 1
}
return 0
}override func numberOfSections(in tableView: UITableView) -> Int {
if let legs = route?.legs {
return legs.count
}
return 0
}Last updated
Was this helpful?