createRouteResultWithFeatureCollectionCancelable static method

CancelableOperation<RouteResult> createRouteResultWithFeatureCollectionCancelable(
  1. {required FeatureCollection collection}
)

Cancelable version of createRouteResultWithFeatureCollection. See that method for more information.

Implementation

static CancelableOperation<RouteResult>
    createRouteResultWithFeatureCollectionCancelable(
        {required FeatureCollection collection}) {
  _initializeArcGISEnvironmentIfNeeded();
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore
        .RT_RouteTask_createRouteResultWithFeatureCollectionAsync(
            collection._handle, errorHandler);
  });
  return taskHandle
      .toCancelableOperation((element) => element.getValueAsRouteResult()!);
}