makeRoute method

  1. @override
RoutePath makeRoute(
  1. LocationPoint from,
  2. LocationPoint to
)
override

Method is used to build a route between points about evaluated RoutePath from your position to target point. from starting LocationPoint. to destination LocationPoint. Returns RoutePath from starting to destination point.

Example:

// Make route from point to point
RoutePath routePath = _routeManager!.makeRoute(startLocationPoint, endLocationPoint);
print("Route created with length: ${routePath.length} meters");

Implementation

@override
RoutePath makeRoute(LocationPoint from, LocationPoint to) {
    final _makeRouteFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
        Pointer<Void> Function(Pointer<Void>, Pointer<Void>, Pointer<Void>),
        Pointer<Void> Function(Pointer<Void>, Pointer<Void>, Pointer<Void>)
      >('navigine_sdk_flutter_RouteManager_makeRoute__From_To'));
    final _fromHandle = navigine_sdk_flutter_LocationPoint_ToFfi(from);
    final _toHandle = navigine_sdk_flutter_LocationPoint_ToFfi(to);
    final _handle = this.handle;
    final __resultHandle = _makeRouteFfi(_handle, _fromHandle, _toHandle);
    navigine_sdk_flutter_LocationPoint_ReleaseFfiHandle(_fromHandle);
    navigine_sdk_flutter_LocationPoint_ReleaseFfiHandle(_toHandle);
    final _result = navigine_sdk_flutter_RoutePath_FromFfi(__resultHandle);
    navigine_sdk_flutter_RoutePath_ReleaseFfiHandle(__resultHandle);
    return _result;
}