12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import s from"../support/AggregateField.js";import{featureReductionProperty as o}from"../support/featureReductionUtils.js";import{createClusterRenderer as i}from"../../views/2d/layers/support/clusterUtils.js";const n=n=>{let u=class extends n{constructor(...e){super(...e),this.own(this.watch("renderer",(()=>{if(this.featureReduction){const e=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",e)}}),!0))}set featureReduction(e){const r=this._normalizeFeatureReduction(e);this._set("featureReduction",r)}set renderer(e){}_normalizeFeatureReduction(e){if("cluster"!==e?.type)return e;const r=e.clone(),t=[new s({name:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],o=(r.fields??[]).filter((e=>!e.isAutoGenerated));if(e.renderer&&!e.renderer.authoringInfo?.isAutoGenerated)return r.fields=[...t,...o],r;if(e.symbol)return r.fields=[...t,...o],r.renderer=null,r;if(!this.renderer)return e;const n=i(t,this.renderer,e,null,!1);return r.fields=[...t,...o],r.renderer=n,r}};return e([r(o)],u.prototype,"featureReduction",null),u=e([t("esri.layers.mixins.FeatureReductionLayer")],u),u};export{n as FeatureReductionLayer};
|