UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 1.65 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as t}from"../../../../chunks/tslib.es6.js";import{clock as r}from"../../../../core/clock.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{interactingTimeout as i}from"../ViewStateManager.js";import{CameraController as s,State as a}from"./CameraController.js";import n from"../../webgl/RenderCamera.js";let c=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,r){r.copyViewFrom(this.currentCamera),this.currentCamera.copyFrom(r)}onControllerStart(t){this.state=a.Running,this.startCamera.copyFrom(t),this.currentCamera.copyFrom(t)}onControllerEnd(t){t.copyViewFrom(this.currentCamera)}commitCamera(){this._isInteractive=!0,this._interactingTimeoutHandle?.remove(),this._interactingTimeoutHandle=r.setTimeout((()=>{this._isInteractive=!1,this._interactingTimeoutHandle=void 0}),i),this.view.state.updateCamera((t=>this.stepController(0,t))),this.steppingFinished&&this.finishController()}};t([e({readOnly:!0})],c.prototype,"isInteractive",null),t([e()],c.prototype,"_isInteractive",void 0),c=t([o("esri.views.3d.state.controllers.InteractiveController")],c);export{c as InteractiveController};