@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 2.05 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 t from"../../core/JSONSupport.js";import{property as s}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 r from"../../geometry/Extent.js";import n from"../../geometry/Geometry.js";import i from"../../geometry/Polygon.js";import{fromJSON as a}from"../../geometry/support/jsonUtils.js";import l from"./DimensionalDefinition.js";var m;const p={base:n,key:"type",typeMap:{extent:r,polygon:i}};let u=m=class extends t{constructor(e){super(e),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:e}=this;if(null==e||0===e.length)return[];const t=new Map;e.forEach((e=>{if(!e.dimensionName)return;let s,o;if(Array.isArray(e.values[0])){const t=e.values;s=t[0][0],o=t[e.values.length-1][1]}else{const t=e.values;s=t[0],o=t[e.values.length-1]}if(t.has(e.dimensionName)){const r=t.get(e.dimensionName);r[0]=Math.min(s,r[0]),r[1]=Math.max(o,r[1])}else t.set(e.dimensionName,[s,o])}));const s=[];for(const o of t)s.push({name:o[0],extent:o[1]});return s}get variables(){const{subsetDefinitions:e}=this;if(null==e||0===e.length)return[];const t=new Set;return e.forEach((e=>{e.variableName&&t.add(e.variableName)})),[...t]}clone(){const e=this.subsetDefinitions?.map((e=>e.clone())),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new m({areaOfInterest:t,subsetDefinitions:e})}};e([s({types:p,json:{read:a,write:!0}})],u.prototype,"areaOfInterest",void 0),e([s({readOnly:!0})],u.prototype,"dimensions",null),e([s({readOnly:!0})],u.prototype,"variables",null),e([s({type:[l],json:{write:!0}})],u.prototype,"subsetDefinitions",void 0),u=m=e([o("esri.layers.support.MultidimensionalSubset")],u);export{u as default};