OTRoute class
Over-track (OT) route representation.
Provides access to a route that is backed by a detailed track (Path) rather than only a set of turn-by-turn segments. An OTRoute exposes route-level properties and helpers built on top of RouteBase, and specifically provides access to the underlying track as a Path when available.
This class is primarily returned by converting a generic Route to an OTRoute using Route.toOTRoute.
Example
// Covert the Path to a list of Landmarks that can be used for routing.
List<Landmark> landmarkList = path.toLandmarkList();
// Define the route preferences.
final routePreferences = RoutePreferences();
RoutingService.calculateRoute(landmarkList, routePreferences,
(err, routes) {
if (err == GemError.success) {
Route route = routes.first;
OTRoute? otRoute = route.toOTRoute();
} else {
showSnackbar("Error calculating route: $err");
}
});
See also:
Properties
-
dominantRoads
→ List<
String> -
Dominant road names along the route.
no setterinherited
- geographicArea → RectangleGeographicArea
-
The geographic bounding rectangle that encloses the route.
no setterinherited
- hasFerryConnections → bool
-
Whether the route includes ferry connections.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasRegisteredAutoReleaseObject ↔ bool
-
getter/setter pairinherited
- hasTollRoads → bool
-
Whether the route contains toll roads.
no setterinherited
- incursCosts → bool
-
Whether traveling this route may incur monetary costs (for example tolls).
no setterinherited
- pointerId → int
-
The pointer ID of the native object
no setterinherited
- polygonGeographicArea → PolygonGeographicArea
-
Polygonal geographic area covering the route.
no setterinherited
- preferences → RoutePreferences
-
Preferences used when the route was calculated.
no setterinherited
- routeListener ↔ RouteListener?
-
Returns the currently attached RouteListener, if any.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
segments
→ List<
RouteSegment> -
List of segments that make up the route.
no setterinherited
- status → RouteStatus
-
Current status of the route calculation.
no setterinherited
- summary → String
-
Short textual summary of the route.
no setterinherited
- terrainProfile → RouteTerrainProfile?
-
Route terrain elevation profile, if available.
no setterinherited
- tilesGeographicArea → TilesCollectionGeographicArea
-
Geographic area of the route represented as a tiles collection.
no setterinherited
-
tollSections
→ List<
TollSection> -
A list of tolled sections that occur along the route.
no setterinherited
- track → Path?
-
The path representing the detailed track of this route, if available.
no setter
-
trafficEvents
→ List<
RouteTrafficEvent> -
Traffic events that affect this route (delays, closures, etc.).
no setterinherited
Methods
-
clearRouteListener(
) → void -
Remove any previously attached RouteListener.
inherited
-
dispose(
) → void -
Disposes the native object.
inherited
-
exportAs(
PathFileFormat format) → String -
Export route data in a standard file format.
inherited
-
getClosestSegment(
Coordinates coord) → int -
Find the index of the route segment nearest to
coord.inherited -
getCoordinateOnRoute(
int distance) → Coordinates -
Returns the coordinate located at
distancemetres from the route start.inherited -
getDistanceOnRoute(
Coordinates coords, bool activePart) → int -
Returns the route distance (meters) from departure at the given
coords.inherited -
getPath(
int start, int end) → Path? -
Build a Path covering the route between
startandenddistances.inherited -
getTimeDistance(
{bool activePart = true}) → TimeDistance -
Returns time and distance metrics for the route or a segment.
inherited
-
getTimeDistanceCoordinateOnRoute(
Coordinates coordinates) → TimeDistanceCoordinate -
Find the time-distance coordinate nearest to a reference
coordinates.inherited -
getTimeDistanceCoordinates(
{required int start, required int end, required int step, required StepType stepType}) → List< TimeDistanceCoordinate> -
Build a timestamped list of coordinates sampled along the route.
inherited
-
getWaypoints(
{GetWaypointsOptions options = GetWaypointsOptions.remainingInitial}) → List< Landmark> -
Retrieve the route's waypoints.
inherited
-
getWaypointsVia(
Landmark landmark) → List< Landmark> -
Produce a new waypoint list inserting
landmarkinto the remaining route waypoints.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerAutoReleaseObject(
int pointerId) → void -
Registers an object for auto release.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited