UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.5 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{_ as r}from"../../../../chunks/tslib.es6.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{interactingTimeout as o}from"../ViewStateManager.js";import{CameraController as s,State as a}from"./CameraController.js";import i from"../../webgl/RenderCamera.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};