@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.83 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
*/
import{_ as t}from"../../../../chunks/tslib.es6.js";import{assertIsSome as s}from"../../../../core/maybe.js";import{createAbortError as i}from"../../../../core/promiseUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import n from"../../../ViewAnimation.js";import{CameraController as o,State as r}from"./CameraController.js";let a=class extends o{constructor(){super(...arguments),this._asyncResult=null}get canStop(){return!0}set asyncResult(t){this._asyncResult&&(this._asyncResult.reject(i()),this._asyncResult=null),this.state===r.Finished||this.state===r.Stopped?(s(t),this.state===r.Finished?t.resolve():t.reject(i())):this._asyncResult=t}get asyncResult(){return this._asyncResult}onControllerStart(){this.state=r.Running,null!=this.viewAnimation&&this.viewAnimation.when((()=>this.updateStateFromViewAnimation()),(()=>this.updateStateFromViewAnimation()))}updateStateFromViewAnimation(){!this.viewAnimation||this.state!==r.Ready&&this.state!==r.Running||(this.viewAnimation.state===n.State.FINISHED?this.finish():this.viewAnimation.state===n.State.STOPPED&&(this.state=r.Stopped))}onControllerEnd(t){null==this.viewAnimation||this.viewAnimation.done||(this.state===r.Finished?this.viewAnimation.finish():this.state===r.Stopped&&this.viewAnimation.stop()),this._asyncResult&&(this.state===r.Finished?this._asyncResult.resolve():this._asyncResult.reject(i()))}finish(){this.finishController()}};a=t([e("esri.views.3d.state.controllers.AnimationController")],a);export{a as AnimationController};