Skip to main content
GuidesAPI ReferenceExamplesFAQ

Routes

|

A route represents a navigable path between two or more landmarks (waypoints), including distance, estimated time, and navigation instructions.

Compute routes in different ways:

  • Waypoint-based - Based on 2 or more landmarks (navigable)
  • Over-track - Based on a predefined path from GPX files or other sources (navigable)
  • Route ranges - Not navigable, without segments or instructions

Navigable routes consist of segments. Each segment represents the portion between consecutive waypoints with its own route instructions.


Create Routes

Routes cannot be instantiated directly. Compute them based on a list of landmarks. See Get started with Routing for details.

danger

Calculating a route does not automatically display it on the map. See Display routes for instructions.


Route Types

The SDK supports multiple route types, each tailored for specific use cases:

  • Normal routes - Standard routes for typical navigation
  • Public transport (PT) routes - Routes using public transport with frequency, ticket info, and transit-specific data
  • Over-track (OT) routes - Routes based on predefined paths from GPX files or drawn routes
  • Electric vehicle (EV) routes - Routes for EVs with charging station information (not fully implemented)

Route Classes

Each route type has specific classes:

Route TypeRoute ClassSegment ClassInstruction Class
Normal RouteRouteRouteSegmentRouteInstruction
Public Transport RoutePTRoutePTRouteSegmentPTRouteInstruction
Over-Track RouteOTRouteNot AvailableNot Available
Electric Vehicle RouteEVRouteEVRouteSegmentEVRouteInstruction

These classes extend base classes (RouteBase, RouteSegmentBase, RouteInstructionBase) that provide common features.


Route Structure

Key route characteristics:

FieldTypeExplanation
geographicAreaGeographicAreaA geographic boundary or region covered by the route.
polygonGeographicAreaPolygonGeographicAreaA polygon representing the geographic area as a series of connected points.
tilesGeographicAreaTilesCollectionGeographicAreaA collection of map tiles representing the geographic area.
dominantRoadsList<String>A list of road names or identifiers that dominate the route.
hasFerryConnectionsboolIndicates whether the route includes ferry connections.
hasTollRoadsboolIndicates whether the route includes toll roads.
tollSectionsList of TollSectionThe list of toll sections along the route.
incursCostsboolSpecifies if the route incurs any monetary costs, such as tolls or fees [DEPRECATED - same as hasTollRoads]
routeStatusRouteStatusIf we are navigating a route and we deviate from it, the route is recalculated. This means that the routeStatus might signal that route is computed or we don't have internet connection, or even that on recomputation we got an error.
terrainProfileList<double>A profile of terrain elevations along the route, represented as a list of elevation values.
segmentsList<RouteSegment>
A collection of route segments, each representing a specific portion of the route.
Segments are split based on the initial waypoints that were used to compute the route.
For Public Transit routes a segment is either a pedestrian part or a public transit part.
trafficEventsList<RouteTrafficEvent>A list of traffic events, such as delays or road closures, affecting the route.

RouteSegment Structure

A route segment represents the portion between two consecutive waypoints. For public transport routes, segments are categorized as pedestrian or public transit sections.

Field/MethodReturn TypeDescription
waypointsList<Landmark>Retrieves the list of landmarks representing the start and end waypoints of the route segment.
timeDistanceTimeDistanceProvides the length in meters and estimated travel time in seconds for the route segment.
geographicAreaRectangleGeographicAreaRetrieves the smallest rectangle enclosing the geographic area of the route.
incursCostsboolChecks whether traveling the route or segment incurs a cost to the user.
summaryStringProvides a summary of the route segment.
instructionsList<RouteInstruction>Retrieves the list of route instructions for the segment.
isCommonboolIndicates whether the segment shares the same travel mode as the parent route. Mostly used within public transport routes.
tollSectionsList<TollSection>The list of toll sections along the route segment.

RouteInstruction Structure

Route instructions provide detailed navigation guidance, including coordinates, turn directions, distances, and time to waypoints.

MethodReturn TypeDescription
coordinatesCoordinatesGets coordinates for this route instruction.
countryCodeISOStringGets ISO 3166-1 alpha-3 country code for the navigation instruction.
exitDetailsStringGets exit route instruction text.
followRoadInstructionStringGets textual description for follow road information.
realisticNextTurnImgAbstractGeometryImgGets image for the realistic turn information.
remainingTravelTimeDistanceTimeDistanceGets remaining travel time and distance until the destination
remainingTravelTimeDistanceToNextWaypointTimeDistanceGets remaining travel time and distance to the next waypoint.
roadInfoList<RoadInfo>Gets road information.
roadInfoImgRoadInfoImgGets road information image.
signpostDetailsSignpostDetailsGets extended signpost details.
signpostInstructionStringGets textual description for the signpost information.
timeDistanceToNextTurnTimeDistanceGets distance and time to the next turn.
traveledTimeDistanceTimeDistanceGets traveled time and distance.
turnDetailsTurnDetailsGets full details for the turn.
turnImgImgGets image for the turn.
turnInstructionStringGets textual description for the turn.
hasFollowRoadInfoboolChecks if follow road information is available.
hasSignpostInfoboolChecks if signpost information is available.
hasTurnInfoboolChecks if turn information is available.
hasRoadInfoboolChecks if road information is available.
isCommonboolChecks if this instruction is of common type - has the same transport mode as the parent route
isExitboolChecks if the route instruction is a main road exit instruction.
isFerryboolChecks if the route instruction is on a ferry segment.
isTollRoadboolChecks if the route instruction is on a toll road.
info

Distinguish between NavigationInstruction and RouteInstruction:

  • NavigationInstruction - Real-time, turn-by-turn navigation based on current position (only during navigation or simulation)
  • RouteInstruction - Route overview available immediately after calculation (instructions don't change during navigation)

TimeDistance

The TimeDistance class provides time and distance details to important points of interest.

It differentiates between road types:

  • Restricted - Non-public roads
  • Unrestricted - Publicly accessible roads
FieldTypeExplanation
unrestrictedTimeSintUnrestricted time in seconds.
restrictedTimeSintRestricted time in seconds.
unrestrictedDistanceMintUnrestricted distance in meters.
restrictedDistanceMintRestricted distance in meters.
ndBeginEndRatiodoubleRatio representing the division of restricted time/distance between the begin and the end.
totalTimeSintTotal time in seconds (sum of unrestricted and restricted times).
totalDistanceMintTotal distance in meters (sum of unrestricted and restricted distances).
isEmptyboolIndicates whether the total time is zero.
isNotEmptyboolIndicates whether the total time is non-zero.
hasRestrictedBeginEndDifferentiationboolIndicates if the begin and end have differentiated restricted values based on the ratio.
restrictedTimeAtBeginintRestricted time allocated to the beginning, based on the ratio.
restrictedTimeAtEndintRestricted time allocated to the end, based on the ratio.
restrictedDistanceAtBeginintRestricted distance allocated to the beginning, based on the ratio.
restrictedDistanceAtEndintRestricted distance allocated to the end, based on the ratio.

Signpost Details

Signposts near roadways indicate intersections and directions. The SDK provides realistic image renderings with additional information.

Signpost image captured during highway navigation

The SignpostDetails class provides:

MemberTypeDescription
backgroundColorColorRetrieves the background color of the signpost.
borderColorColorRetrieves the border color of the signpost.
textColorColorRetrieves the text color of the signpost.
hasBackgroundColorboolIndicates whether the signpost has a background color.
hasBorderColorboolIndicates whether the signpost has a border color.
hasTextColorboolIndicates whether the signpost has a text color.
itemsList<SignpostItem>Retrieves a list of SignpostItem elements associated with the signpost.

Each SignpostItem provides:

MemberTypeDescription
rowintRetrieves the one-based row of the item. Zero indicates not applicable.
columnintRetrieves the one-based column of the item. Zero indicates not applicable.
connectionInfoSignpostConnectionInfoRetrieves the connection type of the item (branch, towards, exit, invalid)
phonemeStringRetrieves the phoneme assigned to the item if available, otherwise empty.
pictogramTypeSignpostPictogramTypeRetrieves the pictogram type for the item (airport, busStation, parkingFacility, etc).
shieldTypeRoadShieldTypeRetrieves the shield type for the item (county, state, federal, interstate, etc)
textStringRetrieves the text assigned to the item, if available.
typeSignpostItemTypeRetrieves the type of the item (placeName, routeNumber, routeName, etc).
hasAmbiguityboolIndicates if the item has ambiguity. Avoid using such items for TTS.
hasSameShieldLevelboolIndicates if the road code item has the same shield level as its road.

Turn Details

The TurnDetails class provides:

  • event - Turn type enum (straight, right, left, lightLeft, lightRight, sharpRight, sharpLeft, roundaboutExitRight, and more)
  • abstractGeometryImg - Abstract turn image (verify validity). Customize colors with AbstractGeometryImageRenderSettings
  • roundaboutExitNumber - Roundabout exit number (if available)

Abstract Image vs. Turn Image

Compare images from abstractGeometryImg (left) and turnImg (right):

Turn details abstract image
Turn image

  • abstractGeometryImg - Detailed intersection representation with customizable colors for theme alignment
  • turnImg - Simplified turn schematic focusing on essential direction (no customization)
Tip

Use the uid getter to retrieve each image's unique identifier. Update the UI only when the ID changes to enhance navigation performance.

Customize Abstract Geometry Images

Use AbstractGeometryImageRenderSettings to customize render settings and colors:

 AbstractGeometryImageRenderSettings customizedRenderSettings = const AbstractGeometryImageRenderSettings(
activeInnerColor: Colors.red,
activeOuterColor: Colors.green,
inactiveInnerColor: Colors.blue,
inactiveOuterColor: Colors.yellow,
);

These settings produce:

Customized next turn details abstract image

Toll Sections

The TollSection class represents a tolled route portion, defining start and end points (in meters from route start), cost, and currency.

MemberTypeDescription
startDistanceMintDistance in meters where the section starts (from route starting point).
endDistanceMintDistance in meters where the section ends (from route starting point).
costdoubleCost in the specified currency.
currencyStringCurrency code, e.g. EUR, USD.

When cost data is unavailable, cost is 0 and currency is an empty string.

Tip

Get WGS coordinates of toll section start and end using Route.getCoordinateOnRoute with startDistanceM and endDistanceM values.


Change Instruction Language

Route instruction texts follow the SDK language settings. See Internationalization for details.