createParameters method

Future<RouteParameters> createParameters({
  1. required FeatureCollection collection,
})

Imports route parameters from feature collection and then adjusts imported parameters to current Route task.

Travel mode would be null if it could not be created from the route layer settings for the route task's network. In case if travel mode is null then client can override it by another travel mode (for example obtained from RouteTaskInfo). Accumulate attributes from Route Info table going to be applied only if they exist in transportation network restriction and cost attributes.

Parameters:

  • collection — The feature collection object that contains stops, route info, and barriers tables. Stops table is required.

Return Value: A Future that returns a RouteParameters.

Implementation

Future<RouteParameters> createParameters({
  required FeatureCollection collection,
}) {
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_RouteTask_createParametersAsync(
      _handle,
      collection._handle,
      errorHandler,
    );
  });
  return taskHandle.toFuture(
    (element) => element.getValueAsRouteParameters()!,
  );
}