createParametersWithPortalItem method

Future<RouteParameters> createParametersWithPortalItem(
  1. PortalItem portalItem
)

Imports route parameters from portal item 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:

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

Return Value: A Future that returns a RouteParameters.

Implementation

Future<RouteParameters> createParametersWithPortalItem(
    PortalItem portalItem) {
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_RouteTask_createParametersWithPortalItemAsync(
        _handle, portalItem._handle, errorHandler);
  });
  return taskHandle
      .toFuture((element) => element.getValueAsRouteParameters()!);
}