Loading...
Searching...
No Matches

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

#include <com/navigine/idl/objc/NCRoutePath.h>

Inherits NSObject.

Instance Methods

(nullable NCRoutePath *) - head:
 Returns the leading segment of the route.
 
(nullable NCRoutePath *) - tail:
 Returns the remaining segment of the route.
 

Properties

float length
 Total lenth of the route path in meters.
 
NSArray< NCRouteEvent * > * events
 List of consecutive incoming events RouteEvent.
 
NSArray< NCLocationPoint * > * points
 List of consecutive points. NCLocationPoint.
 

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 NCRoutePath.h.

Method Documentation

◆ head:

- (nullable NCRoutePath *) head: (float) 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.

Swift code snippet:

// Get head of route (first 10 meters)
if let headPath = path.head(10.0) {
print("Head path length: \‍(headPath.getLength()) meters")
}

Objective C code snippet:

// Get head of route (first 10 meters)
NCRoutePath *headPath = [path head:10.0];
if (headPath != nil) {
NSLog(@"Head path length: %f meters", [headPath getLength]);
}

◆ tail:

- (nullable NCRoutePath *) tail: (float) 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.

Swift code snippet:

// Get tail of route (remaining after 10 meters)
if let tailPath = path.tail(10.0) {
print("Tail path length: \‍(tailPath.getLength()) meters")
}

Objective C code snippet:

// Get tail of route (remaining after 10 meters)
NCRoutePath *tailPath = [path tail:10.0];
if (tailPath != nil) {
NSLog(@"Tail path length: %f meters", [tailPath getLength]);
}

Property Documentation

◆ events

- (NSArray<NCRouteEvent *>*) events
readnonatomicassign

List of consecutive incoming events RouteEvent.

Swift code snippet:

// Get route events
let events = path.getEvents()
print("Route has \‍(events.count) events")
for event in events {
demonstrateRouteEventUsage(event)
}

Objective C code snippet:

// Get route events
NSArray<NCRouteEvent *> *events = [path getEvents];
NSLog(@"Route has %lu events", (unsigned long)events.count);
for (int j = 0; j < events.count; j++) {
[self demonstrateRouteEventUsage:events[j]];
}

Definition at line 93 of file NCRoutePath.h.

◆ length

- (float) length
readnonatomicassign

Total lenth of the route path in meters.

Swift code snippet:

// Get route length
let length = path.getLength()
print("Route length: \‍(length) meters")

Objective C code snippet:

// Get route length
double length = [path getLength];
NSLog(@"Route length: %f meters", length);

Definition at line 79 of file NCRoutePath.h.

◆ points

- (NSArray<NCLocationPoint *>*) points
readnonatomicassign

List of consecutive points. NCLocationPoint.

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

Swift code snippet:

// Get route points
let points = path.getPoints()
print("Route has \‍(points.count) points")
for point in points {
demonstrateLocationPointUsage(point)
}

Objective C code snippet:

// Get route points
NSArray<NCLocationPoint *> *points = [path getPoints];
NSLog(@"Route has %lu points", (unsigned long)points.count);
for (int j = 0; j < points.count; j++) {
[self demonstrateLocationPointUsage:points[j]];
}

Definition at line 109 of file NCRoutePath.h.


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