@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 1.36 kB
JavaScript
import{_ as r}from"../../../../chunks/tslib.es6.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{INTERACTING_TIMEOUT as o}from"../ViewStateManager.js";import{CameraController as s,State as a}from"./CameraController.js";import{Camera as i}from"../../webgl-engine/lib/Camera.js";let n=class extends s{constructor(){super(...arguments),this.startCamera=new i,this.currentCamera=new i,this._lastInteraction=0}get isInteractive(){return performance.now()-this._lastInteraction<o}stepController(r,t){t.copyViewFrom(this.currentCamera),this.currentCamera.copyFrom(t)}onControllerStart(r){this.state=a.Running,this.startCamera.copyFrom(r),this.currentCamera.copyFrom(r)}onControllerEnd(r){r.copyViewFrom(this.currentCamera)}commitCamera(){this._lastInteraction=performance.now(),setTimeout((()=>this.notifyChange("isInteractive")),o),this.view.state.updateCamera((r=>this.stepController(0,r))),this.steppingFinished&&this.finishController()}};r([t({readOnly:!0})],n.prototype,"isInteractive",null),r([t()],n.prototype,"_lastInteraction",void 0),n=r([e("esri.views.3d.state.controllers.InteractiveController")],n);export{n as InteractiveController};