@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 1.35 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.19/LICENSE.txt */
import{__decorate as t}from"tslib";import{clock as e}from"../../../../core/clock.js";import{Seconds as r}from"../../../../core/time.js";import{property as i,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{interactingTimeout as a}from"../ViewStateManager.js";import{CameraController as s}from"./CameraController.js";import n from"../../webgl/RenderCamera.js";let m=class extends s{constructor(){super(...arguments),this.startCamera=new n,this.currentCamera=new n,this._isInteractive=!1,this._interactingTimeoutHandle=void 0}get isInteractive(){return this._isInteractive}stepController(t,e){e.copyViewFrom(this.currentCamera),this.currentCamera.copyFrom(e)}onControllerStart(t){this.state=2,this.startCamera.copyFrom(t),this.currentCamera.copyFrom(t)}onControllerEnd(t){t.copyViewFrom(this.currentCamera)}commitCamera(){this._isInteractive=!0,this._interactingTimeoutHandle?.remove(),this._interactingTimeoutHandle=e.setTimeout(()=>{this._isInteractive=!1,this._interactingTimeoutHandle=void 0},a),this.view.state.updateCamera(t=>this.stepController(r(0),t))}};t([i({readOnly:!0})],m.prototype,"isInteractive",null),t([i()],m.prototype,"_isInteractive",void 0),m=t([o("esri.views.3d.state.controllers.InteractiveController")],m);export{m as InteractiveController};