UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.59 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ function t(t){const e=t.renderer,n=e?.type,o=e?.toJSON()??null;let l=null,i=!1;const a=t.attributeStorageInfo;"point-cloud-unique-value"===n||"point-cloud-stretch"===n||"point-cloud-class-breaks"===n?l=u(a,e.field):"point-cloud-rgb"===n?(l=r(a,e.field),i=null!=l):(l=r(a,"RGB"),i=null!=l);let s=null;return e?.colorModulation&&(s=u(a,e.colorModulation.field)),{rendererJSON:o,isRGBRenderer:i,primaryAttribute:l,modulationAttribute:s}}function e(t){const e=t.filters;return e?e.map((e=>({filterJSON:e.toJSON(),attributeInfo:u(t.attributeStorageInfo,e.field)}))):[]}function n(t){const e=t?.pointSizeAlgorithm;return e&&"splat"===e.type?e:null}function o(t){const e=t?.pointSizeAlgorithm;return e&&"fixed-size"===e.type?e:null}function l(t){const e=t?.pointSizeAlgorithm;return!!e?.type&&"fixed-size"===e.type}function r(t,e){for(const n of t??[])if(n.name===e&&null!=n.attributeValues&&"UInt8"===n.attributeValues.valueType&&3===n.attributeValues.valuesPerElement)return{name:e,storageInfo:n,useElevation:!1};return null}function u(t,e){for(const n of t??[])if(n.name===e){const t="embedded-elevation"===n.encoding;return t?{name:e,storageInfo:null,useElevation:t}:{name:e,storageInfo:n,useElevation:t}}return"elevation"===e?.toLowerCase()?{name:e,storageInfo:null,useElevation:!0}:null}export{u as getAttributeInfo,e as getFilterInfo,o as getFixedSizeAlgorithm,t as getRendererInfo,n as getSplatSizeAlgorithm,l as rendererUsesFixedSizes};