@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 1.8 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.19/LICENSE.txt */
import{__decorate as t}from"tslib";import{createScreenPointArray as e}from"../../../../../core/screenUtils.js";import{property as s,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{create as o,clone as i}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as n,fromPoints as m}from"../../../../../geometry/support/axisAngle.js";import{Sphere as p}from"../../../../../geometry/support/sphere.js";import{applyAll as c}from"../../../camera/constraintUtils.js";import{MomentumController as l}from"./MomentumController.js";import{applyZoomOnSphere as h,sphereOrPlanePointFromScreenPoint as a,applyRotation as u}from"../../utils/navigationUtils.js";let y=class extends l{constructor(t){super(t),this.radius=0,this.interactionType=1,this._tmpSceneCenter=o(),this._tmpZoomAxisAngle=n(),this._sphere=new p}initialize(){this._sphere.radius=this.radius}momentumStep(t,e){const s=this.momentum.valueDelta(0,t);h(this._sphere,e,s),this.constraintOptions.interactionType=1,c(this.view,e,this.constraintOptions),a(this._sphere,e,this.screenCenter,this._tmpSceneCenter),m(this.sceneCenter,this._tmpSceneCenter,this._tmpZoomAxisAngle),u(e,this._sphere.center,this._tmpZoomAxisAngle),this.constraintOptions.interactionType=4}set screenCenter(t){this._set("screenCenter",e(t[0],t[1]))}set sceneCenter(t){this._set("sceneCenter",i(t))}};t([s({constructOnly:!0})],y.prototype,"momentum",void 0),t([s({constructOnly:!0})],y.prototype,"radius",void 0),t([s({constructOnly:!0})],y.prototype,"screenCenter",null),t([s({constructOnly:!0})],y.prototype,"sceneCenter",null),y=t([r("esri.views.3d.state.controllers.momentum.ZoomSphericalMomentumController")],y);export{y as ZoomSphericalMomentumController};