You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
3.6 KiB
10 lines
3.6 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
define("require exports ../../../chunks/tslib.es6 ../../../core/throttle ../../../core/unitFormatUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../Widget ../css ../support/constants ../../../chunks/componentsUtils ../../support/widgetUtils ../../support/decorators/messageBundle ../../support/jsxFactory".split(" "),function(t,e,g,u,l,m,y,z,A,v,w,h,n,x,B,q,f){e.Statistics=class extends w{constructor(a, |
|
c){super(a,c);this._updateLayout=b=>{const d=b.parentElement,k=b.style.display;d?.removeChild(b);document.body.appendChild(b);b.style.display="block";let p=80;for(const r of b.childNodes)r instanceof HTMLElement&&(p=Math.max(p,r.offsetWidth));document.body.removeChild(b);d?.appendChild(b);b.style.display=k;b.style.setProperty("--max-width",`${p}px`)};this._updateLayoutThrottled=u.throttle(this._updateLayout,100)}loadDependencies(){return x.loadCalciteComponents({icon:()=>new Promise((a,c)=>t(["../../../chunks/calcite-icon"], |
|
a,c))})}initialize(){this.addHandles(this._updateLayoutThrottled)}render(){return f.tsx("div",{afterCreate:this._updateLayout,afterUpdate:this._updateLayoutThrottled,bind:this,class:h.statisticsCss.base},this._renderStatistics())}_renderStatistics(){const a=this._messages?.statistics;return a?[this._renderDistanceStatistic("maxDistance",a.maxDistance),this._renderElevationStatistic("elevationGain",a.gain),this._renderElevationStatistic("elevationLoss",a.loss),this._renderElevationStatistic("minElevation", |
|
a.minElevation),this._renderElevationStatistic("maxElevation",a.maxElevation),this._renderElevationStatistic("avgElevation",a.avgElevation),this._renderSlopeStatistic("maxPositiveSlope","maxNegativeSlope",a.maxSlope),this._renderSlopeStatistic("avgPositiveSlope","avgNegativeSlope",a.avgSlope)]:[]}_renderDistanceStatistic(a,c){const b=n.getConfig().formatPrecision;a=this._renderValue(a,d=>l.formatDecimal(this._messagesUnits,d,this.effectiveUnits.distance,b));return this._renderStatistic(c,a)}_renderElevationStatistic(a, |
|
c){const b=n.getConfig().formatPrecision;a=this._renderValue(a,d=>l.formatDecimal(this._messagesUnits,d,this.effectiveUnits.elevation,b));return this._renderStatistic(c,a)}_renderSlopeStatistic(a,c,b){const d=n.getConfig().formatPrecision;a=f.tsx("div",{class:h.statisticsCss.slopeValue,key:"slope-up"},f.tsx("calcite-icon",{icon:"arrow-up",scale:"s"}),this._renderValue(a,k=>l.formatAngleDegrees(k,"degrees","geographic","geographic",d)),f.tsx("calcite-icon",{icon:"arrow-down",scale:"s"}),this._renderValue(c, |
|
k=>l.formatAngleDegrees(k,"degrees","geographic","geographic",d)));return this._renderStatistic(b,a)}_renderStatistic(a,c){return f.tsx("div",{class:h.statisticsCss.statistic},f.tsx("label",{class:h.statisticsCss.statisticLabel},a),f.tsx("div",{class:h.statisticsCss.statisticValue},c))}_renderValue(a,c){const b=this.line;a=(1===b.progress?b.statistics:null)?.[a];return null!=a?c(a):n.notAvailable}};g.__decorate([m.property()],e.Statistics.prototype,"effectiveUnits",void 0);g.__decorate([m.property()], |
|
e.Statistics.prototype,"line",void 0);g.__decorate([m.property(),q.messageBundle("esri/widgets/ElevationProfile/t9n/ElevationProfile")],e.Statistics.prototype,"_messages",void 0);g.__decorate([m.property(),q.messageBundle("esri/core/t9n/Units")],e.Statistics.prototype,"_messagesUnits",void 0);e.Statistics=g.__decorate([v.subclass("esri.widgets.ElevationProfile.components.Statistics")],e.Statistics);Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}); |