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

class is used for storing the route path between the two points on the location. More...

Inherits Finalizable.

Public Member Functions

RoutePath head (double advance)
 Returns the leading segment of the route.
 
RoutePath tail (double advance)
 Returns the remaining segment of the route.
 

Public Attributes

double get length
 Total lenth of the route path in meters.
 
List< RouteEvent > get events
 List of consecutive incoming events RouteEvent.
 
List< LocationPoint > get points
 List of consecutive points. LocationPoint.
 

Detailed Description

class is used for storing the route path between the two points on the location.

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

Definition at line 23 of file route_path.dart.

Member Function Documentation

◆ head()

RoutePath RoutePath.head ( double advance)

Returns the leading segment of the route.

Returns the portion of the route from the start up to the specified advance distance along the route. If advance exceeds the total route length, the entire route is returned.

Parameters
advanceDistance along the route (in meters).
Returns
The covered (passed) segment of the route (from start to advance), or nil if the segment is empty.

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");
}

◆ tail()

RoutePath RoutePath.tail ( double advance)

Returns the remaining segment of the route.

Returns the portion of the route starting from the specified advance distance to the end of the route. If advance is less than or equal to zero, the entire route is returned.

Parameters
advanceDistance along the route (in meters).
Returns
The remaining segment of the route (from advance to end), or nil if the segment is empty.

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

◆ events

List<RouteEvent> get RoutePath.events

List of consecutive incoming events RouteEvent.

Dart code snippet:

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

Definition at line 80 of file route_path.dart.

◆ length

double get RoutePath.length

Total lenth of the route path in meters.

Dart code snippet:

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

Definition at line 70 of file route_path.dart.

◆ points

List<LocationPoint> get RoutePath.points

List of consecutive points. LocationPoint.

Note
points could be on different sublocations if target sublocation is different from the starting one

Dart code snippet:

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

Definition at line 92 of file route_path.dart.


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