@arcgis/core 5.2.0-next.28 → 5.2.0-next.29
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/WebMap.js +1 -1
- package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +40 -2
- package/applications/KnowledgeStudio/generalSharedKgUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0197e459fdb04dfb28ef.js +1 -0
- package/assets/esri/core/workers/chunks/{f7344d855f1092383abe.js → 15aa9b85976069acf4f3.js} +1 -1
- package/assets/esri/core/workers/chunks/17b98787a0698f584882.js +1 -0
- package/assets/esri/core/workers/chunks/1b9c68e8431bb4608209.js +1 -0
- package/assets/esri/core/workers/chunks/1bbf5f5da5842b93f638.js +1 -0
- package/assets/esri/core/workers/chunks/1bd7b7f4ee7ea6cb7ef9.js +1 -0
- package/assets/esri/core/workers/chunks/1e386475937e02b3f523.js +1 -0
- package/assets/esri/core/workers/chunks/{24704e70d1ce01ca4081.js → 20ffeb09bb30400de110.js} +1 -1
- package/assets/esri/core/workers/chunks/21122f3f3e19a7fd7d33.js +1 -0
- package/assets/esri/core/workers/chunks/{25fd4d5d3af887536b3b.js → 2628136bf9f47d238a24.js} +1 -1
- package/assets/esri/core/workers/chunks/2b044c8fab2055a8818d.js +1 -0
- package/assets/esri/core/workers/chunks/2b2b042a6d6949b06127.js +1 -0
- package/assets/esri/core/workers/chunks/2c15c227d057292d4fa8.js +1 -0
- package/assets/esri/core/workers/chunks/2f02880a7f081eb210cd.js +1 -0
- package/assets/esri/core/workers/chunks/2fc3e43b64300014dddc.js +1 -0
- package/assets/esri/core/workers/chunks/{5363c622a0571134cadd.js → 32740b075d7a890d7888.js} +1 -1
- package/assets/esri/core/workers/chunks/38b69fba9ae4ccbae6b7.js +1 -0
- package/assets/esri/core/workers/chunks/3c342e662c13a05f4caf.js +1 -0
- package/assets/esri/core/workers/chunks/{8b452383ba972b638a0c.js → 3d1e5bfd88771d4a0bf6.js} +1 -1
- package/assets/esri/core/workers/chunks/43847d66726fd0bcbbb7.js +1 -0
- package/assets/esri/core/workers/chunks/4545cf12ad0824ce6b41.js +1 -0
- package/assets/esri/core/workers/chunks/45e4b9069263adeae394.js +1 -0
- package/assets/esri/core/workers/chunks/47290f27375c76bcc9c7.js +1 -0
- package/assets/esri/core/workers/chunks/{8aba35305368234c94f8.js → 5115059b012ef84407cf.js} +1 -1
- package/assets/esri/core/workers/chunks/5cccb8b06014ccef30f8.js +1 -0
- package/assets/esri/core/workers/chunks/{7f1babbb7ead78201ab3.js → 689673173ca1c0e098fe.js} +1 -1
- package/assets/esri/core/workers/chunks/6991ba1b204668e7d4da.js +1 -0
- package/assets/esri/core/workers/chunks/{ccffaba50674adba7a0f.js → 6b56971783bf4c31a563.js} +1 -1
- package/assets/esri/core/workers/chunks/70c94bcfa20453134037.js +1 -0
- package/assets/esri/core/workers/chunks/759686b896f51f0fe6a9.js +1 -0
- package/assets/esri/core/workers/chunks/7656900713e55036c3c1.js +1 -0
- package/assets/esri/core/workers/chunks/774615303c1cc9a77e20.js +1 -0
- package/assets/esri/core/workers/chunks/{6183a26837dc087663ad.js → 7ff37a4f315f7621462b.js} +1 -1
- package/assets/esri/core/workers/chunks/8ad5e80e911419c1685a.js +1 -0
- package/assets/esri/core/workers/chunks/{87011d2fe14c54e296af.js → 9fe71d49c888fd871312.js} +1 -1
- package/assets/esri/core/workers/chunks/a14e5607c5c091c77e3d.js +1 -0
- package/assets/esri/core/workers/chunks/{7c344c339743295d11d7.js → a2be8784f2cfdbb42681.js} +1 -1
- package/assets/esri/core/workers/chunks/a6379a8df8c08b729b9c.js +1 -0
- package/assets/esri/core/workers/chunks/a988fd54912969b812ce.js +1 -0
- package/assets/esri/core/workers/chunks/{11d1af758e2140095b10.js → aec82b94787821153d2b.js} +1 -1
- package/assets/esri/core/workers/chunks/b624796ff4a9d4c406bf.js +1 -0
- package/assets/esri/core/workers/chunks/bb1fad01d9f070e7d795.js +1 -0
- package/assets/esri/core/workers/chunks/{654a6dc13ff5be88c8b9.js → bcb2092c87d8d21c6458.js} +1 -1
- package/assets/esri/core/workers/chunks/{3e94ed4d57ee7d870cba.js → c6f5688074ae89c37add.js} +1 -1
- package/assets/esri/core/workers/chunks/caf150028aeac91b8d80.js +1 -0
- package/assets/esri/core/workers/chunks/{a3ca0649edb646da0918.js → cb30e8a66d6dcfebd439.js} +1 -1
- package/assets/esri/core/workers/chunks/d7c0ab622caf495dbcef.js +1 -0
- package/assets/esri/core/workers/chunks/{fd629872b5c07853f695.js → e4015870412edd69453c.js} +1 -1
- package/assets/esri/core/workers/chunks/e774303efefee31952d0.js +1 -0
- package/assets/esri/core/workers/chunks/e98a8f80023c6023e72c.js +1 -0
- package/assets/esri/core/workers/chunks/f10a339b16d84b650012.js +2 -0
- package/assets/esri/core/workers/chunks/fe42fa2144691b9186fd.js +1 -0
- package/chunks/GlowComposition.glsl.js +5 -5
- package/config.js +1 -1
- package/core/AsyncUpdate.js +1 -1
- package/core/date.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/form/elements/AttachmentElement.d.ts +4 -1
- package/form/elements/inputs/attachments/AttachmentInput.d.ts +1 -0
- package/form/elements/inputs/attachments/AudioInput.d.ts +1 -0
- package/form/elements/inputs/attachments/DocumentInput.d.ts +3 -0
- package/form/elements/inputs/attachments/ImageInput.d.ts +1 -0
- package/form/elements/inputs/attachments/VideoInput.d.ts +1 -0
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +0 -2
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +0 -2
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/linkChart/guards.js +2 -0
- package/linkChart/utils.js +1 -1
- package/networks/CircuitManager.d.ts +44 -0
- package/networks/support/CircuitExportJobInfo.d.ts +1 -1
- package/networks/support/CircuitVerifyJobInfo.d.ts +1 -1
- package/networks/support/jsonTypes.d.ts +2 -0
- package/package.json +3 -3
- package/rest/featureService/types.d.ts +4 -7
- package/rest/networks/circuits/support/CircuitVerifyResult.d.ts +1 -1
- package/rest/networks/circuits/support/ExportCircuitsParameters.d.ts +1 -1
- package/rest/networks/circuits/support/VerifyCircuitsParameters.d.ts +17 -3
- package/rest/networks/unitIdentifiers/support/UnitQueryResult.d.ts +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMOperators.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/symbols/support/cimSymbolUtils.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/FeatureMeshFactory.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
- package/views/2d/engine/webgl/util/DictionaryMatcher.js +1 -1
- package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
- package/views/2d/engine/webgl/util/IntervalMatcher.js +1 -1
- package/views/2d/engine/webgl/util/LabelMatcher.js +1 -1
- package/views/2d/engine/webgl/util/MapMatcher.js +1 -1
- package/views/2d/engine/webgl/util/Matcher.js +1 -1
- package/views/2d/engine/webgl/util/createMatcher.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.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/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/2d/layers/support/annodime/MatcherGeometryOverride.js +2 -0
- package/views/2d/layers/support/annodime/PrivateDimensionEffect.js +1 -1
- package/views/2d/layers/support/annodime/PrivateMatcherGeometryOverrideEffect.js +2 -0
- package/views/2d/layers/support/annodime/TileObjectId.js +2 -0
- package/views/2d/layers/support/annodime/annotationGraphic.js +1 -1
- package/views/2d/layers/support/annodime/debugUtils.js +2 -0
- package/views/2d/layers/support/annodime/dimensionStyleDefaults.js +2 -0
- package/views/2d/layers/support/annodime/dimensionSymbols.js +1 -1
- package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
- package/views/2d/layers/support/annodime/utils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
- package/views/3d/layers/SceneLayerWorkerHandle.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/interactive/sketch/SketchLabelOptions.d.ts +0 -6
- package/views/layers/AnnotationFeatureLayerView.d.ts +0 -7
- package/views/layers/DimensionFeatureLayerView.d.ts +0 -7
- package/views/support/LayerViewManager.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +0 -12
- package/widgets/Editor.d.ts +0 -12
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.d.ts +0 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +0 -12
- package/widgets/Sketch.d.ts +0 -12
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/assets/esri/core/workers/chunks/1893a4b344aa9b57aa8d.js +0 -1
- package/assets/esri/core/workers/chunks/1a7c0a1dc6ecc93ea03a.js +0 -1
- package/assets/esri/core/workers/chunks/29a7321fd069253c2521.js +0 -1
- package/assets/esri/core/workers/chunks/3b7060d264888bf298b1.js +0 -1
- package/assets/esri/core/workers/chunks/409bc7d69b95f7a1634c.js +0 -1
- package/assets/esri/core/workers/chunks/4fc32e60e63a9c8429b9.js +0 -1
- package/assets/esri/core/workers/chunks/548842f8ba9224b15ee4.js +0 -1
- package/assets/esri/core/workers/chunks/5728d8440aca205e4f53.js +0 -1
- package/assets/esri/core/workers/chunks/668d84dc512b3085a960.js +0 -1
- package/assets/esri/core/workers/chunks/67f44cab103d4411dcc5.js +0 -1
- package/assets/esri/core/workers/chunks/6db5ee9c589265b23b60.js +0 -1
- package/assets/esri/core/workers/chunks/78f68f7534716956f5bc.js +0 -1
- package/assets/esri/core/workers/chunks/7c34eb94e2c74602aeab.js +0 -1
- package/assets/esri/core/workers/chunks/7fcf4f3b9131c7516524.js +0 -1
- package/assets/esri/core/workers/chunks/86e61841df12dbe20a19.js +0 -1
- package/assets/esri/core/workers/chunks/8dbf9b1d8bb6817b19c1.js +0 -1
- package/assets/esri/core/workers/chunks/937e347d130d469518ce.js +0 -1
- package/assets/esri/core/workers/chunks/a195f569eada3a8736be.js +0 -1
- package/assets/esri/core/workers/chunks/a2357aae79bfbb91f125.js +0 -1
- package/assets/esri/core/workers/chunks/a8167ab9fd846d699be5.js +0 -1
- package/assets/esri/core/workers/chunks/b10f36658aa77bc3a6cf.js +0 -1
- package/assets/esri/core/workers/chunks/b87aca8ad281870ae970.js +0 -1
- package/assets/esri/core/workers/chunks/c46500cc95a84e2a5f7a.js +0 -1
- package/assets/esri/core/workers/chunks/cc46261e01a985df5aab.js +0 -1
- package/assets/esri/core/workers/chunks/ceb5bd9f2afaa2ea0808.js +0 -1
- package/assets/esri/core/workers/chunks/d07261f3fb67b9a99369.js +0 -1
- package/assets/esri/core/workers/chunks/d25c37f169577a33db46.js +0 -1
- package/assets/esri/core/workers/chunks/d61294dcc3ba41060d44.js +0 -1
- package/assets/esri/core/workers/chunks/d8ae5b61b5ae71f4796c.js +0 -1
- package/assets/esri/core/workers/chunks/db279d5d9c7deec554bb.js +0 -1
- package/assets/esri/core/workers/chunks/e1340232962cf576d37e.js +0 -1
- package/assets/esri/core/workers/chunks/e38d1ba15babc238b151.js +0 -1
- package/assets/esri/core/workers/chunks/f5125925f83c979edde7.js +0 -2
- package/assets/esri/core/workers/chunks/f68b84df093f2894210b.js +0 -1
- package/assets/esri/core/workers/chunks/f74b6952c888d92e479e.js +0 -1
- package/assets/esri/core/workers/chunks/fe20683f442294eb111b.js +0 -1
- package/views/2d/layers/features/layerAdapters/featureLayerAdapterUtils.js +0 -2
- package/views/2d/layers/features/support/FeatureSetReaderAnnotationJSON.js +0 -2
- package/views/2d/layers/features/support/FeatureSetReaderDimensionJSON.js +0 -2
- package/views/2d/layers/support/annodime/annotationUtils.js +0 -2
- /package/assets/esri/core/workers/chunks/{f5125925f83c979edde7.js.LICENSE.txt → f10a339b16d84b650012.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfAborted as s,after as r}from"../../../../core/promiseUtils.js";import{diff as i}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as a}from"../../../../core/workers/utils.js";import{normalizeTransform as o,quantizeX as n,quantizeY as c}from"../../../../geometry/support/quantizationUtils.js";import{
|
|
2
|
+
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfAborted as s,after as r}from"../../../../core/promiseUtils.js";import{diff as i}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as a}from"../../../../core/workers/utils.js";import{normalizeTransform as o,quantizeX as n,quantizeY as c}from"../../../../geometry/support/quantizationUtils.js";import{checkProjectionSupport as h}from"../../../../layers/graphics/data/projectionSupport.js";import{MultiTileMeshData as u}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as p}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as g}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as y}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as d}from"../../engine/webgl/util/MatcherContext.js";import{BinningStrategy as _}from"./processor/BinningStrategy.js";import{ClusterStrategy as l}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as m}from"./processor/FeatureUpdateStrategy.js";import{TrackStrategy as f}from"./processor/TrackStrategy.js";import{AttributeStore as b}from"./support/AttributeStore.js";import{ComputedAttributeStorage as w}from"./support/ComputedAttributeStorage.js";class S{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new y,this._proxy=new g({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t),fetchMesh:(e,t)=>this._connection.layerView.fetchMesh(e,t)}),this._attributeStore=new b({isLocal:!1,update:e=>a(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get hasClusters(){return"cluster"===this._schema?.mesh.strategy.type}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,r)=>{t[r]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(e){return this._strategy?.requiresInvalidation(e)??!1}async update(e,s,r,a,o){const n=e.processor,c=t(this._schema?.storage,n.storage),u=t(this._schema?.mesh.properties,n.mesh.properties),g=t(this._schema?.mesh.factory,n.mesh.factory),y=t(this._schema?.mesh.strategy,n.mesh.strategy),_=j(this._schema?.expressionProperties,n.expressionProperties),l=_.some(e=>this._attributeStore.hasArcadeDependency(e)),m=_.some(e=>this._factory?.hasArcadeDependency(e)??!1),f=_.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&l,b=m||f,S=u||g||y;if(!(c||S||(m||l||f))&&!a)return!1;if(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:i(this._schema,n),schema:n}),this._schema=n,"annotation-feature"===n.mesh.factory.symbology.type||"dimension-feature"===n.mesh.factory.symbology.type){const e=this._source.metadata.outSpatialReference,t=this._source.metadata.attributeSpatialReference??this._source.metadata.spatialReference??e;await h(t,e)}const I=new w({fields:this._source.metadata.fieldsIndex,spatialReference:this._source.metadata.outSpatialReference}),M={currentUser:n.mesh.properties.currentUser};if((c||S||l)&&(await this._attributeStore.update(n.storage,I,this._source.metadata,s),this._strategy?.invalidateAttributeData(v(n))),!a&&!S&&!b)return!1;(y||u||b)&&await this._updateStrategy(n.mesh.strategy,o,v(n),M),this._updateSortKey(I,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const x="dictionary"===n.mesh.factory.symbology.type?n.mesh.factory.symbology.fieldMap:null,U=new d(I,this._proxy,r,this._registry,x);return(g||"dictionary"===n.mesh.factory.symbology.type)&&(this._factory=await p.create(U,n.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(e,t){if(this._strategy)try{const s=await this._strategy.applyOverrideUpdate(e);s&&await this._process(s,t)}catch(s){}}async updateChunks(e,t,s){await this._doUpdateChunks(e,t,s),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(e,t,s){if(this._strategy){try{const r=await this._strategy.updateChunks(e,t);r&&await this._process(r,s)}catch(r){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}}async _updateStrategy(e,t,s,r){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new m(this._source,this._attributeStore,s,r);break;case"binning":this._strategy=await _.create(e,this._source,this._attributeStore,s,r);break;case"cluster":this._strategy=await l.create(this._connection,e,this._source,this._attributeStore,s,r);break;case"track":this._strategy=await f.create(e,this._source,this._attributeStore,s,r)}for(const i of t)this._strategy.onSubscribe(i)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}async _process(e,t){switch(e.type){case"level-replace":return this._processLevelBatch(e,t);case"append":case"update":return this._processStandardBatch(e,t)}}async _processLevelBatch(e,t){const s=await this._connection.container.beginLevelMeshUpdate(e.level);await this._processBatchMessages(e.messages,t),await this._connection.container.applyLevelMeshUpdate(s)}async _processStandardBatch(e,t){return this._processBatchMessages(e.messages,t)}async _processBatchMessages(e,t){for(const r of e){const e=r.subscription;if(has("esri-2d-update-debug")){const t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${r.end}] Processor._process`)}const i={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(r,i),s(e.signal);const a=await this._write(r,e.tile.createArcadeEvaluationOptions(v(this._schema)),i,t),o=e.tile.tileInfoView.getLODInfoAt(e.tile.key);s(e.signal);const{message:n,transferList:c}=a.serialize(o),h={objectIdMap:null,inner:r.createMessage(n,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){h.objectIdMap={};const e=r.reader?.getCursor();if(e)for(;e.next();)h.objectIdMap[e.getDisplayId()]=e.getObjectId()}if(s(e.signal),await this._connection.container.onMessage(h,{signal:e.signal,transferList:c}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${r.end}] Processor._process.await`)}}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(!e.reader)return;const t=e.subscription.tile.createArcadeEvaluationOptions(v(this._schema));return this._factory.enqueueMatcherRequests(this._proxy,e.reader,{scale:t.$view.scale,viewingMode:"2d"},e.id)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(v(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,t,e.id);await this._proxy.fetchEnqueuedResources()}async _write(e,t,i,a){const o=e.subscription.tile,n=e.reader?.getCursor(),c=n?.getSize()??0,h=o.tileInfoView.tileInfo.isWrappable,p=o.tileInfoView.spatialReference.isWGS84,g=this._schema?.mesh.factory.referenceScale,y=new u(o.key,this._strategy.enablePixelBuffering,h,p,c);if(!n)return y;const d=I(o.transform,a),_=o.createArcadeEvaluationOptions(v(this._schema));let l=0;for(;n.next();){++l%1e3||(await r(0),s(e.subscription));const a=this._getSortKeyValue(n,t);y.entityStart(n.getDisplayId(),a);try{this._factory.write(y,this._proxy,n,_,i,o.level,d,g)}catch(m){}y.entityEnd()}return y}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function j(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function v(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}function I(e,t){const s=o(e),r=[];for(const i of t.rings){const e=[];for(const t of i)e.push([n(s,t[0]),c(s,t[1])]);r.push(e)}return{rings:r}}export{S as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{sqlNotIn as t,sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{createFeatureIdInfo as i}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as n}from"./floorFilterUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{ExceedsLimitCache as p}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as u,createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{getSortKey as m}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as y}from"../schema/processor/StorageSchema.js";import{getAnnotationMatcherSchema as d}from"../../support/annodime/annotationSchema.js";import{annotationRealFields as h,annotationVirtualFields as f}from"../../support/annodime/fields.js";import{getReferenceScale as g}from"../../support/annodime/utils.js";class S{constructor(e){this.layer=e,this._cache=new p}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,a=this.layer.refreshInterval>0,i=!s&&a,o=u("isSourceHosted"in r&&r.isSourceHosted,i,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);let n=[];return n=e.availableFields.concat(...h),c(r,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:n,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{meshes:s,referenceScale:a}=await this._fetchAnnotationDataElementRequest(e,{type:"annotation-data-element-request"}),{objectIdField:i}=this.layer,o=m(null,null,i);return{storage:y(null,t.filters),mesh:{properties:{sortKey:o,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:s,labels:{type:"label",classes:[]},referenceScale:a}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e,s){e=o(this.layer,e,s);const i=this.layer.sublayers.filter(e=>!e.visible).map(e=>e.subtypeCode);if(!i.length)return e;e??=new a;const n=t(this.layer.subtypeField,i.toArray());return e.where=r(e.where,n),e}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>n(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields,()=>this.layer.sublayers.map(({visible:e})=>({visible:e}))]}getRenderer(){return null}setGraphicOrigin(e){const t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=this.layer,e.origin=t?.graphicOrigin}_createServiceInfo(t){const r=this.layer,a=r.fieldsIndex.toJSON();a.fields.push(...f);const{capabilities:o,editingInfo:n,globalIdField:p,datesInUnknownTimezone:u,dateFieldsTimeZone:c,subtypeField:m}=r,y=l(r),d=r.timeInfo?.toJSON(),h=r.spatialReference.toJSON(),g=e(this.layer.parsedUrl),S=this.layer.objectIdField,b=s(g.path),F=t.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:b,orderByFields:S,outSpatialReference:F,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:c,subtypeField:m,globalIdField:p,fieldsIndex:a,geometryType:y,featureIdInfo:i(r),timeInfo:d,spatialReference:h,outSpatialReference:F,attributeSpatialReference:this.layer.attributeSpatialReference?.toJSON(),subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:r.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:o.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:o.query.maxRecordCount,tileMaxRecordCount:o.query.tileMaxRecordCount,supportsCompactGeometry:o.query.supportsCompactGeometry,supportsDefaultSpatialReference:o.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:o.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:o.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:o.query.supportsDegeneratedQuantizedGeometry,lastEditDate:n?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:o.query.supportsReturnExceededLimitGeometries}}}async _fetchAnnotationDataElementRequest(e,t){const r={cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null},s=this.layer,a=await s.fetchDataElement(),i=g(a);return{type:"annotation-data-element-response",dataElement:a,meshes:await d(a,r),referenceScale:i}}}export{S as AnnotationLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{createLabelVVEvaluator as i}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class n{constructor(e){this.layer=e,this._cache=new s}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:i(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return a(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,postQueryFilter:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,geometryType:s,orderBy:a,objectIdField:l,renderer:n,labelingInfo:u,labelsVisible:
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{createLabelVVEvaluator as i}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class n{constructor(e){this.layer=e,this._cache=new s}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:i(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return a(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,postQueryFilter:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,geometryType:s,orderBy:a,objectIdField:l,renderer:n,labelingInfo:u,labelsVisible:p}=this.layer,d={featureReduction:null,labelingInfoSource:this.layer.id,fields:i.map(e=>e.toJSON()),geometryType:s,labelingInfo:u,labelsVisible:p,objectIdField:l,orderBy:a??"default",renderer:n?.clone()};return o(e,r,d,t)}get hasRequiredSupport(){return l(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const s=this.layer,{capabilities:a,editingInfo:o,objectIdField:l,globalIdField:n,datesInUnknownTimezone:u,dateFieldsTimeZone:p,orderBy:d,parsedUrl:c,hasZ:y,hasM:m}=s,f=s.fieldsIndex.toJSON(),h=t(s),g=s.timeInfo?.toJSON(),b=s.spatialReference.toJSON(),F=e(c);let I=l;if(d?.length){const e=!d[0].valueExpression&&d[0].field;e&&(I=e)}const S=r(F.path),R=i.spatialReference.toJSON();return{type:"feature-service",source:F,isSourceHosted:S,orderByFields:I,outSpatialReference:R,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:p,globalIdField:n,fieldsIndex:f,geometryType:h,hasZ:y??!1,hasM:m??!1,featureIdInfo:{type:"object-id",fieldName:l},timeInfo:g,spatialReference:b,outSpatialReference:R,attributeSpatialReference:null,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:a.query.supportsReturnExceededLimitGeometries,lastEditDate:o?.lastEditDate?.getTime()}}}}export{n as CatalogFootprintLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{createFeatureIdInfo as r}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{ExceedsLimitCache as i}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as a,createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{getSortKey as n}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as l}from"../schema/processor/StorageSchema.js";import{getDimensionMatcherSchema as c}from"../../support/annodime/dimensionSchema.js";import{dimensionRealFields as p,dimensionVirtualFields as u}from"../../support/annodime/fields.js";import{getReferenceScale as m}from"../../support/annodime/utils.js";class d{constructor(e){this.layer=e,this._cache=new i}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,i=this.layer.refreshInterval>0,n=!s&&i,l=a("isSourceHosted"in r&&r.isSourceHosted,n,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);let c=[];return c=e.availableFields.concat(...p),o(r,l,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:c,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{meshes:s,referenceScale:i}=await this._fetchDimensionDataElementRequest(e,{type:"dimension-data-element-request"}),{objectIdField:a}=this.layer,o=n(null,null,a);return{storage:l(null,t.filters),mesh:{properties:{sortKey:o,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:s,labels:{type:"label",classes:[]},referenceScale:i}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e){return e}getUpdateHashProperties(){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields]}getRenderer(){return null}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const a=this.layer,o=a.fieldsIndex.toJSON();o.fields.push(...u);const{capabilities:n,editingInfo:l,globalIdField:c,datesInUnknownTimezone:p,dateFieldsTimeZone:m,subtypeField:d}=a,y=s(a),h=a.timeInfo?.toJSON(),f=a.spatialReference.toJSON(),g=e(this.layer.parsedUrl),S=this.layer.objectIdField,R=t(g.path),b=i.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:R,orderByFields:S,outSpatialReference:b,metadata:{timeReferenceUnknownClient:p,dateFieldsTimeZone:m,subtypeField:d,globalIdField:c,fieldsIndex:o,geometryType:y,featureIdInfo:r(a),timeInfo:h,spatialReference:f,outSpatialReference:b,attributeSpatialReference:this.layer.attributeSpatialReference?.toJSON(),subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:a.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:n.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:n.query.maxRecordCount,tileMaxRecordCount:n.query.tileMaxRecordCount,supportsCompactGeometry:n.query.supportsCompactGeometry,supportsDefaultSpatialReference:n.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:n.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:n.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:n.query.supportsDegeneratedQuantizedGeometry,lastEditDate:l?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:n.query.supportsReturnExceededLimitGeometries}}}async _fetchDimensionDataElementRequest(e,t){const r={cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null},s=this.layer,i=await s.fetchDataElement(),a=m(i);return{type:"dimension-data-element-response",dataElement:i,meshes:await c(i,r),referenceScale:a}}}export{d as DimensionLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{canConvertSqlRelativeTime as i,sqlRelativeTimeToAbsolute as s}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as a}from"../../../../../networks/support/networkFieldUtils.js";import{
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{canConvertSqlRelativeTime as i,sqlRelativeTimeToAbsolute as s}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as a}from"../../../../../networks/support/networkFieldUtils.js";import{getEffectiveFeatureReduction as o}from"./featureReductionUtils.js";import{createFeatureIdInfo as l}from"./featureServiceUtils.js";import{addFloorFilter as n,hasFloorFilter as y}from"./floorFilterUtils.js";import{getServiceGeometryType as d}from"./geometryUtils.js";import{createLabelVVEvaluator as p}from"./labelingUtils.js";import{ExceedsLimitCache as u}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as c,createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as h}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as f}from"../support/rendererUtils.js";class g{constructor(e){this.layer=e,this._cache=new u}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:p(this.layer.renderer)}}]}async createSourceSchema(e,t){const a=this._createServiceInfo(e),o=null!=this.layer.editingInfo?.lastEditDate,l=this.layer.refreshInterval>0,n=!o&&l,y=c(a.isSourceHosted,n,this.layer.capabilities,a.metadata.geometryType,e.extent,this.layer.fullExtent),d=null!=this.layer.subtypeCode?`${this.layer.subtypeField} = ${this.layer.subtypeCode}`:null,p=r(this.layer.definitionExpression,d),u=i(p)?await s(this.layer.fieldsIndex,p,this.layer.capabilities.query.relativeTimeBinWindow):p,h=p!==u?{where:p}:null,{gdbVersion:f,apiKey:g,historicMoment:b,timeExtent:F,customParameters:I,displayFilterInfo:S}=this.layer;return m(a,y,{definitionExpression:u,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:h,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:S,customParameters:I,gdbVersion:f,historicMoment:b,timeExtent:F,apiKey:g,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,renderer:s,geometryType:a,labelingInfo:l,labelsVisible:n,orderBy:y,objectIdField:d,trackInfo:p,symbolLayerDrawing:u}=this.layer,c={fields:i.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:o(this.layer,r),geometryType:a,labelingInfo:l,labelsVisible:n,objectIdField:d,orderBy:y??"default",trackInfo:p,symbolLayerDrawing:u};return h(e,r,c,t)}get hasRequiredSupport(){return f(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return n(this.layer,e,r)}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>o(this.layer,e),()=>y(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.subtypeCode,()=>this.layer.trackInfo,()=>this.layer.symbolLayerDrawing?.drawOrder,()=>this.layer.symbolLayerDrawing?.enabled,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&a(e,this.layer)]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:s,editingInfo:a,typeIdField:o,globalIdField:n,datesInUnknownTimezone:y,dateFieldsTimeZone:p,orderBy:u,subtypeField:c}=i,m=i.fieldsIndex.toJSON(),h=d(i),{hasZ:f,hasM:g}=i,b=i.timeInfo?.toJSON(),F=i.spatialReference.toJSON(),I=i.types?.map(e=>e.toJSON()),S=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(S.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let R=this.layer.objectIdField;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(R=e)}const x=t(S.path),O=r.spatialReference.toJSON();return{type:"feature-service",source:S,isSourceHosted:x,orderByFields:R,outSpatialReference:O,metadata:{typeIdField:o??void 0,types:I,timeReferenceUnknownClient:y,dateFieldsTimeZone:p,subtypeField:c,globalIdField:n,fieldsIndex:m,geometryType:h,hasZ:f,hasM:g,featureIdInfo:l(i),timeInfo:b,spatialReference:F,outSpatialReference:O,attributeSpatialReference:null,subtypes:this.layer.subtypes?.map(e=>e.toJSON())},queryMetadata:{maxRecordCount:s.query.maxRecordCount,tileMaxRecordCount:s.query.tileMaxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:s.query.supportsReturnExceededLimitGeometries,lastEditDate:a?.lastEditDate?.getTime()}}}}export{g as FeatureLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../core/Error.js";import{hasTimeOptions as r}from"../../../../../layers/support/timeSupport.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{createFeatureIdInfo as i}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{createLabelVVEvaluator as
|
|
2
|
+
import e from"../../../../../core/Error.js";import{hasTimeOptions as r}from"../../../../../layers/support/timeSupport.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{createFeatureIdInfo as i}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{createLabelVVEvaluator as n}from"./labelingUtils.js";import{ExceedsLimitCache as o}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";function p(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class c{constructor(e){this.layer=e,this._cache=new o}openMessagePorts(){return p(this.layer.source),this.layer.source.openPorts()}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:n(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return a(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:"timeExtent"in this.layer?this.layer.timeExtent:null,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:s,renderer:n,geometryType:o,labelingInfo:a,labelsVisible:u,orderBy:p,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:s.map(e=>e.toJSON()),renderer:n?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:a,labelsVisible:u,objectIdField:c,orderBy:p??"default",trackInfo:d};return l(e,r,y,i)}get hasRequiredSupport(){return u(this.layer.renderer)}get timeOptions(){return r(this.layer)?this.layer:null}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){"trackGraphicOrigin"in this.layer&&(e.origin=this.layer.trackGraphicOrigin)}getRenderer(){return this.layer.renderer}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:n}=r,o=r.fieldsIndex.toJSON(),a=s(r),l="timeInfo"in r?r.timeInfo?.toJSON():null,u=r.spatialReference.toJSON();p(r.source);const c=n,d=e.spatialReference.toJSON();return{type:"memory",orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:o,geometryType:a,featureIdInfo:i(r),hasZ:"hasZ"in r&&r.hasZ,hasM:"hasM"in r&&r.hasM,timeInfo:l,spatialReference:u,outSpatialReference:d,attributeSpatialReference:null,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:t.query.supportsReturnExceededLimitGeometries,lastEditDate:null}}}}export{c as InMemoryLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
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 i}from"./featureReductionUtils.js";import{getServiceGeometryType as
|
|
2
|
+
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 i}from"./featureReductionUtils.js";import{getServiceGeometryType as a}from"./geometryUtils.js";import{createLabelVVEvaluator as s}from"./labelingUtils.js";import{ExceedsLimitCache as o}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as n}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as p}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e,this._cache=new o}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:s(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return n(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:null,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,t){const{fields:a,renderer:s,geometryType:o,labelingInfo:n,labelsVisible:p,objectIdField:u}=this.layer,d={fields:a.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:i(this.layer,r),geometryType:o,labelingInfo:n,labelsVisible:p,objectIdField:u,orderBy:"default"};return l(e,r,d,t)}get hasRequiredSupport(){return p(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>i(this.layer,e),()=>null!=this.layer.parentCompositeLayer&&d(this.layer.parentCompositeLayer)]}getRenderer(){return this.layer.renderer}hasFilters(e){return null!=this.layer.parentCompositeLayer&&d(this.layer.parentCompositeLayer)}addFilters(i,a){if(null!=this.layer.parentCompositeLayer&&d(this.layer.parentCompositeLayer)){const a=e(i?.where,`${r}=1`);if(!a)return i;i??=new t,i.where=a}return i}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}openMessagePorts(){return this.layer.source.openPorts()}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:i}=r,s=r.fieldsIndex.toJSON(),o=a(r),n=r.spatialReference.toJSON(),l=i,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:l,outSpatialReference:p,metadata:{fieldsIndex:s,geometryType:o,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:n,outSpatialReference:p,attributeSpatialReference:null,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:t.query.supportsReturnExceededLimitGeometries,lastEditDate:null}}}}function d(e){return"link-chart"===e.type&&"hidden"===e.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode}export{u as KnowledgeGraphSublayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../../core/lang.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{createLabelVVEvaluator as i}from"./labelingUtils.js";import{ExceedsLimitCache as a}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as s}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class n{constructor(e){this.layer=e,this._cache=new a}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:i(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return s(t,null,{definitionExpression:null,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,t,i){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:r(this.layer,t),geometryType:l,labelingInfo:n,labelsVisible:u,objectIdField:p,orderBy:c??"default"};return o(e,t,d,i)}get hasRequiredSupport(){return l(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>r(this.layer,e),()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.renderer]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:a}=i,s=i.fieldsIndex.toJSON(),o=t(i),l=i.timeInfo?.toJSON(),n=i.spatialReference.toJSON(),u=i.source.getSource(),c=this.layer.objectIdField,p=e(a);p.query.maxRecordCount=u.maxRecordCount;const d=r.spatialReference.toJSON();return{type:"ogc",source:u,orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:s,geometryType:o,hasZ:this.layer.hasZ??!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:l,spatialReference:n,outSpatialReference:d,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:p.query.maxRecordCount,tileMaxRecordCount:p.query.tileMaxRecordCount,supportsCompactGeometry:p.query.supportsCompactGeometry,supportsDefaultSpatialReference:p.query.supportsDefaultSpatialReference,supportsFormatPBF:p.query.supportsFormatPBF,supportsMaxRecordCountFactor:p.query.supportsMaxRecordCountFactor,supportsQuantization:p.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:p.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:p.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:p.query.supportsReturnExceededLimitGeometries,lastEditDate:null}}}}export{n as OGCFeatureLayerAdapter};
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{createLabelVVEvaluator as i}from"./labelingUtils.js";import{ExceedsLimitCache as a}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as s}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class n{constructor(e){this.layer=e,this._cache=new a}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:i(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return s(t,null,{definitionExpression:null,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,t,i){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:r(this.layer,t),geometryType:l,labelingInfo:n,labelsVisible:u,objectIdField:p,orderBy:c??"default"};return o(e,t,d,i)}get hasRequiredSupport(){return l(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>r(this.layer,e),()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.renderer]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:a}=i,s=i.fieldsIndex.toJSON(),o=t(i),l=i.timeInfo?.toJSON(),n=i.spatialReference.toJSON(),u=i.source.getSource(),c=this.layer.objectIdField,p=e(a);p.query.maxRecordCount=u.maxRecordCount;const d=r.spatialReference.toJSON();return{type:"ogc",source:u,orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:s,geometryType:o,hasZ:this.layer.hasZ??!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:l,spatialReference:n,outSpatialReference:d,attributeSpatialReference:null,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:p.query.maxRecordCount,tileMaxRecordCount:p.query.tileMaxRecordCount,supportsCompactGeometry:p.query.supportsCompactGeometry,supportsDefaultSpatialReference:p.query.supportsDefaultSpatialReference,supportsFormatPBF:p.query.supportsFormatPBF,supportsMaxRecordCountFactor:p.query.supportsMaxRecordCountFactor,supportsQuantization:p.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:p.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:p.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:p.query.supportsReturnExceededLimitGeometries,lastEditDate:null}}}}export{n as OGCFeatureLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
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{addFloorFilter as i,hasFloorFilter as s}from"./floorFilterUtils.js";import{getServiceGeometryType as a}from"./geometryUtils.js";import{createLabelVVEvaluator as o}from"./labelingUtils.js";import{ExceedsLimitCache as l}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as n,createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as d}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as p}from"../support/rendererUtils.js";class c{constructor(e){this.layer=e,this._cache=new l}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:o(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=null!=this.layer.editingInfo?.lastEditDate,s=this.layer.refreshInterval>0,a=!i&&s,o=n(t.isSourceHosted,a,this.layer.capabilities,t.metadata.geometryType,e.extent,this.layer.fullExtent);return u(t,o,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:s,renderer:a,geometryType:o,labelingInfo:l,labelsVisible:n,orderBy:u,objectIdField:p}=this.layer,c={fields:s.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:u??"default"};return d(e,r,c,i)}get hasRequiredSupport(){return p(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return i(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,()=>s(this.layer,e)?e.floors:null]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(t){const i=this.layer,{capabilities:s,globalIdField:o,orderBy:l}=i,n=i.fieldsIndex.toJSON(),u=a(i),d=i.timeInfo?.toJSON(),p=i.spatialReference.toJSON(),c=e(this.layer.parsedUrl);let y=this.layer.objectIdField;if(l?.length){const e=!l[0].valueExpression&&l[0].field;e&&(y=e)}const m=r(c.path),h=t.spatialReference.toJSON();return{type:"feature-service",source:c,isSourceHosted:m,orderByFields:y,outSpatialReference:h,metadata:{globalIdField:o,fieldsIndex:n,geometryType:u,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:d,spatialReference:p,outSpatialReference:h,timeReferenceUnknownClient:i.datesInUnknownTimezone,dateFieldsTimeZone:i.dateFieldsTimeZone,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:s.query.maxRecordCount,tileMaxRecordCount:s.query.tileMaxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:s.query.supportsReturnExceededLimitGeometries,lastEditDate:null}}}}export{c as OrientedImageryLayerAdapter};
|
|
2
|
+
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{addFloorFilter as i,hasFloorFilter as s}from"./floorFilterUtils.js";import{getServiceGeometryType as a}from"./geometryUtils.js";import{createLabelVVEvaluator as o}from"./labelingUtils.js";import{ExceedsLimitCache as l}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as n,createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as d}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as p}from"../support/rendererUtils.js";class c{constructor(e){this.layer=e,this._cache=new l}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:o(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=null!=this.layer.editingInfo?.lastEditDate,s=this.layer.refreshInterval>0,a=!i&&s,o=n(t.isSourceHosted,a,this.layer.capabilities,t.metadata.geometryType,e.extent,this.layer.fullExtent);return u(t,o,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:s,renderer:a,geometryType:o,labelingInfo:l,labelsVisible:n,orderBy:u,objectIdField:p}=this.layer,c={fields:s.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:u??"default"};return d(e,r,c,i)}get hasRequiredSupport(){return p(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return i(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,()=>s(this.layer,e)?e.floors:null]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(t){const i=this.layer,{capabilities:s,globalIdField:o,orderBy:l}=i,n=i.fieldsIndex.toJSON(),u=a(i),d=i.timeInfo?.toJSON(),p=i.spatialReference.toJSON(),c=e(this.layer.parsedUrl);let y=this.layer.objectIdField;if(l?.length){const e=!l[0].valueExpression&&l[0].field;e&&(y=e)}const m=r(c.path),h=t.spatialReference.toJSON();return{type:"feature-service",source:c,isSourceHosted:m,orderByFields:y,outSpatialReference:h,metadata:{globalIdField:o,fieldsIndex:n,geometryType:u,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:d,spatialReference:p,outSpatialReference:h,attributeSpatialReference:null,timeReferenceUnknownClient:i.datesInUnknownTimezone,dateFieldsTimeZone:i.dateFieldsTimeZone,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:s.query.maxRecordCount,tileMaxRecordCount:s.query.tileMaxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:s.query.supportsReturnExceededLimitGeometries,lastEditDate:null}}}}export{c as OrientedImageryLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
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 i}from"./geometryUtils.js";import{createLabelVVEvaluator as a}from"./labelingUtils.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as s}from"../support/rendererUtils.js";class n{constructor(e){this.layer=e}get hasRequiredSupport(){return s(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:a(this.layer.renderer)}}]}getUpdateHashProperties(e){return[()=>this.layer.data,()=>this.layer.outFields,()=>this.layer.definitionExpression,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}openMessagePorts(){return this.layer.source.openPorts()}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=e.availableFields.includes("*")?this.layer.fields.map(e=>e.name):e.availableFields,a={partial:{dataSourceHash:this.layer.data?JSON.stringify(this.layer.data.toJSON()):null,availableFields:i},full:{definitionExpression:this.layer.definitionExpression??null,sourceRefreshVersion:r,customParameters:this.layer.customParameters??null}};return{type:"parquet",service:t,strategy:this._createStrategy(t,a)}}_createStrategy(e,r){return e.geometryInfo.displayOptimization?{type:"xz",...r}:{type:"snapshot",...r}}createProcessorSchema(e,r,i){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 l(e,r,a,i)}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}_createServiceInfo(t){const a=i(this.layer),l=t.spatialReference.toJSON(),s=this.layer.geometryEncoding;if(null==s&&null==this.layer.displayOptimization)throw new e("parquet-layer:unsupported","creating a parquet layer view requires an encoding",{layer:this.layer});return{type:"parquet",outSpatialReference:l,geometryInfo:{geometry:s?{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),encoding:s.toJSON()}:null,displayOptimization:this.layer.displayOptimization},metadata:{spatialReference:this.layer.spatialReference.toJSON(),outSpatialReference:l,fieldsIndex:this.layer.fieldsIndex.toJSON(),featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},geometryType:a,hasZ:!1,hasM:!1,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}}export{n as ParquetLayerAdapter};
|
|
2
|
+
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 i}from"./geometryUtils.js";import{createLabelVVEvaluator as a}from"./labelingUtils.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as s}from"../support/rendererUtils.js";class n{constructor(e){this.layer=e}get hasRequiredSupport(){return s(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:a(this.layer.renderer)}}]}getUpdateHashProperties(e){return[()=>this.layer.data,()=>this.layer.outFields,()=>this.layer.definitionExpression,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}openMessagePorts(){return this.layer.source.openPorts()}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=e.availableFields.includes("*")?this.layer.fields.map(e=>e.name):e.availableFields,a={partial:{dataSourceHash:this.layer.data?JSON.stringify(this.layer.data.toJSON()):null,availableFields:i},full:{definitionExpression:this.layer.definitionExpression??null,sourceRefreshVersion:r,customParameters:this.layer.customParameters??null}};return{type:"parquet",service:t,strategy:this._createStrategy(t,a)}}_createStrategy(e,r){return e.geometryInfo.displayOptimization?{type:"xz",...r}:{type:"snapshot",...r}}createProcessorSchema(e,r,i){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 l(e,r,a,i)}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}_createServiceInfo(t){const a=i(this.layer),l=t.spatialReference.toJSON(),s=this.layer.geometryEncoding;if(null==s&&null==this.layer.displayOptimization)throw new e("parquet-layer:unsupported","creating a parquet layer view requires an encoding",{layer:this.layer});return{type:"parquet",outSpatialReference:l,geometryInfo:{geometry:s?{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),encoding:s.toJSON()}:null,displayOptimization:this.layer.displayOptimization},metadata:{spatialReference:this.layer.spatialReference.toJSON(),outSpatialReference:l,attributeSpatialReference:null,fieldsIndex:this.layer.fieldsIndex.toJSON(),featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},geometryType:a,hasZ:!1,hasM:!1,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}}export{n as ParquetLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getServiceGeometryType as r}from"./geometryUtils.js";import{createLabelVVEvaluator as t}from"./labelingUtils.js";import{createSimpleProcessorSchema as i}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as a}from"../support/rendererUtils.js";class
|
|
2
|
+
import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getServiceGeometryType as r}from"./geometryUtils.js";import{createLabelVVEvaluator as t}from"./labelingUtils.js";import{createSimpleProcessorSchema as i}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as a}from"../support/rendererUtils.js";class l{constructor(e){this.layer=e}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:t(this.layer.renderer)}}]}async createSourceSchema(e,r){return{type:"stream",service:this._createServiceInfo(e),strategy:{type:"stream",partial:{sourceRefreshVersion:r},full:{availableFields:e.availableFields,geometryDefinition:this.layer.geometryDefinition?.toJSON(),definitionExpression:this.layer.definitionExpression,customParameters:this.layer.customParameters,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(r,t,a){const{fields:l,renderer:n,geometryType:s,labelingInfo:o,labelsVisible:c,objectIdField:y,trackInfo:h}=this.layer,p={fields:l.map(e=>e.toJSON()),renderer:n?.clone(),labelingInfoSource:this.layer.id,featureReduction:e(this.layer,t),geometryType:s,labelingInfo:o,labelsVisible:c,objectIdField:y,orderBy:"default",trackInfo:h};return i(r,t,p,a)}get hasRequiredSupport(){return a(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(r){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>e(this.layer,r),()=>this.layer.customParameters,()=>this.layer.geometryDefinition,()=>this.layer.definitionExpression,()=>this.layer.trackInfo,()=>this.layer?.source?.refreshInterval]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(e){const t=r(this.layer),i=this.layer.timeInfo?.toJSON()||null,a=this.layer.spatialReference?this.layer.spatialReference.toJSON():null,l=e.spatialReference.toJSON();return{type:"stream",source:this.layer.getStreamConnectionSource(),outSpatialReference:l,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:t,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},timeInfo:i,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,spatialReference:a,outSpatialReference:l,attributeSpatialReference:null,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}}export{l as StreamLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as r}from"../../../../../core/mathUtils.js";import{sqlAnd as t}from"../../../../../core/sql.js";import{isHostedAgolService as i}from"../../../../../layers/support/arcgisLayerUrl.js";import s from"../../../../../layers/support/FeatureFilter.js";import{canConvertSqlRelativeTime as a,sqlRelativeTimeToAbsolute as l}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as o}from"../../../../../networks/support/networkFieldUtils.js";import{createFeatureIdInfo as n}from"./featureServiceUtils.js";import{addFloorFilter as u,hasFloorFilter as p}from"./floorFilterUtils.js";import{getServiceGeometryType as y}from"./geometryUtils.js";import{ExceedsLimitCache as c}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as d,createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as h}from"../schema/processor/SubtypeProcessorSchema.js";class f{constructor(e){this.layer=e,this._cache=new c}getLabelingDeconflictionInfo(){return[{vvEvaluators:{}}]}async createSourceSchema(e,r){const{definitionExpression:t,customParameters:i,gdbVersion:s,historicMoment:o,timeExtent:n,apiKey:u,displayFilterInfo:p}=this.layer,y=this._createServiceInfo(e),c=null!=this.layer.editingInfo?.lastEditDate,h=this.layer.refreshInterval>0,f=!c&&h,b=d(y.isSourceHosted,f,this.layer.capabilities,y.metadata.geometryType,e.extent,this.layer.fullExtent),S=a(t)?await l(this.layer.fieldsIndex,t,this.layer.capabilities.query.relativeTimeBinWindow):t,F=t!==S?{where:t}:null;return m(y,b,{definitionExpression:S,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:F,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:p,customParameters:i,gdbVersion:s,historicMoment:o,timeExtent:n,apiKey:u,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const i={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,r)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${r}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return h(e,r,i,t)}addFilters(e,r){e=u(this.layer,e,r);const i=this.layer.sublayers.filter(e=>!b(e,r)).map(e=>e.subtypeCode);if(!i.length)return e;e??=new s;const a=`NOT ${this.layer.subtypeField} IN (${i.join(",")})`;return e.where=t(e.where,a),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>p(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&o(e,this.layer),()=>this.layer.sublayers.map(({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:s,maxScale:a})=>({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:s,maxScale:a}))]}setGraphicOrigin(e){const r=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=r,e.origin=r?.graphicOrigin}getRenderer(e){return this.layer.findSublayerForFeature(e)?.renderer}_createServiceInfo(r){const{capabilities:t,datesInUnknownTimezone:s,dateFieldsTimeZone:a,editingInfo:l,globalIdField:o,objectIdField:u,subtypeField:p}=this.layer,c=this.layer.fieldsIndex.toJSON(),d=y(this.layer),m=this.layer.timeInfo?.toJSON(),h=this.layer.spatialReference.toJSON(),f=e(this.layer.parsedUrl),b=u,S=i(f.path),F=r.spatialReference.toJSON();return{type:"feature-service",source:f,isSourceHosted:S,orderByFields:b,outSpatialReference:F,metadata:{timeReferenceUnknownClient:s,dateFieldsTimeZone:a,subtypeField:p,globalIdField:o,fieldsIndex:c,geometryType:d,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:n(this.layer),timeInfo:m,spatialReference:h,outSpatialReference:F,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:t.query.supportsReturnExceededLimitGeometries,lastEditDate:l?.lastEditDate?.getTime()}}}}function b(e,t){return e.visible&&(0===e.minScale||r(t.scale,e.minScale)||t.scale<e.minScale)&&(0===e.maxScale||r(t.scale,e.maxScale)||t.scale>e.maxScale)}export{f as SubtypeGroupLayerAdapter};
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as r}from"../../../../../core/mathUtils.js";import{sqlAnd as t}from"../../../../../core/sql.js";import{isHostedAgolService as i}from"../../../../../layers/support/arcgisLayerUrl.js";import s from"../../../../../layers/support/FeatureFilter.js";import{canConvertSqlRelativeTime as a,sqlRelativeTimeToAbsolute as l}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as o}from"../../../../../networks/support/networkFieldUtils.js";import{createFeatureIdInfo as n}from"./featureServiceUtils.js";import{addFloorFilter as u,hasFloorFilter as p}from"./floorFilterUtils.js";import{getServiceGeometryType as y}from"./geometryUtils.js";import{ExceedsLimitCache as c}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as d,createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as h}from"../schema/processor/SubtypeProcessorSchema.js";class f{constructor(e){this.layer=e,this._cache=new c}getLabelingDeconflictionInfo(){return[{vvEvaluators:{}}]}async createSourceSchema(e,r){const{definitionExpression:t,customParameters:i,gdbVersion:s,historicMoment:o,timeExtent:n,apiKey:u,displayFilterInfo:p}=this.layer,y=this._createServiceInfo(e),c=null!=this.layer.editingInfo?.lastEditDate,h=this.layer.refreshInterval>0,f=!c&&h,b=d(y.isSourceHosted,f,this.layer.capabilities,y.metadata.geometryType,e.extent,this.layer.fullExtent),S=a(t)?await l(this.layer.fieldsIndex,t,this.layer.capabilities.query.relativeTimeBinWindow):t,F=t!==S?{where:t}:null;return m(y,b,{definitionExpression:S,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:F,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:p,customParameters:i,gdbVersion:s,historicMoment:o,timeExtent:n,apiKey:u,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const i={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,r)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${r}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return h(e,r,i,t)}addFilters(e,r){e=u(this.layer,e,r);const i=this.layer.sublayers.filter(e=>!b(e,r)).map(e=>e.subtypeCode);if(!i.length)return e;e??=new s;const a=`NOT ${this.layer.subtypeField} IN (${i.join(",")})`;return e.where=t(e.where,a),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>p(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&o(e,this.layer),()=>this.layer.sublayers.map(({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:s,maxScale:a})=>({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:s,maxScale:a}))]}setGraphicOrigin(e){const r=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=r,e.origin=r?.graphicOrigin}getRenderer(e){return this.layer.findSublayerForFeature(e)?.renderer}_createServiceInfo(r){const{capabilities:t,datesInUnknownTimezone:s,dateFieldsTimeZone:a,editingInfo:l,globalIdField:o,objectIdField:u,subtypeField:p}=this.layer,c=this.layer.fieldsIndex.toJSON(),d=y(this.layer),m=this.layer.timeInfo?.toJSON(),h=this.layer.spatialReference.toJSON(),f=e(this.layer.parsedUrl),b=u,S=i(f.path),F=r.spatialReference.toJSON();return{type:"feature-service",source:f,isSourceHosted:S,orderByFields:b,outSpatialReference:F,metadata:{timeReferenceUnknownClient:s,dateFieldsTimeZone:a,subtypeField:p,globalIdField:o,fieldsIndex:c,geometryType:d,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:n(this.layer),timeInfo:m,spatialReference:h,outSpatialReference:F,attributeSpatialReference:null,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:t.query.supportsReturnExceededLimitGeometries,lastEditDate:l?.lastEditDate?.getTime()}}}}function b(e,t){return e.visible&&(0===e.minScale||r(t.scale,e.minScale)||t.scale<e.minScale)&&(0===e.maxScale||r(t.scale,e.maxScale)||t.scale>e.maxScale)}export{f as SubtypeGroupLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{equals as e}from"../../../../../core/SetUtils.js";import t from"../../../../../geometry/SpatialReference.js";import{convertToFeature as s,unquantizeOptimizedGeometryInPlace as a}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as r}from"../../../../../layers/graphics/OptimizedFeature.js";import{checkProjectionSupport as i}from"../../../../../layers/graphics/data/projectionSupport.js";import o from"../../../../../layers/support/FieldsIndex.js";import{ComputedAggregateField as n}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as l}from"./AAggregateStrategy.js";import{UpdateBatch as d,ASendState as c}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as u}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as f}from"../support/ComputedAttributeStorage.js";import p from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as h}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as m}from"../support/FeatureSetReaderJSON.js";import{Hashed as g}from"../support/Hashed.js";class y extends c{constructor(e,t){super(e),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=t}take(){const e=this.bins,t=this.featureCache;return this.bins=new Map,this.featureCache=new Map,{bins:e,featureCache:t}}destroy(){const e=this.subscription.tile.key.level;for(const t of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${t}.${e}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const e of this.featureCache.values()){const t=e.clone();t.geometry&&a(t.geometry,this.subscription.tile.transform),yield t}}}class I extends l{static async create(e,s,a,r,o){const l=s.metadata.outSpatialReference,d=new f({spatialReference:l}),c=await Promise.all(e.fields.map(async e=>n.create(d,e))),u=e.featureFilter?await p.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:l,filterJSON:e.featureFilter}):null;return"geohash"===e.index.type&&await i(l,t.WGS84),new I(e,u,r,c,l,s,a,o)}constructor(e,t,s,a,r,i,n,l){super(i,n,r,a,l),this._schema=e,this._featureFilter=t,this._arcadeContextInfo=s,this._handled=new Set,this._invalidated=!1,this._metadata=h.createFeature({geometryType:"esriGeometryPolygon",hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new o(e.fields).toJSON(),globalIdField:null,spatialReference:i.metadata.spatialReference,outSpatialReference:i.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null}),this._getIndex=this._createGetIndex()}requiresInvalidation(t){for(const e of this._sendStates.values())if(!e.done)return!0;const s=new Set;for(const e of t)s.add(e.chunkId);return!e(s,this._handled)&&(this._handled=s,!0)}invalidate(){this._invalidated=!0}createState(e){return new y(e,this._attributeStore)}async applyOverrideUpdate(e){return null}displayMap(e,t,s){const a=new Map(e.map(e=>[t(e),e])),r=[];for(const i of this._sendStates.values())for(const e of i.featuresWorldSpace()){const{objectId:t,displayId:i}=e,o=a.get(t);if(null!=o){const e=s(i,o,t);r.push(e),a.delete(t)}}return r}getDisplayFeatures(e){const t=new Set(e),a=new Set,r=[];for(const i of this._sendStates.values())for(const e of i.featuresWorldSpace())t.has(e.displayId)&&!a.has(e.objectId)&&(e.geometry&&r.push({...s(e,this._metadata.geometryType,!1,!1),displayId:e.displayId}),a.add(e.objectId));return{features:[],aggregates:r,tracks:[]}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e){const e=[];for(const t of s.containedObjectIds)for(const s of t.values())e.push(s);return e}return[]}async updateChunks(e,t){if(!this._invalidated)return null;this._invalidated=!1;const s=new d;for(const a of this._sendStates.values())s.messages.push(this._update(a,e,t));return s}forEachAggregateWorldSpace(e){const t=new Set;for(const s of this._sendStates.values())for(const a of s.featuresWorldSpace())t.has(a.objectId)||(e(a),t.add(a.objectId))}_createGetIndex(){return(e,t)=>{switch(this._schema.index.type){case"geohash":return e.getGeohashIndex(new g({type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:t.scale,sqlOptions:this._sqlOptions}));case"grid":{const s=this._schema.index.fixedBinLevel,a=null!=s?t.tileInfoView.getLODInfoAt(s).scale:t.scale;return e.getGridIndex(new g({type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:a,sqlOptions:this._sqlOptions}))}}}}_update(e,t,s){const{subscription:a}=e,i=e.take(),{bins:o,featureCache:n}=e,l=a.tile,d=new Set;for(const r of t){this._getIndex(r,l).putBounded(o,d,e.tile.extent,e.tile.resolution)}const c=[],f=a.tile.transform,p=a.tile.key.level;for(const u of o.values()){const e=u.getGeometry(this.spatialReference,f),t=new r(e,u.getAttributes(),null,u.id);e||(t.centroid=u.getGeometricCentroid(this.spatialReference,f)),t.displayId=this._attributeStore.createDisplayIdForObjectId(`${t.objectId}.${p}`),n.set(u.id,t),c.push(t)}this.events.emit("changed"),e.done||=!s;const h=m.fromOptimizedFeatures(c,this._metadata,f),g=h.getCursor(),y=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo);for(;g.next();)this._attributeStore.setAttributeData(g.getDisplayId(),g,y,this._sqlOptions);const I=new u(e.subscription,h,[],e.done,{});for(const r of i.featureCache.keys())this._attributeStore.releaseDisplayIdForObjectId(`${r}.${p}`);return I}}export{y as BinningState,I as BinningStrategy};
|
|
2
|
+
import{equals as e}from"../../../../../core/SetUtils.js";import t from"../../../../../geometry/SpatialReference.js";import{convertToFeature as s,unquantizeOptimizedGeometryInPlace as a}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as r}from"../../../../../layers/graphics/OptimizedFeature.js";import{checkProjectionSupport as i}from"../../../../../layers/graphics/data/projectionSupport.js";import o from"../../../../../layers/support/FieldsIndex.js";import{ComputedAggregateField as n}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as l}from"./AAggregateStrategy.js";import{UpdateBatch as d,ASendState as c}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as u}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as f}from"../support/ComputedAttributeStorage.js";import p from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as h}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as m}from"../support/FeatureSetReaderJSON.js";import{Hashed as g}from"../support/Hashed.js";class y extends c{constructor(e,t){super(e),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=t}take(){const e=this.bins,t=this.featureCache;return this.bins=new Map,this.featureCache=new Map,{bins:e,featureCache:t}}destroy(){const e=this.subscription.tile.key.level;for(const t of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${t}.${e}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const e of this.featureCache.values()){const t=e.clone();t.geometry&&a(t.geometry,this.subscription.tile.transform),yield t}}}class I extends l{static async create(e,s,a,r,o){const l=s.metadata.outSpatialReference,d=new f({spatialReference:l}),c=await Promise.all(e.fields.map(async e=>n.create(d,e))),u=e.featureFilter?await p.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:l,filterJSON:e.featureFilter}):null;return"geohash"===e.index.type&&await i(l,t.WGS84),new I(e,u,r,c,l,s,a,o)}constructor(e,t,s,a,r,i,n,l){super(i,n,r,a,l),this._schema=e,this._featureFilter=t,this._arcadeContextInfo=s,this._handled=new Set,this._invalidated=!1,this._metadata=h.createFeature({geometryType:"esriGeometryPolygon",hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new o(e.fields).toJSON(),globalIdField:null,spatialReference:i.metadata.spatialReference,outSpatialReference:i.metadata.outSpatialReference,attributeSpatialReference:null,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null}),this._getIndex=this._createGetIndex()}requiresInvalidation(t){for(const e of this._sendStates.values())if(!e.done)return!0;const s=new Set;for(const e of t)s.add(e.chunkId);return!e(s,this._handled)&&(this._handled=s,!0)}invalidate(){this._invalidated=!0}createState(e){return new y(e,this._attributeStore)}async applyOverrideUpdate(e){return null}displayMap(e,t,s){const a=new Map(e.map(e=>[t(e),e])),r=[];for(const i of this._sendStates.values())for(const e of i.featuresWorldSpace()){const{objectId:t,displayId:i}=e,o=a.get(t);if(null!=o){const e=s(i,o,t);r.push(e),a.delete(t)}}return r}getDisplayFeatures(e){const t=new Set(e),a=new Set,r=[];for(const i of this._sendStates.values())for(const e of i.featuresWorldSpace())t.has(e.displayId)&&!a.has(e.objectId)&&(e.geometry&&r.push({...s(e,this._metadata.geometryType,!1,!1),displayId:e.displayId}),a.add(e.objectId));return{features:[],aggregates:r,tracks:[]}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e){const e=[];for(const t of s.containedObjectIds)for(const s of t.values())e.push(s);return e}return[]}async updateChunks(e,t){if(!this._invalidated)return null;this._invalidated=!1;const s=new d;for(const a of this._sendStates.values())s.messages.push(this._update(a,e,t));return s}forEachAggregateWorldSpace(e){const t=new Set;for(const s of this._sendStates.values())for(const a of s.featuresWorldSpace())t.has(a.objectId)||(e(a),t.add(a.objectId))}_createGetIndex(){return(e,t)=>{switch(this._schema.index.type){case"geohash":return e.getGeohashIndex(new g({type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:t.scale,sqlOptions:this._sqlOptions}));case"grid":{const s=this._schema.index.fixedBinLevel,a=null!=s?t.tileInfoView.getLODInfoAt(s).scale:t.scale;return e.getGridIndex(new g({type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:a,sqlOptions:this._sqlOptions}))}}}}_update(e,t,s){const{subscription:a}=e,i=e.take(),{bins:o,featureCache:n}=e,l=a.tile,d=new Set;for(const r of t){this._getIndex(r,l).putBounded(o,d,e.tile.extent,e.tile.resolution)}const c=[],f=a.tile.transform,p=a.tile.key.level;for(const u of o.values()){const e=u.getGeometry(this.spatialReference,f),t=new r(e,u.getAttributes(),null,u.id);e||(t.centroid=u.getGeometricCentroid(this.spatialReference,f)),t.displayId=this._attributeStore.createDisplayIdForObjectId(`${t.objectId}.${p}`),n.set(u.id,t),c.push(t)}this.events.emit("changed"),e.done||=!s;const h=m.fromOptimizedFeatures(c,this._metadata,f),g=h.getCursor(),y=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo);for(;g.next();)this._attributeStore.setAttributeData(g.getDisplayId(),g,y,this._sqlOptions);const I=new u(e.subscription,h,[],e.done,{});for(const r of i.featureCache.keys())this._attributeStore.releaseDisplayIdForObjectId(`${r}.${p}`);return I}}export{y as BinningState,I as BinningStrategy};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"../../../../../core/has.js";import{convertToFeature as e}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as t}from"../../../../../layers/graphics/OptimizedFeature.js";import s from"../../../../../layers/graphics/OptimizedGeometry.js";import i from"../../../../../layers/support/FieldsIndex.js";import{tileSize as r}from"../../../engine/webgl/definitions.js";import{ComputedAggregateField as a}from"../aggregation/ComputedAggregateField.js";import{GridCell as n}from"../aggregation/GridCell.js";import{pixelsPerMapUnit as l}from"../aggregation/GridSpatialIndex.js";import{AAggregateStrategy as o}from"./AAggregateStrategy.js";import{LevelReplaceBatch as d,ASendState as u}from"./AProcessorStrategy.js";import{WithDisplayId as c}from"./support/WithDisplayId.js";import{FeatureTileAppendMessage as p}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as f}from"../support/ComputedAttributeStorage.js";import h from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as g}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as m}from"../support/FeatureSetReaderJSON.js";import{Hashed as _}from"../support/Hashed.js";const y=128;class I extends u{constructor(e){super(e),this.didSend=!1,this.done=!1}}class x{constructor(e,t,s,i,r){this.level=e,this._scale=t,this._indexOptions=s,this._clusterRadius=i,this._store=r,this._statistics=new Map,this._handledChunks=new Set,this._handledIds=new Set,this._cells=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const e of this._clusters.values())this._store.releaseDisplayIdForObjectId(e.inner.id);this._clusters.clear()}invalidate(){this._cells.clear(),this._handledChunks.clear(),this._handledIds.clear()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const s=e.inner.getCentroid(null),i=new t(s,e.inner.getAttributes(),null,e.inner.id,e.displayId);yield i}}clusters(){return this._clusters.values()}update(e,t){let s=!1;const i=new _({...this._indexOptions,scale:this._scale});for(const l of e){if(this._handledChunks.has(l.normalizedChunkId))continue;if(this._handledChunks.add(l.normalizedChunkId),null!=l.lodInfo&&l.lodInfo.level!==this.level)continue;l.getGridIndex(i).put(this._cells,this._handledIds),s=!0}const r=l(this._indexOptions.spatialReference,this._scale),a=this._indexOptions.cellSize,n={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0};for(const{subscription:l}of t){const e=l.tile.bounds,t=Math.floor(e[0]*r/a),s=Math.floor(e[1]*r/a),i=Math.ceil(e[2]*r/a),o=Math.ceil(e[3]*r/a);n.xMin=Math.min(n.xMin,t),n.yMin=Math.min(n.yMin,s),n.xMax=Math.max(n.xMax,i),n.yMax=Math.max(n.yMax,o)}return null!=this._lastCellBounds&&n.xMin===this._lastCellBounds.xMin&&n.xMax===this._lastCellBounds.xMax&&n.yMin===this._lastCellBounds.yMin&&n.yMax===this._lastCellBounds.yMax||(this._lastCellBounds=n,s=!0),s&&this._clusterCells(n),s}_clusterCells(e){const t=this._clusters;this._clusters=new Map;const s=this._clusterRadius*(1/l(this._indexOptions.spatialReference,this._scale));let i=Array.from(this._cells.values());i=i.sort((e,t)=>t.count-e.count);const r=new Set;for(const a of i){if(r.has(a.id))continue;if(a.gridX<e.xMin||a.gridX>e.xMax||a.gridY<e.yMin||a.gridY>e.yMax)continue;const t=1+this._clusterRadius/this._indexOptions.cellSize,i=this._store.createDisplayIdForObjectId(a.id),l=new c(a.clone(),i);r.add(a.id),this._clusters.set(a.id,l);const o=a.centroidXWorld,d=a.centroidYWorld;for(let e=a.gridY-t;e<=a.gridY+t;e++)for(let i=a.gridX-t;i<=a.gridX+t;i++){if(e===a.gridY&&i===a.gridX)continue;const t=this._cells.get(n.createId(i,e));if(!t||r.has(t.id))continue;const u=Math.abs(t.centroidXWorld-o),c=Math.abs(t.centroidYWorld-d);u<s&&c<s&&(l.inner.merge(t),r.add(t.id))}}for(const a of t.values())this._store.releaseDisplayIdForObjectId(a.inner.id)}async updateStatistics(e){let t=!1;for(const s of this._clusters.values())s.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,s.inner)||t);if(t){const t=Array.from(this._statistics.entries()).map(([e,t])=>({fieldName:e,minValue:t.minValue,maxValue:t.maxValue}));await e.container.updateStatistics(this.level,t)}}createAggregateFeatures(e,i){const a=e.subscription,n=[],l=a.tile.transform,o=Array.from(this._clusters.values()),d=o.length;for(const c of o){const e=c.inner.getCentroidX(l),i=c.inner.getCentroidY(l),a=1===c.inner.count?c.inner.firstObjectId:c.inner.id,o=c.displayId;if(e<r+y&&e>=-y&&i<r+y&&i>=-y){const r=new s([],[e,i]),l=new t(r,c.inner.getAttributes(),null,a,o);n.push(l)}}const u=m.fromOptimizedFeatures(n,i,a.tile.transform);return has("esri-2d-update-debug")&&console.debug(`Tile[${e.subscription.tile.id}] ClusterStrategy.createAggregateFeatures`,{clusters:u,levelClusterCount:d}),u}_updateAggregateStatistics(e,t){let s=!1;for(const i of t.statistics.values()){if("esriFieldTypeString"===i.field.type)continue;const t=i.value,r=i.field,a=e.get(r.name);if(a){const{minValue:e,maxValue:i}=a,r=Math.min(a.minValue,t),n=Math.max(a.maxValue,t);e===r&&i===n||(a.minValue=r,a.maxValue=n,s=!0);continue}e.set(r.name,{minValue:t,maxValue:t}),s=!0}return s}}class
|
|
2
|
+
import has from"../../../../../core/has.js";import{convertToFeature as e}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as t}from"../../../../../layers/graphics/OptimizedFeature.js";import s from"../../../../../layers/graphics/OptimizedGeometry.js";import i from"../../../../../layers/support/FieldsIndex.js";import{tileSize as r}from"../../../engine/webgl/definitions.js";import{ComputedAggregateField as a}from"../aggregation/ComputedAggregateField.js";import{GridCell as n}from"../aggregation/GridCell.js";import{pixelsPerMapUnit as l}from"../aggregation/GridSpatialIndex.js";import{AAggregateStrategy as o}from"./AAggregateStrategy.js";import{LevelReplaceBatch as d,ASendState as u}from"./AProcessorStrategy.js";import{WithDisplayId as c}from"./support/WithDisplayId.js";import{FeatureTileAppendMessage as p}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as f}from"../support/ComputedAttributeStorage.js";import h from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as g}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as m}from"../support/FeatureSetReaderJSON.js";import{Hashed as _}from"../support/Hashed.js";const y=128;class I extends u{constructor(e){super(e),this.didSend=!1,this.done=!1}}class x{constructor(e,t,s,i,r){this.level=e,this._scale=t,this._indexOptions=s,this._clusterRadius=i,this._store=r,this._statistics=new Map,this._handledChunks=new Set,this._handledIds=new Set,this._cells=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const e of this._clusters.values())this._store.releaseDisplayIdForObjectId(e.inner.id);this._clusters.clear()}invalidate(){this._cells.clear(),this._handledChunks.clear(),this._handledIds.clear()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const s=e.inner.getCentroid(null),i=new t(s,e.inner.getAttributes(),null,e.inner.id,e.displayId);yield i}}clusters(){return this._clusters.values()}update(e,t){let s=!1;const i=new _({...this._indexOptions,scale:this._scale});for(const l of e){if(this._handledChunks.has(l.normalizedChunkId))continue;if(this._handledChunks.add(l.normalizedChunkId),null!=l.lodInfo&&l.lodInfo.level!==this.level)continue;l.getGridIndex(i).put(this._cells,this._handledIds),s=!0}const r=l(this._indexOptions.spatialReference,this._scale),a=this._indexOptions.cellSize,n={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0};for(const{subscription:l}of t){const e=l.tile.bounds,t=Math.floor(e[0]*r/a),s=Math.floor(e[1]*r/a),i=Math.ceil(e[2]*r/a),o=Math.ceil(e[3]*r/a);n.xMin=Math.min(n.xMin,t),n.yMin=Math.min(n.yMin,s),n.xMax=Math.max(n.xMax,i),n.yMax=Math.max(n.yMax,o)}return null!=this._lastCellBounds&&n.xMin===this._lastCellBounds.xMin&&n.xMax===this._lastCellBounds.xMax&&n.yMin===this._lastCellBounds.yMin&&n.yMax===this._lastCellBounds.yMax||(this._lastCellBounds=n,s=!0),s&&this._clusterCells(n),s}_clusterCells(e){const t=this._clusters;this._clusters=new Map;const s=this._clusterRadius*(1/l(this._indexOptions.spatialReference,this._scale));let i=Array.from(this._cells.values());i=i.sort((e,t)=>t.count-e.count);const r=new Set;for(const a of i){if(r.has(a.id))continue;if(a.gridX<e.xMin||a.gridX>e.xMax||a.gridY<e.yMin||a.gridY>e.yMax)continue;const t=1+this._clusterRadius/this._indexOptions.cellSize,i=this._store.createDisplayIdForObjectId(a.id),l=new c(a.clone(),i);r.add(a.id),this._clusters.set(a.id,l);const o=a.centroidXWorld,d=a.centroidYWorld;for(let e=a.gridY-t;e<=a.gridY+t;e++)for(let i=a.gridX-t;i<=a.gridX+t;i++){if(e===a.gridY&&i===a.gridX)continue;const t=this._cells.get(n.createId(i,e));if(!t||r.has(t.id))continue;const u=Math.abs(t.centroidXWorld-o),c=Math.abs(t.centroidYWorld-d);u<s&&c<s&&(l.inner.merge(t),r.add(t.id))}}for(const a of t.values())this._store.releaseDisplayIdForObjectId(a.inner.id)}async updateStatistics(e){let t=!1;for(const s of this._clusters.values())s.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,s.inner)||t);if(t){const t=Array.from(this._statistics.entries()).map(([e,t])=>({fieldName:e,minValue:t.minValue,maxValue:t.maxValue}));await e.container.updateStatistics(this.level,t)}}createAggregateFeatures(e,i){const a=e.subscription,n=[],l=a.tile.transform,o=Array.from(this._clusters.values()),d=o.length;for(const c of o){const e=c.inner.getCentroidX(l),i=c.inner.getCentroidY(l),a=1===c.inner.count?c.inner.firstObjectId:c.inner.id,o=c.displayId;if(e<r+y&&e>=-y&&i<r+y&&i>=-y){const r=new s([],[e,i]),l=new t(r,c.inner.getAttributes(),null,a,o);n.push(l)}}const u=m.fromOptimizedFeatures(n,i,a.tile.transform);return has("esri-2d-update-debug")&&console.debug(`Tile[${e.subscription.tile.id}] ClusterStrategy.createAggregateFeatures`,{clusters:u,levelClusterCount:d}),u}_updateAggregateStatistics(e,t){let s=!1;for(const i of t.statistics.values()){if("esriFieldTypeString"===i.field.type)continue;const t=i.value,r=i.field,a=e.get(r.name);if(a){const{minValue:e,maxValue:i}=a,r=Math.min(a.minValue,t),n=Math.max(a.maxValue,t);e===r&&i===n||(a.minValue=r,a.maxValue=n,s=!0);continue}e.set(r.name,{minValue:t,maxValue:t}),s=!0}return s}}class S extends o{static async create(e,t,s,i,r,n){const l=s.metadata.outSpatialReference,o=new f({spatialReference:l}),d={type:"grid",fields:await Promise.all(t.fields.map(async e=>a.create(o,e))),spatialReference:l,featureFilter:t.featureFilter?await h.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:l,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,arcadeContextInfo:r,sqlOptions:n};return new S(e,t.clusterRadius,d,t.fields,s,i,n)}constructor(e,t,s,r,a,n,l){super(a,n,s.spatialReference,s.fields,l),this._connection=e,this._clusterRadius=t,this._indexOptions=s,this._cellsPerLevel=new Map,this._metadata=g.createFeature({geometryType:"esriGeometryPoint",hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new i([...r,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:a.metadata.spatialReference,outSpatialReference:a.metadata.outSpatialReference,attributeSpatialReference:null,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!0}onSubscribe(e){super.onSubscribe(e);const{scale:t,level:s}=e.tile;this._lastSubscribedLodInfo={level:s,scale:t}}requiresInvalidation(e){return!1}invalidate(){for(const e of this._cellsPerLevel.values())e.invalidate()}createState(e){return new I(e)}async applyOverrideUpdate(e){for(const t of this._cellsPerLevel.values())t.invalidate();return null}displayMap(e,t,s){const i=new Map(e.map(e=>[t(e),e])),r=[],a=this._getActiveClusterState();if(a)for(const n of a.clusters()){const e=i.get(n.inner.id);if(null!=e){const t=s(n.displayId,e,n.inner.id);r.push(t),i.delete(n.inner.id);continue}if(1===n.inner.count){const{firstObjectId:e}=n.inner,t=e?i.get(e):null;if(null!=t){const a=s(n.displayId,t,e);r.push(a),i.delete(e)}}}return r}getDisplayFeatures(t){const s=new Set(t),i=new Set,r=[],a=[],n=this._getActiveClusterState();if(n)for(const l of n.aggregatesWorldSpace())if(s.has(l.displayId)&&!i.has(l.displayId)){const t=e(l,this._metadata.geometryType,!1,!1);if(i.add(l.displayId),1===t.attributes.cluster_count){r.push({...t,displayId:l.displayId});continue}a.push({...t,displayId:l.displayId})}return{features:r,aggregates:a,tracks:[]}}getFeatureObjectIdsForAggregate(e){const t=this._getActiveClusterState();if(t)for(const s of t.clusters())if(s.inner.id===e){const e=[];for(const t of s.inner.containedObjectIds)for(const s of t.values())e.push(s);return e}return[]}async updateChunks(e,t){const s=this._lastSubscribedLodInfo;if(!s)return null;const i=this._getOrCreateClusterState(s),r=Array.from(this._sendStates.values()).filter(e=>e.subscription.tile.level===s.level);i.update(e,r);const a=new d(s.level);for(const n of r)a.messages.push(this._update(n,i,t));return await i.updateStatistics(this._connection),a}forEachAggregateWorldSpace(e){const t=this._getActiveClusterState();if(t)for(const s of t.aggregatesWorldSpace())e(s)}_getActiveClusterState(){return this._lastSubscribedLodInfo?this._cellsPerLevel.get(this._lastSubscribedLodInfo.level):null}_getOrCreateClusterState(e){if(null==e.level)throw new Error("InternalError: Level and scale must be defined");let t=this._cellsPerLevel.get(e.level);return t||(t=new x(e.level,e.scale,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerLevel.set(e.level,t)),t}_update(e,t,s){const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=e.done||!s;const r=i.getCursor(),a=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.arcadeContextInfo);for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,a,this._sqlOptions);return has("esri-2d-update-debug")&&console.debug(`Tile[${e.subscription.tile.id}] ClusterStrategy._update`,{done:e.done}),new p(e.subscription,i,e.done,{})}}export{I as ClusterSendState,S as ClusterStrategy};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
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 a,execute as i}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 u,expandPointInPlace as d}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,convertFromPolyline as _}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as g}from"../../../../../layers/graphics/OptimizedFeature.js";import b from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{AppendBatch as x,ASendState as S}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as T}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"),M=32;class W{constructor(t,e,s,r,a){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=a}}class z{static getOid(t){return I+t}constructor(t,e,s,r,a,i,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=a,this._spatialReference=i,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]:0};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 W(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const a=new Set(this._nextObservationRecords.map(t=>t.objectId)),i=this._observationRecords.filter(t=>!a.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?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let u=this._nextObservationRecords.length-1;u>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);u--){const t=this._nextObservationRecords[u],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,a=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(a),n=l[e];s(n),n.setIndex(r);const u=new g(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,a,o);this._latestObservationFeature&&i.push(this._latestObservationFeature.objectId),this._latestObservationFeature=u,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=Z(this._trackLinePath,this._spatialReference),this._bounds=N(this._trackLineGeometry),this._nextObservationRecords=[],i}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:a,featureIndex:i}of this._observationRecords){const t=r[a];s(t),t.setIndex(i),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,M))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:a}=this._latestObservationFeature,i=m(r,this._metadata.geometryType,t.subscription.tile.transform)??new b,o=l(1/0,1/0,-1/0,-1/0);E(i,(t,e)=>d(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new g(i,a,null,e,s)}getTrackLineFeatureForTile(t){const e=m(this._trackLineGeometry,"esriGeometryPolyline",t.subscription.tile.transform)??new b;return new g(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new g(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],a=s?.coords[1];null==s&&(r=e.readXWorldSpace(),a=e.readYWorldSpace()),null!=r&&null!=a&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,a]))}}class U extends S{constructor(t){super(t),this.done=!1}}class q extends j{static async create(t,e,s,i,o){const n=e.metadata.outSpatialReference,l=new w({spatialReference:n}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),u=t.featureFilter?await D.create({geometryType:e.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:e.metadata.timeInfo,fieldsIndex:e.metadata.fieldsIndex,spatialReference:n,filterJSON:t.featureFilter}):null;return n.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),a()]).then(([t,e,s])=>{G={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new q(t,e,s,n,c,u,i,o)}constructor(t,e,s,r,a,i,o,n){super(e,s,r,a,n),this._schema=t,this._featureFilter=i,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,hasZ:!1,hasM:!1})}destroy(){super.destroy(),this._clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){return!0}invalidate(){super.invalidate(),this._clear()}createState(t){return new U(t)}async applyOverrideUpdate(t){return P().error("Applying override to tracks is not supported"),null}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),a=[];for(const i of this._tracks.values()){const t=r.get(i.objectId);if(null!=t){const e=s(i.displayId,t,i.objectId);a.push(e),r.delete(i.objectId);continue}const e=i.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const i=s(e.displayId,t,e.objectId);a.push(i),r.delete(e.objectId);continue}}for(const o of i.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);a.push(e),r.delete(o.objectId)}}}return a}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],a=this._source.chunks().map(t=>t.reader.getCursor());for(const i of this._tracks.values()){if(e.has(i.displayId)&&r.push(i.getTrackLineDisplayFeature()),null!=i.latestObservationFeature&&e.has(i.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=i.latestObservationRecord,o=a[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of i.observations())if(e.has(t)){const e=a[r];e.setIndex(o),s.push({displayId:t,...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();const t=new x;for(const e of this._sendStates.values())this._update(t,e);return t}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_clear(){for(const t of this._source.chunks())if(this._handledChunks.has(t.chunkId)){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._attributeStore.releaseDisplayIdForObjectId(t)}}this._handledChunks.clear();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}_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 a=t[r];if(this._handledChunks.has(a.chunkId))continue;this._handledChunks.add(a.chunkId);const i=a.reader.getCursor();for(;i.next();){const t=i.getObjectId();i.setDisplayId(this._attributeStore.createDisplayIdForObjectId(t));const a=i.readAttribute(e);if(null!=a&&null!=t&&(null===this._featureFilter||this._featureFilter.check(i,this._sqlOptions))){if(!this._tracks.has(a)){const t=z.getOid(a),e=this._attributeStore.createDisplayIdForObjectId(t),s=new z(this._schema,a,t,e,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(a,s)}this._tracks.get(a).stageObservation(r,i),s.add(a)}}}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),null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}_update(e,s){if(s.done)return;s.done=!this._source.updateTracking.updating;const r=[],a=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const e=t.getLatestObservationFeatureForTile(s);null!=e&&r.push(e)}this._schema.showTrackLine&&t.overlapsTile(s.subscription.tile)&&a.push(t.getTrackLineFeatureForTile(s))}const i=C.fromOptimizedFeatures(r,this._metadata,s.subscription.tile.transform),o=C.fromOptimizedFeatures(a,this._trackLineMetadata,s.subscription.tile.transform);let n=[];if(this._schema.showPreviousObservations){const e=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:s,featureIndex:r}of t.previousObservations())e[s].push(r);n=this._source.chunks().map((t,r)=>{const a=t.getTileReader(s.subscription.tile);if(null==a)return null;const i=A.from(a,e[r]);return i.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==i.geometryType&&null!=i.getInTransform()||i.setTransformForDisplay(s.subscription.tile.transform),i}).filter(t)}this.events.emit("changed");const l=s.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),c=o.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,l,this._sqlOptions);for(const t of n){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,l,this._sqlOptions)}const u=i.getCursor();for(;u.next();)this._attributeStore.setAttributeData(u.getDisplayId(),u,l,this._sqlOptions);e.messages.push(new T(s.subscription,o,!1,{}));for(const t of n)e.messages.push(new T(s.subscription,t,!1,{}));e.messages.push(new T(s.subscription,i,s.done,{}))}}function Z(t,e){if(t.length<2)return _({paths:[t]},!1,!1);if(e.isWrappable){let s=!1;for(let r=1;r<t.length;r++){const a=t[r][0],i=h(a,t[r-1][0],e);a!==i&&(t[r][0]=i,s=!0)}if(s){const s=p({paths:[t],spatialReference:e});if(null!=s)return _({paths:s.paths},!1,!1)}return _({paths:[t]},!1,!1)}const s=G.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[t]}),r=G.fromSpatialReference(e);if(null!=r){const t=i(s,1e6,r,o.geodesic);if(null!=t){const e=G.toGeometry(t,r);if(null!=e&&"paths"in e)return _({paths:e.paths},!1,!1)}}return _({paths:[t]},!1,!1)}function E(t,e){const s=2,{coords:r,lengths:a}=t;if(!a.length)return void e(r[0],r[1]);let i=0;for(let o=0;o<a.length;o++){const t=a[o];let n=0,l=0;for(let a=0;a<t;a++)n+=r[s*(a+i)],l+=r[s*(a+i)+1],e(n,l);i+=t}}function N(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[u()];const a=[];let i=0;for(let o=0;o<e.length;o++){const t=e[o],n=u();a.push(n);for(let e=0;e<t;e++){const t=s[r*(e+i)],a=s[r*(e+i)+1];d(n,[t,a])}i+=t}return a}export{q as TrackStrategy};
|
|
2
|
+
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 a,execute as i}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 u,expandPointInPlace as d}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,convertFromPolyline as _}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as g}from"../../../../../layers/graphics/OptimizedFeature.js";import b from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{AppendBatch as x,ASendState as S}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as T}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"),M=32;class W{constructor(t,e,s,r,a){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=a}}class z{static getOid(t){return I+t}constructor(t,e,s,r,a,i,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=a,this._spatialReference=i,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]:0};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 W(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const a=new Set(this._nextObservationRecords.map(t=>t.objectId)),i=this._observationRecords.filter(t=>!a.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?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let u=this._nextObservationRecords.length-1;u>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);u--){const t=this._nextObservationRecords[u],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,a=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(a),n=l[e];s(n),n.setIndex(r);const u=new g(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,a,o);this._latestObservationFeature&&i.push(this._latestObservationFeature.objectId),this._latestObservationFeature=u,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=Z(this._trackLinePath,this._spatialReference),this._bounds=N(this._trackLineGeometry),this._nextObservationRecords=[],i}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:a,featureIndex:i}of this._observationRecords){const t=r[a];s(t),t.setIndex(i),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,M))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:a}=this._latestObservationFeature,i=m(r,this._metadata.geometryType,t.subscription.tile.transform)??new b,o=l(1/0,1/0,-1/0,-1/0);E(i,(t,e)=>d(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new g(i,a,null,e,s)}getTrackLineFeatureForTile(t){const e=m(this._trackLineGeometry,"esriGeometryPolyline",t.subscription.tile.transform)??new b;return new g(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new g(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],a=s?.coords[1];null==s&&(r=e.readXWorldSpace(),a=e.readYWorldSpace()),null!=r&&null!=a&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,a]))}}class U extends S{constructor(t){super(t),this.done=!1}}class q extends j{static async create(t,e,s,i,o){const n=e.metadata.outSpatialReference,l=new w({spatialReference:n}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),u=t.featureFilter?await D.create({geometryType:e.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:e.metadata.timeInfo,fieldsIndex:e.metadata.fieldsIndex,spatialReference:n,filterJSON:t.featureFilter}):null;return n.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),a()]).then(([t,e,s])=>{G={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new q(t,e,s,n,c,u,i,o)}constructor(t,e,s,r,a,i,o,n){super(e,s,r,a,n),this._schema=t,this._featureFilter=i,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,attributeSpatialReference:null,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null,hasZ:!1,hasM:!1})}destroy(){super.destroy(),this._clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){return!0}invalidate(){super.invalidate(),this._clear()}createState(t){return new U(t)}async applyOverrideUpdate(t){return P().error("Applying override to tracks is not supported"),null}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),a=[];for(const i of this._tracks.values()){const t=r.get(i.objectId);if(null!=t){const e=s(i.displayId,t,i.objectId);a.push(e),r.delete(i.objectId);continue}const e=i.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const i=s(e.displayId,t,e.objectId);a.push(i),r.delete(e.objectId);continue}}for(const o of i.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);a.push(e),r.delete(o.objectId)}}}return a}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],a=this._source.chunks().map(t=>t.reader.getCursor());for(const i of this._tracks.values()){if(e.has(i.displayId)&&r.push(i.getTrackLineDisplayFeature()),null!=i.latestObservationFeature&&e.has(i.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=i.latestObservationRecord,o=a[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of i.observations())if(e.has(t)){const e=a[r];e.setIndex(o),s.push({displayId:t,...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();const t=new x;for(const e of this._sendStates.values())this._update(t,e);return t}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_clear(){for(const t of this._source.chunks())if(this._handledChunks.has(t.chunkId)){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._attributeStore.releaseDisplayIdForObjectId(t)}}this._handledChunks.clear();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}_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 a=t[r];if(this._handledChunks.has(a.chunkId))continue;this._handledChunks.add(a.chunkId);const i=a.reader.getCursor();for(;i.next();){const t=i.getObjectId();i.setDisplayId(this._attributeStore.createDisplayIdForObjectId(t));const a=i.readAttribute(e);if(null!=a&&null!=t&&(null===this._featureFilter||this._featureFilter.check(i,this._sqlOptions))){if(!this._tracks.has(a)){const t=z.getOid(a),e=this._attributeStore.createDisplayIdForObjectId(t),s=new z(this._schema,a,t,e,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(a,s)}this._tracks.get(a).stageObservation(r,i),s.add(a)}}}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),null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}_update(e,s){if(s.done)return;s.done=!this._source.updateTracking.updating;const r=[],a=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const e=t.getLatestObservationFeatureForTile(s);null!=e&&r.push(e)}this._schema.showTrackLine&&t.overlapsTile(s.subscription.tile)&&a.push(t.getTrackLineFeatureForTile(s))}const i=C.fromOptimizedFeatures(r,this._metadata,s.subscription.tile.transform),o=C.fromOptimizedFeatures(a,this._trackLineMetadata,s.subscription.tile.transform);let n=[];if(this._schema.showPreviousObservations){const e=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:s,featureIndex:r}of t.previousObservations())e[s].push(r);n=this._source.chunks().map((t,r)=>{const a=t.getTileReader(s.subscription.tile);if(null==a)return null;const i=A.from(a,e[r]);return i.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==i.geometryType&&null!=i.getInTransform()||i.setTransformForDisplay(s.subscription.tile.transform),i}).filter(t)}this.events.emit("changed");const l=s.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),c=o.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,l,this._sqlOptions);for(const t of n){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,l,this._sqlOptions)}const u=i.getCursor();for(;u.next();)this._attributeStore.setAttributeData(u.getDisplayId(),u,l,this._sqlOptions);e.messages.push(new T(s.subscription,o,!1,{}));for(const t of n)e.messages.push(new T(s.subscription,t,!1,{}));e.messages.push(new T(s.subscription,i,s.done,{}))}}function Z(t,e){if(t.length<2)return _({paths:[t]},!1,!1);if(e.isWrappable){let s=!1;for(let r=1;r<t.length;r++){const a=t[r][0],i=h(a,t[r-1][0],e);a!==i&&(t[r][0]=i,s=!0)}if(s){const s=p({paths:[t],spatialReference:e});if(null!=s)return _({paths:s.paths},!1,!1)}return _({paths:[t]},!1,!1)}const s=G.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[t]}),r=G.fromSpatialReference(e);if(null!=r){const t=i(s,1e6,r,o.geodesic);if(null!=t){const e=G.toGeometry(t,r);if(null!=e&&"paths"in e)return _({paths:e.paths},!1,!1)}}return _({paths:[t]},!1,!1)}function E(t,e){const s=2,{coords:r,lengths:a}=t;if(!a.length)return void e(r[0],r[1]);let i=0;for(let o=0;o<a.length;o++){const t=a[o];let n=0,l=0;for(let a=0;a<t;a++)n+=r[s*(a+i)],l+=r[s*(a+i)+1],e(n,l);i+=t}}function N(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[u()];const a=[];let i=0;for(let o=0;o<e.length;o++){const t=e[o],n=u();a.push(n);for(let e=0;e<t;e++){const t=s[r*(e+i)],a=s[r*(e+i)+1];d(n,[t,a])}i+=t}return a}export{q as TrackStrategy};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../../../request.js";import t from"../../../../../../../core/Error.js";import has from"../../../../../../../core/has.js";import
|
|
2
|
+
import e from"../../../../../../../request.js";import t from"../../../../../../../core/Error.js";import has from"../../../../../../../core/has.js";import r from"../../../../../../../core/workers/Connection.js";import{toQuantizationTransform as a}from"../../../../../../../geometry/support/quantizationUtils.js";import{equals as s}from"../../../../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatureSet as o,quantizeOptimizedFeatureSet as i}from"../../../../../../../layers/graphics/featureConversionUtils.js";import{queryOptimizedFeatureSet as n}from"../../../../../../../layers/ogc/ogcFeatureUtils.js";import{executeQueryPBFBuffer as u,getQueryParameters as c,executeQuery as m}from"../../../../../../../rest/query/operations/query.js";import{FeatureSetReaderJSON as l}from"../../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderPBF as p}from"../../../support/FeatureSetReaderPBF.js";class f{constructor(e,t){this.service=e,this._metadata=t}destroy(){}}function y(e,t,r){switch(e.type){case"memory":return new h(e,t,r);case"ogc":return new q(e,t);case"feature-service":return e.queryMetadata.supportsFormatPBF&&has("featurelayer-pbf")?new w(e,t):new _(e,t)}}async function d(e){const t=new r;return await t.open(e,{}),t}class h extends f{constructor(e,t,r){super(e,t),this._ports=[],this._loaded=this._load(r)}destroy(){this._loaded.finally(()=>{this._client.close(),this._client=null;for(const e of this._ports)e.close()}).catch(()=>{})}async _load(e){this._ports=await e.layerView.openMemoryPorts(),this._client=await d(this._ports)}async executeQuery(e,t){await this._loaded;const r=await this._client.invoke("queryFeatures",e.toJSON(),t);let a=this._metadata;return s(e.outSpatialReference,r.spatialReference)&&(a=a.weakCloneWithResolvedSpatialReference()),l.fromFeatureSet(r,a)}}class w extends f{async executeQuery(r,a){const s=await u(this.service.source,r,a),o=!r.quantizationParameters;try{return p.fromBuffer(s,this._metadata,o)}catch(i){const s=await c(this.service.source,r,"pbf",a??{}),{data:{url:o}}=await e(s.url,{responseType:"native-request-init",...s.options});throw new t("featurelayer:query","Failed to parse response",{url:o,error:i,query:r.toJSON()})}}}class _ extends f{async executeQuery(e,t){const{source:r,queryMetadata:s}=this.service,n=null;if(null!=e.quantizationParameters&&!s.supportsQuantization){const s=e.clone(),u=a(s.quantizationParameters);s.quantizationParameters=null;const c=await m(r,s,n,t),p=o(c,this._metadata.featureIdInfo);return i(u,p),l.fromOptimizedFeatureSet(p,this._metadata)}const u=await m(r,e,n,t);return"esriGeometryPoint"===this._metadata.geometryType&&(u.features=u.features?.filter(e=>{if(null!=e.geometry){const t=e.geometry;return Number.isFinite(t.x)&&Number.isFinite(t.y)}return!0})),l.fromFeatureSet(u,this._metadata)}}class q extends f{async executeQuery(e,t){if(e.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const r=e.clone(),s=a(r.quantizationParameters);r.quantizationParameters=null;const o=await n(this.service.source,e,t);return i(s,o),l.fromOptimizedFeatureSet(o,this._metadata)}const r=await n(this.service.source,e,t);return l.fromOptimizedFeatureSet(r,this._metadata)}}export{f as SourceAdapter,y as createQueryAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../geometry/SpatialReference.js";import t from"../../../../../layers/support/FieldsIndex.js";class i{static minimal(e,n,s=[],l=!1,
|
|
2
|
+
import e from"../../../../../geometry/SpatialReference.js";import t from"../../../../../layers/support/FieldsIndex.js";class i{static minimal(e,n,s=[],l=!1,a=!1){return new i({geometryType:e,hasZ:l,hasM:a,fieldsIndex:new t(s).toJSON(),featureIdInfo:{type:"object-id",fieldName:n},subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,outSpatialReference:null,attributeSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,layerType:void 0})}static createFeature(e){return new i(e)}constructor(i){let n;this._options=i,this._fieldsIndex=t.fromJSON(i.fieldsIndex),i.spatialReference&&(i.spatialReference instanceof e?this._spatialReference=i.spatialReference:this._spatialReference=e.fromJSON(i.spatialReference)),i.outSpatialReference&&(i.outSpatialReference instanceof e?this._outSpatialReference=i.outSpatialReference:this._outSpatialReference=e.fromJSON(i.outSpatialReference)),i.attributeSpatialReference&&(i.attributeSpatialReference instanceof e?this._attributeSpatialReference=i.attributeSpatialReference:this._attributeSpatialReference=e.fromJSON(i.attributeSpatialReference)),"object-id"===i.featureIdInfo.type&&(n=i.featureIdInfo.fieldName),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:n,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0,datesInUnknownTimezone:this._options.timeReferenceUnknownClient??void 0,dateFieldsTimeZone:this._options.dateFieldsTimeZone??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return"esriGeometryMultiPatch"===this._options.geometryType?"esriGeometryPolygon":this._options.geometryType}get hasZ(){return this._options.hasZ}get hasM(){return this._options.hasM}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get featureIdInfo(){return this._options.featureIdInfo}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get outSpatialReference(){return this._outSpatialReference}get attributeSpatialReference(){return this._attributeSpatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}get layerType(){return this._options.layerType}weakCloneWithAdditionalFields(e){return new i({fieldsIndex:{fields:[...this._fieldsIndex.fields,...e],timeZoneByFieldName:null},geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM,globalIdField:this.globalIdField,featureIdInfo:this.featureIdInfo,spatialReference:this.spatialReference,attributeSpatialReference:this.attributeSpatialReference,outSpatialReference:this.outSpatialReference,subtypeField:this.subtypeField,subtypes:this._options.subtypes,timeInfo:this.timeInfo,timeReferenceUnknownClient:this.timeReferenceUnknownClient,dateFieldsTimeZone:this._options.dateFieldsTimeZone,typeIdField:this._options.typeIdField,types:this._options.types,layerType:this._options.layerType})}weakCloneWithResolvedSpatialReference(){return new i({fieldsIndex:{fields:this._fieldsIndex.fields,timeZoneByFieldName:null},geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM,globalIdField:this.globalIdField,featureIdInfo:this.featureIdInfo,spatialReference:this.outSpatialReference,outSpatialReference:this.outSpatialReference,attributeSpatialReference:this.attributeSpatialReference,subtypeField:this.subtypeField,subtypes:this._options.subtypes,timeInfo:this.timeInfo,timeReferenceUnknownClient:this.timeReferenceUnknownClient,dateFieldsTimeZone:this._options.dateFieldsTimeZone,typeIdField:this._options.typeIdField,types:this._options.types,layerType:this._options.layerType})}}class n extends i{static createGraphics(e){return new n({fieldsIndex:(new t).toJSON(),featureIdInfo:{type:"object-id",fieldName:"uid"},geometryType:null,hasZ:!1,hasM:!1,spatialReference:e,outSpatialReference:e,attributeSpatialReference:null,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,layerType:null})}}export{i as FeatureMetadata,n as GraphicsMetadata};
|