@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 1.2 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{__decorate as e}from"tslib";import t from"./Analysis.js";import r from"../core/Logger.js";import{measurementLengthUnits as s}from"../core/units.js";import{property as o,subclass as i}from"../core/accessorSupport/decorators.js";import l from"../geometry/Polyline.js";import{geometryEquals as n}from"../layers/graphics/dehydratedFeatureComparison.js";let a=class extends t{constructor(e){super(e),this.type="distance-measurement",this.unit=null}set geometry(e){e?(e.paths.length>1&&r.getLogger(this).warn("Measuring polylines with multiple paths is not supported."),this._set("geometry",e.clone())):this._set("geometry",null)}get valid(){return(this.geometry?.paths?.at(0)?.length??0)>=2}clear(){this.geometry=null}equals(e){return this===e||super.equals(e)&&this.unit===e.unit&&n(this.geometry,e.geometry)}};e([o({type:["distance-measurement"],readOnly:!0})],a.prototype,"type",void 0),e([o({value:null,type:l})],a.prototype,"geometry",null),e([o({type:s,value:null})],a.prototype,"unit",void 0),e([o({readOnly:!0})],a.prototype,"valid",null),a=e([i("esri.analysis.DistanceMeasurementAnalysis")],a);const p=a;export{p as default};