@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 3.06 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 r from"../../PopupTemplate.js";import{clone as o}from"../../core/lang.js";import{setDeepValue as t}from"../../core/object.js";import{toPt as i}from"../../core/screenUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{ensureNumber as p}from"../../core/accessorSupport/ensureType.js";import{enumeration as n}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../../core/accessorSupport/decorators/writer.js";import m from"./AggregateField.js";import{labelsVisible as c,popupEnabled as u}from"./commonProperties.js";import{createDefaultRenderer as f}from"./featureLayerUtils.js";import{FeatureReduction as y}from"./FeatureReduction.js";import b from"./LabelClass.js";import{read as h}from"../../renderers/support/jsonUtils.js";import{rendererTypes as g}from"../../renderers/support/typeUtils.js";var j;let v=j=class extends y{constructor(e){super(e),this.type="binning",this.binType="geohash",this.fixedBinLevel=null,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.size=i("12px"),this.fields=[],this.renderer=null}writeFields(e,r,o){const i=e.filter((e=>"avg_angle"!==e.statisticType)).map((e=>e.toJSON()));t(o,i,r)}readRenderer(e,r,o){const t=r.drawingInfo?.renderer;return t?h(t,r,o)??void 0:f(r,o)}clone(){return new j({fields:o(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:o(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:o(this.popupTemplate),renderer:o(this.renderer),binType:o(this.binType),size:this.size})}};e([n({binning:"binning"})],v.prototype,"type",void 0),e([n({geohash:"geohash",square:"square"}),s({type:["geohash","square"]})],v.prototype,"binType",void 0),e([s({type:Number,json:{write:!0}})],v.prototype,"fixedBinLevel",void 0),e([s({type:[b],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],v.prototype,"labelingInfo",void 0),e([s(c)],v.prototype,"labelsVisible",void 0),e([s({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],v.prototype,"maxScale",void 0),e([s(u)],v.prototype,"popupEnabled",void 0),e([s({type:r,json:{name:"popupInfo",write:!0}})],v.prototype,"popupTemplate",void 0),e([s({cast:e=>"auto"===e?e:p(i(e))})],v.prototype,"size",void 0),e([s({type:[m],json:{write:!0}})],v.prototype,"fields",void 0),e([d("fields")],v.prototype,"writeFields",null),e([s({types:g,json:{write:{target:"drawingInfo.renderer"}}})],v.prototype,"renderer",void 0),e([a("renderer",["drawingInfo.renderer"])],v.prototype,"readRenderer",null),v=j=e([l("esri.layers.support.FeatureReductionBinning")],v);export{v as default};