@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.96 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{_ as e}from"../../../chunks/tslib.es6.js";import{createTask as r}from"../../../core/asyncUtils.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{watch as t,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{updateDirectionalNodesGeneric as c,updateDirectionalNodesWithSameView as h}from"./imageNavigationUtils.js";import n from"./NavigationUIPanoramicViewModel.js";let d=class extends n{constructor(e){super(e),this.cameraHeadingThreshold=0,this.cameraPitchThreshold=0,this.preserveAngle="none"}initialize(){this.addHandles(t((()=>({nodes:this.nodes,currenNode:this.currentNode,length:this.nodes.length,currentHeading:this.currentNode?.currentHeading,currentPitch:this.currentNode?.currentPitch,preserveAngle:this.preserveAngle,cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold})),(()=>{this._compileTask?.abort(),this._compileTask=r((async e=>{s(e),this.compile()}))}),o))}compile(){const{currentNode:e,nodes:r}=this;if(e)if(r.length)switch(this.preserveAngle){case"heading":return h(e,r,this.cameraHeadingThreshold,null);case"pitch":return h(e,r,null,this.cameraPitchThreshold);case"both":return h(e,r,this.cameraHeadingThreshold,this.cameraPitchThreshold);default:return c(e,r)}else e.reset()}};e([i()],d.prototype,"cameraHeadingThreshold",void 0),e([i()],d.prototype,"cameraPitchThreshold",void 0),e([i()],d.prototype,"preserveAngle",void 0),d=e([a("esri.widgets.OrientedImageryViewer.components.NavigationUIViewModel")],d);const l=d;export{l as default};