@arcgis/core 5.1.0-next.46 → 5.1.0-next.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{521a671182b0f79e3624.js → 193775b3b7de8f5dc578.js} +1 -1
- package/assets/esri/core/workers/chunks/{c0ecb68387e342dddf58.js → 25509953f19fbc4949a1.js} +1 -1
- package/assets/esri/core/workers/chunks/2669a7195f1de21a9cf3.js +1 -0
- package/assets/esri/core/workers/chunks/36425d29aaa5852cb41d.js +1 -0
- package/assets/esri/core/workers/chunks/440a650ed0867a16f559.js +1 -0
- package/assets/esri/core/workers/chunks/{aa367ca7f8326fd67881.js → 4afddb66242438b38df0.js} +1 -1
- package/assets/esri/core/workers/chunks/5344919fc6e8050450f1.js +1 -0
- package/assets/esri/core/workers/chunks/53c149bca42595b7dd1e.js +1 -0
- package/assets/esri/core/workers/chunks/{6afdaa6c4555c467dca7.js → 54420b66fd53d6e19ba5.js} +1 -1
- package/assets/esri/core/workers/chunks/797bf402489b3677a5f7.js +1 -0
- package/assets/esri/core/workers/chunks/{5c830cce32710d70dfa6.js → 7dba4121cdd20dbc4b20.js} +1 -1
- package/assets/esri/core/workers/chunks/947a715b608c8affd812.js +1 -0
- package/assets/esri/core/workers/chunks/{ce0a6bc9df30af778ac9.js → 9f7b5749f3ceca8d5978.js} +12 -9
- package/assets/esri/core/workers/chunks/aa69cbaa38b49677ddff.js +1 -0
- package/assets/esri/core/workers/chunks/{beb53b372d356800f333.js → ab414a60808ea05a63e6.js} +1 -1
- package/assets/esri/core/workers/chunks/b98dd9fc9a7e3ff6bd49.js +1 -0
- package/assets/esri/core/workers/chunks/cb8c17daec7055bf99cc.js +1 -0
- package/assets/esri/core/workers/chunks/cd491c37ba1ac381178c.js +1 -0
- package/assets/esri/core/workers/chunks/{a9f35127c3f5bf42036b.js → de359f89e03da18999fc.js} +1 -1
- package/chunks/Fog.glsl.js +3 -3
- package/chunks/GlowComposition.glsl.js +5 -3
- package/chunks/OITBlend.glsl.js +2 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/workers/Connection.js +1 -1
- package/core/workers/WorkerHandle.js +1 -1
- package/core/workers/workers.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/Layer.d.ts +2 -1
- package/layers/Lyr3DWorkerHandle.js +1 -1
- package/layers/ParquetLayer.d.ts +23 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/RasterJobHandler.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/package.json +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/support/revision.js +1 -1
- package/time/TimeExtent.d.ts +34 -0
- package/time/TimeInterval.d.ts +15 -0
- package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/Highlights.js +1 -1
- package/views/3d/layers/i3s/Intersector.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialGlobalParameters.js +2 -0
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/fog/FogTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowBlurTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +2 -0
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/Dithering.glsl.js +4 -0
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +11 -10
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
- package/views/SceneView.d.ts +2 -1
- package/views/SceneView.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/types.d.ts +33 -2
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0601c316da0256a60538.js +0 -1
- package/assets/esri/core/workers/chunks/13d55e3c9aea04116eaa.js +0 -1
- package/assets/esri/core/workers/chunks/54c1d31e1efab765ee7a.js +0 -1
- package/assets/esri/core/workers/chunks/5b515b5741733bcb4645.js +0 -1
- package/assets/esri/core/workers/chunks/7f07f490c6fcc794c8d9.js +0 -1
- package/assets/esri/core/workers/chunks/abcb39ad1e2d54710766.js +0 -1
- package/assets/esri/core/workers/chunks/c2aa3b1344b42a904234.js +0 -1
- package/assets/esri/core/workers/chunks/cf5e4cf9b1aa37eeb6b0.js +0 -1
- package/assets/esri/core/workers/chunks/e63046a9567d84228644.js +0 -1
- package/assets/esri/core/workers/chunks/f4ec2dcdc4bbf7dbcc94.js +0 -1
- package/assets/esri/core/workers/chunks/fce8d4ff920baf8856e6.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../request.js";import{isSome as n}from"../../core/arrayUtils.js";import{JSONSupportMixin as i}from"../../core/JSONSupport.js";import{Loadable as s}from"../../core/Loadable.js";import{property as o,subclass as r}from"../../core/accessorSupport/decorators.js";import{parse as a}from"./arcgisLayerUrl.js";import l from"./Contingency.js";import u from"./ContingencyConstraintViolation.js";import c from"./ContingentValue.js";import p from"./ContingentValuesResult.js";import d from"./FieldGroup.js";import{isStringField as f,isDateField as y}from"./fieldUtils.js";import m from"./Subtype.js";import{getNormalizedFeatureTypeInfo as g}from"../../widgets/FeatureForm/featureFormUtils.js";var h;let V=h=class extends(i(s)){constructor(e){super(e),this.request=t,this.fieldGroups=null,this.fieldGroupDefinitions=null}initialize(){}get loaded(){return super.loaded}get subtypeFieldName(){return g(this.layer).typeFieldName}static async createLoadedLayerContingentValuesCache(e){await e.load();const t=e.sourceJSON;if(void 0===e.layerId)return null;const n=t?.hasContingentValuesDefinition;if(n)return new h({layer:e}).load();if(void 0===n){const t=a(e.url);if(null==t)return null;const n=t.url.path;if((await C(n)).supportsQueryDataElements){const t=e.layerId.toString(),i=await x(n,t);if(i){const t=i.map(t=>({name:t.name,isEditingRestrictive:t.isEditingRestrictive,fields:t.fieldNames.names.map(t=>e.fieldsIndex.normalizeFieldName(t))}));return new h({layer:e,fieldGroupDefinitions:t}).load()}}}return null}async load(e){const t=this.layer.load(e).then(()=>this._initializeContingentValues(this.fieldGroupDefinitions,e));return this.addResolvingPromise(t),this}validateContingencyConstraints(e,t){const n=Object.keys(e),i=[],s=[];for(const o of this.fieldGroups){const r=o.isEditingRestrictive?"error":"warning";if(t&&!o.fields.some(e=>t.includes(e)))continue;if(!o.fields.every(e=>n.includes(e))){s.push(new u({fieldGroup:o,type:r}));continue}let a=!1;const l=e[this.subtypeFieldName],c=o.contingencies.filter(e=>!(!e.isRetired&&e.subtype)||e.subtype.code===l);if(0!==c.length){for(const t of c){let n=!0;for(const i in t.values){const s=t.values[i];if("any"!==s.objectType)if("null"===s.objectType){if(null!=e[i]){n=!1;break}}else if("code"===s.objectType){if(e[i]!==s.codedValue.code){n=!1;break}}else if("range"===s.objectType){const t=e[i];if(t<s.minValue||t>s.maxValue){n=!1;break}}}if(n){a=!0;break}}a||i.push(new u({fieldGroup:o,type:r}))}}return{invalid:i,incomplete:s}}getContingentValues(e,t,n=!1){const i=e[this.subtypeFieldName],s=null!=i,o={};let r=[];const a=this.fieldGroups.filter(e=>e.fields.includes(t));r.push(new c({objectType:"any"}));for(const l of a){let a=[];const u=l.contingencies.filter(e=>!(e.isRetired||e.subtype&&s&&e.subtype.code!==i));let c=!1;const p={};for(const n of u){let i,s=!0;for(const o in n.values){const r=n.values[o];if(t!==o){if(void 0!==e[o]&&"any"!==r.objectType)if("null"===r.objectType)null!==e[o]&&(s=!1);else if("code"===r.objectType)e[o]!==r.codedValue.code&&(s=!1);else if("range"===r.objectType){const t=e[o];(t<r.minValue||t>r.maxValue)&&(s=!1)}}else i=r,c=c||"range"===r.objectType}if(i&&s){if("any"===i.objectType){a.length=0,a.push(i);break}const e=b(i);p[e]||a.push(i),p[e]=!0}}c&&(a=j(a)),o[l.name]=a,r=n?G(r,a):[]}return 1===a.length&&n&&(r=[]),new p({contingentValuesAllGroups:r,contingentValuesByFieldGroup:o})}async _initializeContingentValues(e,t){const n=e??await this._fetchFieldGroupDefs(t);if(0===n.length)return void(this.fieldGroups=[]);const i=await this._fetchContingentValues(n,t);this.fieldGroups=i}async _fetchFieldGroupDefs(e){if(void 0===this.layer.layerId)return[];const t=this.layer.sourceJSON,n=this.layer.layerId.toString(),i=a(this.layer.url).url.path;if(t?.hasContingentValuesDefinition){return(await v(i,n,e)).map(e=>({name:e.name,isEditingRestrictive:e.restrictive,fields:e.fields.map(e=>this.layer.fieldsIndex.normalizeFieldName(e))}))}return void 0!==t?.hasContingentValuesDefinition?[]:C(i,e).then(async t=>{if(t.supportsQueryDataElements){return(await x(i,n,e)).map(e=>({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fieldNames.names.map(e=>this.layer.fieldsIndex.normalizeFieldName(e))}))}return[]})}async _fetchContingentValues(e,t){if(void 0===this.layer.layerId)return[];const n=this.layer.sourceJSON,i=this.layer.layerId.toString(),s=a(this.layer.url).url.path;if(n?.hasContingentValuesDefinition){const n=await S(s,i,t);return this._constructFieldGroupsAGOL(e,n)}const o=await F(s,i,t);return this._constructFieldGroupsEnterprise(e,o)}_constructFieldGroupsAGOL(e,t){return e.map(e=>{const n=t.contingentValuesDefinition.fieldGroups.find(t=>t.name===e.name);if(n){let i=[];return i=t.contingentValuesDefinition.hasSubType?this._parseAGOLFieldGroupSubtype(e,t,n.subTypes):this._parseAGOLFieldGroup(e,t,n.contingentValues),new d({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fields,contingencies:i})}return null}).filter(n)}_parseAGOLFieldGroupSubtype(e,t,n){let i=[];return n?.forEach(n=>{const s=this._getSubtypeAGOL(n.name);i=i.concat(this._parseAGOLFieldGroup(e,t,n.contingentValues,s))}),i}_parseAGOLFieldGroup(e,t,n,i=null){const s=[];for(const o of n??[]){const n=this._parseAGOLContingency(o,e,t,i);s.push(n)}return s}_parseAGOLContingency(e,t,n,i){const s=e.id,o=!!e.retired&&1===e.retired,r={};for(let a=0,l=0;a<t.fields.length;a++){const s=t.fields[a],o=n.typeCodes[e.types[a]];if("Code"===o){let t=e.values[l];l++;const o=this._getDomain(i,s),a=this.layer.getField(s);if("string"===a?.type){const e=n.stringDicts.find(e=>e.domain===o?.name);e&&(t=e.entries[t])}const u=o?.codedValues.find(e=>e.code===t),p=new c({codedValue:u,objectType:"code"});r[s]=p}else if("Range"===o){const t=e.values[l];l++;const n=t.range[0],i=t.range[1],o=new c({minValue:n,maxValue:i,objectType:"range"});r[s]=o}else if("Any"===o){const e=new c({objectType:"any"});r[s]=e}else{const e=new c({objectType:"null"});r[s]=e}}return new l({id:s,isRetired:o,subtype:i,values:r})}_constructFieldGroupsEnterprise(e,t){const i=t.fieldGroups;return e.map(e=>{const n=i.find(t=>t.name===e.name);if(n){const i=n.contingencies.map(n=>{const i=n.id,s=n.isRetired||!1,o=this._getSubtypeEnterprise(n.subtypeCode),r={};for(let a=0;a<e.fields.length;a++){const i=e.fields[a];let s=n.values[a];if("number"==typeof s||"string"==typeof s){const e=this._getDomain(o,i),n=this.layer.getField(i);if(f(n))s=t.stringDictionary[s];else if(y(n)){const e=new Date(`${s}+00:00`);s=e.getTime()}const a=e?.codedValues.find(e=>e.code===s),l=new c({codedValue:a,objectType:"code"});r[i]=l}else if("object"==typeof s){const e=s.minValue,t=s.maxValue,n=new c({minValue:e,maxValue:t,objectType:"range"});r[i]=n}else if(s){const e=new c({objectType:"any"});r[i]=e}else{const e=new c({objectType:"null"});r[i]=e}}return new l({id:i,isRetired:s,subtype:o,values:r})});return new d({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fields,contingencies:i})}return null}).filter(n)}_getSubtypeEnterprise(e){const t=this.layer.sourceJSON;let n;if(t?.subtypes){const i=t.subtypes.find(t=>t.code===e);n=m.fromJSON(i)}return n||null}_getSubtypeAGOL(e){const t=this.layer.sourceJSON;let n;if(t?.subtypes){const i=t.subtypes.find(t=>t.name===e);n=m.fromJSON(i)}return n||null}_getDomain(e,t){const n=e?O(e,t):this.layer.getFieldDomain(t);return"inherited"===n?.type?this.layer.getFieldDomain(t):n}};function b(e){switch(e.objectType){case"any":return"@any@";case"null":return"@null@";case"code":return e.codedValue.name+e.codedValue.code.toString();case"range":return e.minValue.toString()+"-"+e.maxValue.toString()}}function j(e){let t,n;e.sort((e,t)=>"null"===e.objectType?-1:"null"===t.objectType?1:e.minValue-t.minValue);const i=[];for(const s of e)"null"!==s.objectType?null!=t&&null!=n?n<s.minValue?(i.push(new c({objectType:"range",minValue:t,maxValue:n})),t=s.minValue,n=s.maxValue):n<s.maxValue&&(n=s.maxValue):(t=s.minValue,n=s.maxValue):i.push(s);return i.push(new c({objectType:"range",minValue:t,maxValue:n})),i}function T(e,t){const n=[];let i,s=0;for(const o of e)for(;s<t.length;s++){const e=t[s];if("null"===o.objectType&&"null"===e.objectType)n.push(new c({objectType:"null"}));else{if("null"===o.objectType)break;if("null"===e.objectType)continue}if(o.maxValue<e.minValue)break;if(o.maxValue===e.minValue){n.push(new c({objectType:"range",minValue:o.maxValue,maxValue:e.minValue}));break}if(!(o.minValue>e.maxValue))if(o.minValue!==e.maxValue){if(i=o.minValue>e.minValue?o.minValue:e.minValue,o.maxValue<e.maxValue){n.push(new c({objectType:"range",minValue:i,maxValue:o.maxValue}));break}n.push(new c({objectType:"range",minValue:i,maxValue:e.maxValue}))}else n.push(new c({objectType:"range",minValue:o.minValue,maxValue:e.maxValue}))}return n}function w(e,t){const n=[];for(const i of e)t.some(e=>{if(i.objectType===e.objectType)switch(i.objectType){case"any":case"null":return!0;case"code":return i.codedValue.code===e.codedValue.code&&i.codedValue.name===e.codedValue.name}return!1})&&n.push(i);return n}function G(e,t){if(0===e.length||0===t.length)return[];if("any"===e[0].objectType)return t;if("any"===t[0].objectType)return e;const n="range"===e[0].objectType||"range"===e[1]?.objectType,i="range"===t[0].objectType||"range"===t[1]?.objectType;return n||i?T(e,t):w(e,t)}async function v(e,n,i){return t(`${e}/${n}/fieldgroups`,{responseType:"json",query:{f:"json"},...i}).then(e=>e.data.fieldGroups??[])}async function x(e,n,i){return t(`${e}/queryDataElements`,{responseType:"json",query:{layers:JSON.stringify([n]),f:"json"},...i}).then(e=>e.data.layerDataElements?.[0].dataElement.fieldGroups??[])}async function C(e,n){return t(e,{responseType:"json",query:{f:"json"},...n}).then(e=>e.data)}async function F(e,n,i){return t(`${e}/queryContingentValues`,{responseType:"json",query:{layers:JSON.stringify([n]),f:"json"},...i}).then(e=>e.data.contingentValueSets?.[0])}async function S(e,n,i){return t(`${e}/${n}/contingentValues`,{responseType:"json",query:{f:"json"},...i}).then(e=>e.data)}function O(e,t){const n=e.domains;if(n){const[e,i]=Object.entries(n).find(([e])=>e.trim().toLowerCase()===t.trim().toLowerCase())||[];return i||null}return null}e([o({constructOnly:!0})],V.prototype,"layer",void 0),e([o({constructOnly:!0})],V.prototype,"request",void 0),e([o({type:[d]})],V.prototype,"fieldGroups",void 0),e([o({constructOnly:!0})],V.prototype,"fieldGroupDefinitions",void 0),e([o()],V.prototype,"subtypeFieldName",null),V=h=e([r("esri.layers.support.LayerContingentValuesCache")],V);const D=V;export{D as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../request.js";import{isSome as n}from"../../core/arrayUtils.js";import{JSONSupportMixin as i}from"../../core/JSONSupport.js";import{Loadable as s}from"../../core/Loadable.js";import{property as o,subclass as r}from"../../core/accessorSupport/decorators.js";import{parse as a}from"./arcgisLayerUrl.js";import l from"./Contingency.js";import u from"./ContingencyConstraintViolation.js";import c from"./ContingentValue.js";import p from"./ContingentValuesResult.js";import d from"./FieldGroup.js";import{isStringField as f,isDateField as y}from"./fieldUtils.js";import m from"./Subtype.js";import{getNormalizedFeatureTypeInfo as g}from"../../widgets/FeatureForm/featureFormUtils.js";var h;let V=h=class extends(i(s)){constructor(e){super(e),this.request=t,this.fieldGroups=null,this.fieldGroupDefinitions=null}initialize(){}get loaded(){return super.loaded}get subtypeFieldName(){return g(this.layer).typeFieldName}static async createLoadedLayerContingentValuesCache(e,t){await e.load();const n=e.sourceJSON;if(void 0===e.layerId)return null;const i=n?.hasContingentValuesDefinition;if(i)return new h({layer:e}).load(t);if(void 0===i){const n=a(e.url);if(null==n)return null;const i=n.url.path;if((await C(i,t)).supportsQueryDataElements){const n=e.layerId.toString(),s=await x(i,n,t);if(s){const n=s.map(t=>({name:t.name,isEditingRestrictive:t.isEditingRestrictive,fields:t.fieldNames.names.map(t=>e.fieldsIndex.normalizeFieldName(t))}));return new h({layer:e,fieldGroupDefinitions:n}).load(t)}}}return null}async load(e){const t=this.layer.load(e).then(()=>this._initializeContingentValues(this.fieldGroupDefinitions,e));return this.addResolvingPromise(t),this}validateContingencyConstraints(e,t){const n=Object.keys(e),i=[],s=[];for(const o of this.fieldGroups){const r=o.isEditingRestrictive?"error":"warning";if(t&&!o.fields.some(e=>t.includes(e)))continue;if(!o.fields.every(e=>n.includes(e))){s.push(new u({fieldGroup:o,type:r}));continue}let a=!1;const l=e[this.subtypeFieldName],c=o.contingencies.filter(e=>!(!e.isRetired&&e.subtype)||e.subtype.code===l);if(0!==c.length){for(const t of c){let n=!0;for(const i in t.values){const s=t.values[i];if("any"!==s.objectType)if("null"===s.objectType){if(null!=e[i]){n=!1;break}}else if("code"===s.objectType){if(e[i]!==s.codedValue.code){n=!1;break}}else if("range"===s.objectType){const t=e[i];if(t<s.minValue||t>s.maxValue){n=!1;break}}}if(n){a=!0;break}}a||i.push(new u({fieldGroup:o,type:r}))}}return{invalid:i,incomplete:s}}getContingentValues(e,t,n=!1){const i=e[this.subtypeFieldName],s=null!=i,o={};let r=[];const a=this.fieldGroups.filter(e=>e.fields.includes(t));r.push(new c({objectType:"any"}));for(const l of a){let a=[];const u=l.contingencies.filter(e=>!(e.isRetired||e.subtype&&s&&e.subtype.code!==i));let c=!1;const p={};for(const n of u){let i,s=!0;for(const o in n.values){const r=n.values[o];if(t!==o){if(void 0!==e[o]&&"any"!==r.objectType)if("null"===r.objectType)null!==e[o]&&(s=!1);else if("code"===r.objectType)e[o]!==r.codedValue.code&&(s=!1);else if("range"===r.objectType){const t=e[o];(t<r.minValue||t>r.maxValue)&&(s=!1)}}else i=r,c=c||"range"===r.objectType}if(i&&s){if("any"===i.objectType){a.length=0,a.push(i);break}const e=b(i);p[e]||a.push(i),p[e]=!0}}c&&(a=j(a)),o[l.name]=a,r=n?G(r,a):[]}return 1===a.length&&n&&(r=[]),new p({contingentValuesAllGroups:r,contingentValuesByFieldGroup:o})}async _initializeContingentValues(e,t){const n=e??await this._fetchFieldGroupDefs(t);if(0===n.length)return void(this.fieldGroups=[]);const i=await this._fetchContingentValues(n,t);this.fieldGroups=i}async _fetchFieldGroupDefs(e){if(void 0===this.layer.layerId)return[];const t=this.layer.sourceJSON,n=this.layer.layerId.toString(),i=a(this.layer.url).url.path;if(t?.hasContingentValuesDefinition){return(await v(i,n,e)).map(e=>({name:e.name,isEditingRestrictive:e.restrictive,fields:e.fields.map(e=>this.layer.fieldsIndex.normalizeFieldName(e))}))}return void 0!==t?.hasContingentValuesDefinition?[]:C(i,e).then(async t=>{if(t.supportsQueryDataElements){return(await x(i,n,e)).map(e=>({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fieldNames.names.map(e=>this.layer.fieldsIndex.normalizeFieldName(e))}))}return[]})}async _fetchContingentValues(e,t){if(void 0===this.layer.layerId)return[];const n=this.layer.sourceJSON,i=this.layer.layerId.toString(),s=a(this.layer.url).url.path;if(n?.hasContingentValuesDefinition){const n=await S(s,i,t);return this._constructFieldGroupsAGOL(e,n)}const o=await F(s,i,t);return this._constructFieldGroupsEnterprise(e,o)}_constructFieldGroupsAGOL(e,t){return e.map(e=>{const n=t.contingentValuesDefinition.fieldGroups.find(t=>t.name===e.name);if(n){let i=[];return i=t.contingentValuesDefinition.hasSubType?this._parseAGOLFieldGroupSubtype(e,t,n.subTypes):this._parseAGOLFieldGroup(e,t,n.contingentValues),new d({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fields,contingencies:i})}return null}).filter(n)}_parseAGOLFieldGroupSubtype(e,t,n){let i=[];return n?.forEach(n=>{const s=this._getSubtypeAGOL(n.name);i=i.concat(this._parseAGOLFieldGroup(e,t,n.contingentValues,s))}),i}_parseAGOLFieldGroup(e,t,n,i=null){const s=[];for(const o of n??[]){const n=this._parseAGOLContingency(o,e,t,i);s.push(n)}return s}_parseAGOLContingency(e,t,n,i){const s=e.id,o=!!e.retired&&1===e.retired,r={};for(let a=0,l=0;a<t.fields.length;a++){const s=t.fields[a],o=n.typeCodes[e.types[a]];if("Code"===o){let t=e.values[l];l++;const o=this._getDomain(i,s),a=this.layer.getField(s);if("string"===a?.type){const e=n.stringDicts.find(e=>e.domain===o?.name);e&&(t=e.entries[t])}const u=o?.codedValues.find(e=>e.code===t),p=new c({codedValue:u,objectType:"code"});r[s]=p}else if("Range"===o){const t=e.values[l];l++;const n=t.range[0],i=t.range[1],o=new c({minValue:n,maxValue:i,objectType:"range"});r[s]=o}else if("Any"===o){const e=new c({objectType:"any"});r[s]=e}else{const e=new c({objectType:"null"});r[s]=e}}return new l({id:s,isRetired:o,subtype:i,values:r})}_constructFieldGroupsEnterprise(e,t){const i=t.fieldGroups;return e.map(e=>{const n=i.find(t=>t.name===e.name);if(n){const i=n.contingencies.map(n=>{const i=n.id,s=n.isRetired||!1,o=this._getSubtypeEnterprise(n.subtypeCode),r={};for(let a=0;a<e.fields.length;a++){const i=e.fields[a];let s=n.values[a];if("number"==typeof s||"string"==typeof s){const e=this._getDomain(o,i),n=this.layer.getField(i);if(f(n))s=t.stringDictionary[s];else if(y(n)){const e=new Date(`${s}+00:00`);s=e.getTime()}const a=e?.codedValues.find(e=>e.code===s),l=new c({codedValue:a,objectType:"code"});r[i]=l}else if("object"==typeof s){const e=s.minValue,t=s.maxValue,n=new c({minValue:e,maxValue:t,objectType:"range"});r[i]=n}else if(s){const e=new c({objectType:"any"});r[i]=e}else{const e=new c({objectType:"null"});r[i]=e}}return new l({id:i,isRetired:s,subtype:o,values:r})});return new d({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fields,contingencies:i})}return null}).filter(n)}_getSubtypeEnterprise(e){const t=this.layer.sourceJSON;let n;if(t?.subtypes){const i=t.subtypes.find(t=>t.code===e);n=m.fromJSON(i)}return n||null}_getSubtypeAGOL(e){const t=this.layer.sourceJSON;let n;if(t?.subtypes){const i=t.subtypes.find(t=>t.name===e);n=m.fromJSON(i)}return n||null}_getDomain(e,t){const n=e?O(e,t):this.layer.getFieldDomain(t);return"inherited"===n?.type?this.layer.getFieldDomain(t):n}};function b(e){switch(e.objectType){case"any":return"@any@";case"null":return"@null@";case"code":return e.codedValue.name+e.codedValue.code.toString();case"range":return e.minValue.toString()+"-"+e.maxValue.toString()}}function j(e){let t,n;e.sort((e,t)=>"null"===e.objectType?-1:"null"===t.objectType?1:e.minValue-t.minValue);const i=[];for(const s of e)"null"!==s.objectType?null!=t&&null!=n?n<s.minValue?(i.push(new c({objectType:"range",minValue:t,maxValue:n})),t=s.minValue,n=s.maxValue):n<s.maxValue&&(n=s.maxValue):(t=s.minValue,n=s.maxValue):i.push(s);return i.push(new c({objectType:"range",minValue:t,maxValue:n})),i}function T(e,t){const n=[];let i,s=0;for(const o of e)for(;s<t.length;s++){const e=t[s];if("null"===o.objectType&&"null"===e.objectType)n.push(new c({objectType:"null"}));else{if("null"===o.objectType)break;if("null"===e.objectType)continue}if(o.maxValue<e.minValue)break;if(o.maxValue===e.minValue){n.push(new c({objectType:"range",minValue:o.maxValue,maxValue:e.minValue}));break}if(!(o.minValue>e.maxValue))if(o.minValue!==e.maxValue){if(i=o.minValue>e.minValue?o.minValue:e.minValue,o.maxValue<e.maxValue){n.push(new c({objectType:"range",minValue:i,maxValue:o.maxValue}));break}n.push(new c({objectType:"range",minValue:i,maxValue:e.maxValue}))}else n.push(new c({objectType:"range",minValue:o.minValue,maxValue:e.maxValue}))}return n}function w(e,t){const n=[];for(const i of e)t.some(e=>{if(i.objectType===e.objectType)switch(i.objectType){case"any":case"null":return!0;case"code":return i.codedValue.code===e.codedValue.code&&i.codedValue.name===e.codedValue.name}return!1})&&n.push(i);return n}function G(e,t){if(0===e.length||0===t.length)return[];if("any"===e[0].objectType)return t;if("any"===t[0].objectType)return e;const n="range"===e[0].objectType||"range"===e[1]?.objectType,i="range"===t[0].objectType||"range"===t[1]?.objectType;return n||i?T(e,t):w(e,t)}async function v(e,n,i){return t(`${e}/${n}/fieldgroups`,{responseType:"json",query:{f:"json"},...i}).then(e=>e.data.fieldGroups??[])}async function x(e,n,i){return t(`${e}/queryDataElements`,{responseType:"json",query:{layers:JSON.stringify([n]),f:"json"},...i}).then(e=>e.data.layerDataElements?.[0].dataElement.fieldGroups??[])}async function C(e,n){return t(e,{responseType:"json",query:{f:"json"},...n}).then(e=>e.data)}async function F(e,n,i){return t(`${e}/queryContingentValues`,{responseType:"json",query:{layers:JSON.stringify([n]),f:"json"},...i}).then(e=>e.data.contingentValueSets?.[0])}async function S(e,n,i){return t(`${e}/${n}/contingentValues`,{responseType:"json",query:{f:"json"},...i}).then(e=>e.data)}function O(e,t){const n=e.domains;if(n){const[e,i]=Object.entries(n).find(([e])=>e.trim().toLowerCase()===t.trim().toLowerCase())||[];return i||null}return null}e([o({constructOnly:!0})],V.prototype,"layer",void 0),e([o({constructOnly:!0})],V.prototype,"request",void 0),e([o({type:[d]})],V.prototype,"fieldGroups",void 0),e([o({constructOnly:!0})],V.prototype,"fieldGroupDefinitions",void 0),e([o()],V.prototype,"subtypeFieldName",null),V=h=e([r("esri.layers.support.LayerContingentValuesCache")],V);const D=V;export{D as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Error.js";import{
|
|
2
|
+
import e from"../../core/Error.js";import{removeMaybe as r}from"../../core/maybe.js";import{throwIfNotAbortError as t}from"../../core/promiseUtils.js";import{open as i}from"../../core/workers.js";import a from"./PixelBlock.js";class s{constructor(){this._workerThread=null,this._destroyed=!1,this._onClientConnectedHandle=null,this._symbolizerState=null,this._rasterFunctionState=null}async initialize(){const e=await i("RasterWorker");this._destroyed?e.close():(this._onClientConnectedHandle=r(this._onClientConnectedHandle),this._workerThread=e,this._onClientConnectedHandle=e.onClientConnected(e=>{this._symbolizerState&&e.invoke("updateSymbolizer",this._symbolizerState).catch(e=>t(e)),this._rasterFunctionState&&e.invoke("updateRasterFunction",this._rasterFunctionState).catch(e=>t(e))}))}destroy(){this._destroyed=!0,this._onClientConnectedHandle=r(this._onClientConnectedHandle),this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(e,r){o(this._workerThread);const t=e.pixelBlock.getTransferableObject().pixelBlock,i=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t,type:e.dataType},r);return i?new a(i):null}async convertPixelBlockToFeatures(e,r){o(this._workerThread);const t=await this._workerThread.invoke("convertPixelBlockToFeatures",{pixelBlock:e.pixelBlock.toJSON(),extent:e.extent.toJSON(),fieldNames:e.fieldNames,skipFactor:e.skipFactor,pixelIdOffset:e.pixelIdOffset,imageRowSize:e.imageRowSize},r),i=e.extent.spatialReference?.toJSON();return t.forEach(e=>e.geometry.spatialReference=i),t}computeStatisticsHistograms(e,r){o(this._workerThread);const{transferList:t,pixelBlock:i}=e.pixelBlock.getTransferableObject();return r?.transferPixelsToWorker&&(r={...r,transferList:t}),this._workerThread.invoke("computeStatisticsHistograms",{...e,pixelBlock:i},r)}async transformPixels(e,r){o(this._workerThread);const{transferList:t,pixelBlock:i}=e.pixelBlock.getTransferableObject();r?.transferPixelsToWorker&&(r={...r,transferList:t});const s=await this._workerThread.invoke("transformPixels",{...e,pixelBlock:i},r);return a.fromJSON(s)}async compositeBands(e,r){o(this._workerThread);const t=e.pixelBlocks.map(e=>e?.getTransferableObject()),i={pixelBlocks:t.map(e=>e?.pixelBlock)};if(r?.transferPixelsToWorker){const e=t.flatMap(e=>e?.transferList).filter(e=>null!=e);r={...r,transferList:e}}const s=await this._workerThread.invoke("compositeBands",i,r);return s?a.fromJSON(s):null}async decode(e,r){o(this._workerThread);const t=await this._workerThread.invoke("decode",e,{...r,transferList:[e.data]});return t?new a(t):null}async symbolize(e,r){o(this._workerThread);const t=e.pixelBlock?.getTransferableObject().pixelBlock,i={extent:e.extent?.toJSON(),pixelBlock:t,simpleStretchParams:e.simpleStretchParams,bandIds:e.bandIds},s=await this._workerThread.invoke("symbolize",i,r);return s?new a(s):null}async highlightPixels(e,r){o(this._workerThread);const t={pixelBlock:e.pixelBlock?.toJSON(),renderedPixelBlock:e.renderedPixelBlock?.toJSON(),highlightOptions:e.highlightOptions},i=await this._workerThread.invoke("highlightPixels",t,r);e.renderedPixelBlock.pixels=i.pixels,e.renderedPixelBlock.mask=i.mask,e.renderedPixelBlock.maskIsAlpha=i.maskIsAlpha}async updateSymbolizer(e,r){o(this._workerThread);const t=e?.rendererJSON?.histograms;this._symbolizerState={symbolizerJSON:e.toJSON(),histograms:t},await Promise.all(this._workerThread.broadcast("updateSymbolizer",this._symbolizerState,r))}async updateRasterFunction(e,r){o(this._workerThread),this._rasterFunctionState={rasterFunctionJSON:e.toJSON()},await Promise.all(this._workerThread.broadcast("updateRasterFunction",this._rasterFunctionState,r))}async process(e,r){o(this._workerThread);const t=await this._workerThread.invoke("process",{extent:e.extent?.toJSON(),primaryPixelSizes:e.primaryPixelSizes?.map(e=>null!=e?e.toJSON():null),primaryPixelBlocks:e.primaryPixelBlocks.map(e=>e?.getTransferableObject().pixelBlock),primaryRasterIds:e.primaryRasterIds,parameters:e.parameters},r);return t?new a(t):null}async stretch(e,r){if(o(this._workerThread),!e?.pixelBlock)return null;const t={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock,stretchParams:e.stretchParams},i=await this._workerThread.invoke("stretch",t,r);return i?new a(i):null}async split(e,r){if(o(this._workerThread),!e?.pixelBlock)return null;const t={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock,tileSize:e.tileSize,maximumPyramidLevel:e.maximumPyramidLevel,useBilinear:e.useBilinear},i=await this._workerThread.invoke("split",t,r);return i&&i.forEach((e,r)=>{i.set(r,e?a.fromJSON(e):null)}),i}async clipTile(e,r){if(o(this._workerThread),!e?.pixelBlock)return null;const t=e.pixelBlock.getTransferableObject().pixelBlock,i={...e,pixelBlock:t},s=await this._workerThread.invoke("clipTile",i,r);return s?a.fromJSON(s):null}async estimateStatisticsHistograms(e,r){if(o(this._workerThread),!e?.pixelBlock)return null;const t={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock};return await this._workerThread.invoke("estimateStatisticsHistograms",t,r)}async mosaicAndTransform(e,r){if(o(this._workerThread),!e?.srcPixelBlocks?.length)return{pixelBlock:null};const t=e.srcPixelBlocks.map(e=>e?.getTransferableObject()),i={...e,srcPixelBlocks:t.map(e=>e?.pixelBlock)};if(r?.transferPixelsToWorker){const e=t.flatMap(e=>e?.transferList).filter(e=>null!=e);r={...r,transferList:e}}const s=await this._workerThread.invoke("mosaicAndTransform",i,r);return{pixelBlock:s.pixelBlock?new a(s.pixelBlock):null,localNorthDirections:s.localNorthDirections}}async createFlowMesh(e,r){o(this._workerThread);const t={buffer:e.flowData.data.buffer,maskBuffer:e.flowData.mask.buffer,width:e.flowData.width,height:e.flowData.height},{meshType:i,simulationSettings:a,startInfo:s}=e,l=await this._workerThread.invoke("createFlowMesh",{meshType:i,flowData:t,simulationSettings:a,startInfo:s},{...r,transferList:[t.buffer,t.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer),pathData:new Float32Array(l.pathBuffer)}}getProjectionOffsetGrid(e,r){o(this._workerThread);const t=null!=e.datumTransformation?e.datumTransformation.steps.map(e=>({wkid:e.wkid,wkt:e.wkt,isInverse:e.isInverse})):null,i=null!=e.rasterTransform?e.rasterTransform.toJSON():null,a={projectedExtent:e.projectedExtent.toJSON(),srcBufferExtent:e.srcBufferExtent.toJSON(),pixelSize:e.pixelSize,hasWrapAround:e.hasWrapAround,spacing:e.spacing,datumTransformationSteps:t,rasterTransform:i,isAdaptive:e.isAdaptive,includeGCSGrid:e.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",a,r)}}function o(r){if(null==r)throw new e("raster-jobhandler:no-connection","no available worker connection")}export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Error.js";import{urlToObject as r,getFilename as a}from"../../core/urlUtils.js";import{parse as t,parseNonStandardSublayerUrl as s}from"./arcgisLayerUrl.js";import{findAssociatedFeatureService as
|
|
2
|
+
import e from"../../core/Error.js";import{urlToObject as r,getFilename as a}from"../../core/urlUtils.js";import{parse as t,parseNonStandardSublayerUrl as s}from"./arcgisLayerUrl.js";import{findAssociatedFeatureService as n}from"./associatedFeatureServiceUtils.js";import{getLayerModuleType as l,fetchFeatureService as o}from"./fetchService.js";import{getPreferredUrl as i,sceneServiceLayerTypeToClassName as c}from"./layerUtils.js";import{layerLookupMap as u}from"./lazyLayerLoader.js";import{requestServiceJSON as y}from"../../request/serviceJSON.js";const f="KHR_gaussian_splatting",p={FeatureLayer:!0,SceneLayer:!0,VideoLayer:!0};async function m(e){const{properties:r,url:a}=e,t={...r,url:a},s=await S(a,r?.customParameters),{Constructor:n,layerId:l,sourceJSON:o,parsedUrl:i,layers:c,tables:u}=s;if(c.length+u.length===0)return null!=l&&(t.layerId=l),null!=o&&(t.sourceJSON=o),new n(t);const y=new(0,(await import("../GroupLayer.js")).default)({title:i.title});return await w(y,s,t),y}function d(e,r){return e?e.find(({id:e})=>e===r):null}function v(e,r,a,t,s){const n={...s,layerId:r};return null!=e&&(n.url=e),null!=a&&(n.sourceJSON=a),"sublayerTitleMode"in t.prototype&&(n.sublayerTitleMode="service-name"),new t(n)}async function w(e,r,a){const t=r.sublayerConstructorProvider;for(const{id:s,serverUrl:n}of r.layers){const l=d(r.sublayerInfos,s),o=v(n,s,l,(l&&t?.(l))??r.Constructor,a);e.add(o)}if(r.tables.length){const t=await g("FeatureLayer");r.tables.forEach(({id:s,serverUrl:n})=>{const l=v(n,s,d(r.tableInfos,s),t,a);e.tables.add(l)})}}async function S(r,a){let s=t(r);if(null==s&&(s=await b(r,a)),null==s)throw new e("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:n,sublayer:o}=s;let u;const f={FeatureServer:"FeatureLayer",KnowledgeGraphServer:"KnowledgeGraphLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer",VideoServer:"VideoLayer"},m="FeatureServer"===n,d="SceneServer"===n,v={parsedUrl:s,Constructor:null,layerId:m||d?o??void 0:void 0,layers:[],tables:[]};switch(n){case"MapServer":if(null!=o){const{type:t}=await y(r,{customParameters:a});switch(u="FeatureLayer",t){case"Catalog Layer":u="CatalogLayer";break;case"Catalog Dynamic Group Layer":throw new e("arcgis-layers:unsupported",`fromUrl() not supported for "${t}" layers`)}}else{u=await P(r,a)?"TileLayer":"MapImageLayer"}break;case"ImageServer":{const e=await y(r,{customParameters:a}),{tileInfo:t,cacheType:s}=e;u=t?"LERC"!==t?.format?.toUpperCase()||s&&"elevation"!==s.toLowerCase()?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const e=await y(s.url.path,{customParameters:a});if(u="SceneLayer",e){const r=e?.layers;if("Voxel"===e?.layerType)u="VoxelLayer";else if(r?.length){const e=r[0]?.layerType;null!=e&&null!=c[e]&&(u=c[e])}}break}case"3DTilesServer":u=await U(r,a)?"GaussianSplatLayer":"IntegratedMesh3DTilesLayer";break;case"FeatureServer":if(u="FeatureLayer",null!=o){const e=await y(r,{customParameters:a});v.sourceJSON=e,v.preferredUrl=i(),u=l(e.type)}break;default:u=f[n]}if(p[u]&&null==o){const e=await L(r,n,a);m&&(v.preferredUrl=e.preferredUrl,v.sublayerInfos=e.layerInfos,v.tableInfos=e.tableInfos);if(1!==e.layers.length+e.tables.length)v.layers=e.layers,v.tables=e.tables,m&&e.layerInfos?.length&&(v.sublayerConstructorProvider=await O(e.layerInfos));else if(m||d){const r=e.layerInfos?.[0]??e.tableInfos?.[0];if(v.layerId=e.layers[0]?.id??e.tables[0]?.id,v.sourceJSON=r,m){const e=r?.type;u=l(e)}}}return v.Constructor=await g(u),v}async function b(e,t){const n=await y(e,{customParameters:t});let l=null,o=null;const i=n.type;if("Feature Layer"===i||"Table"===i?(l="FeatureServer",o=n.id??null):"indexedVector"===i?l="VectorTileServer":n.hasOwnProperty("mapName")?l="MapServer":n.hasOwnProperty("bandCount")&&n.hasOwnProperty("pixelSizeX")?l="ImageServer":n.hasOwnProperty("maxRecordCount")&&n.hasOwnProperty("allowGeometryUpdates")?l="FeatureServer":n.hasOwnProperty("streamUrls")?l="StreamServer":h(n)?(l="SceneServer",o=n.id):n.hasOwnProperty("layers")&&h(n.layers?.[0])&&(l="SceneServer"),!l)return null;const c=null!=o?s(e):null;return{title:null!=c&&n.name||a(e),serverType:l,sublayer:o,url:{path:null!=c?c.serviceUrl:r(e).path}}}function h(e){return null!=e&&e.hasOwnProperty("store")&&e.hasOwnProperty("id")&&"number"==typeof e.id}async function L(e,r,a){let t,s,n,l=!1;switch(r){case"FeatureServer":{const r=await o(e,{customParameters:a});n=i(e,{preferredHost:r.preferredHost}),l=!!r.layersJSON,t=r.layersJSON||r.serviceJSON;break}case"SceneServer":{const r=await I(e,a);t=r.serviceInfo,s=r.tableServerUrl;break}default:t=await y(e,{customParameters:a})}const c=t?.layers,u=t?.tables;return{preferredUrl:n,layers:c?.map(e=>({id:e.id})).reverse()||[],tables:u?.map(e=>({serverUrl:s,id:e.id})).reverse()||[],layerInfos:l?c:[],tableInfos:l?u:[]}}async function I(e,r){const a=await y(e,{customParameters:r}),t=a.layers?.[0];if(!t)return{serviceInfo:a};try{const{serverUrl:t}=await n(e),s=await y(t,{customParameters:r}).catch(()=>null);return s&&(a.tables=s.tables),{serviceInfo:a,tableServerUrl:t}}catch{return{serviceInfo:a}}}async function g(e){return(0,u[e])()}async function P(e,r){return(await y(e,{customParameters:r})).tileInfo}async function U(e,r){const a=await y(e,{customParameters:r}),t=a.extensions?.["3DTILES_content_gltf"];return!0===t?.extensionsRequired?.includes(f)}async function O(e){if(!e.length)return;const r=new Set,a=[];for(const{type:n}of e)r.has(n)||(r.add(n),a.push(g(l(n))));const t=await Promise.all(a),s=new Map;return Array.from(r).forEach((e,r)=>{s.set(e,t[r])}),e=>s.get(e.type)}export{m as fromUrl};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import"../../core/urlUtils.js";import{isLayerFromCatalog as r}from"../catalog/catalogUtils.js";import{isBasemap as i}from"../../support/userTypeGuards/isBasemap.js";function u(e){return
|
|
2
|
+
import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import"../../core/urlUtils.js";import{isLayerFromCatalog as r}from"../catalog/catalogUtils.js";import{isBasemap as i}from"../../support/userTypeGuards/isBasemap.js";function u(e,t){return null!=e&&"object"==typeof e&&"type"in e&&e.type===t}function s(e){return h(e)||d(e)}function o(e){return u(e,"feature")}function c(e){return"gaussian-splat"===e?.type}function a(e){return u(e,"graphics")}function l(e){return u(e,"map-image")}function f(e){return u(e,"map-notes")&&"sublayers"in e}function p(e){return u(e,"knowledge-graph")&&"layers"in e}function y(e){return u(e,"knowledge-graph-sublayer")}function g(e){return u(e,"link-chart")&&"layers"in e}function d(e){return u(e,"scene")}function b(e){return u(e,"subtype-group")&&"sublayers"in e}function m(e){return"subtype-sublayer"===e?.type}function h(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function v(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function w(e){return"group"===e?.type}function j(e){const t=e.parent;return w(t)&&t.tables.includes(e)}const L={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function S(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function E(e){return"integrated-mesh"===e.type||"integrated-mesh-3dtiles"===e.type}function k(e){return"integrated-mesh-3dtiles"===e.type}function C(e){return"voxel"===e?.type}function x(e){return"imagery-tile"===e?.type}function T(e,t){return i(e?.parent)&&e.parent[t].includes(e)}function U(e){return T(e,"baseLayers")}function M(e){return T(e,"referenceLayers")}function O(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function P(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function B(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function I(e){return o(e)&&B(e)}function R(e){const t=e?.type;return"binning"===t||"cluster"===t}function q(e,t){if(!I(e))return;const n=t?.graphic,r=e.featureReduction;if(n){if(n.isAggregate){const e=n.origin;return e&&("featureReductionProvider"in e&&r)?R(r)?r:null:void 0}return e}return t?.checkFeatureReduction&&r?R(r)?r:null:e}function F(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)}),n.length>0)){let e;if(r){const t={};n.forEach(e=>{t[e[0]]=e[1]}),e=JSON.stringify(t)}else{const t=[];n.forEach(e=>{t.push(e[0]+":"+e[1])}),e=t.join(";")}return e}return null}function J(e){if(!e)return;const t=[];return e.forEach((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))}),t.length?"{"+t.join(",")+"}":void 0}function N(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function A(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf("/rest/services");if(-1===u)return null;const s=`${n.slice(0,u)}/rest/info`,o=null!=r?r.signal:null,{data:c}=await t(s,{query:{f:"json"},responseType:"json",signal:o});return c?.owningSystemUrl||null}function D(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function G(e){return null!=e&&"object"==typeof e&&"isTable"in e&&!!e.isTable}function V(e){return D(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function $(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}function z(e){return!!$(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function H(e){if(!e)return[];return("subtypes"in e?e.subtypes:b(e.parent)?e.parent.subtypes:[])??[]}function K(e){return("imagery"===e.type||"imagery-tile"===e.type)&&"flow"===e.renderer?.type}function Q(e){const t=new n;for(const n of e.allLayers.concat(e.allTables))r(n)||j(n)||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function W(e,t){return null}function X(e){return null}function Y(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function Z(e,t){if(!t||!Y(e))return;const n=W(e.url);n&&(e.url=n)}export{Z as applyPreferredHostToPortalItem,z as getEffectiveEditingEnabled,V as getEffectiveLayerCapabilities,q as getFieldConfigurationsContainer,Q as getLayersWithChartSupport,A as getOwningPortalUrl,X as getPreferredHost,W as getPreferredUrl,H as getSubtypesFromLayer,N as getTileMaxtrixSetFromActiveLayer,U as isBaseLayer,s as isBasemap3DSupportedLayer,h as isBasemapSupportedTiledLayer,O as isFeatureCollectionLayer,o as isFeatureLayer,B as isFeatureServiceLayer,c as isGaussianSplatLayer,a as isGraphicsLayer,w as isGroupLayer,x as isImageryTileLayer,k as isIntegratedMesh3DTilesLayer,E as isIntegratedMeshLayer,p as isKnowledgeGraphLayer,y as isKnowledgeGraphSublayer,D as isLayerWithFeatureCapabilities,P as isLayerWithFeatureLayerSource,K as isLayerWithFlowRenderer,g as isLinkChartLayer,l as isMapImageLayer,f as isMapNotesLayer,Y as isPreferredUrlApplicable,M as isReferenceLayer,d as isSceneLayer,S as isSceneServiceLayer,b as isSubtypeGroupLayer,m as isSubtypeSublayer,G as isTable,v as isTiledLayer,C as isVoxelLayer,L as sceneServiceLayerTypeToClassName,F as serializeLayerDefinitions,J as serializeTimeOptions,I as supportsFieldConfiguration};
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{getDataValues as i,quantizeFeatures as e,calculateHeatmapStats as a}from"./utils.js";import{calculateClassBreaks as n,resolveCBResult as t,calculateHistogram as o,
|
|
2
|
+
import{getDataValues as i,quantizeFeatures as e,calculateHeatmapStats as a}from"./utils.js";import{calculateClassBreaks as n,resolveCBResult as t,calculateHistogram as o,isNullCountSupported as l,calculateStringStatistics as s,calculateStatistics as r,processSummaryStatisticsResult as m,calculateUniqueValuesCount as u,createUVResult as f}from"../../../statistics/utils.js";async function d(e){const{attribute:a,features:n}=e,{normalizationType:t,normalizationField:o,minValue:u,maxValue:f,fieldType:d,outStatisticTypes:p}=a,c=await i({field:a.field,valueExpression:a.valueExpression,normalizationType:t,normalizationField:o,normalizationTotal:a.normalizationTotal,viewInfoParams:a.viewInfoParams,timeZone:a.timeZone,fieldInfos:a.fieldInfos},n),v=l({normalizationType:t,normalizationField:o,minValue:u,maxValue:f}),z={value:.5,fieldType:d},T="esriFieldTypeString"===d?s({values:c,supportsNullCount:v,percentileParams:z,outStatisticTypes:p}):r({values:c,minValue:u,maxValue:f,useSampleStdDev:!t,supportsNullCount:v,percentileParams:z,outStatisticTypes:p});return m(T,p,"esriFieldTypeDate"===d)}async function p(e){const{attribute:a,features:n}=e,t=await i({field:a.field,field2:a.field2,field3:a.field3,fieldDelimiter:a.fieldDelimiter,valueExpression:a.valueExpression,viewInfoParams:a.viewInfoParams,timeZone:a.timeZone,fieldInfos:a.fieldInfos},n,!1),o=u(t);return f(o,a.domains,a.returnAllCodedValues,a.fieldDelimiter)}async function c(e){const{attribute:a,features:o}=e,{field:l,normalizationType:s,normalizationField:r,normalizationTotal:m,classificationMethod:u}=a,f=await i({field:l,valueExpression:a.valueExpression,normalizationType:s,normalizationField:r,normalizationTotal:m,viewInfoParams:a.viewInfoParams,timeZone:a.timeZone,fieldInfos:a.fieldInfos},o),d=n(f,{field:l,normalizationType:s,normalizationField:r,normalizationTotal:m,classificationMethod:u,standardDeviationInterval:a.standardDeviationInterval,numClasses:a.numClasses,minValue:a.minValue,maxValue:a.maxValue});return t(d,u)}async function v(e){const{attribute:a,features:n}=e,{field:t,normalizationType:l,normalizationField:s,normalizationTotal:r,classificationMethod:m}=a,u=await i({field:t,valueExpression:a.valueExpression,sqlExpression:a.sqlExpression,normalizationType:l,normalizationField:s,normalizationTotal:r,viewInfoParams:a.viewInfoParams,timeZone:a.timeZone,fieldInfos:a.fieldInfos},n);return o(u,{field:t,normalizationType:l,normalizationField:s,normalizationTotal:r,classificationMethod:m,standardDeviationInterval:a.standardDeviationInterval,numBins:a.numBins,minValue:a.minValue,maxValue:a.maxValue})}async function z(i){const{attribute:n,features:t}=i,{field:o,radius:l,transform:s,spatialReference:r}=n,m=n.size??[0,0],u=e(t??[],s,r,m);return a(u,l??void 0,o,m[0],m[1])}export{c as classBreaks,z as heatmapStatistics,v as histogram,d as summaryStatistics,p as uniqueValues};
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const b="20260321",c="6fcd8870bccbfb9b647fc20854a20befa9ecb869";export{b as buildDate,c as commitHash};
|
package/time/TimeExtent.d.ts
CHANGED
|
@@ -30,6 +30,14 @@ export interface TimeExtentProperties {
|
|
|
30
30
|
* });
|
|
31
31
|
*/
|
|
32
32
|
export default class TimeExtent extends JSONSupport {
|
|
33
|
+
/**
|
|
34
|
+
* @param values - An array of two numbers representing the start and end time of the TimeExtent.
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
static fromArray(values: [
|
|
38
|
+
number | null | undefined,
|
|
39
|
+
number | null | undefined
|
|
40
|
+
]): TimeExtent;
|
|
33
41
|
/**
|
|
34
42
|
* @example
|
|
35
43
|
* // Typical usage
|
|
@@ -43,6 +51,19 @@ export default class TimeExtent extends JSONSupport {
|
|
|
43
51
|
/** The end time of the time extent. */
|
|
44
52
|
get end(): Date | null | undefined;
|
|
45
53
|
set end(value: (Date | number | string) | null | undefined);
|
|
54
|
+
/**
|
|
55
|
+
* Returns true if the TimeExtent represents all time.
|
|
56
|
+
*
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
get isAllTime(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Returns true if the TimeExtent represents no time for example as the result of the
|
|
62
|
+
* non-intersection of two TimeExtents.
|
|
63
|
+
*
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
get isEmpty(): boolean;
|
|
46
67
|
/** The start time of the time extent. */
|
|
47
68
|
get start(): Date | null | undefined;
|
|
48
69
|
set start(value: (Date | number | string) | null | undefined);
|
|
@@ -52,6 +73,14 @@ export default class TimeExtent extends JSONSupport {
|
|
|
52
73
|
* @returns A new instance of a TimeExtent object equal to the object used to call `.clone()`.
|
|
53
74
|
*/
|
|
54
75
|
clone(): TimeExtent;
|
|
76
|
+
/**
|
|
77
|
+
* Tests if the parsed TimeExtent is equivalent to the current instance.
|
|
78
|
+
*
|
|
79
|
+
* @param other - The TimeExtent to compare with the current instance.
|
|
80
|
+
* @returns Returns `true` if the parsed TimeExtent is equivalent to the current instance.
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
equals(other: TimeExtent | null | undefined): boolean;
|
|
55
84
|
/**
|
|
56
85
|
* Expands the TimeExtent so that the start and end dates are rounded down and up, respectively, to the parsed time unit.
|
|
57
86
|
*
|
|
@@ -99,6 +128,11 @@ export default class TimeExtent extends JSONSupport {
|
|
|
99
128
|
* }
|
|
100
129
|
*/
|
|
101
130
|
intersection(timeExtent: TimeExtent | null | undefined): TimeExtent;
|
|
131
|
+
/** @internal */
|
|
132
|
+
toArray(): [
|
|
133
|
+
number | null | undefined,
|
|
134
|
+
number | null | undefined
|
|
135
|
+
];
|
|
102
136
|
/**
|
|
103
137
|
* Returns the time extent resulting from the union of the current time extent and a given time extent.
|
|
104
138
|
*
|
package/time/TimeInterval.d.ts
CHANGED
|
@@ -43,5 +43,20 @@ export default class TimeInterval extends TimeIntervalSuperclass {
|
|
|
43
43
|
* });
|
|
44
44
|
*/
|
|
45
45
|
accessor value: number;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the duration of the time interval in milliseconds.
|
|
48
|
+
*
|
|
49
|
+
* @returns The time interval expressed as milliseconds.
|
|
50
|
+
* @internal
|
|
51
|
+
* @example
|
|
52
|
+
* const interval = new TimeInterval({
|
|
53
|
+
* value: 5,
|
|
54
|
+
* unit: "days"
|
|
55
|
+
* });
|
|
56
|
+
* const milliseconds = interval.toMilliseconds();
|
|
57
|
+
* const formatted = new Intl.NumberFormat().format(milliseconds);
|
|
58
|
+
* console.log("Five days is equivalent to", formatted, "milliseconds.");
|
|
59
|
+
*/
|
|
60
|
+
toMilliseconds(): number;
|
|
46
61
|
}
|
|
47
62
|
declare const TimeIntervalSuperclass: typeof JSONSupport & typeof ClonableMixin
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import has from"../../../../core/has.js";import{abortMaybe as
|
|
2
|
+
import has from"../../../../core/has.js";import{removeMaybe as t,abortMaybe as e}from"../../../../core/maybe.js";import{throwIfNotAbortError as s,throwIfAbortError as i,isAbortError as r,eachAlways as o}from"../../../../core/promiseUtils.js";import{addQueryParameters as n}from"../../../../core/urlUtils.js";import{open as a}from"../../../../core/workers.js";import l from"./SpriteMosaic.js";import c from"../webgl/GlyphMosaic.js";import h from"../webgl/GlyphSource.js";import u from"../../tiling/TileKey.js";class p{constructor(t,e,s,i){this._layer=t,this._styleRepository=e,this.devicePixelRatio=s,this._sourceDataMaxLOD=i,this._spriteMosaic=null,this._glyphMosaic=null,this._connection=null,this._spriteSourceAbortController=null,this._onClientConnectedHandle=null,this._startOptionsInputSignal=null,this._inputSignalEventListener=null}destroy(){this._onClientConnectedHandle=t(this._onClientConnectedHandle),this._connection?.close(),this._connection=null,this._styleRepository=null,this._layer=null,this._spriteMosaic?.destroy(),this._spriteMosaic=null,this._glyphMosaic=null,this._spriteSourceAbortController=e(this._spriteSourceAbortController),this._spriteSourcePromise=null,this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener("abort",this._inputSignalEventListener),this._startOptionsInputSignal=null,this._inputSignalEventListener=null}get spriteMosaic(){return this._spriteSourcePromise.then(()=>this._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(e){this._requestSprite(e);const i=this._layer.currentStyleInfo.glyphsUrl,r=new h(i?n(i,{...this._layer.customParameters,token:this._layer.apiKey}):"");this._onClientConnectedHandle=t(this._onClientConnectedHandle),this._glyphMosaic=new c(1024,1024,r,!0),this._broadcastPromise=a("WorkerTileHandler",{client:this,schedule:e.schedule,signal:e.signal}).then(t=>{if(this._layer&&(this._connection?.close(),this._connection=t,this._onClientConnectedHandle=t.onClientConnected(t=>{this._layer&&!this._connection.closed&&t.invoke("setStyle",{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD}).catch(t=>s(t))}),this._layer&&!this._connection.closed)){const e=t.broadcast("setStyle",{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD});Promise.all(e).catch(t=>s(t))}})}_requestSprite(t){this._spriteSourceAbortController?.abort();const e=new AbortController;this._spriteSourceAbortController=e;const s=t?.signal;this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener("abort",this._inputSignalEventListener),this._startOptionsInputSignal=null,s&&(this._inputSignalEventListener=_(e),s.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:r}=e,o={...t,signal:r};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,o),this._spriteSourcePromise.then(t=>{i(r),this._spriteMosaic=new l(1024,1024,250),this._spriteMosaic.setSpriteSource(t)})}async updateStyle(t){const e=[];for(const s of t)4===s.type?e.push({type:4,data:{spriteSource:null}}):e.push(s);return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(t){const e=new l(1024,1024,250);return e.setSpriteSource(t),this._spriteMosaic=e,this._spriteSourcePromise=Promise.resolve(t),this._spriteSourceAbortController=null,e}async setStyle(t,e,s){await this._broadcastPromise,this._styleRepository=t,this._sourceDataMaxLOD=s,this._requestSprite();const i=this._layer.currentStyleInfo.glyphsUrl,r=new h(i?n(i,{...this._layer.customParameters,token:this._layer.apiKey}):"");return this._glyphMosaic=new c(1024,1024,r,!0),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",{style:e,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(t,e){const s=await this._getRefKeys(t,e);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),s,e)}async fetchTilePBFs(t){const e=Object.keys(this._layer.sourceNameToSource),s={},i=await this._getRefKeys(t,s),r=[],o=[];for(let n=0;n<i.length;n++)if(null==i[n].value||null==e[n])o.push(null);else{const t=i[n].value,a=this._getTilePayload(t,e[n],s);a.then(e=>{r.push({...e,key:t})}),o.push(a)}return Promise.all(o).then(()=>r)}async parseTileData(t,e){const s=t&&t.data;if(!s)return null;const{sourceName2DataAndRefKey:i,transferList:r}=s;return 0===Object.keys(i).length?null:this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:t.key.id,sourceName2DataAndRefKey:i,styleLayerUIDs:t.styleLayerUIDs},{...e,transferList:r}))}async getSprites(t){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(t)}async getGlyphs(t){return has("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(t.font),this._glyphMosaic.getGlyphItemsVTL(t.font,t.codePoints)}async _getTilePayload(t,e,s){const i=u.pool.acquire(t.id),o=this._layer.sourceNameToSource[e],{level:n,row:a,col:l}=i;u.pool.release(i);try{return{protobuff:await o.requestTile(n,a,l,s),sourceName:e}}catch(c){if(r(c))throw c;return{protobuff:null,sourceName:e}}}async _getRefKeys(t,e){const s=this._layer.sourceNameToSource,i=new Array;for(const r in s){const o=s[r].getRefKey(t,e);i.push(o)}return o(i)}_getSourcesData(t,e,s){const i=[];for(let r=0;r<e.length;r++)if(null==e[r].value||null==t[r])i.push(null);else{const o=e[r].value,n=this._getTilePayload(o,t[r],s);i.push(n)}return o(i).then(t=>{const s={},i=[];for(let r=0;r<t.length;r++){const o=t[r].value;if(o&&(o.protobuff&&o.protobuff.byteLength>0)){const t=e[r].value.id;s[o.sourceName]={refKey:t,protobuff:o.protobuff},i.push(o.protobuff)}}return{sourceName2DataAndRefKey:s,transferList:i}})}}function _(t){return()=>t.abort()}export{p as TileHandler};
|