setViewpointWithDurationAndCurveCancelable method

CancelableOperation<bool> setViewpointWithDurationAndCurveCancelable(
  1. {required Viewpoint viewpoint,
  2. required double durationSeconds,
  3. required AnimationCurve curve}
)

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

Implementation

CancelableOperation<bool> setViewpointWithDurationAndCurveCancelable(
    {required Viewpoint viewpoint,
    required double durationSeconds,
    required AnimationCurve curve}) {
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_MapView_setViewpointWithDurationAndCurveAsync(
        _handle,
        viewpoint._handle,
        durationSeconds,
        curve.coreValue,
        errorHandler);
  });
  return taskHandle
      .toCancelableOperation((element) => element.getValueAsBool()!);
}