@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 1.75 kB
JavaScript
import{_ as t}from"../../../../chunks/tslib.es6.js";import{assertIsSome as s,isSome as i}from"../../../../core/maybe.js";import{createAbortError as e}from"../../../../core/promiseUtils.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import n from"../../../ViewAnimation.js";import{CameraController as r,State as a}from"./CameraController.js";let h=class extends r{constructor(){super(...arguments),this._asyncResult=null}get canStop(){return!0}set asyncResult(t){this._asyncResult&&(this._asyncResult.reject(e()),this._asyncResult=null),this.state===a.Finished||this.state===a.Stopped?(s(t),this.state===a.Finished?t.resolve():t.reject(e())):this._asyncResult=t}get asyncResult(){return this._asyncResult}onControllerStart(){this.state=a.Running,i(this.viewAnimation)&&this.viewAnimation.when((()=>this.updateStateFromViewAnimation()),(()=>this.updateStateFromViewAnimation()))}updateStateFromViewAnimation(){!i(this.viewAnimation)||this.state!==a.Ready&&this.state!==a.Running||(this.viewAnimation.state===n.State.FINISHED?this.finish():this.viewAnimation.state===n.State.STOPPED&&(this.state=a.Stopped))}onControllerEnd(){i(this.viewAnimation)&&!this.viewAnimation.done&&(this.state===a.Finished?this.viewAnimation.finish():this.state===a.Stopped&&this.viewAnimation.stop()),this._asyncResult&&(this.state===a.Finished?this._asyncResult.resolve():this._asyncResult.reject(e()))}finish(){this.finishController()}};h=t([o("esri.views.3d.state.controllers.AnimationController")],h);export{h as AnimationController};