LengthDimension.js 1.6 KB

12345
  1. /*
  2. All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. See https://js.arcgis.com/4.24/esri/copyright.txt for details.
  4. */
  5. import{_ as t}from"../chunks/tslib.es6.js";import"../geometry.js";import{lengthDimensionAxes as o}from"./dimensionUtils.js";import{Clonable as r}from"../core/Clonable.js";import{cyclicalDegrees as e}from"../core/Cyclical.js";import{isNone as s,isSome as i}from"../core/maybe.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as p}from"../core/accessorSupport/decorators/cast.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{ensureNumber as a}from"../core/accessorSupport/ensureType.js";import l from"../geometry/Extent.js";import c from"../geometry/Point.js";let y=class extends r{constructor(t){super(t),this.type="length",this.startPoint=null,this.endPoint=null,this.axis="horizontal",this.offset=0,this.heading=0}get extent(){if(s(this.startPoint))return null;const t=l.fromPoint(this.startPoint);return i(this.endPoint)&&t.union(l.fromPoint(this.endPoint)),t}};t([n({type:["length"]})],y.prototype,"type",void 0),t([n({type:c})],y.prototype,"startPoint",void 0),t([n({type:c})],y.prototype,"endPoint",void 0),t([n({type:o,nonNullable:!0})],y.prototype,"axis",void 0),t([n({type:Number,nonNullable:!0})],y.prototype,"offset",void 0),t([n({type:Number,nonNullable:!0}),p((t=>e.normalize(a(t),0,!0)))],y.prototype,"heading",void 0),t([n({readOnly:!0})],y.prototype,"extent",null),y=t([m("esri.analysis.LengthDimension")],y);const u=y;export{u as default};