Loading...
Searching...
No Matches
RoutePath Class Referenceabstract

Class is used for storing the route path between two points in location. More...

Inherits Finalizable.

Public Member Functions

RoutePath head (double advance)
 Returns the leading segment of the route up to advance meters.
 
RoutePath tail (double advance)
 Returns the route segment after advance meters.
 
List< RouteNodenodes ()
 Returns route nodes with points and events.
 

Public Attributes

double get length
 Total route length in meters.
 
double get weight
 Total route weight/cost.
 

Detailed Description

Class is used for storing the route path between two points in location.

Referenced from: AsyncRouteListener, AsyncRouteManager, Location, RouteListener, RouteManager

Definition at line 20 of file route_path.dart.

Member Function Documentation

◆ head()

RoutePath RoutePath.head ( double advance)

Returns the leading segment of the route up to advance meters.

Parameters
advancedistance along route (meters).
Returns
route head segment.

Dart code snippet:

// Get head of route (first 10 meters)
RoutePath? headPath = path.head(10.0);
if (headPath != null) {
print("Head path length: ${headPath.length} meters");
}

◆ nodes()

List< RouteNode > RoutePath.nodes ( )

Returns route nodes with points and events.

Dart code snippet:

// Get route nodes
List<RouteNode> nodes = path.nodes;
print("Route has ${nodes.length} nodes");
for (int j = 0; j < nodes.length; j++) {
_demonstrateRouteNodeUsage(nodes[j]);
}

◆ tail()

RoutePath RoutePath.tail ( double advance)

Returns the route segment after advance meters.

Parameters
advancedistance along route (meters).
Returns
route tail segment.

Dart code snippet:

// Get tail of route (remaining after 10 meters)
RoutePath? tailPath = path.tail(10.0);
if (tailPath != null) {
print("Tail path length: ${tailPath.length} meters");
}

Member Data Documentation

◆ length

double get RoutePath.length

Total route length in meters.

Dart code snippet:

// Get route length
double length = path.length;
print("Route length: $length meters");

Definition at line 72 of file route_path.dart.

◆ weight

double get RoutePath.weight

Total route weight/cost.

Dart code snippet:

// Get total route weight
double weight = path.weight;
print("Route weight: $weight");

Definition at line 83 of file route_path.dart.


The documentation for this class was generated from the following file: