setViewpointAnimatedCancelable method

CancelableOperation<bool> setViewpointAnimatedCancelable(
  1. Viewpoint viewpoint,
  2. {double? duration}
)

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

Implementation

CancelableOperation<bool> setViewpointAnimatedCancelable(Viewpoint viewpoint,
    {double? duration}) {
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_GeoView_setViewpointAsyncCombined(
        _handle, viewpoint._handle, duration, errorHandler);
  });
  return taskHandle
      .toCancelableOperation((element) => element.getValueAsBool()!);
}