@arcgis/core 4.33.9 → 4.33.10
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/11587332ed09d46fa368.js +1 -0
- package/assets/esri/core/workers/chunks/5f42b7315d8330401410.js +1 -0
- package/assets/esri/core/workers/chunks/822e554d7c985c0181b9.js +1 -0
- package/assets/esri/core/workers/chunks/c3dfa739d109aa9c99a5.js +1 -0
- package/kernel.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/projection.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/schema/processor/LabelMatcherSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/SubtypeProcessorSchema.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/assets/esri/core/workers/chunks/606782a94adcce6975af.js +0 -1
- package/assets/esri/core/workers/chunks/68e432a80bf6fa7b17fb.js +0 -1
- package/assets/esri/core/workers/chunks/d45a4e5806a80b69ceec.js +0 -1
- package/assets/esri/core/workers/chunks/fd520abd351571226ae3.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{sqlAnd as e}from"../../../../../core/sql.js";import{systemIsSpatialFieldName as r}from"../../../../../layers/knowledgeGraph/constants.js";import t from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveFeatureReduction as o}from"./featureReductionUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as l}from"./labelingUtils.js";import{createFeatureSourceSchema as n}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as p}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";class c{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??a(r);return[{vvEvaluators:{0:l(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(e){const r=this.layer,{capabilities:t,objectIdField:o}=r,i=r.fieldsIndex.toJSON(),a=s(r),l=r.spatialReference.toJSON(),n=await r.source.openPorts(),p=o,u=e.spatialReference.toJSON();return{type:"memory",source:n,orderByFields:p,outSpatialReference:u,metadata:{fieldsIndex:i,geometryType:a,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:l,outSpatialReference:u,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,r){const{definitionExpression:t,displayFilterInfo:o}=this.layer;return n({definitionExpression:t,displayFilterInfo:o,customParameters:null},e,r,null)}createProcessorSchema(e,r,t){const{fields:s,renderer:i,geometryType:a,labelingInfo:l,labelsVisible:n,objectIdField:u}=this.layer,c={fields:s.map((e=>e.toJSON())),renderer:i?.clone(),
|
|
5
|
+
import{sqlAnd as e}from"../../../../../core/sql.js";import{systemIsSpatialFieldName as r}from"../../../../../layers/knowledgeGraph/constants.js";import t from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveFeatureReduction as o}from"./featureReductionUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as l}from"./labelingUtils.js";import{createFeatureSourceSchema as n}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as p}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";class c{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??a(r);return[{vvEvaluators:{0:l(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(e){const r=this.layer,{capabilities:t,objectIdField:o}=r,i=r.fieldsIndex.toJSON(),a=s(r),l=r.spatialReference.toJSON(),n=await r.source.openPorts(),p=o,u=e.spatialReference.toJSON();return{type:"memory",source:n,orderByFields:p,outSpatialReference:u,metadata:{fieldsIndex:i,geometryType:a,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:l,outSpatialReference:u,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,r){const{definitionExpression:t,displayFilterInfo:o}=this.layer;return n({definitionExpression:t,displayFilterInfo:o,customParameters:null},e,r,null)}createProcessorSchema(e,r,t){const{fields:s,renderer:i,geometryType:a,labelingInfo:l,labelsVisible:n,objectIdField:u}=this.layer,c={fields:s.map((e=>e.toJSON())),renderer:i?.clone(),labelingInfoSource:this.layer.id,featureReduction:o(this.layer,r),geometryType:a,labelingInfo:l,labelsVisible:n,objectIdField:u,orderBy:"default"};return p(e,r,c,t)}get hasRequiredSupport(){return u(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>o(this.layer,e),()=>d(this.layer)]}hasFilters(e){return d(this.layer)}addFilters(o,s){if(d(this.layer)){const s=e(o?.where,`${r}=1`);if(!s)return o;o??=new t,o.where=s}return o}}function d(e){return"link-chart"===e.parentCompositeLayer.type&&"hidden"===e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode}export{c as KnowledgeGraphSublayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as e}from"../../../../../core/lang.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as r}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as i}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=o(t,e)??a(t);return[{vvEvaluators:{0:s(t.renderer)},deconflictionEnabled:r,labelingInfo:t.labelingInfo}]}async createServiceOptions(t){const o=this.layer,{capabilities:a}=o,s=o.fieldsIndex.toJSON(),l=r(o),i=o.timeInfo?.toJSON(),n=o.spatialReference.toJSON(),u=o.source.getSource(),c=this.layer.objectIdField,p=e(a);p.query.maxRecordCount=u.maxRecordCount;const d=t.spatialReference.toJSON();return{type:"ogc",source:u,orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:s,geometryType:l,featureIdInfo:{type:"object-id",fieldName:o.objectIdField},timeInfo:i,spatialReference:n,outSpatialReference:d,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:p.query.maxRecordCount,supportsCompactGeometry:p.query.supportsCompactGeometry,supportsDefaultSpatialReference:p.query.supportsDefaultSpatialReference,supportsFormatPBF:p.query.supportsFormatPBF,supportsMaxRecordCountFactor:p.query.supportsMaxRecordCountFactor,supportsQuantization:p.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t){const{customParameters:r,timeExtent:o,apiKey:a}=this.layer;return l({customParameters:r,timeExtent:o},e,t,a)}createProcessorSchema(e,r,o){const{fields:a,renderer:s,geometryType:l,labelingInfo:n,labelsVisible:u,orderBy:c,objectIdField:p}=this.layer,d={fields:a.map((e=>e.toJSON())),renderer:s?.clone(),
|
|
5
|
+
import{clone as e}from"../../../../../core/lang.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as r}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as i}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=o(t,e)??a(t);return[{vvEvaluators:{0:s(t.renderer)},deconflictionEnabled:r,labelingInfo:t.labelingInfo}]}async createServiceOptions(t){const o=this.layer,{capabilities:a}=o,s=o.fieldsIndex.toJSON(),l=r(o),i=o.timeInfo?.toJSON(),n=o.spatialReference.toJSON(),u=o.source.getSource(),c=this.layer.objectIdField,p=e(a);p.query.maxRecordCount=u.maxRecordCount;const d=t.spatialReference.toJSON();return{type:"ogc",source:u,orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:s,geometryType:l,featureIdInfo:{type:"object-id",fieldName:o.objectIdField},timeInfo:i,spatialReference:n,outSpatialReference:d,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:p.query.maxRecordCount,supportsCompactGeometry:p.query.supportsCompactGeometry,supportsDefaultSpatialReference:p.query.supportsDefaultSpatialReference,supportsFormatPBF:p.query.supportsFormatPBF,supportsMaxRecordCountFactor:p.query.supportsMaxRecordCountFactor,supportsQuantization:p.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t){const{customParameters:r,timeExtent:o,apiKey:a}=this.layer;return l({customParameters:r,timeExtent:o},e,t,a)}createProcessorSchema(e,r,o){const{fields:a,renderer:s,geometryType:l,labelingInfo:n,labelsVisible:u,orderBy:c,objectIdField:p}=this.layer,d={fields:a.map((e=>e.toJSON())),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:l,labelingInfo:n,labelsVisible:u,objectIdField:p,orderBy:c??"default"};return i(e,r,d,o)}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>t(this.layer,e),()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.renderer]}}export{u as OGCFeatureLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{createSnapshotInfo as o}from"./featureServiceUtils.js";import{addFloorFilter as s,hasFloorFilter as i}from"./floorFilterUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as a,getLayerDeconflictionEnabled as n,createLabelVVEvaluator as p}from"./labelingUtils.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as d}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class m{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=a(r,e)??n(r);return[{vvEvaluators:{0:p(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(t){const s=this.layer,{capabilities:i,globalIdField:a,orderBy:n,refreshInterval:p}=s,u=s.fieldsIndex.toJSON(),d=l(s),c=s.timeInfo?.toJSON(),m=s.spatialReference.toJSON(),
|
|
5
|
+
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{createSnapshotInfo as o}from"./featureServiceUtils.js";import{addFloorFilter as s,hasFloorFilter as i}from"./floorFilterUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as a,getLayerDeconflictionEnabled as n,createLabelVVEvaluator as p}from"./labelingUtils.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as d}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class m{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=a(r,e)??n(r);return[{vvEvaluators:{0:p(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(t){const s=this.layer,{capabilities:i,globalIdField:a,orderBy:n,refreshInterval:p}=s,u=s.fieldsIndex.toJSON(),d=l(s),c=s.timeInfo?.toJSON(),m=s.spatialReference.toJSON(),f=e(this.layer.parsedUrl);let y=this.layer.objectIdField;if(n?.length){const e=!n[0].valueExpression&&n[0].field;e&&(y=e)}const h=p>0,b=r(f.path),I=t.spatialReference.toJSON(),F=o(b,h,i,d,t.extent,s.fullExtent);return{type:"feature-service",source:f,isSourceHosted:b,orderByFields:y,outSpatialReference:I,metadata:{globalIdField:a,fieldsIndex:u,geometryType:d,featureIdInfo:{type:"object-id",fieldName:s.objectIdField},timeInfo:c,spatialReference:m,outSpatialReference:I,timeReferenceUnknownClient:s.datesInUnknownTimezone,dateFieldsTimeZone:s.dateFieldsTimeZone,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:null,snapshotInfo:F}}}createSourceSchema(e,r){const{definitionExpression:t,displayFilterInfo:o,customParameters:s,timeExtent:i}=this.layer;return u({definitionExpression:t,displayFilterInfo:o,customParameters:s,timeExtent:i},e,r,null)}createProcessorSchema(e,r,o){const{fields:s,renderer:i,geometryType:l,labelingInfo:a,labelsVisible:n,orderBy:p,objectIdField:u}=this.layer,c={fields:s.map((e=>e.toJSON())),renderer:i?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:l,labelingInfo:a,labelsVisible:n,objectIdField:u,orderBy:p??"default"};return d(e,r,c,o)}get hasRequiredSupport(){return c(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return s(this.layer,e,r)}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.orderBy,()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>i(this.layer,e)?e.floors:null]}}export{m as OrientedImageryLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../core/Error.js";import{toParquetJSONGeometryType as r}from"../../../../../layers/support/parquetUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as a,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const r=this.layer,l=a(r,e)??i(r),o=t(r,e),n=[...r.labelingInfo||[],...o?.labelingInfo||[]];return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:l,labelingInfo:n}]}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}async createServiceOptions(t){const a=l(this.layer),i=t.spatialReference.toJSON(),s=this.layer.encoding;if(null==s)throw new e("parquet-layer:unsupported","creating a parquet layer view requires an encoding",{layer:this.layer});return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:i,geometryInfo:{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),encoding:s.toJSON()},metadata:{spatialReference:this.layer.spatialReference,outSpatialReference:i,fieldsIndex:this.layer.fieldsIndex.toJSON(),featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},geometryType:a,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}createSourceSchema(e,r){return{type:"parquet",mutable:{sourceRefreshVersion:r,availableFields:e.availableFields.includes("*")?this.layer.fields.map((e=>e.name)):e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,r,l){const a={fields:this.layer.fields.map((e=>e.toJSON())),renderer:this.layer.renderer?.clone(),
|
|
5
|
+
import e from"../../../../../core/Error.js";import{toParquetJSONGeometryType as r}from"../../../../../layers/support/parquetUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as a,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const r=this.layer,l=a(r,e)??i(r),o=t(r,e),n=[...r.labelingInfo||[],...o?.labelingInfo||[]];return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:l,labelingInfo:n}]}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}async createServiceOptions(t){const a=l(this.layer),i=t.spatialReference.toJSON(),s=this.layer.encoding;if(null==s)throw new e("parquet-layer:unsupported","creating a parquet layer view requires an encoding",{layer:this.layer});return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:i,geometryInfo:{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),encoding:s.toJSON()},metadata:{spatialReference:this.layer.spatialReference,outSpatialReference:i,fieldsIndex:this.layer.fieldsIndex.toJSON(),featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},geometryType:a,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}createSourceSchema(e,r){return{type:"parquet",mutable:{sourceRefreshVersion:r,availableFields:e.availableFields.includes("*")?this.layer.fields.map((e=>e.name)):e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,r,l){const a={fields:this.layer.fields.map((e=>e.toJSON())),renderer:this.layer.renderer?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return o(e,r,a,l)}}export{y as ParquetLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as r,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as l}from"./labelingUtils.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as
|
|
5
|
+
import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as r,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as l}from"./labelingUtils.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as o}from"../support/rendererUtils.js";class a{constructor(e){this.layer=e}getLabelingDeconflictionInfo(t){const n=this.layer,o=r(n,t)??i(n),a=e(n,t),s=[...n.labelingInfo||[],...a?.labelingInfo||[]];return[{vvEvaluators:{0:l(n.renderer)},deconflictionEnabled:o,labelingInfo:s}]}async createServiceOptions(e){const r=this.layer,i=t(r),l=r.timeInfo?.toJSON()||null,n=r.spatialReference?r.spatialReference.toJSON():null,o=e.spatialReference.toJSON();return{type:"stream",source:this.layer.parsedUrl,outSpatialReference:o,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:i,featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},timeInfo:l,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,spatialReference:n,outSpatialReference:o,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(e,t){const{definitionExpression:r,geometryDefinition:i,customParameters:l}=this.layer;return{type:"stream",mutable:{sourceRefreshVersion:t,availableFields:e.availableFields,dataFilter:{geometryDefinition:i?.toJSON(),definitionExpression:r,customParameters:l??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(t,r,i){const{fields:l,renderer:o,geometryType:a,labelingInfo:s,labelsVisible:c,objectIdField:d,trackInfo:f}=this.layer,m={fields:l.map((e=>e.toJSON())),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:e(this.layer,r),geometryType:a,labelingInfo:s,labelsVisible:c,objectIdField:d,orderBy:"default",trackInfo:f};return n(t,r,m,i)}get hasRequiredSupport(){return o(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>e(this.layer,t),()=>this.layer.customParameters,()=>this.layer.geometryDefinition,()=>this.layer.definitionExpression,()=>this.layer.trackInfo]}}export{a as StreamLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{createSnapshotInfo as i,createFeatureIdInfo as l}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as n}from"./floorFilterUtils.js";import{getServiceGeometryType as u}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as p}from"./labelingUtils.js";import{createFeatureSourceSchema as
|
|
5
|
+
import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{createSnapshotInfo as i,createFeatureIdInfo as l}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as n}from"./floorFilterUtils.js";import{getServiceGeometryType as u}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as p}from"./labelingUtils.js";import{createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as y}from"../schema/processor/SubtypeProcessorSchema.js";class m{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer;return[{vvEvaluators:{},deconflictionEnabled:t.sublayers.some((e=>p(e))),labelingInfo:t.sublayers.toArray().filter((e=>!!e.labelingInfo)).flatMap((e=>e.labelingInfo))}]}async createServiceOptions(t){const r=this.layer,{capabilities:a,datesInUnknownTimezone:o,dateFieldsTimeZone:n,editingInfo:p,globalIdField:c,objectIdField:y,refreshInterval:m,subtypeField:d}=r,f=r.fieldsIndex.toJSON(),b=u(r),h=r.timeInfo?.toJSON(),S=r.spatialReference.toJSON(),g=e(this.layer.parsedUrl),F=y,I=!(null!=p?.lastEditDate)&&m>0,x=s(g.path),R=t.spatialReference.toJSON(),j=i(x,I,a,b,t.extent,r.fullExtent);return{type:"feature-service",source:g,isSourceHosted:x,orderByFields:F,outSpatialReference:R,metadata:{timeReferenceUnknownClient:o,dateFieldsTimeZone:n,subtypeField:d,globalIdField:c,fieldsIndex:f,geometryType:b,featureIdInfo:l(this.layer),timeInfo:h,spatialReference:S,outSpatialReference:R,subtypes:this.layer.subtypes?.map((e=>e.toJSON())),typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,lastEditDate:p?.lastEditDate?.getTime(),snapshotInfo:j}}}createSourceSchema(e,t){const{definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:i,subtypeField:l,timeExtent:o,apiKey:n,displayFilterInfo:u}=this.layer,p={queryScaleRanges:this.layer.sublayers.items.map((e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale}))),definitionExpression:r,displayFilterInfo:u,customParameters:s,gdbVersion:a,historicMoment:i,subtypeField:l,timeExtent:o};return c(p,e,t,n)}createProcessorSchema(e,t,r){const s={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,((e,t)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${t}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null})))};return y(e,t,s,r)}addFilters(e,t){e=o(this.layer,e,t);const s=this.layer.sublayers.filter((e=>!d(e,t))).map((e=>e.subtypeCode));if(!s.length)return e;e??=new a;const i=`NOT ${this.layer.subtypeField} IN (${s.join(",")})`;return e.where=r(e.where,i),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>n(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.sublayers.map((({renderer:e,labelsVisible:t,labelingInfo:r,visible:s,minScale:a,maxScale:i})=>({renderer:e,labelsVisible:t,labelingInfo:r,visible:s,minScale:a,maxScale:i})))]}setGraphicOrigin(e){const t=this.layer.fieldsIndex.get(this.layer.subtypeField),r=e.attributes[t.name],s=this.layer.sublayers.find((e=>e.subtypeCode===r));e.layer=e.sourceLayer=s}}function d(e,r){return e.visible&&(0===e.minScale||t(r.scale,e.minScale)||r.scale<e.minScale)&&(0===e.maxScale||t(r.scale,e.maxScale)||r.scale>e.maxScale)}export{m as SubtypeGroupLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as m}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as p,convertToGeometry as f,convertFromNestedArray as g}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as _}from"../../../../../layers/graphics/OptimizedFeature.js";import b from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,TrackPart as I,externalTrackLineOidPrefix as k,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as F}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as j}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as T}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as R}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as w}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as L}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as A}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as C}from"../support/FeatureSetReaderJSON.js";let G;const P=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),z=32;class M{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class W{static getOid(t){return k+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new b}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes??{},aggregateId:this.objectId,[y]:I.TrackLine};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}stageObservation(t,e){this._nextObservationRecords.push(new M(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e){const r=new Set(this._nextObservationRecords.map((t=>t.objectId))),i=this._observationRecords.filter((t=>!r.has(t.objectId))).map((t=>t.objectId));let a,o;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort(((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0})),this._schema.timeField){case"startTimeField":a=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":a=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":a=this._isStream?v:null}o=this._isStream?e?.end??Date.now():e?.end??-1/0;const n=t.map((t=>t.reader.getCursor()));let l;for(let c=this._nextObservationRecords.length-1;c>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);c--){const t=this._nextObservationRecords[c],e=n[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=a?e.readAttributeAsTimestamp(a):null;(null!=r?o-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),l??=t)}if(null!=l){const{chunkIndex:t,featureIndex:e,objectId:r,displayId:i}=l,a=n[t];s(a),a.setIndex(e);const o=new _(a.readGeometryWorldSpace(),{...a.readAttributes(),[y]:I.LatestObservation},null,r,i);this._latestObservationFeature=o}else this._latestObservationFeature=null;return this._trackLineGeometry=E(this._trackLineGeometry,this._trackLinePath,this._spatialReference),this._bounds=X(this._trackLineGeometry),this._nextObservationRecords=[],i}updateStatistics(t,e){this._statistics=j.create(this._fields);const r=t.map((t=>t.reader.getCursor()));for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,z))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=new b;p(a,r,!1,!1,this._metadata.geometryType,t.subscription.tile.transform);const o=l(1/0,1/0,-1/0,-1/0);N(a,((t,e)=>u(o,[t,e])));if(!c(o,l(0,0,F,F)))return null;return new _(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=new b;p(e,this._trackLineGeometry,!1,!1,"esriGeometryPolyline",t.subscription.tile.transform);return new _(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new _(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class U extends x{constructor(t){super(t),this.done=!1}}class q extends T{static async create(t,e,s,a,o,n){const l=new w({spatialReference:e}),c=await Promise.all(t.fields.map((async t=>O.create(l,t)))),d=t.featureFilter?await D.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then((([t,e,s])=>{G={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}})),new q(t,s,a,e,c,d,o,n)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=L.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){const t=new Set(this._source.chunks().map((t=>t.chunkId)));for(const e of t)if(!this._handledChunks.has(e))return!0;for(const e of this._handledChunks)if(!t.has(e))return!0;return!1}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new U(t)}async*applyOverrideUpdate(t){P().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map((t=>[e(t),t]))),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null==t)for(const e of a.observations()){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId)}}else{const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId)}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map((t=>t.reader.getCursor()));for(const a of this._tracks.values()){e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature());for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,attributes:{},...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),(t=>t.objectId));return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.readAttribute(e),i=a.getObjectId();if(null!=t&&null!=i&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(a.getDisplayId()||a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(i)),!this._tracks.has(t)){const e=W.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),r=new W(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,r)}this._tracks.get(t).stageObservation(r,a),s.add(t)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,R(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=C.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=C.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map((()=>[]));for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map(((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=A.from(i,s[r]);return a.setProcessorAttributes({[y]:I.PreviousObservation}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a})).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function E(t,e,s){if(e.length<2)return g(t,[e],!1,!1);if(s.isWrappable){let r=!1;for(let t=1;t<e.length;t++){const i=e[t][0],a=h(i,e[t-1][0],s);i!==a&&(e[t][0]=a,r=!0)}if(r){const r=m({paths:[e],spatialReference:s});if(null!=r)return g(t,r.paths,!1,!1)}return g(t,[e],!1,!1)}const r=G.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[e]}),i=G.fromSpatialReference(s);if(null!=i){const e=a(r,1e6,i,o.geodesic);if(null!=e){const s=G.toGeometry(e,i);if(null!=s&&"paths"in s)return g(t,s.paths,!1,!1)}}return g(t,[e],!1,!1)}function N(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function X(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{q as TrackStrategy};
|
|
5
|
+
import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromNestedArray as b}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as _}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,TrackPart as I,externalTrackLineOidPrefix as v,internalTimeReceivedField as k}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as F}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as O}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as j}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as x}from"./AAggregateStrategy.js";import{ASendState as T}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as R}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as D}from"../support/ComputedAttributeStorage.js";import w from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as L}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as A}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as C}from"../support/FeatureSetReaderJSON.js";let G;const P=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),W=32;class z{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class M{static getOid(t){return v+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new g}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes??{},aggregateId:this.objectId,[y]:I.TrackLine};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new z(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map((t=>t.objectId))),a=this._observationRecords.filter((t=>!i.has(t.objectId))).map((t=>t.objectId));let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort(((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0})),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?k:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map((t=>t.reader.getCursor()));let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new _(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:I.LatestObservation},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=E(this._trackLineGeometry,this._trackLinePath,this._spatialReference),this._bounds=X(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=O.create(this._fields);const r=t.map((t=>t.reader.getCursor()));for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,W))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=new g;m(a,r,!1,!1,this._metadata.geometryType,t.subscription.tile.transform);const o=l(1/0,1/0,-1/0,-1/0);N(a,((t,e)=>u(o,[t,e])));if(!c(o,l(0,0,F,F)))return null;return new _(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=new g;m(e,this._trackLineGeometry,!1,!1,"esriGeometryPolyline",t.subscription.tile.transform);return new _(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new _(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class U extends T{constructor(t){super(t),this.done=!1}}class q extends x{static async create(t,e,s,a,o,n){const l=new D({spatialReference:e}),c=await Promise.all(t.fields.map((async t=>j.create(l,t)))),d=t.featureFilter?await w.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then((([t,e,s])=>{G={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}})),new q(t,s,a,e,c,d,o,n)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=L.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}destroy(){super.destroy();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){const t=new Set(this._source.chunks().map((t=>t.chunkId)));for(const e of t)if(!this._handledChunks.has(e))return!0;for(const e of this._handledChunks)if(!t.has(e))return!0;return!1}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new U(t)}async*applyOverrideUpdate(t){P().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map((t=>[e(t),t]))),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map((t=>t.reader.getCursor()));for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,attributes:{},...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,attributes:{},...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),(t=>t.objectId));return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.readAttribute(e),i=a.getObjectId();if(null!=t&&null!=i&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(a.getDisplayId()||a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(i)),!this._tracks.has(t)){const e=M.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),r=new M(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,r)}this._tracks.get(t).stageObservation(r,a),s.add(t)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,R(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e);null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=C.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=C.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map((()=>[]));for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map(((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=A.from(i,s[r]);return a.setProcessorAttributes({[y]:I.PreviousObservation}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a})).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function E(t,e,s){if(e.length<2)return b(t,[e],!1,!1);if(s.isWrappable){let r=!1;for(let t=1;t<e.length;t++){const i=e[t][0],a=h(i,e[t-1][0],s);i!==a&&(e[t][0]=a,r=!0)}if(r){const r=p({paths:[e],spatialReference:s});if(null!=r)return b(t,r.paths,!1,!1)}return b(t,[e],!1,!1)}const r=G.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[e]}),i=G.fromSpatialReference(s);if(null!=i){const e=a(r,1e6,i,o.geodesic);if(null!=e){const s=G.toGeometry(e,i);if(null!=s&&"paths"in s)return b(t,s.paths,!1,!1)}}return b(t,[e],!1,!1)}function N(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function X(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{q as TrackStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{numericHash as e}from"../../../../../../core/string.js";import{validateLabelingInfo as s}from"../../../../../../layers/support/labelingInfo.js";import{getServiceGeometryType as l}from"../../layerAdapters/geometryUtils.js";import{createSymbolMeshSchemas as
|
|
5
|
+
import{numericHash as e}from"../../../../../../core/string.js";import{validateLabelingInfo as s}from"../../../../../../layers/support/labelingInfo.js";import{getServiceGeometryType as l}from"../../layerAdapters/geometryUtils.js";import{createSymbolMeshSchemas as o}from"./symbols/SymbolSchema.js";async function a(e,o,a){const r=o.labelsVisible&&o.labelingInfo||[],i=l(o),t=s(r,i);return{type:"label",classes:await Promise.all(t.map(((s,l)=>n(e,s,o.labelsVisible,o.labelingInfoSource,l,i,a))))}}async function n(s,l,a,n,r,i,t){const m=e(`${n} ${r}`),c=await o(l,{schemaOptions:s,uniforms:t,labelClassId:m});return{maxScale:l.maxScale,minScale:l.minScale,deconflictionEnabled:"none"!==l.deconflictionStrategy&&a,expression:l.labelExpressionInfo?.expression??l.labelExpression,where:l.where,meshes:c,labelClassId:m,geometryType:i}}export{a as createLabelMatcherSchema};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{pt2px as e}from"../../../../../../core/screenUtils.js";import r from"../../../../../../layers/support/OrderByInfo.js";import{TechniqueType as t}from"../../../../engine/webgl/shaderGraph/techniques/TechniqueType.js";import{createLabelMatcherSchema as
|
|
5
|
+
import{pt2px as e}from"../../../../../../core/screenUtils.js";import r from"../../../../../../layers/support/OrderByInfo.js";import{TechniqueType as t}from"../../../../engine/webgl/shaderGraph/techniques/TechniqueType.js";import{createLabelMatcherSchema as i}from"./LabelMatcherSchema.js";import{createMatcherSchema as s}from"./MatcherSchema.js";import{createStorageSchema as n,createTrackStorageSchema as a}from"./StorageSchema.js";import{createVisualVariableUniforms as l}from"./VisualVariablesSchema.js";async function o(e,r){const t=r.renderer,n=l(t);return{symbology:await s(e,t),labels:await i(e,r,n)}}async function c(e,r,t,i){const s=t.featureReduction;if(s)switch(s.type){case"binning":return b(s,e,r,t,i);case"cluster":return p(s,e,r,t,i)}if(t.trackInfo?.enabled)return y(t.trackInfo,e,r,t,i);const a=m(t.orderBy,t.renderer,t.objectIdField),l=n(t.renderer,r.filters),c=await o(e,t),u=g(c.symbology);return{storage:l,mesh:{properties:{sortKey:a,timeZone:r.timeZone,returnMeshObjectId:u,displayRefreshVersion:i,currentUser:r.currentUser},strategy:{type:"feature"},factory:c},expressionProperties:{timeExtent:r.timeExtent?.toJSON()}}}function u(e,r){return e.fields.map((e=>({...e.toJSON(),type:f(e,r)})))}function f(e,r){const{onStatisticExpression:t,onStatisticField:i,statisticType:s}=e;switch(s){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(t){const{returnType:e}=t;return e?"string"===e?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const e=r.find((e=>e.name===i));return e?e.type:"esriFieldTypeString"}}}async function b(r,t,a,o,c){const f=u(r,o.fields),b=r.renderer,p=await s(t,b),y=n(b,[null,null]),m=l(b),d=await i(t,{geometryType:"polygon",labelingInfoSource:o.labelingInfoSource+"-binning",labelingInfo:r.labelingInfo,labelsVisible:r.labelsVisible},m),v=g(p),h="geohash"===r.binType?{type:"geohash",fixBinLevel:r.fixedBinLevel??3}:{type:"grid",size:e(r.size),fixedBinLevel:r.fixedBinLevel};return{storage:y,mesh:{properties:{sortKey:null,timeZone:a.timeZone,returnMeshObjectId:v,displayRefreshVersion:c,currentUser:a.currentUser},strategy:{type:"binning",fields:f,index:h,featureFilter:a.filters[0]},factory:{labels:d,symbology:p}},expressionProperties:{timeExtent:a.timeExtent?.toJSON()}}}async function p(r,t,a,o,c){const f=u(r,o.fields),b={type:"cluster",feature:await s(t,r.effectiveFeatureRenderer),cluster:await s(t,r.effectiveClusterRenderer)},p=l(r.effectiveFeatureRenderer),y={type:"cluster",feature:await i(t,o,p),cluster:await i(t,{geometryType:"point",labelingInfoSource:o.labelingInfoSource+"-clusters",labelingInfo:r.labelingInfo,labelsVisible:r.labelsVisible},p)},m=n(r.effectiveFeatureRenderer,[null,null]),d=g(b);return{storage:m,mesh:{properties:{sortKey:null,timeZone:a.timeZone,displayRefreshVersion:c,returnMeshObjectId:d,currentUser:a.currentUser},strategy:{type:"cluster",fields:f,featureFilter:a.filters[0],clusterRadius:e(r.clusterRadius/2)},factory:{labels:y,symbology:b}},expressionProperties:{timeExtent:a.timeExtent?.toJSON()}}}async function y(e,r,t,n,o){const c=u(e,n.fields),f={type:"track",previousObservation:await s(r,e.previousObservations.renderer),latestObservation:await s(r,e.latestObservations.renderer),trackLine:await s(r,e.trackLines.renderer)},b={type:"track",previousObservation:await i(r,{geometryType:n.geometryType,labelingInfoSource:n.labelingInfoSource+"-track-prev",labelingInfo:e.previousObservations.labelingInfo,labelsVisible:e.previousObservations.labelsVisible},l(e.previousObservations.renderer)),latestObservation:await i(r,{geometryType:n.geometryType,labelingInfoSource:n.labelingInfoSource+"-track-latest",labelingInfo:e.latestObservations.labelingInfo,labelsVisible:e.latestObservations.labelsVisible},l(e.latestObservations.renderer)),trackLine:await i(r,{geometryType:"polyline",labelingInfoSource:n.labelingInfoSource+"-track-line",labelingInfo:e.trackLines.labelingInfo,labelsVisible:e.trackLines.labelsVisible},l(e.trackLines.renderer))},p=a(e,[null,null]),y=g(f);return{storage:p,mesh:{properties:{sortKey:null,timeZone:t.timeZone,returnMeshObjectId:y,displayRefreshVersion:o,currentUser:t.currentUser},strategy:{type:"track",featureFilter:t.filters[0],fields:c,maxDisplayDuration:e.maxDisplayDuration?.toMilliseconds()??0,maxDisplayObservationsPerTrack:e.maxDisplayObservationsPerTrack,showLatestObservation:e.latestObservations.visible,showPreviousObservations:e.previousObservations.visible,showTrackLine:e.trackLines.visible,timeField:e.timeField},factory:{labels:b,symbology:f}},expressionProperties:{timeExtent:t.timeExtent?.toJSON()}}}function m(e,t,i){const s=null!=t&&"unique-value"===t.type&&t.orderByClassesEnabled;if("default"!==e||s||(e=[new r({field:i,order:"descending"})]),"default"!==e&&e?.length){e.length;const r=e[0],t="ascending"===r.order?"asc":"desc";return r.field?{field:r.field,order:t}:r.valueExpression?{expression:r.valueExpression,order:t}:null}if(s){return{byRenderer:!0,order:"asc"}}return null}function d(e){return e.techniqueType===t.AnimatedMarker}function g(e){if("simple"===e.type&&e.meshes.some(d))return!0;if("interval"===e.type){if(e.intervals.some((e=>e.meshes.some(d))))return!0;if(e.backgroundFill.some(d))return!0}if("map"===e.type){if(e.map.some((e=>e.symbol.some(d))))return!0;if(e.backgroundFill.some(d))return!0}return!1}export{c as createSimpleProcessorSchema,u as getAggregateFields};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createLabelMatcherSchema as e}from"./LabelMatcherSchema.js";import{createMatcherSchema as r}from"./MatcherSchema.js";import{createVVBindings as t}from"./StorageSchema.js";import{createVisualVariableUniforms as s}from"./VisualVariablesSchema.js";import{getWebGLCapabilities as
|
|
5
|
+
import{createLabelMatcherSchema as e}from"./LabelMatcherSchema.js";import{createMatcherSchema as r}from"./MatcherSchema.js";import{createVVBindings as t}from"./StorageSchema.js";import{createVisualVariableUniforms as s}from"./VisualVariablesSchema.js";import{getWebGLCapabilities as i}from"../../../../../webgl/capabilities.js";async function a(e,{subtypeField:t,sublayers:s}){const i=await Promise.all(s.map((({renderer:t})=>r(e,t))));return{type:"subtype",subtypeField:t,renderers:s.reduce(((e,{subtypeCode:r},t)=>({...e,[r]:i[t]})),{})}}function n(e,r){const s=i();return{type:"multi",filters:e.filters,capabilities:{maxTextureSize:s.maxTextureSize},keyField:r.subtypeField,target:"feature",bindings:r.sublayers.reduce(((e,{renderer:r,subtypeCode:s})=>{const i=t(r);return{...e,[s]:i}}),{})}}async function o(r,{subtypeField:t,sublayers:i,labelingInfoSource:a}){const n=await Promise.all(i.map((t=>{const i=s(t.renderer),n={...t,geometryType:t.geometryType??null,labelingInfoSource:a};return e(r,n,i)})));return{type:"subtype",subtypeField:t,renderers:i.reduce(((e,{subtypeCode:r},t)=>({...e,[r]:n[t]})),{})}}async function u(e,r,t,s){return{storage:n(r,t),mesh:{properties:{timeZone:r.timeZone,displayRefreshVersion:s,returnMeshObjectId:!1,sortKey:null,currentUser:r.currentUser},strategy:{type:"feature"},factory:{symbology:await a(e,t),labels:await o(e,t)}},expressionProperties:{timeExtent:r.timeExtent?.toJSON()}}}export{u as createSubtypeProcessorSchema};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{difference as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{isSome as t,difference as s}from"../core/arrayUtils.js";import o from"../core/Collection.js";import{referenceSetter as i}from"../core/collectionUtils.js";import n from"../core/Evented.js";import r from"../core/Logger.js";import{getOrCreateMapValue as l}from"../core/MapUtils.js";import{removeMaybe as c}from"../core/maybe.js";import a from"../core/ReactiveMap.js";import{watch as h,on as u,initial as d}from"../core/reactiveUtils.js";import{symmetricDifference as p}from"../core/SetUtils.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{isSubtypeSublayer as y,isSubtypeGroupLayer as m,isKnowledgeGraphLayer as _,isMapImageLayer as v}from"../layers/support/layerUtils.js";import w from"../rest/support/Query.js";import{isSelectableLayer as S}from"./support/selectionUtils.js";let b=class extends n.EventedAccessor{constructor(e){super(e),this._selectionMap=new a,this._sources=new o,this._trashCan=[],this._layerEditHandles=new o,this._vizTaskId=0,this.view=null,this.showHighlight=!0,this.highlightName="default"}initialize(){this.addHandles([h((()=>[this.view,this.showHighlight]),(()=>this._refreshVisualization())),h((()=>this.view),(e=>{e?.when().then((()=>this.syncSources()))}),d),u((()=>this.sources),"change",(e=>{const t=this._selectionMap,s=[];for(const o of e.removed){const e=t.get(o);e&&(t.delete(o),e.highlightHandle?.remove(),s.push({layer:o,selection:[],added:[],removed:[...e.selection]}))}this._refreshListeners(),s.length&&this._onSelectionChange(s)}),{onListenerAdd:()=>this._refreshListeners()})])}destroy(){this.clear(),this._layerEditHandles.drain(c)}get selections(){return Array.from(this._selectionMap.entries()).map((e=>{const[t,s]=e;return{layer:t,selection:[...s.selection]}}))}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get sources(){return this._sources}set sources(e){i(e,this._sources)}syncSources(){const e=new Set,t=this.view?.map;if(!t)return;const s=t=>{_(t)?(t.layers?.forEach(s),t.tables?.forEach(s)):v(t)?(t.sublayers?.forEach(s),t.subtables?.forEach(s)):m(t)?t.sublayers?.forEach(s):S(t)&&e.add(t)};t.allLayers.forEach(s),t.allTables.forEach(s),this.sources=[...e]}async getSelectedFeatures(e,s={},o="layerView"){const{view:i,selections:n}=this;if(!i&&"layerView"===o)return r.getLogger(this).warn("Cannot query layer views without a view."),[];const l=(e?.length?n.filter((t=>e.includes(t.layer))):n).map((async e=>{const{layer:t,selection:n}=e;if(!n.length)return;const r=y(t)?t.parent:t;if(null!=r){if(i&&"layerView"===o&&!j(r)&&E(r)){const e=await i.whenLayerView(r).catch((()=>null));if(e)return L(e,n,s)}return L(r,n,s)}})).filter(t);return(await Promise.all(l)).filter(t)}updateSelection(e){const t=new Map;for(const[s,n]of this._selectionMap)t.set(s,[...n.selection]);let o=!1;const i=e.current.concat(e.added);for(const s of i){const e=s.sourceLayer,i=s.getObjectId();if(this.sources.includes(e)&&(S(e)||y(e))&&null!==i){const s=l(t,e,(()=>[]));s.includes(i)||(s.push(i),o=!0)}}for(const s of e.removed){const e=s.sourceLayer,i=s.getObjectId();if(this.sources.includes(e)&&(S(e)||y(e))&&null!==i){const s=t.get(e),n=s?.indexOf(i);void 0!==n&&n>=0&&(s?.splice(n,1),o=!0)}}if(o){const{_selectionMap:e,_trashCan:o}=this,i=[];for(const[n,r]of t){const t=e.get(n);void 0!==t&&o.push(t),e.set(n,{selection:r}),i.push({layer:n,selection:r,...s(void 0!==t?t.selection:[],r)})}this._onSelectionChange(i)}}setSelection(e,t){this._setSelection(e,t)}getSelection(e){const t=this._selectionMap.get(e);return t?.selection}appendToSelection(e,t){const s=this._selectionMap.get(e),o=void 0!==s?[...s.selection]:[];for(const i of t)o.includes(i)||o.push(i);this._setSelection(e,o)}removeFromSelection(e,t){const s=this._selectionMap.get(e);if(!s)return;const o=[];for(const i of s.selection)t.includes(i)||o.push(i);this._setSelection(e,o)}toggleInSelection(e,t){const s=this._selectionMap.get(e);if(!s||0===s.selection.length)return void this._setSelection(e,t);const o=new Set(s.selection),i=new Set(t),n=p(o,i);this._setSelection(e,Array.from(n))}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[s,o]of this._selectionMap.entries())t.push({layer:s,added:[],removed:[...o.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}_refreshVisualization(){for(this._vizTaskId++;this._trashCan.length>0;){const e=this._trashCan.pop();e?.highlightHandle?.remove()}if(null==this.view)return;const{sources:e,view:t,_selectionMap:s,showHighlight:o}=this,i=this._vizTaskId;for(const n of e){const e=s.get(n),r=y(n)?n.parent:n;if(null!=r&&E(r)){if(j(r))continue;t.whenLayerView(r).then((t=>{e?.highlightHandle?.remove(),null!=e&&o&&i===this._vizTaskId&&"highlight"in t&&"function"==typeof t.highlight&&e.selection.length>0&&(e.highlightHandle=t.highlight(e.selection,this.highlightName))})).catch((()=>{e?.highlightHandle?.remove()}))}}}_refreshListeners(){this._layerEditHandles.drain(c);const e=new Set(this.sources.map((e=>y(e)?e.parent:e)));for(const t of e)S(t)&&"on"in t&&t.on&&this._layerEditHandles.push(t.on("edits",(e=>this._onLayerEdit(e,t))))}_onLayerEdit(e,t){if(m(t))this._onParentLayerEdit(e,t);else if(e.deletedFeatures.length&&this._selectionMap.has(t)){const s=[];e.deletedFeatures.forEach((({error:e,objectId:t})=>{null!=t&&null==e&&s.push(t)})),this.removeFromSelection(t,s)}}_onParentLayerEdit(e,t){const{deletedFeatures:s,edits:o,updatedFeatures:i}=e;if(o?.updateFeatures?.forEach((e=>{const s=e.getObjectId()??e.attributes[t.objectIdField];if(null==s)return;if(i.find((e=>e.objectId===s))?.error)return;const o=t.findSublayerForFeature(e);if(!S(o))return;const n=t.sublayers.find((e=>!(!S(e)||!this.getSelection(e)?.includes(s))));S(n)&&n!==o&&(this.removeFromSelection(n,[s]),this.appendToSelection(o,[s]))})),s.length){const e=[];s.forEach((({error:t,objectId:s})=>{null!=s&&null==t&&e.push(s)})),t.sublayers.forEach((t=>{S(t)&&this._selectionMap.has(t)&&this.removeFromSelection(t,e)}))}}_setSelection(e,t){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const o=this._selectionMap.get(e);if(void 0===o||!F(o,{selection:t})){void 0!==o&&this._trashCan.push(o),this._selectionMap.set(e,{selection:[...t]});const i={layer:e,selection:[...t],...s(void 0!==o?o.selection:[],t)};this._onSelectionChange([i])}}};e([f()],b.prototype,"_selectionMap",void 0),e([f()],b.prototype,"_sources",void 0),e([f({readOnly:!0,nonNullable:!0})],b.prototype,"selections",null),e([f({readOnly:!0,nonNullable:!0})],b.prototype,"count",null),e([f()],b.prototype,"view",void 0),e([f({readOnly:!0,nonNullable:!0})],b.prototype,"hasSelection",null),e([f()],b.prototype,"showHighlight",void 0),e([f()],b.prototype,"sources",null),e([f()],b.prototype,"highlightName",void 0),b=e([g("esri.views.SelectionManager")],b);const j=e=>y(e)?!0===e.parent?.isTable:e.isTable,M=e=>void 0!==e.layer,E=e=>void 0!==e?.when,F=(e,t)=>{if(null==e&&null==t)return!0;if(null!=e&&null==t||null==e&&null!=t)return!1;if(null!=e&&null!=t&&null!=e.selection&&null!=t.selection){const s=[...e.selection],o=[...t.selection];if(s.length!==o.length)return!1;s.sort(),o.sort();for(let e=0;e<s.length;e++)if(s[e]!==o[e])return!1}return!0},L=async(e,t,s={})=>{let o;if(M(e)){const i=e;o=void 0===i?null:await i.queryFeatures(new w({...s,objectIds:t})).then((t=>({data:t,layer:e.layer})))}else{const i=e;o=void 0===i?null:await i.queryFeatures(new w({...s,objectIds:t})).then((e=>({data:e,layer:i})))}return o},C=b;export{C as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3359,5740],{23154:(e,t,r)=>{r.d(t,{K:()=>d,Q:()=>s});var a=r(77548),n=r(24183);const o=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function s(e,t){const{loadContext:r,...o}=t||{},s=r?await r.fetchServiceMetadata(e,o):await(0,n.V)(e,o),i=(0,a.G$)();p(s),u(s);const l={serviceJSON:s,preferredHost:i};if((s.currentVersion??0)<10.5)return l;const c=`${(0,a.$x)()??e}/layers`,y=r?await r.fetchServiceMetadata(c,o):await(0,n.V)(c,o);return p(y),u(y),l.layersJSON={layers:y.layers,tables:y.tables},l}function i(e){const{type:t}=e;return!!t&&o.has(t)}function l(e){return"Table"===e.type}function u(e){e.layers=e.layers?.filter(i),e.tables=e.tables?.filter(l)}function c(e){e.type||="Feature Layer"}function y(e){e.type||="Table"}function p(e){e.layers?.forEach(c),e.tables?.forEach(y)}function d(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}},24183:(e,t,r)=>{r.d(t,{V:()=>n});var a=r(78888);async function n(e,t){const{data:r}=await(0,a.A)(e,{responseType:"json",query:{f:"json",...t?.customParameters,token:t?.apiKey}});return r}},26121:(e,t,r)=>{r.d(t,{ci:()=>s,dL:()=>n});var a=r(49186);async function n(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}r(77548);const o=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);function s(e,t,r){let n=(e.messages??[]).filter((({type:e})=>"error"===e)).map((({name:e,message:t,details:r})=>new a.A(e,t,r)));if(e.blockedRelativeUrls&&(n=n.concat(e.blockedRelativeUrls.map((e=>new a.A("url:unsupported",`Relative url '${e}' is not supported`))))),r){const{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:a}=r;e&&(n=n.filter((({name:e})=>!(o.has(e)||t.includes(e))))),a&&(n=n.filter((e=>"web-document-write:property-required"!==e.name)))}if(n.length>0)throw new a.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:n})}},33359:(e,t,r)=>{r.d(t,{save:()=>E,saveAs:()=>U});var a=r(4576),n=(r(44208),r(49186),r(71530)),o=r(60694),s=r(23154),i=r(77548),l=r(88788),u=r(10407);const c="Feature Service",y="feature-layer-utils",p=`${y}-save`,d=`${y}-save-as`;function f(e){return{isValid:(0,i.W_)(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function m(e,t){const r=(0,l.m)(e,"portal-item");return t?.isTable&&(r.layerContainerType="tables"),r}function w(e){const t=[],r=[];for(const{layer:a,layerJSON:n}of e)h(a)?r.push(n):t.push(n);return{layers:t,tables:r}}function h(e,t){return e.isTable}function b(e){return w([e])}async function v(e,t){return/\/\d+\/?$/.test(e.url)?b(t[0]):async function(e,t){if(e.reverse(),!t)return w(e);const a=await async function(e,t){let a=await e.fetchData("json");if(function(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}(a))return a;a||={},function(e){e.layers||=[],e.tables||=[]}(a);const{layer:{url:n,customParameters:o,apiKey:i}}=t[0];return await async function(e,t,a){const{url:n,customParameters:o,apiKey:i}=t,{serviceJSON:l,layersJSON:u}=await(0,s.Q)(n,{customParameters:o,apiKey:i}),c=I(e.layers,l.layers,a),y=I(e.tables,l.tables,a);e.layers=c.itemResources,e.tables=y.itemResources;const p=[...c.added,...y.added],d=u?[...u.layers,...u.tables]:[];await async function(e,t,a,n){const o=await async function(e){const t=[];e.forEach((({type:e})=>{switch((0,s.K)(e)){case"CatalogLayer":t.push(Promise.all([r.e(1214),r.e(708),r.e(364),r.e(8628),r.e(2593),r.e(1419)]).then(r.bind(r,79003)).then((e=>e.default)));break;case"FeatureLayer":t.push(Promise.all([r.e(1214),r.e(9953),r.e(3029),r.e(3600),r.e(3447)]).then(r.bind(r,13600)).then((e=>e.default)));break;case"OrientedImageryLayer":t.push(Promise.all([r.e(1214),r.e(9953),r.e(3029),r.e(3600),r.e(8373)]).then(r.bind(r,97927)).then((e=>e.default)))}}));const a=await Promise.all(t),n=new Map;return e.forEach((({type:e},t)=>{n.set(e,a[t])})),n}(t),i=t.map((({id:e,type:t})=>new(o.get(t))({url:a,layerId:e,sourceJSON:n.find((({id:t})=>t===e))})));await Promise.allSettled(i.map((e=>e.load()))),i.forEach((t=>{const{layerId:r,loaded:a,defaultPopupTemplate:n}=t;if(!a||null==n)return;const o={id:r,popupInfo:n.toJSON()};L(t,"ArcGISFeatureLayer"===t.operationalLayerType?o:{...o,layerType:t.operationalLayerType},e)}))}(e,p,n,d)}(a,{url:n??"",customParameters:o,apiKey:i},t.map((e=>e.layer.layerId))),a}(t,e);for(const t of e)L(t.layer,t.layerJSON,a);return function(e,t){const r=[],a=[];for(const{layer:e}of t){const{isTable:t,layerId:n}=e;t?a.push(n):r.push(n)}S(e.layers,r),S(e.tables,a)}(a,e),a}(t,e)}function S(e,t){if(e.length<2)return;const r=[];for(const{id:t}of e)r.push(t);(0,a.aI)(r.sort(g),t.slice().sort(g))&&e.sort(((e,r)=>{const a=t.indexOf(e.id),n=t.indexOf(r.id);return a<n?-1:a>n?1:0}))}function g(e,t){return e<t?-1:e>t?1:0}function I(e,t,r){const n=(0,a.iv)(e,t,((e,t)=>e.id===t.id));e=e.filter((e=>!n.removed.some((t=>t.id===e.id))));const o=n.added;return o.forEach((({id:t})=>{e.push({id:t})})),{itemResources:e,added:o.filter((({id:e})=>!r.includes(e)))}}function L(e,t,r){e.isTable?P(r.tables,t):P(r.layers,t)}function P(e,t){const r=e.findIndex((({id:e})=>e===t.id));-1===r?e.push(t):e[r]=t}function T(e){if(!("layerType"in e))return!!e.charts?.length;switch(e.layerType){case"OrientedImageryLayer":return!!e.charts?.length;case"SubtypeGroupLayer":return!!e.layers.some((e=>!!e.charts?.length));case"SubtypeGroupTable":return!!e.tables.some((e=>!!e.charts?.length));case"CatalogLayer":return!!e.footprintLayer?.charts?.length}}function O(e,t){let r=0,a=0,n=0,o=0;for(const e of[...t.layers,...t.tables])if(T(e)&&o++,"layerType"in e)switch(e.layerType){case"OrientedImageryLayer":r++;break;case"SubtypeGroupLayer":a++;break;case"SubtypeGroupTable":n++}(0,u.Sm)(e,u.mm.ORIENTED_IMAGERY_LAYER,r>0),(0,u.Sm)(e,u.mm.SUBTYPE_GROUP_LAYER,a>0),(0,u.Sm)(e,u.mm.SUBTYPE_GROUP_TABLE,n>0),(0,u.Sm)(e,u.mm.CHARTS,o>0)}async function A(e,t,r){O(t,r)}async function N(e,t,r){const{url:a,layerId:n,title:s,fullExtent:i,isTable:l}=e,c=(0,o.qg)(a);t.url=("FeatureServer"===c?.serverType?a:`${a}/${n}`)??null,t.title||=s,t.extent=null,l||null==i||(t.extent=await(0,u.sQ)(i)),function(e,t,r){(0,u.OM)(t,u.mm.METADATA),(0,u.Sm)(t,u.mm.MULTI_LAYER,e.length>1),(0,u.Sm)(t,u.mm.SINGLE_LAYER,1===e.length),(0,u.Sm)(t,u.mm.TABLE,r.tables.length>0&&0===r.layers.length),O(t,r)}([e],t,r)}async function E(e,t){return(0,n.UN)({layer:e,itemType:c,validateLayer:f,createJSONContext:t=>m(t,e),createItemData:(e,t)=>v(t,[e]),errorNamePrefix:p,setItemProperties:A},t)}async function U(e,t,r){return(0,n.Uh)({layer:e,itemType:c,validateLayer:f,createJSONContext:t=>m(t,e),createItemData:(e,t)=>Promise.resolve(b(e)),errorNamePrefix:d,newItem:t,setItemProperties:N},r)}},46130:(e,t,r)=>{r.d(t,{v:()=>n});var a=r(76553);function n(e){e?.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,a.H)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},71530:(e,t,r)=>{r.d(t,{UN:()=>b,Uh:()=>v});var a=r(49186),n=r(46130),o=r(20655),s=r(80812),i=r(88788),l=r(10407),u=r(26121);async function c(e){const{layer:t,errorNamePrefix:r,validateLayer:n}=e;await t.load(),function(e,t,r){const n=r(e);if(!n.isValid)throw new a.A(`${t}:invalid-parameters`,n.errorMessage,{layer:e})}(t,r,n)}function y(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function p(e){const{item:t,errorNamePrefix:r,layer:n,validateItem:o}=e;if(function(e){const{item:t,itemType:r,additionalItemType:n,errorNamePrefix:o,layer:s}=e,i=[r];if(n&&i.push(n),!i.includes(t.type)){const e=i.map((e=>`'${e}'`)).join(", ");throw new a.A(`${o}:portal-item-wrong-type`,`Portal item type should be one of: "${e}"`,{item:t,layer:s})}}(e),o){const e=o(t);if(!e.isValid)throw new a.A(`${r}:invalid-parameters`,e.errorMessage,{layer:n})}}function d(e){const{layer:t,errorNamePrefix:r}=e,{portalItem:n}=t;if(!n)throw new a.A(`${r}:portal-item-not-set`,y(t,"requires the portalItem property to be set"));if(!n.loaded)throw new a.A(`${r}:portal-item-not-loaded`,y(t,"cannot be saved to a portal item that does not exist or is inaccessible"));p({...e,item:n})}function f(e){const{newItem:t,itemType:r}=e;let a=s.default.from(t);return a.id&&(a=a.clone(),a.id=null),a.type??=r,a.portal??=o.A.getDefault(),p({...e,item:a}),a}function m(e){return(0,i.m)(e,"portal-item")}async function w(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const a=e.write({},t);return await Promise.all(t.resources?.pendingOperations??[]),(0,u.ci)(t,{errorName:"layer-write:unsupported"},r),a}function h(e){(0,l.LG)(e,l.mm.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}async function b(e,t){const{layer:r,createItemData:a,createJSONContext:o,setItemProperties:s,saveResources:i,supplementalUnsupportedErrors:l}=e;await c(e),d(e);const u=r.portalItem,y=o?o(u):m(u),p=await w(r,y,{...t,supplementalUnsupportedErrors:l}),f=await a({layer:r,layerJSON:p},u);return await(s?.(r,u,f)),h(u),await u.update({data:f}),(0,n.v)(y),await(i?.(u,y)),u}async function v(e,t){const{layer:r,createItemData:a,createJSONContext:o,setItemProperties:s,saveResources:i,supplementalUnsupportedErrors:l}=e;await c(e);const u=f(e),y=o?o(u):m(u),p=await w(r,y,{...t,supplementalUnsupportedErrors:l}),d=await a({layer:r,layerJSON:p},u);return await s(r,u,d),h(u),await async function(e,t,r){const a=e.portal;await a.signIn(),await a.user.addItem({item:e,data:t,folder:r?.folder})}(u,d,t),r.portalItem=u,(0,n.v)(y),await(i?.(u,y)),u}},76553:(e,t,r)=>{function a(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{H:()=>a})},88788:(e,t,r)=>{r.d(t,{m:()=>s,v:()=>o});var a=r(84952),n=r(20655);function o(e,t){return{...i(e,t),readResourcePaths:[]}}function s(e,t,r){const n=(0,a.An)(e.itemUrl);return{...i(e,t),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:n?{rootPath:n.path,writtenUrls:[]}:null,resources:r?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function i(e,t){return{origin:t,url:(0,a.An)(e.itemUrl),portal:e.portal||n.A.getDefault(),portalItem:e}}}}]);
|