Route progress
Tracking a user's progress along a route is key to providing helpful and prompt navigation instructions. The RouteProgress
struct contains all the user's progress information along the route, including current leg and step information. This object allows you to get distance measurements, the percentage of route complete, current step index, and more.
The NavigationController
tracks the user’s progress along a route, continuously publishing an updated RouteProgressState
struct in routeProgress
property, and emits other events as the user reaches significant points along the route.
Information about progress
There are three structs that contain information on route progress at different levels of granularity: route, leg, and step.
Route: The blue line represents a route. A route stretches between the origin and destination.
Leg: The larger circles with a pink stroke represent waypoints, or stops, along the route. A leg is the part of the route between two waypoints.
Step: The smaller circles with a green stroke represent maneuvers. A step is the part of the leg between two maneuvers.
Read more about what properties are available in these three progress structs in the API reference documentation:
RouteProgress
: This struct contains all progress information at any given time during a navigation session. This progress includes information for the current route, leg and step the user is traversing along. With every new valid location update, the route progress will be updated with the latest information. You can subscribe to forrouteProgress
publisher inNavigationController
to be notified when the route progress object changes.RouteLegProgress
: This struct is specific to the current leg the user is on. If there is only one leg in the directions route, much of this information will be the same as the parentRouteProgress
.RouteStepProgress
: This struct is specific to the current step the user is on.