UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.18 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 r from"../../../core/Accessor.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 i from"../../../geometry/Point.js";import{normalizeDegrees as s,getRelativeAngleBetweenPoints as n}from"./imageNavigationUtils.js";const a=["right","towards","left","backwards"];let c=class extends r{constructor(t){super(t),this.attributes=null,this.backwards=null,this.geometry=null,this.left=null,this.right=null,this.towards=null}get currentHeading(){return this._get("currentHeading")??0}set currentHeading(t){const r=s(t);this._set("currentHeading",r)}get currentPitch(){return this._get("currentPitch")??0}set currentPitch(t){const r=s(t);this._set("currentPitch",r)}get heading(){return this.attributes.cameraHeading}get id(){return this.attributes.objectId}get pitch(){return this.attributes.cameraPitch}get roll(){return this.attributes.cameraRoll??0}getDistanceTo(t){return this.geometry.distance(t.geometry)}getDirectionTo(t){if(!t)return null;const{geometry:{x:r,y:e},currentHeading:o}=this,{geometry:{x:i,y:c}}=t,l=n(r,e,i,c),u=s(l+o),p=Math.floor((u+45)/90)%4;return a[p]}reset(){this.towards=null,this.backwards=null,this.left=null,this.right=null}};t([e()],c.prototype,"attributes",void 0),t([e()],c.prototype,"backwards",void 0),t([e()],c.prototype,"currentHeading",null),t([e()],c.prototype,"currentPitch",null),t([e({type:i})],c.prototype,"geometry",void 0),t([e({readOnly:!0})],c.prototype,"heading",null),t([e({readOnly:!0})],c.prototype,"id",null),t([e()],c.prototype,"left",void 0),t([e({readOnly:!0})],c.prototype,"pitch",null),t([e()],c.prototype,"right",void 0),t([e({readOnly:!0})],c.prototype,"roll",null),t([e()],c.prototype,"towards",void 0),c=t([o("esri.widgets.OrientedImageryViewer.components.NavigationNode")],c);const l=c;export{l as default};