@arcgis/core 4.29.1 → 4.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/7427d03e693f32a81377.js +1 -0
- package/assets/esri/core/workers/chunks/8a9387483b19a5ec5b86.js +1 -0
- package/geohash/geohashUtils.js +1 -1
- package/interfaces.d.ts +14 -8
- package/kernel.js +1 -1
- package/layers/graphics/data/StreamFeatureManager.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createTestMeshData.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/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/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/SubtypeProcessorSchema.js +1 -1
- package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/Tile.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/58723274ef657fe212eb.js +0 -1
- package/assets/esri/core/workers/chunks/8c360923cd1850767d3e.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{ignoreAbortErrors as e,throwIfNotAbortError as s,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{diff as i,hasDiff as a}from"../../../../core/accessorSupport/diffUtils.js";import o from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as n}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as c}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as h}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{BinningStrategy as u}from"./processor/BinningStrategy.js";import{ClusterStrategy as g}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as d}from"./processor/FeatureUpdateStrategy.js";import{AttributeStore as y}from"./support/AttributeStore.js";import{ComputedAttributeStorage as _}from"./support/ComputedAttributeStorage.js";import{QueueProcessor as p}from"../../../support/QueueProcessor.js";class l{constructor(t,s){this._connection=t,this._source=s,this._version=1,this._queue=new p({concurrency:1,process:t=>this._process(t)}),this._proxy=new h({fetch:(t,e)=>this._connection.layerView.fetch(t,e),fetchDictionary:(t,e)=>this._connection.layerView.fetchDictionary(t,e)}),this._attributeStore=new y({isLocal:!1,update:t=>e(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destory(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(t){return this._strategy?this._strategy.getDisplayFeatures(t):{features:[],aggregates:[]}}getFeatureObjectIdsForAggregate(t){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(t):[]}onSubscribe(t){this._strategy?.onSubscribe(t)}onUnsubscribe(t){this._strategy?.onUnsubscribe(t)}async update(t,e,s,r,n){const h=t.processor,u=i(this._schema,h);if(!u&&!r)return;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:u,schema:h}),this._schema=h;const g=o.fromJSON(t.source.mutable.dataFilter.outSpatialReference),d=new _({fields:this._source.metadata.fieldsIndex,spatialReference:g});return await this._attributeStore.update(h.storage,d,this._source.metadata,g,e),this._strategy?.invalidateAttributeData(),r||a(u,"mesh")?(a(u,"mesh.strategy")&&await this._updateStrategy(h.mesh.strategy,g,n),this._updateSortKey(d,"sortKey"in h.mesh?h.mesh.sortKey:null),(a(u,"mesh.factory")||"dictionary"===h.mesh.factory.symbology.type)&&(this._factory=await c.create(d,this._proxy,h.mesh.factory,s)),this._invalidate(),this._version=e,this._connection.container.updateRenderState(this._version)):void 0}async applyOverride(t){if(!this._strategy)return;const e=this._strategy.applyOverride(t);for await(const r of e)try{await this._process(r)}catch(s){}this._source.applyOverride(t)}async updateChunks(){return this._doUpdateChunks()}async removeChunks(t){this._strategy?.removeChunks(t),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:t}){if(!this._strategy)return void this._attributeStore.setHighlight(t.map((({objectId:t,highlightFlags:e})=>({objectId:t,highlightFlags:e,displayId:-1}))),t);const e=this._strategy.displayMap(t,(({objectId:t})=>t),((t,{highlightFlags:e},s)=>({objectId:s,displayId:t,highlightFlags:e})));this._attributeStore.setHighlight(e,t)}async _doUpdateChunks(){if(!this._strategy)return;const t=this._strategy.updateChunks(),e=[];for await(const i of t){const t=this._queue.push(i).catch((t=>s(t)));e.push(t)}try{await Promise.all(e)}catch(r){}has("esri-2d-update-debug")&&console.log("SendUpdates"),await this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(t,e,s){switch(this._strategy?.destroy(),t.type){case"feature":this._strategy=new d(this._source,this._attributeStore);break;case"binning":this._strategy=await u.create(t,e,this._source,this._attributeStore);break;case"cluster":this._strategy=await g.create(this._connection,t,e,this._source,this._attributeStore)}for(const
|
|
5
|
+
import has from"../../../../core/has.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{ignoreAbortErrors as e,throwIfNotAbortError as s,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{diff as i,hasDiff as a}from"../../../../core/accessorSupport/diffUtils.js";import o from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as n}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as c}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as h}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{BinningStrategy as u}from"./processor/BinningStrategy.js";import{ClusterStrategy as g}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as d}from"./processor/FeatureUpdateStrategy.js";import{AttributeStore as y}from"./support/AttributeStore.js";import{ComputedAttributeStorage as _}from"./support/ComputedAttributeStorage.js";import{QueueProcessor as p}from"../../../support/QueueProcessor.js";class l{constructor(t,s){this._connection=t,this._source=s,this._version=1,this._queue=new p({concurrency:1,process:t=>this._process(t)}),this._proxy=new h({fetch:(t,e)=>this._connection.layerView.fetch(t,e),fetchDictionary:(t,e)=>this._connection.layerView.fetchDictionary(t,e)}),this._attributeStore=new y({isLocal:!1,update:t=>e(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destory(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(t){return this._strategy?this._strategy.getDisplayFeatures(t):{features:[],aggregates:[]}}getFeatureObjectIdsForAggregate(t){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(t):[]}onSubscribe(t){this._strategy?.onSubscribe(t)}onUnsubscribe(t){this._strategy?.onUnsubscribe(t)}async update(t,e,s,r,n){const h=t.processor,u=i(this._schema,h);if(!u&&!r)return;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:u,schema:h}),this._schema=h;const g=o.fromJSON(t.source.mutable.dataFilter.outSpatialReference),d=new _({fields:this._source.metadata.fieldsIndex,spatialReference:g});return await this._attributeStore.update(h.storage,d,this._source.metadata,g,e),this._strategy?.invalidateAttributeData(),r||a(u,"mesh")?(a(u,"mesh.strategy")&&await this._updateStrategy(h.mesh.strategy,g,n,h.mesh.timeZone),this._updateSortKey(d,"sortKey"in h.mesh?h.mesh.sortKey:null),(a(u,"mesh.factory")||"dictionary"===h.mesh.factory.symbology.type)&&(this._factory=await c.create(d,this._proxy,h.mesh.factory,s)),this._invalidate(),this._version=e,this._connection.container.updateRenderState(this._version)):void 0}async applyOverride(t){if(!this._strategy)return;const e=this._strategy.applyOverride(t);for await(const r of e)try{await this._process(r)}catch(s){}this._source.applyOverride(t)}async updateChunks(){return this._doUpdateChunks()}async removeChunks(t){this._strategy?.removeChunks(t),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:t}){if(!this._strategy)return void this._attributeStore.setHighlight(t.map((({objectId:t,highlightFlags:e})=>({objectId:t,highlightFlags:e,displayId:-1}))),t);const e=this._strategy.displayMap(t,(({objectId:t})=>t),((t,{highlightFlags:e},s)=>({objectId:s,displayId:t,highlightFlags:e})));this._attributeStore.setHighlight(e,t)}async _doUpdateChunks(){if(!this._strategy)return;const t=this._strategy.updateChunks(),e=[];for await(const i of t){const t=this._queue.push(i).catch((t=>s(t)));e.push(t)}try{await Promise.all(e)}catch(r){}has("esri-2d-update-debug")&&console.log("SendUpdates"),await this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(t,e,s,r){switch(this._strategy?.destroy(),t.type){case"feature":this._strategy=new d(this._source,this._attributeStore,r);break;case"binning":this._strategy=await u.create(t,e,this._source,this._attributeStore,r);break;case"cluster":this._strategy=await g.create(this._connection,t,e,this._source,this._attributeStore,r)}for(const i of s)this._strategy.onSubscribe(i)}async _updateSortKey(e,s){if(this._sortInfo=t(this._sortInfo?.computed),null!=s){const t=s.byRenderer?null:await e.createComputedField(s);this._sortInfo={...s,computed:t}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(t){const e=t.subscription;if(has("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process`)}await this._fetchResources(t),r(e.signal);const s=await this._write(t,e.tile.createArcadeEvaluationOptions(this._schema.mesh.timeZone)),i=e.tile.tileInfoView.tileInfo.isWrappable,{message:a,transferList:o}=s.serialize(i),n=t.createMessage(a,this._version,this._attributeStore.epoch);if(r(e.signal),await this._connection.container.onMessage(n,{signal:e.signal,transferList:o}),await this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process.await`)}}async _fetchResources(t){await this._fetchMatcherResources(t),await this._fetchWriterResources(t)}async _fetchMatcherResources(t){if(t.reader)return this._factory.enqueueMatcherRequests(this._proxy,t.reader)}async _fetchWriterResources(t){if(!t.reader)return;const e=t.reader.getCursor(),s=t.subscription.tile.createArcadeEvaluationOptions(this._schema.mesh.timeZone);for(;e.next();)this._factory.enqueueWriterRequests(this._proxy,e,s);await this._proxy.fetchEnqueuedResources()}async _write(t,e){const s=t.subscription.tile,r=t.reader?.getCursor(),i=r?.getSize()??0,a=new n(s.key.id,this._strategy.enablePixelBuffering,i);if(!r)return a;const o=s.createArcadeEvaluationOptions(this._schema.mesh.timeZone);for(;r.next();){const t=this._getSortKeyValue(r,e);a.entityStart(r.getDisplayId(),t),this._factory.write(a,this._proxy,r,o,s.level),a.entityEnd()}return a}_getSortKeyValue(t,e){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(t,e):s?.read(t,e);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}export{l as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as t}from"../../../../../layers/support/layerUtils.js";import{getEffectiveGeometryType as i}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as s,createLabelVVEvaluator as o}from"./labelingUtils.js";import{createFeatureSourceSchema as
|
|
5
|
+
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as t}from"../../../../../layers/support/layerUtils.js";import{getEffectiveGeometryType as i}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as s,createLabelVVEvaluator as o}from"./labelingUtils.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=s(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(s){const o=this.layer,a=o.parent,l=t(a),{capabilities:n,editingInfo:d,objectIdField:p,globalIdField:c,datesInUnknownTimezone:m,orderBy:y,subtypeField:f,parsedUrl:u}=a,b=a.fieldsIndex.toJSON(),g=i(o),h=a.timeInfo?.toJSON(),I=o.spatialReference.toJSON(),S=e(u);let j=p;if(y?.length){const e=!y[0].valueExpression&&y[0].field;e&&(j=e)}return{type:"feature-service",source:S,isSourceHosted:r(S.path),orderByFields:j,metadata:{timeReferenceUnknownClient:m,subtypeField:f,globalIdField:c,fieldsIndex:b,geometryType:g,objectIdField:p,timeInfo:h,spatialReference:I,subtypes:null,typeIdField:null,types:null},queryMetadata:{capabilities:n,effectiveCapabilities:l,lastEditDate:d?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,r,t){const{definitionExpression:i,customParameters:s,timeExtent:o,apiKey:l}=this.layer.parent;return a(e,{definitionExpression:i,customParameters:s,timeExtent:o},r,t,l)}createProcessorSchema(e,r,t){const{parent:{fields:i,geometryType:s,orderBy:o,objectIdField:a},renderer:n,labelingInfo:d,labelsVisible:p}=this.layer,c={featureReduction:null,fields:i.map((e=>e.toJSON())),geometryType:s,labelingInfo:d,labelsVisible:p,objectIdField:a,orderBy:o??"default",renderer:n?.clone()};return l(e,r,c,t)}get hasRequiredSupport(){return n(this.layer.renderer)}getUpdateHashProperties(e){const r=this.layer,{parent:t,parent:{definitionExpression:i,apiKey:s},renderer:o}=r,a=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:s,customParameters:JSON.stringify(t.customParameters),definitionExpression:i,labelingInfo:a,orderBy:JSON.stringify(t.orderBy),renderer:o}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}}export{d as CatalogFootprintLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as s}from"./featureReductionUtils.js";import{exceedsMinimumSnapshotCoverage as i}from"./featureServiceUtils.js";import{hasFloorFilter as o,addFloorFilter as a}from"./floorFilterUtils.js";import{getEffectiveGeometryType as l}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as d,createLabelVVEvaluator as p}from"./labelingUtils.js";import{createFeatureSourceSchema as
|
|
5
|
+
import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as s}from"./featureReductionUtils.js";import{exceedsMinimumSnapshotCoverage as i}from"./featureServiceUtils.js";import{hasFloorFilter as o,addFloorFilter as a}from"./floorFilterUtils.js";import{getEffectiveGeometryType as l}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as d,createLabelVVEvaluator as p}from"./labelingUtils.js";import{createFeatureSourceSchema as y}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as m}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=n(t,e)??d(t);return[{vvEvaluators:{0:p(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(s){const o=this.layer,a=r(o),{capabilities:n,editingInfo:d,objectIdField:p,typeIdField:y,globalIdField:m,datesInUnknownTimezone:c,orderBy:u,subtypeField:f,refreshInterval:h}=o,b=o.fieldsIndex.toJSON(),g=b.fields,S=l(o),I=o.timeInfo?.toJSON(),j=o.spatialReference.toJSON(),F=o.types?.map((e=>e.toJSON())),x=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(x.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let E=this.layer.objectIdField;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(E=e)}const U=!(null!=d?.lastEditDate)&&h>0,v=has("featurelayer-snapshot-enabled")&&"point"===o.geometryType&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!U,O=v&&i(s,o.fullExtent);return{type:"feature-service",source:x,isSourceHosted:t(x.path),orderByFields:E,metadata:{typeIdField:y??void 0,types:F,timeReferenceUnknownClient:c,subtypeField:f,globalIdField:m,fields:g,fieldsIndex:b,geometryType:S,objectIdField:p,timeInfo:I,spatialReference:j,subtypes:this.layer.subtypes?.map((e=>e.toJSON()))},queryMetadata:{capabilities:n,effectiveCapabilities:a,lastEditDate:d?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:v,supportsSnapshotMaxThreshold:O,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:s,customParameters:i,gdbVersion:o,historicMoment:a,subtypeCode:l,subtypeField:n,timeExtent:d,apiKey:p}=this.layer;return y(e,{definitionExpression:s,customParameters:i,gdbVersion:o,historicMoment:a,subtypeCode:l,subtypeField:n,timeExtent:d},t,r,p)}createProcessorSchema(e,t,r){const{fields:i,renderer:o,geometryType:a,labelingInfo:l,labelsVisible:n,orderBy:d,objectIdField:p}=this.layer,y={fields:i.map((e=>e.toJSON())),renderer:o?.clone(),featureReduction:s(this.layer,t),geometryType:a,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:d??"default"};return m(e,t,y,r)}get hasRequiredSupport(){return c(this.layer.renderer)}hasFilters(e){return o(this.layer,e)}addFilters(e,t){return a(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:i,gdbVersion:a,apiKey:l,subtypeCode:n}=t,d=this.layer.labelsVisible?this.layer.labelingInfo:null,p=t.historicMoment?.getTime()??void 0,y=JSON.stringify(t.customParameters),m=s(t,e)?.toJSON(),c=JSON.stringify(t.orderBy);return{apiKey:l,customParameters:y,definitionExpression:r,featureReduction:m,floors:o(this.layer,e)?e.floors:null,gdbVersion:a,historicMoment:p,labelingInfo:d,orderBy:c,renderer:i,subtypeCode:n}}}export{u as FeatureLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../core/Error.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getEffectiveGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as
|
|
5
|
+
import e from"../../../../../core/Error.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getEffectiveGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as s,createLabelVVEvaluator as l}from"./labelingUtils.js";import{createFeatureSourceSchema as n}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as a}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";function d(r){if(!("openPorts"in r))throw new e("source-not-supported")}class p{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=o(r,e)??s(r);return[{vvEvaluators:{0:l(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(e){const t=this.layer,o=r(t),{capabilities:s,objectIdField:l}=t,n=t.fieldsIndex.toJSON(),a=i(t),c=t.timeInfo?.toJSON(),p=t.spatialReference.toJSON();d(t.source);return{type:"memory",source:await t.source.openPorts(),orderByFields:l,metadata:{fieldsIndex:n,geometryType:a,objectIdField:l,timeInfo:c,spatialReference:p,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:null},queryMetadata:{capabilities:s,effectiveCapabilities:o,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,r,t){const{definitionExpression:i,timeExtent:o}=this.layer;return n(e,{definitionExpression:i,timeExtent:o,customParameters:null},r,t,null)}createProcessorSchema(e,r,i){const{fields:o,renderer:s,geometryType:l,labelingInfo:n,labelsVisible:c,orderBy:d,objectIdField:p}=this.layer,u={fields:o.map((e=>e.toJSON())),renderer:s?.clone(),featureReduction:t(this.layer,r),geometryType:l,labelingInfo:n,labelsVisible:c,objectIdField:p,orderBy:d??"default"};return a(e,r,u,i)}get hasRequiredSupport(){return c(this.layer.renderer)}getUpdateHashProperties(e){const r=this.layer,{definitionExpression:i,renderer:o}=r,s=this.layer.labelsVisible?this.layer.labelingInfo:null,l=t(r,e)?.toJSON();return{orderBy:JSON.stringify(r.orderBy),definitionExpression:i,renderer:o,labelingInfo:s,featureReduction:l}}}export{p as InMemoryLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getEffectiveLayerCapabilities as e}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getEffectiveGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as
|
|
5
|
+
import{getEffectiveLayerCapabilities as e}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getEffectiveGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as a}from"../support/rendererUtils.js";class c{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??l(r);return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(r){const i=this.layer,l=e(i),{capabilities:s,objectIdField:o}=i,n=i.fieldsIndex.toJSON(),a=t(i),c=i.spatialReference.toJSON();return{type:"memory",source:await i.source.openPorts(),orderByFields:o,metadata:{fieldsIndex:n,geometryType:a,objectIdField:o,spatialReference:c,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{capabilities:s,effectiveCapabilities:l,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,r,t){const{definitionExpression:i}=this.layer;return o(e,{definitionExpression:i,customParameters:null},r,t,null)}createProcessorSchema(e,t,i){const{fields:l,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:c,objectIdField:d}=this.layer,p={fields:l.map((e=>e.toJSON())),renderer:s?.clone(),featureReduction:r(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:c,objectIdField:d,orderBy:"default"};return n(e,t,p,i)}get hasRequiredSupport(){return a(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:l}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null,o=r(t,e)?.toJSON();return{definitionExpression:i,renderer:l,labelingInfo:s,featureReduction:o}}}export{c as KnowledgeGraphSublayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as e}from"../../../../../core/lang.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getEffectiveGeometryType as o}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??l(r);return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(t){const i=this.layer,l=r(i),{capabilities:s,objectIdField:a}=i,n=i.fieldsIndex.toJSON(),c=o(i),d=i.timeInfo?.toJSON(),m=i.spatialReference.toJSON(),u=i.source.getSource(),p=this.layer.objectIdField,y=e(s);return y.query.maxRecordCount=u.maxRecordCount,{type:"ogc",source:u,orderByFields:p,metadata:{fieldsIndex:n,geometryType:c,objectIdField:a,timeInfo:d,spatialReference:m,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null
|
|
5
|
+
import{clone as e}from"../../../../../core/lang.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getEffectiveGeometryType as o}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??l(r);return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(t){const i=this.layer,l=r(i),{capabilities:s,objectIdField:a}=i,n=i.fieldsIndex.toJSON(),c=o(i),d=i.timeInfo?.toJSON(),m=i.spatialReference.toJSON(),u=i.source.getSource(),p=this.layer.objectIdField,y=e(s);return y.query.maxRecordCount=u.maxRecordCount,{type:"ogc",source:u,orderByFields:p,metadata:{fieldsIndex:n,geometryType:c,objectIdField:a,timeInfo:d,spatialReference:m,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{capabilities:y,effectiveCapabilities:l,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,r,t){const{customParameters:o,timeExtent:i,apiKey:l}=this.layer;return a(e,{customParameters:o,timeExtent:i},r,t,l)}createProcessorSchema(e,r,o){const{fields:i,renderer:l,geometryType:s,labelingInfo:a,labelsVisible:c,orderBy:d,objectIdField:m}=this.layer,u={fields:i.map((e=>e.toJSON())),renderer:l?.clone(),featureReduction:t(this.layer,r),geometryType:s,labelingInfo:a,labelsVisible:c,objectIdField:m,orderBy:d??"default"};return n(e,r,u,o)}get hasRequiredSupport(){return c(this.layer.renderer)}getUpdateHashProperties(e){const r=this.layer,{renderer:o,apiKey:i}=r,l=this.layer.labelsVisible?this.layer.labelingInfo:null,s=JSON.stringify(r.customParameters),a=t(r,e)?.toJSON();return{apiKey:i,customParameters:s,featureReduction:a,labelingInfo:l,orderBy:JSON.stringify(r.orderBy),renderer:o}}}export{d as OGCFeatureLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as t}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as s}from"./featureReductionUtils.js";import{exceedsMinimumSnapshotCoverage as o}from"./featureServiceUtils.js";import{hasFloorFilter as i,addFloorFilter as l}from"./floorFilterUtils.js";import{getEffectiveGeometryType as a}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as p,createLabelVVEvaluator as d}from"./labelingUtils.js";import{createFeatureSourceSchema as
|
|
5
|
+
import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as t}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as s}from"./featureReductionUtils.js";import{exceedsMinimumSnapshotCoverage as o}from"./featureServiceUtils.js";import{hasFloorFilter as i,addFloorFilter as l}from"./floorFilterUtils.js";import{getEffectiveGeometryType as a}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as p,createLabelVVEvaluator as d}from"./labelingUtils.js";import{createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as f}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as m}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=n(r,e)??p(r);return[{vvEvaluators:{0:d(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(s){const i=this.layer,l=t(i),{capabilities:n,objectIdField:p,globalIdField:d,orderBy:c,refreshInterval:f}=i,m=i.fieldsIndex.toJSON(),u=m.fields,y=a(i),h=i.timeInfo?.toJSON(),b=i.spatialReference.toJSON(),g=e(this.layer.parsedUrl);let S=this.layer.objectIdField;if(c?.length){const e=!c[0].valueExpression&&c[0].field;e&&(S=e)}const I=f>0,j=has("featurelayer-snapshot-enabled")&&"point"===i.geometryType&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!I,x=j&&o(s,i.fullExtent);return{type:"feature-service",source:g,isSourceHosted:r(g.path),orderByFields:S,metadata:{globalIdField:d,fields:u,fieldsIndex:m,geometryType:y,objectIdField:p,timeInfo:h,spatialReference:b,timeReferenceUnknownClient:!1,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{capabilities:n,effectiveCapabilities:l,lastEditDate:null,snapshotInfo:{supportsSnapshotMinThreshold:j,supportsSnapshotMaxThreshold:x,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,r,t){const{definitionExpression:s,customParameters:o,timeExtent:i}=this.layer;return c(e,{definitionExpression:s,customParameters:o,timeExtent:i},r,t,null)}createProcessorSchema(e,r,t){const{fields:o,renderer:i,geometryType:l,labelingInfo:a,labelsVisible:n,orderBy:p,objectIdField:d}=this.layer,c={fields:o.map((e=>e.toJSON())),renderer:i?.clone(),featureReduction:s(this.layer,r),geometryType:l,labelingInfo:a,labelsVisible:n,objectIdField:d,orderBy:p??"default"};return f(e,r,c,t)}get hasRequiredSupport(){return m(this.layer.renderer)}hasFilters(e){return i(this.layer,e)}addFilters(e,r){return l(this.layer,e,r)}getUpdateHashProperties(e){const r=this.layer,{definitionExpression:t,renderer:o}=r,l=this.layer.labelsVisible?this.layer.labelingInfo:null,a=JSON.stringify(r.customParameters),n=s(r,e)?.toJSON();return{orderBy:JSON.stringify(r.orderBy),definitionExpression:t,renderer:o,labelingInfo:l,featureReduction:n,customParameters:a,floors:i(this.layer,e)?e.floors:null}}}export{u as OrientedImageryLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getEffectiveGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as r,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as n}from"./labelingUtils.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class s{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,o=r(t,e)??i(t);return[{vvEvaluators:{0:n(t.renderer)},deconflictionEnabled:o}]}async createServiceOptions(e){const r=this.layer,{objectIdField:i}=r,n=t(r),o=r.timeInfo?.toJSON()||null,l=r.spatialReference?r.spatialReference.toJSON():null;return{source:this.layer.parsedUrl,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:n,objectIdField:i,timeInfo:o,timeReferenceUnknownClient:null,spatialReference:l,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null
|
|
5
|
+
import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getEffectiveGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as r,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as n}from"./labelingUtils.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class s{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,o=r(t,e)??i(t);return[{vvEvaluators:{0:n(t.renderer)},deconflictionEnabled:o}]}async createServiceOptions(e){const r=this.layer,{objectIdField:i}=r,n=t(r),o=r.timeInfo?.toJSON()||null,l=r.spatialReference?r.spatialReference.toJSON():null;return{source:this.layer.parsedUrl,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:n,objectIdField:i,timeInfo:o,timeReferenceUnknownClient:null,spatialReference:l,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(e,t,r){const{definitionExpression:i,geometryDefinition:n,customParameters:o}=this.layer;return{type:"stream",service:e,tileInfoJSON:t.tileInfoJSON,mutable:{sourceRefreshVersion:r,availableFields:t.availableFields,dataFilter:{geometryDefinition:n?.toJSON(),definitionExpression:i,outSpatialReference:t.outSpatialReference.toJSON(),customParameters:o??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(t,r,i){const{fields:n,renderer:l,geometryType:s,labelingInfo:a,labelsVisible:c,objectIdField:d}=this.layer,m={fields:n.map((e=>e.toJSON())),renderer:l?.clone(),featureReduction:e(this.layer,r),geometryType:s,labelingInfo:a,labelsVisible:c,objectIdField:d,orderBy:"default"};return o(t,r,m,i)}get hasRequiredSupport(){return l(this.layer.renderer)}getUpdateHashProperties(t){const r=this.layer,{definitionExpression:i,renderer:n}=r,o=this.layer.labelsVisible?this.layer.labelingInfo:null,l=JSON.stringify(r.customParameters),s=e(r,t)?.toJSON();return{definitionExpression:i,renderer:n,labelingInfo:o,featureReduction:s,customParameters:l,streamFilter:`${JSON.stringify(r.geometryDefinition)}${r.definitionExpression}`}}}export{s as StreamLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveLayerCapabilities as a}from"../../../../../layers/support/layerUtils.js";import{exceedsMinimumSnapshotCoverage as o}from"./featureServiceUtils.js";import{hasFloorFilter as l,addFloorFilter as n}from"./floorFilterUtils.js";import{getEffectiveGeometryType as p}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as y}from"./labelingUtils.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as m}from"../schema/processor/SubtypeProcessorSchema.js";class c{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every((e=>y(e)))}]}async createServiceOptions(t){const r=this.layer,i=a(r),{capabilities:l,datesInUnknownTimezone:n,editingInfo:y,globalIdField:u,objectIdField:m,refreshInterval:c,subtypeField:d}=r,h=r.fieldsIndex.toJSON(),b=p(r),f=r.timeInfo?.toJSON(),g=r.spatialReference.toJSON(),S=e(this.layer.parsedUrl),F=m,I=!(null!=y?.lastEditDate)&&c>0,j=has("featurelayer-snapshot-enabled")&&"point"===r.geometryType&&l?.query.supportsPagination&&!l?.operations.supportsEditing&&!I,x=j&&o(t,r.fullExtent);return{type:"feature-service",source:S,isSourceHosted:s(S.path),orderByFields:F,metadata:{timeReferenceUnknownClient:n,subtypeField:d,globalIdField:u,fieldsIndex:h,geometryType:b,objectIdField:m,timeInfo:f,
|
|
5
|
+
import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveLayerCapabilities as a}from"../../../../../layers/support/layerUtils.js";import{exceedsMinimumSnapshotCoverage as o}from"./featureServiceUtils.js";import{hasFloorFilter as l,addFloorFilter as n}from"./floorFilterUtils.js";import{getEffectiveGeometryType as p}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as y}from"./labelingUtils.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as m}from"../schema/processor/SubtypeProcessorSchema.js";class c{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every((e=>y(e)))}]}async createServiceOptions(t){const r=this.layer,i=a(r),{capabilities:l,datesInUnknownTimezone:n,editingInfo:y,globalIdField:u,objectIdField:m,refreshInterval:c,subtypeField:d}=r,h=r.fieldsIndex.toJSON(),b=p(r),f=r.timeInfo?.toJSON(),g=r.spatialReference.toJSON(),S=e(this.layer.parsedUrl),F=m,I=!(null!=y?.lastEditDate)&&c>0,j=has("featurelayer-snapshot-enabled")&&"point"===r.geometryType&&l?.query.supportsPagination&&!l?.operations.supportsEditing&&!I,x=j&&o(t,r.fullExtent);return{type:"feature-service",source:S,isSourceHosted:s(S.path),orderByFields:F,metadata:{timeReferenceUnknownClient:n,subtypeField:d,globalIdField:u,fieldsIndex:h,geometryType:b,objectIdField:m,timeInfo:f,spatialReference:g,subtypes:this.layer.subtypes?.map((e=>e.toJSON())),typeIdField:null,types:null},queryMetadata:{capabilities:l,effectiveCapabilities:i,lastEditDate:y?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:j,supportsSnapshotMaxThreshold:x,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,s){const{definitionExpression:i,customParameters:a,gdbVersion:o,historicMoment:l,subtypeField:n,timeExtent:p,apiKey:y}=this.layer,m=this.layer.sublayers.map((e=>e.subtypeCode)).join(","),c=this.layer.sublayers.length?`${this.layer.subtypeField} IN (${m})`:"1=2",d={definitionExpression:r(i,c),customParameters:a,gdbVersion:o,historicMoment:l,subtypeField:n,timeExtent:p};return u(e,d,t,s,y)}createProcessorSchema(e,t,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null})))};return m(e,t,s,r)}hasFilters(e){return l(this.layer,e)||d(this.layer,e)}addFilters(e,t){e=n(this.layer,e,t);const s=this.layer.sublayers.filter((e=>!h(e,t))).map((e=>e.subtypeCode));if(!s.length)return e;e??=new i;const a=`NOT ${this.layer.subtypeField} IN (${s.join(",")})`;return e.where=r(e.where,a),e}get hasRequiredSupport(){return!0}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,gdbVersion:s,apiKey:i}=t,a=t.historicMoment?.getTime()??void 0,o=JSON.stringify(t.customParameters),n=l(this.layer,e)?e.floors:null;return{gdbVersion:s,definitionExpression:r,historicMoment:a,customParameters:o,apiKey:i,sublayerHash:"sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),floors:n}}setGraphicOrigin(e){const t=this.layer.fieldsIndex.get(this.layer.subtypeField),r=e.attributes[t.name],s=this.layer.sublayers.find((e=>e.subtypeCode===r));e.layer=e.sourceLayer=s}}function d(e,t){return e.sublayers.some((e=>!h(e,t)))}function h(e,r){return e.visible&&(0===e.minScale||t(r.scale,e.minScale)||r.scale<e.minScale)&&(0===e.maxScale||t(r.scale,e.maxScale)||r.scale>e.maxScale)}export{c as SubtypeGroupLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getGeohashBounds as e}from"../../../../../geohash/geohashUtils.js";import{unquantizeOptimizedGeometry as t,convertToFeature as s}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as r}from"../../../../../layers/graphics/OptimizedFeature.js";import{ComputedAggregateField as a}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as
|
|
5
|
+
import"../../../../../geometry.js";import{getGeohashBounds as e}from"../../../../../geohash/geohashUtils.js";import{unquantizeOptimizedGeometry as t,convertToFeature as s}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as r}from"../../../../../layers/graphics/OptimizedFeature.js";import{checkProjectionSupport as o}from"../../../../../layers/graphics/data/projectionSupport.js";import{ComputedAggregateField as a}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as i}from"./AAggregateStrategy.js";import{ASendState as n}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as l}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as d}from"../support/ComputedAttributeStorage.js";import c from"../support/FeatureFilter.js";import{FeatureMetadata as u}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as p}from"../support/FeatureSetReaderJSON.js";import f from"../../../tiling/TileKey.js";import h from"../../../../../geometry/SpatialReference.js";class m extends n{constructor(e,t){super(e),this.bins=new Map,this.done=!1,this._store=t}reset(){this.destroy(),this.bins.clear(),this.done=!1,this.handledChunks.clear()}destroy(){const e=this.subscription.tile.key.level;for(const t of this.bins.values()){const s=t.cachedFeature?.objectId;null!=s&&this._store.releaseDisplayIdForObjectId(`${s}.${e}`)}}*featuresWorldSpace(){for(const e of this.bins.values()){const s=e.cachedFeature;if(s){const e=s.clone();t(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}}getGeohashBounds(t,s){const r=this.subscription.tile;return e(r.extent,r.resolution,s,t)}}class g extends i{static async create(e,t,s,r,i){const n=new d({spatialReference:t}),l=e.fixedBinLevel,u=await Promise.all(e.fields.map((async e=>a.create(n,e)))),p=e.featureFilter?await c.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return await o(t,h.WGS84),new g({fields:u,geohashLevel:l,spatialReference:t,featureFilter:p,timeZone:i},e.fields,s,r)}constructor(e,t,s,r){super(s,r,e.spatialReference,e.fields),this._indexOptions=e,this._metadata=new u({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fields:t,globalIdField:null,spatialReference:s.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new m(e,this._attributeStore)}async*applyOverride(e){for(const t of this._sendStates.values())t.reset()}displayMap(e,t,s){const r=new Map(e.map((e=>[t(e),e]))),o=[];for(const a of this._sendStates.values())for(const e of a.featuresWorldSpace()){const{objectId:t,displayId:a}=e,i=r.get(t);if(null!=i){const e=s(a,i,t);o.push(e),r.delete(t)}}return o}getDisplayFeatures(e){const t=new Set(e),r=new Set,o=[];for(const a of this._sendStates.values())for(const e of a.featuresWorldSpace())t.has(e.displayId)&&!r.has(e.objectId)&&(e.geometry&&o.push({...s(e,this._metadata.geometryType,!1,!1),displayId:e.displayId}),r.add(e.objectId));return{features:[],aggregates:o}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.objectIds);return[]}async*updateChunks(){if(this._source.chunks().length)for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){for(const t of this._sendStates.values())for(const s of t.featuresWorldSpace())e(s)}async*_update(e,t){const{handledChunks:s,subscription:o,bins:a}=e,{spatialReference:i,geohashLevel:n}=this._indexOptions,d=o.tile;if(e.done)return;for(const r of t.chunks()){if(s.has(r.chunkId))continue;s.add(r.chunkId);const t=r.queryInfo;if("tileId"in t){const e=new f(t.tileId);if(e.level!==d.level||e.world!==d.key.world)continue}const o=r.getGeohashIndex(this._indexOptions),l=e.getGeohashBounds(i,n);null!=l&&o.putBins(a,l)}const c=[],u=o.tile.transform,h=o.tile.key.level;for(const l of a.values()){if(l.cachedFeature)l.cachedFeature.attributes=l.getAttributes();else{const e=l.getGeometry(this.spatialReference,u),t=new r(e,l.getAttributes(),null);e||(t.centroid=l.getGeometryCentroid(this.spatialReference,u)),t.objectId=l.id,t.displayId=this._attributeStore.createDisplayIdForObjectId(`${t.objectId}.${h}`),l.cachedFeature=t}c.push(l.cachedFeature)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const m=p.fromOptimizedFeatures(c,this._metadata,u),g=m.getCursor(),y=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;g.next();)this._attributeStore.setAttributeData(g.getDisplayId(),g,y);const b=new l(e.subscription,m,[],e.done,{});yield b}}export{m as BinningState,g as BinningStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{convertToFeature as e}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as t}from"../../../../../layers/graphics/OptimizedFeature.js";import{tileSize as s}from"../../../engine/webgl/definitions.js";import{ComputedAggregateField as i}from"../aggregation/ComputedAggregateField.js";import{GridCell as r}from"../aggregation/GridCell.js";import{pixelsPerMapUnit as a}from"../aggregation/GridSpatialIndex.js";import{AAggregateStrategy as n}from"./AAggregateStrategy.js";import{ASendState as l}from"./AProcessorStrategy.js";import{WithDisplayId as o}from"./support/WithDisplayId.js";import{FeatureTileAppendMessage as d}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as c}from"../support/ComputedAttributeStorage.js";import u from"../support/FeatureFilter.js";import{FeatureMetadata as h}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as p}from"../support/FeatureSetReaderJSON.js";import f from"../../../tiling/TileKey.js";const g=128;class
|
|
5
|
+
import{convertToFeature as e}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as t}from"../../../../../layers/graphics/OptimizedFeature.js";import{tileSize as s}from"../../../engine/webgl/definitions.js";import{ComputedAggregateField as i}from"../aggregation/ComputedAggregateField.js";import{GridCell as r}from"../aggregation/GridCell.js";import{pixelsPerMapUnit as a}from"../aggregation/GridSpatialIndex.js";import{AAggregateStrategy as n}from"./AAggregateStrategy.js";import{ASendState as l}from"./AProcessorStrategy.js";import{WithDisplayId as o}from"./support/WithDisplayId.js";import{FeatureTileAppendMessage as d}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as c}from"../support/ComputedAttributeStorage.js";import u from"../support/FeatureFilter.js";import{FeatureMetadata as h}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as p}from"../support/FeatureSetReaderJSON.js";import f from"../../../tiling/TileKey.js";const g=128;class _ extends l{constructor(e){super(e),this.didSend=!1,this.done=!1}}class m{constructor(e,t,s,i,r){this._level=e,this._scale=t,this._indexOptions=s,this._clusterRadius=i,this._store=r,this._cells=new Map,this._handledChunks=new Set,this._statistics=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()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const s=e.inner.getCentroid(null),i=new t(s,e.inner.getAttributes(),null);i.objectId=e.inner.id,i.displayId=e.displayId,yield i}}clusters(){return this._clusters.values()}updateChunks(e){let t=!1;for(const s of e){const e=s.queryInfo;if("tileId"in e){if(new f(e.tileId).level!==this._level)continue}if(!this._handledChunks.has(s.normalizedChunkId)){this._handledChunks.add(s.normalizedChunkId),t=!0;s.getGridIndex({...this._indexOptions,scale:this._scale}).putCells(this._cells)}}return t&&this._clusterCells(),t}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 r=e.subscription,a=[],n=r.tile.transform;for(const l of this._clusters.values()){const e=l.inner.getCentroid(n),i=new t(e,l.inner.getAttributes(),null);i.objectId=l.inner.id,i.displayId=l.displayId;const o=i.geometry.coords,d=r.tile.lod,c=d.wrap?d.worldSize[0]:null;if(null!=c)if(1===c){const e=i.clone();e.geometry.coords[0]-=s,a.push(e);const t=i.clone();t.geometry.coords[0]+=s,a.push(t)}else o[0]>s+s/2?o[0]-=c*s:o[0]<-s/2&&(o[0]+=c*s);const[u,h]=i.geometry.coords;u<s+g&&u>=-g&&h<s+g&&h>=-g&&a.push(i)}return p.fromOptimizedFeatures(a,i,r.tile.transform)}_clusterCells(){let e=Array.from(this._cells.values());e=e.sort(((e,t)=>t.count-e.count));const t=[];for(const i of this._clusters.values())t.push(i.inner.id);this._clusters.clear();const s=new Set;for(const i of e){if(s.has(i.id))continue;const e=this._store.createDisplayIdForObjectId(i.id),t=new o(i.clone(),e);s.add(i.id),this._clusters.set(i.id,t);const n=this._clusterRadius*(1/a(this._indexOptions.spatialReference,this._scale)),l=1+this._clusterRadius/this._indexOptions.cellSize,d=i.centroidXWorld,c=i.centroidYWorld;for(let a=i.gridY-l;a<=i.gridY+l;a++)for(let e=i.gridX-l;e<=i.gridX+l;e++){if(a===i.gridY&&e===i.gridX)continue;const l=this._cells.get(r.createId(e,a));if(!l||s.has(l.id))continue;const o=Math.abs(l.centroidXWorld-d),u=Math.abs(l.centroidYWorld-c);o<n&&u<n&&(t.inner.merge(l),s.add(l.id))}}for(const i of t)this._store.releaseDisplayIdForObjectId(i)}_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)}else e.set(r.name,{minValue:t,maxValue:t}),s=!0}return s}}class y extends n{static async create(e,t,s,r,a,n){const l=new c({spatialReference:s}),o={fields:await Promise.all(t.fields.map((async e=>i.create(l,e)))),spatialReference:s,featureFilter:t.featureFilter?await u.create({geometryType:r.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:r.metadata.timeInfo,fieldsIndex:r.metadata.fieldsIndex,spatialReference:s,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,timeZone:n};return new y(e,t.clusterRadius,o,t.fields,r,a)}constructor(e,t,s,i,r,a){super(r,a,s.spatialReference,s.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=s,this._cellsPerScale=new Map,this._metadata=new h({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fields:[...i,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],globalIdField:null,spatialReference:r.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new _(e)}async*applyOverride(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,s){const i=new Map(e.map((e=>[t(e),e]))),r=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const n of a.clusters()){const e=i.get(n.inner.id);if(null==e){if(1===n.inner.count){const e=i.get(n.inner.firstObjectId);if(null!=e){const t=s(n.displayId,e,n.inner.firstObjectId);r.push(t),i.delete(n.inner.firstObjectId)}}}else{const t=s(n.displayId,e,n.inner.id);r.push(t),i.delete(n.inner.id)}}return r}getDisplayFeatures(t){const s=new Set(t),i=new Set,r=[],a=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);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}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.clusters())if(s.inner.id===e)return Array.from(s.inner.objectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);if(t.updateChunks(e)||!this._source.updateTracking.updating)for(const r of this._sendStates.values())r.subscription.tile.level===this._requiredLevel&&(r.didSend=!1,r.done=!1);const s=Array.from(this._sendStates.values()).filter((e=>e.done)).map((e=>e.subscription.tile.key)),i=new Set(s);for(const r of this._sendStates.values()){if(this._source.updateTracking.updating){if(s.some((e=>e.containsChild(r.subscription.tile.key))))continue;if(r.subscription.tile.key.getChildKeys().every((e=>i.has(e))))continue}r.didSend||r.subscription.tile.level!==this._requiredLevel||(r.didSend=!0,yield*this._update(r,t,this._source))}await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(null==this._requiredLevel||null==this._requiredScale)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.aggregatesWorldSpace())e(s)}_getClusterState(e,t){if(null==e||null==t)throw new Error("InternalError: Level and scale must be defined");let s=this._cellsPerScale.get(t);return s||(s=new m(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,s)),s}async*_update(e,t,s){if(e.done)return;const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!s.updateTracking.updating;const r=i.getCursor(),a=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,a);const n=new d(e.subscription,i,!0,e.done,{});yield n}}export{_ as ClusterState,y as ClusterStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ASendState as t,AProcessorStrategy as e}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as n}from"../sources/strategies/chunks/OverrideChunk.js";class o extends t{}class a extends e{constructor(t,e){super(t,e),this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set}destroy(){super.destroy();for(const t of this._source.chunks())this._cleanupChunkIds(t)}invalidateAttributeData(){this.handledChunksForAttributeData.clear()}onSubscribe(t){super.onSubscribe(t),this._evalOptions=
|
|
5
|
+
import{ASendState as t,AProcessorStrategy as e}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as n}from"../sources/strategies/chunks/OverrideChunk.js";class o extends t{}class a extends e{constructor(t,e,s){super(t,e),this._timeZone=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set}destroy(){super.destroy();for(const t of this._source.chunks())this._cleanupChunkIds(t)}invalidateAttributeData(){this.handledChunksForAttributeData.clear()}onSubscribe(t){super.onSubscribe(t),this._evalOptions=t.tile.createArcadeEvaluationOptions(this._timeZone)}createState(t){return new o(t)}get aggregateQueryEngine(){return null}displayMap(t,e,s){const r=new Map(t.map((t=>[e(t),t]))),n=[];for(const o of this._source.chunks()){const t=o.reader.getCursor();for(;t.next();){const e=t.getObjectId(),o=t.getDisplayId(),a=r.get(e);if(null!=a){const t=s(o,a,e);n.push(t),r.delete(e)}}}return n}getDisplayFeatures(t){const e=new Set(t),s=new Set,r=[];for(const n of this._source.chunks()){const t=n.reader.getCursor();for(;t.next();){const n=t.getObjectId(),o=t.getDisplayId();e.has(o)&&!s.has(n)&&(r.push({...t.readLegacyFeatureWorldSpace(),displayId:o}),s.add(n))}}return{features:r,aggregates:[]}}async*applyOverride(t){const e=[],r=t.reader.getCursor();for(;r.next();){const t=r.getObjectId();e.push(t);const s=this._attributeStore.createDisplayIdForObjectId(t);r.setDisplayId(s),this._attributeStore.setAttributeData(s,r,this._evalOptions)}const o=this.getDisplayIds(e),a=this.getDisplayIds(t.removed),i=new n;i.applyOverrides(t);for(const n of this._sendStates.values())yield new s(n.subscription,null,o,!1,i.queryInfo);for(const n of this._sendStates.values()){const t=i.getTileReader(n.subscription.tile);yield new s(n.subscription,t,a,!1,i.queryInfo)}for(const s of t.removed)this._attributeStore.releaseDisplayIdForObjectId(s)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const t of this._sendStates.values())yield*this._update(t)}}removeChunks(t){for(const e of t)this.handledChunks.delete(e.chunkId),this.handledChunksForAttributeData.delete(e.chunkId),this._cleanupChunkIds(e)}_cleanupChunkIds(t){if(this.handledChunksForIdCreation.has(t.chunkId)){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._attributeStore.releaseDisplayIdForObjectId(t)}this.handledChunksForIdCreation.delete(t.chunkId)}}async _updateAttributeData(){for(const t of this._source.chunks()){const{chunkId:e,reader:s}=t;if(!this.handledChunksForIdCreation.has(e)){this.handledChunksForIdCreation.add(e);const t=s.getCursor();for(;t.next();){const e=this._attributeStore.createDisplayIdForObjectId(t.getObjectId());t.setDisplayId(e)}}}for(const t of this._source.chunks())if(!this.handledChunksForAttributeData.has(t.chunkId)){this.handledChunksForAttributeData.add(t.chunkId);const e=t.reader.getCursor();for(;e.next();){const t=e.getDisplayId();this._attributeStore.setAttributeData(t,e,this._evalOptions)}}}*_update(t){const{subscription:e,handledChunks:s}=t;for(const n of this._source.chunks()){const{chunkId:o}=n;if(s.has(o))continue;s.add(o);const a=n.getTileReader(e.tile);a&&(yield new r(t.subscription,a,!1,n.end,n.queryInfo))}}}export{o as DefaultSendState,a as FeatureUpdateStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{pt2px as e}from"../../../../../../core/screenUtils.js";import r from"../../../../../../layers/support/OrderByInfo.js";import{createLabelMatcherSchema as t}from"./LabelMatcherSchema.js";import{createMatcherSchema as s}from"./MatcherSchema.js";import{createStorageSchema as i}from"./StorageSchema.js";import{createVisualVariableUniforms as n}from"./VisualVariablesSchema.js";async function l(e,r){const i=r.renderer,l=n(i);return{symbology:await s(e,i),labels:await t(e,r,l)}}async function a(e,r,t,s){const n=t.featureReduction;if(n)switch(n.type){case"binning":return u(n,e,r,t,s);case"cluster":return f(n,e,r,t,s)}const a=d(t.orderBy,t.renderer,t.objectIdField);return{storage:i(t.renderer,r.filters),mesh:{displayRefreshVersion:s,strategy:{type:"feature"},factory:await l(e,t),sortKey:a}}}function o(e,r){return e.fields.map((e=>({...e.toJSON(),type:c(e,r)})))}function c(e,r){const{onStatisticExpression:t,onStatisticField:s,statisticType:i}=e;switch(i){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(t){const{returnType:e}=t;return e?"string"===e?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const e=r.find((e=>e.name===s));return e?e.type:"esriFieldTypeString"}}}async function u(e,r,l,a,c){const u=o(e,a.fields),f=e.renderer,d=await s(r,f),y=i(f,[null,null]),p=n(f),
|
|
5
|
+
import{pt2px as e}from"../../../../../../core/screenUtils.js";import r from"../../../../../../layers/support/OrderByInfo.js";import{createLabelMatcherSchema as t}from"./LabelMatcherSchema.js";import{createMatcherSchema as s}from"./MatcherSchema.js";import{createStorageSchema as i}from"./StorageSchema.js";import{createVisualVariableUniforms as n}from"./VisualVariablesSchema.js";async function l(e,r){const i=r.renderer,l=n(i);return{symbology:await s(e,i),labels:await t(e,r,l)}}async function a(e,r,t,s){const n=t.featureReduction;if(n)switch(n.type){case"binning":return u(n,e,r,t,s);case"cluster":return f(n,e,r,t,s)}const a=d(t.orderBy,t.renderer,t.objectIdField);return{storage:i(t.renderer,r.filters),mesh:{displayRefreshVersion:s,strategy:{type:"feature"},factory:await l(e,t),sortKey:a,timeZone:r.timeZone}}}function o(e,r){return e.fields.map((e=>({...e.toJSON(),type:c(e,r)})))}function c(e,r){const{onStatisticExpression:t,onStatisticField:s,statisticType:i}=e;switch(i){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(t){const{returnType:e}=t;return e?"string"===e?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const e=r.find((e=>e.name===s));return e?e.type:"esriFieldTypeString"}}}async function u(e,r,l,a,c){const u=o(e,a.fields),f=e.renderer,d=await s(r,f),y=i(f,[null,null]),p=n(f),m=await t(r,{geometryType:"polygon",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},p);return{storage:y,mesh:{displayRefreshVersion:c,strategy:{type:"binning",fields:u,fixedBinLevel:e.fixedBinLevel,featureFilter:l.filters[0]},factory:{labels:m,symbology:d},sortKey:null,timeZone:l.timeZone}}}async function f(r,l,a,c,u){const f=o(r,c.fields),d={type:"cluster",feature:await s(l,r.effectiveFeatureRenderer),cluster:await s(l,r.effectiveClusterRenderer)},y=n(r.effectiveFeatureRenderer),p={type:"cluster",feature:await t(l,c,y),cluster:await t(l,{geometryType:"point",labelingInfo:r.labelingInfo,labelsVisible:r.labelsVisible},y)};return{storage:i(r.effectiveFeatureRenderer,[null,null]),mesh:{displayRefreshVersion:u,strategy:{type:"cluster",fields:f,featureFilter:a.filters[0],clusterRadius:e(r.clusterRadius/2)},factory:{labels:p,symbology:d},sortKey:null,timeZone:a.timeZone}}}function d(e,t,s){const i=null!=t&&"unique-value"===t.type&&t.orderByClassesEnabled;if("default"!==e||i||(e=[new r({field:s,order:"descending"})]),"default"!==e&&e.length){e.length;const r=e[0],t="ascending"===r.order?"asc":"desc";return r.field?{field:r.field,order:t}:r.valueExpression?{expression:r.valueExpression,order:t}:null}if(i){return{byRenderer:!0,order:"asc"}}return null}export{a as createSimpleProcessorSchema,o as getAggregateFields};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createLabelMatcherSchema as e}from"./LabelMatcherSchema.js";import{createMatcherSchema as r}from"./MatcherSchema.js";import{createVVBindings as t}from"./StorageSchema.js";import{createVisualVariableUniforms as s}from"./VisualVariablesSchema.js";import{getWebGLCapabilities as a}from"../../../../../webgl/capabilities.js";async function i(e,{subtypeField:t,sublayers:s}){const a=await Promise.all(s.map((({renderer:t})=>r(e,t))));return{type:"subtype",subtypeField:t,renderers:s.reduce(((e,{subtypeCode:r},t)=>({...e,[r]:a[t]})),{})}}function
|
|
5
|
+
import{createLabelMatcherSchema as e}from"./LabelMatcherSchema.js";import{createMatcherSchema as r}from"./MatcherSchema.js";import{createVVBindings as t}from"./StorageSchema.js";import{createVisualVariableUniforms as s}from"./VisualVariablesSchema.js";import{getWebGLCapabilities as a}from"../../../../../webgl/capabilities.js";async function i(e,{subtypeField:t,sublayers:s}){const a=await Promise.all(s.map((({renderer:t})=>r(e,t))));return{type:"subtype",subtypeField:t,renderers:s.reduce(((e,{subtypeCode:r},t)=>({...e,[r]:a[t]})),{})}}function o(e,r){const s=a();return{type:"subtype",filters:e.filters,capabilities:{maxTextureSize:s.maxTextureSize},subtypeField:r.subtypeField,target:"feature",bindings:r.sublayers.reduce(((e,{renderer:r,subtypeCode:s})=>({...e,[s]:t(r)})),{})}}async function u(r,{subtypeField:t,sublayers:a}){const i=await Promise.all(a.map((t=>{const a=s(t.renderer),i={...t,geometryType:t.geometryType??null};return e(r,i,a)})));return{type:"subtype",subtypeField:t,renderers:a.reduce(((e,{subtypeCode:r},t)=>({...e,[r]:i[t]})),{})}}async function n(e,r,t,s){return{storage:o(r,t),mesh:{displayRefreshVersion:s,strategy:{type:"feature"},factory:{symbology:await i(e,t),labels:await u(e,t)},sortKey:null,timeZone:r.timeZone}}}export{n as createSubtypeProcessorSchema};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../../core/Evented.js";import{handlesGroup as t}from"../../../../../../core/handleUtils.js";import"../../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../../core/maybe.js";import{StreamFeatureManager as n}from"../../../../../../layers/graphics/data/StreamFeatureManager.js";import{createConnection as o}from"../../../../../../layers/graphics/sources/connections/createConnection.js";import{StreamConnectionState as i}from"../StreamConnectionState.js";import{StreamFeatureStore as r}from"../StreamFeatureStore.js";import{ALoadStrategy as a}from"./ALoadStrategy.js";import{StreamSourceChunk as c}from"./chunks/StreamSourceChunk.js";class h extends a{constructor(t,s,o,a,c){super(o),this._service=t,this._dataFilter=s,this._streamOptions=a,this._metadata=c,this._connectionState=new i,this.events=new e;const{objectIdField:h,timeInfo:m}=this._metadata,{purgeOptions:d}=s;this._stagingStore=new r(this._metadata,(e=>this.events.emit("features-updated",e))),this._manager=new n(this._stagingStore,h,m,d),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){this._manager.checkForUpdates()
|
|
5
|
+
import e from"../../../../../../core/Evented.js";import{handlesGroup as t}from"../../../../../../core/handleUtils.js";import"../../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../../core/maybe.js";import{StreamFeatureManager as n}from"../../../../../../layers/graphics/data/StreamFeatureManager.js";import{createConnection as o}from"../../../../../../layers/graphics/sources/connections/createConnection.js";import{StreamConnectionState as i}from"../StreamConnectionState.js";import{StreamFeatureStore as r}from"../StreamFeatureStore.js";import{ALoadStrategy as a}from"./ALoadStrategy.js";import{StreamSourceChunk as c}from"./chunks/StreamSourceChunk.js";class h extends a{constructor(t,s,o,a,c){super(o),this._service=t,this._dataFilter=s,this._streamOptions=a,this._metadata=c,this._connectionState=new i,this._forceRefresh=!1,this.events=new e;const{objectIdField:h,timeInfo:m}=this._metadata,{purgeOptions:d}=s;this._stagingStore=new r(this._metadata,(e=>this.events.emit("features-updated",e))),this._manager=new n(this._stagingStore,h,m,d),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){const e=null!=this._chunk;this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new c(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick")):this.events.emit("tick")}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){this._connection=s(this._connection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(null!=this._connection)return;const{geometryType:e,spatialReference:s}=this._metadata,{maxReconnectionAttempts:n,maxReconnectionInterval:i,geometryDefinition:r,definitionExpression:a,customParameters:c}=this._dataFilter;this._connection=o(this._service.source,s,this._streamOptions.outSR,e,a,r,n,i,c),this._handlesGroup=t([this._connection.on("data-received",(e=>this._onFeature(e))),this._connection.on("message-received",(e=>this._onWebSocketMessage(e)))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._connection?.updateCustomParameters(e)}sendMessageToSocket(e){this._connection?.sendMessageToSocket(e)}sendMessageToClient(e){this._connection?.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch(t){}}}export{h as StreamLoadStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../geometry/SpatialReference.js";import t from"../../../../../layers/support/FieldsIndex.js";class i{constructor(i){this._options=i,this._fieldsIndex="fieldsIndex"in i?t.fromJSON(i.fieldsIndex):new t(i.fields),i.spatialReference&&(this._spatialReference=e.fromJSON(i.spatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,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}}
|
|
5
|
+
import e from"../../../../../geometry/SpatialReference.js";import t from"../../../../../layers/support/FieldsIndex.js";class i{constructor(i){this._options=i,this._fieldsIndex="fieldsIndex"in i?t.fromJSON(i.fieldsIndex):new t(i.fields),i.spatialReference&&(this._spatialReference=e.fromJSON(i.spatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,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}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return this._options.geometryType}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}}class s extends i{static create(e){return new s({fields:[],objectIdField:"uid",geometryType:null,spatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null})}}export{i as FeatureMetadata,s as GraphicsMetadata};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import e from"../../../../../core/ArrayPool.js";import t from"../../../../../geometry/Extent.js";import{create as i}from"../../../../../geometry/support/aaBoundingRect.js";import s from"../../../../../rest/support/QuantizationParameters.js";import o from"../../../tiling/TileKey.js";class n{constructor(e,t){this.key=new o(0,0,0,0),this.bounds=i(),this.objectIds=new Set,this.key.set(t);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.scale=s.scale,this.level=s.level}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return t.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(e){return{$view:{scale:this.scale,timeZone:e}}}createChildTiles(){const t=this.key.getChildKeys(),i=e.acquire();for(let e=0;e<t.length;e++)i[e]=new n(this.tileInfoView,t[e]);return i}getQuantizationParameters(){return s.fromJSON({mode:"view",originPosition:"upperLeft",tolerance:this.resolution,extent:{xmin:this.bounds[0],ymin:this.bounds[1],xmax:this.bounds[2],ymax:this.bounds[3],spatialReference:this.tileInfoView.tileInfo.spatialReference}})}}export{n as Tile};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{isSome as r}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as s}from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as l,isPolygon as p,isExtent as u,getJsonType as m}from"../../../../geometry/support/jsonUtils.js";import g from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as f,CIMSymbolHelper as y}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as _}from"../../../../symbols/cim/OverrideHelper.js";import{errorPolylineSymbol2D as b,errorPolygonSymbol2D as w,errorPointSymbol2D as S}from"../../../../symbols/support/defaults.js";import{filterFlag0 as I}from"../../engine/webgl/definitions.js";import{FeatureTile as v}from"../../engine/webgl/FeatureTile.js";import{MeshData as T}from"../../engine/webgl/mesh/MeshData.js";import{ResourceProxy as R}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as M}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createMeshWriter as j}from"../../engine/webgl/shaderGraph/techniques/mesh/createMeshWriter.js";import{castStrictInstanceId as x}from"../../engine/webgl/shaderGraph/techniques/mesh/instanceIdUtils.js";import{createStorageSchema as U}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as C}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as q}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as G}from"../features/support/FeatureMetadata.js";import{GraphicsReader as k}from"../features/support/GraphicsReader.js";import P from"./GraphicStore.js";import O from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as A}from"../support/UpdateTracking2D.js";class F{static getOrCreate(e,t,r){let s=t.get(e.id);return s||(s=new F(e,r),t.set(e.id,s)),s}static fromItems(e,t,r){const s=new F(e,r);return s.addedOrModified.push(...t),s}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[]}get reader(){return this._reader||(this._reader=k.from(this.addedOrModified,this.tile,this.metadata)),this._reader}}let V=class extends(s(t)){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new A({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new O({process:e=>{switch(e.type){case"processed-edit":throw new Error("InternalError: Unsupported command");case"update":return this._update()}}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new q({spatialReference:this.view.spatialReference,fields:new g}),this._attributeStore=new C({isLocal:!0,update:async e=>{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e});const t=this.container.attributeView.requestUpdate(e);this.container.requestRender(),await t,has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const e=U(null,[]);this._attributeStore.update(e,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=G.create(this.view.spatialReference),this._resourceProxy=new R({fetch:e=>Promise.all(e.map((e=>this.view.stage.textureManager.rasterizeItem(e)))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([n((()=>this._effectiveRenderer),(()=>this.requestUpdate())),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",(()=>{this.addHandles([this.graphics.on("change",(()=>this._pushUpdate()))]),this._graphicStore=new P(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()}))]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return"function"==typeof this.renderer?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const e=!this._attached||this._updateTracking.updating;return has("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${e}\n -> attaching ${!this._attached}\n -> updateTracking ${this._updateTracking.updating}`),e}hitTest(e){if(!this.view||this.view.suspended)return[];const{resolution:t,rotation:s}=this.view.state,i=this._graphicStore.hitTest(e.x,e.y,2,t,s),o=new Set(i),a=this.graphics.items.reduce(((e,t)=>(o.has(t.uid)&&e.set(t.uid,t),e)),new Map);return i.map((e=>a.get(e))).filter(r)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlight(e){const t=[];for(const{objectId:r,highlightFlags:s}of e){const e=this._graphicStore.getItem(r)?.displayId;t.push({objectId:r,highlightFlags:s,displayId:e})}this._attributeStore.setHighlight(t,e),this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)}_pushUpdate(){o(this._commandQueue.push({type:"update"}))}async _update(){try{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const e=await this._graphicStore.update(this.graphics,(e=>this._getSymbolForGraphic(e)),(e=>this._ensureSymbolResource(e)));if(!e.hasAnyUpdate())return void await this._attributeStore.sendUpdates();e.removed.length&&(this._cleanupRequired=!0),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);const t=this._createTileMessages(e);await this._fetchResources(t),this._write(t);for(const r of e.added)this._setFilterState(r);for(const r of e.updated)this._setFilterState(r);has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),await this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch(e){}this._cleanupSharedResources()}_createTileMessages(e){const t=new Map;for(const r of e.added){const e=this.view.graphicsTileStore.getIntersectingTiles(r.bounds);for(const s of e){F.getOrCreate(s,t,this._metadata).addedOrModified.push(r)}}for(const r of e.updated){const e=this.view.graphicsTileStore.getIntersectingTiles(r.prevBounds),s=this.view.graphicsTileStore.getIntersectingTiles(r.bounds);for(const i of e){F.getOrCreate(i,t,this._metadata).removed.push(r.displayId)}for(const i of s){F.getOrCreate(i,t,this._metadata).addedOrModified.push(r)}}for(const r of e.removed){const e=this.view.graphicsTileStore.getIntersectingTiles(r.bounds);for(const s of e){F.getOrCreate(s,t,this._metadata).removed.push(r.displayId)}}return Array.from(t.values())}async _fetchResources(e){for(const{tile:t,reader:r}of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.id}] GraphicsView fetchResources`,e);const s=r.getCursor();for(;s.next();)for(const e of s.getMeshWriters())e.enqueueRequest(this._resourceProxy,s,this._metadata.createArcadeEvalOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(const t of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);const e=this._writeMeshes(t);let r=this._tiles.get(t.tile.key);r||(r=this._createFeatureTile(t.tile.key)),has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(r,{type:"update",modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch}),this.container.requestRender()}}_writeMeshes(e){const t=new T(e.tile.id),r=e.reader.getCursor();for(;r.next();){t.entityStart(r.getDisplayId(),r.getZOrder());for(const s of r.getMeshWriters())s.write(t,this._resourceProxy,r,this._metadata.createArcadeEvalOptions(e.tile),e.tile.level);t.entityEnd()}return{...t.serialize().message,tileId:e.tile.id}}_setFilterState(e){const t=e.displayId,r=this._attributeStore.getHighlightFlags(e.objectId);this._attributeStore.setData(t,0,0,r|(e.visible?I:0))}_getSymbolForGraphic(e){return null!=e.symbol?e.symbol:null!=this._effectiveRenderer?this._effectiveRenderer.getSymbol(e):this._getNullSymbol(e)}async _ensureSymbolResource(e){if(!e.symbol)return;const t=await this._getSymbolInfo(e.symbol);if(!t)return;const r=t.linearCIM.filter((e=>"text"===e.type));if(r.length>0){const s=await this._getTextResources(e,r);e.symbolResource={symbolInfo:t,textInfo:s}}else e.symbolResource={symbolInfo:t}}_getSymbolInfo(e){const t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch((e=>null))),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){const r=await this._convertToCIMSymbol(t),s=await this._createLinearCIM(r);if("text"===t.type)for(const i of s)"text"===i.type&&(i.lineWidth=t.lineWidth);return{hash:e,cimSymbol:r,linearCIM:s,meshWriters:await this._createMeshWriters(r,s)}}async _convertToCIMSymbol(e){const t=f(e);if("web-style"===t.type){return(await t.fetchCIMSymbol()).data}return t}async _createLinearCIM(e){return await Promise.all(y.fetchResources(e.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t){a(this._controller.signal);const r=this.container.instanceStore,s=await M(e,t,r);return Promise.all(s.map((e=>j(this._storage,this._resourceProxy,e.meshWriterName,x(e.id),e.options,{tileInfo:this.view.featuresTilingScheme.tileInfo},e.optionalAttributes))))}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.addPromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(const t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){const t=this.view.featuresTilingScheme.getTileBounds(c(),e),r=this.view.featuresTilingScheme.getTileResolution(e.level),s=new v(e,r,t[0],t[3]);return this._tiles.set(e,s),this.container.addChild(s),s}async _addTile(e){if(!this._attached)return;const t=this._graphicStore.queryItems(e);if(!t.length)return;const r=this._createFeatureTile(e.key),s=F.fromItems(e,t,this._metadata);await this._fetchResources([s]);const i=this._writeMeshes(s);r.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch})}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){const t=e.geometry;return l(t)?b:p(t)||u(t)?w:this.defaultPointSymbolEnabled?S:null}async _getTextResources(e,t){const r=new Array,s=new Array;for(let i=0;i<t.length;i++){const o=t[i],{resource:a,overrides:n}=o.textRasterizationParam;if(n?.length>0){const t=_.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:n,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:a.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:a.symbol,textString:a.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then((e=>{const t=e.symbolLayers[0],{textString:r}=t.markerGraphics[0];s.push({type:"cim-rasterization-info",resource:{type:"text",textString:r||"",font:a.font}}),o.text=a.textString=r||""})),r.push(t)}else s.push({type:"cim-rasterization-info",resource:a})}r.length>0&&await Promise.all(r);const o=s.map((e=>this.view.stage.textureManager.rasterizeItem(e))),a=await Promise.all(o);i(a);const n=new Map;for(let i=0;i<t.length;i++){const e=t[i];n.set(e.textRasterizationParam.resource.symbol,{text:e.text,glyphMosaicItems:a[i]})}return n}_cleanupSharedResources(){if(!this._cleanupRequired)return;const e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;const t=new Set;for(const s of this._graphicStore.items()){const e=s.symbolResource?.symbolInfo.hash;t.add(e)}const r=new Set(this._hashToSymbolInfo.keys());for(const s of r.values())t.has(s)||this._hashToSymbolInfo.delete(s)}};e([h()],V.prototype,"_effectiveRenderer",null),e([h({constructOnly:!0})],V.prototype,"layerId",void 0),e([h({constructOnly:!0})],V.prototype,"requestUpdateCallback",void 0),e([h()],V.prototype,"container",void 0),e([h({constructOnly:!0})],V.prototype,"graphics",void 0),e([h()],V.prototype,"renderer",void 0),e([h()],V.prototype,"_updateTracking",void 0),e([h()],V.prototype,"updating",null),e([h()],V.prototype,"view",void 0),e([h()],V.prototype,"updateRequested",void 0),e([h()],V.prototype,"defaultPointSymbolEnabled",void 0),V=e([d("esri.views.2d.layers.support.GraphicsView2D")],V);const $=V;export{$ as default};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as r}from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as l,isPolygon as p,isExtent as u,getJsonType as m}from"../../../../geometry/support/jsonUtils.js";import g from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as f,CIMSymbolHelper as y}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as _}from"../../../../symbols/cim/OverrideHelper.js";import{errorPolylineSymbol2D as b,errorPolygonSymbol2D as w,errorPointSymbol2D as S}from"../../../../symbols/support/defaults.js";import{filterFlag0 as v}from"../../engine/webgl/definitions.js";import{FeatureTile as I}from"../../engine/webgl/FeatureTile.js";import{MeshData as T}from"../../engine/webgl/mesh/MeshData.js";import{ResourceProxy as R}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as M}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createMeshWriter as j}from"../../engine/webgl/shaderGraph/techniques/mesh/createMeshWriter.js";import{castStrictInstanceId as x}from"../../engine/webgl/shaderGraph/techniques/mesh/instanceIdUtils.js";import{createStorageSchema as U}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as C}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as q}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as G}from"../features/support/FeatureMetadata.js";import{GraphicsReader as k}from"../features/support/GraphicsReader.js";import P from"./GraphicStore.js";import O from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as A}from"../support/UpdateTracking2D.js";class F{static getOrCreate(e,t,s){let r=t.get(e.id);return r||(r=new F(e,s),t.set(e.id,r)),r}static fromItems(e,t,s){const r=new F(e,s);return r.addedOrModified.push(...t),r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[]}get reader(){return this._reader||(this._reader=k.from(this.addedOrModified,this.tile,this.metadata)),this._reader}}let V=class extends(r(t)){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new A({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new O({process:e=>{switch(e.type){case"processed-edit":throw new Error("InternalError: Unsupported command");case"update":return this._update()}}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new q({spatialReference:this.view.spatialReference,fields:new g}),this._attributeStore=new C({isLocal:!0,update:async e=>{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e});const t=this.container.attributeView.requestUpdate(e);this.container.requestRender(),await t,has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const e=U(null,[]);this._attributeStore.update(e,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=G.create(this.view.spatialReference),this._resourceProxy=new R({fetch:e=>Promise.all(e.map((e=>this.view.stage.textureManager.rasterizeItem(e)))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([n((()=>this._effectiveRenderer),(()=>this._pushUpdate())),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",(()=>{this.addHandles([this.graphics.on("change",(()=>this._pushUpdate()))]),this._graphicStore=new P(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()}))]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return"function"==typeof this.renderer?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const e=!this._attached||this._updateTracking.updating;return has("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${e}\n -> attaching ${!this._attached}\n -> updateTracking ${this._updateTracking.updating}`),e}hitTest(e){if(!this.view||this.view.suspended)return[];const{resolution:t,rotation:r}=this.view.state,i=this._graphicStore.hitTest(e.x,e.y,2,t,r),o=new Set(i),a=this.graphics.items.reduce(((e,t)=>(o.has(t.uid)&&e.set(t.uid,t),e)),new Map);return i.map((e=>a.get(e))).filter(s)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlight(e){const t=[];for(const{objectId:s,highlightFlags:r}of e){const e=this._graphicStore.getItem(s)?.displayId;t.push({objectId:s,highlightFlags:r,displayId:e})}this._attributeStore.setHighlight(t,e),this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)}_pushUpdate(){o(this._commandQueue.push({type:"update"}))}async _update(){try{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const e=await this._graphicStore.update(this.graphics,(e=>this._getSymbolForGraphic(e)),(e=>this._ensureSymbolResource(e)));if(!e.hasAnyUpdate())return void await this._attributeStore.sendUpdates();e.removed.length&&(this._cleanupRequired=!0),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);const t=this._createTileMessages(e);await this._fetchResources(t),this._write(t);for(const s of e.added)this._setFilterState(s);for(const s of e.updated)this._setFilterState(s);has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),await this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch(e){}this._cleanupSharedResources()}_createTileMessages(e){const t=new Map;for(const s of e.added){const e=this.view.graphicsTileStore.getIntersectingTiles(s.bounds);for(const r of e){F.getOrCreate(r,t,this._metadata).addedOrModified.push(s)}}for(const s of e.updated){const e=this.view.graphicsTileStore.getIntersectingTiles(s.prevBounds),r=this.view.graphicsTileStore.getIntersectingTiles(s.bounds);for(const i of e){F.getOrCreate(i,t,this._metadata).removed.push(s.displayId)}for(const i of r){F.getOrCreate(i,t,this._metadata).addedOrModified.push(s)}}for(const s of e.removed){const e=this.view.graphicsTileStore.getIntersectingTiles(s.bounds);for(const r of e){F.getOrCreate(r,t,this._metadata).removed.push(s.displayId)}}return Array.from(t.values())}async _fetchResources(e){for(const{tile:t,reader:s}of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.id}] GraphicsView fetchResources`,e);const r=s.getCursor();for(;r.next();)for(const e of r.getMeshWriters())e.enqueueRequest(this._resourceProxy,r,t.createArcadeEvaluationOptions(this.view.timeZone))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(const t of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);const e=this._writeMeshes(t);let s=this._tiles.get(t.tile.key);s||(s=this._createFeatureTile(t.tile.key)),has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(s,{type:"update",modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch}),this.container.requestRender()}}_writeMeshes(e){const t=new T(e.tile.id),s=e.reader.getCursor();for(;s.next();){t.entityStart(s.getDisplayId(),s.getZOrder());for(const r of s.getMeshWriters())r.write(t,this._resourceProxy,s,e.tile.createArcadeEvaluationOptions(this.view.timeZone),e.tile.level);t.entityEnd()}return{...t.serialize().message,tileId:e.tile.id}}_setFilterState(e){const t=e.displayId,s=this._attributeStore.getHighlightFlags(e.objectId);this._attributeStore.setData(t,0,0,s|(e.visible?v:0))}_getSymbolForGraphic(e){return null!=e.symbol?e.symbol:null!=this._effectiveRenderer?this._effectiveRenderer.getSymbol(e):this._getNullSymbol(e)}async _ensureSymbolResource(e){if(!e.symbol)return;const t=await this._getSymbolInfo(e.symbol);if(!t)return;const s=t.linearCIM.filter((e=>"text"===e.type));if(s.length>0){const r=await this._getTextResources(e,s);e.symbolResource={symbolInfo:t,textInfo:r}}else e.symbolResource={symbolInfo:t}}_getSymbolInfo(e){const t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch((e=>null))),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){const s=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(s);if("text"===t.type)for(const i of r)"text"===i.type&&(i.lineWidth=t.lineWidth);return{hash:e,cimSymbol:s,linearCIM:r,meshWriters:await this._createMeshWriters(s,r)}}async _convertToCIMSymbol(e){const t=f(e);if("web-style"===t.type){return(await t.fetchCIMSymbol()).data}return t}async _createLinearCIM(e){return await Promise.all(y.fetchResources(e.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t){a(this._controller.signal);const s=this.container.instanceStore,r=await M(e,t,s);return Promise.all(r.map((e=>j(this._storage,this._resourceProxy,e.meshWriterName,x(e.id),e.options,{tileInfo:this.view.featuresTilingScheme.tileInfo},e.optionalAttributes))))}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.addPromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(const t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){const t=this.view.featuresTilingScheme.getTileBounds(c(),e),s=this.view.featuresTilingScheme.getTileResolution(e.level),r=new I(e,s,t[0],t[3]);return this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;const t=this._graphicStore.queryItems(e);if(!t.length)return;const s=this._createFeatureTile(e.key),r=F.fromItems(e,t,this._metadata);await this._fetchResources([r]);const i=this._writeMeshes(r);s.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch})}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){const t=e.geometry;return l(t)?b:p(t)||u(t)?w:this.defaultPointSymbolEnabled?S:null}async _getTextResources(e,t){const s=new Array,r=new Array;for(let i=0;i<t.length;i++){const o=t[i],{resource:a,overrides:n}=o.textRasterizationParam;if(n?.length>0){const t=_.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:n,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:a.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:a.symbol,textString:a.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then((e=>{const t=e.symbolLayers[0],{textString:s}=t.markerGraphics[0];r.push({type:"cim-rasterization-info",resource:{type:"text",textString:s||"",font:a.font}}),o.text=a.textString=s||""})),s.push(t)}else r.push({type:"cim-rasterization-info",resource:a})}s.length>0&&await Promise.all(s);const o=r.map((e=>this.view.stage.textureManager.rasterizeItem(e))),a=await Promise.all(o);i(a);const n=new Map;for(let i=0;i<t.length;i++){const e=t[i];n.set(e.textRasterizationParam.resource.symbol,{text:e.text,glyphMosaicItems:a[i]})}return n}_cleanupSharedResources(){if(!this._cleanupRequired)return;const e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;const t=new Set;for(const r of this._graphicStore.items()){const e=r.symbolResource?.symbolInfo.hash;t.add(e)}const s=new Set(this._hashToSymbolInfo.keys());for(const r of s.values())t.has(r)||this._hashToSymbolInfo.delete(r)}};e([h()],V.prototype,"_effectiveRenderer",null),e([h({constructOnly:!0})],V.prototype,"layerId",void 0),e([h({constructOnly:!0})],V.prototype,"requestUpdateCallback",void 0),e([h()],V.prototype,"container",void 0),e([h({constructOnly:!0})],V.prototype,"graphics",void 0),e([h()],V.prototype,"renderer",void 0),e([h()],V.prototype,"_updateTracking",void 0),e([h()],V.prototype,"updating",null),e([h()],V.prototype,"view",void 0),e([h()],V.prototype,"updateRequested",void 0),e([h()],V.prototype,"defaultPointSymbolEnabled",void 0),V=e([d("esri.views.2d.layers.support.GraphicsView2D")],V);const $=V;export{$ as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Logger.js";import o from"../../../../core/PooledArray.js";import{hasFeatureFlagWebGLDebug as s}from"../../../webgl/checkWebGLError.js";class r{constructor(e){this._context=e,this._nodes=new o}destroy(){this._nodes.forEach((e=>e.destroy())),this._nodes.clear()}add(e){this._nodes.push(e),s&&console.log(`Registered render nodes: ${this._nodes.map((({declaredClass:e})=>e)).join(", ")}`)}remove(e){this._nodes.remove(e),s&&console.log(`Registered render nodes: ${this._nodes.map((({declaredClass:e})=>e)).join(", ")}`)}produces(e){return this._nodes.some((({produces:o})=>o===e))}require(e,o){return
|
|
5
|
+
import e from"../../../../core/Logger.js";import o from"../../../../core/PooledArray.js";import{hasFeatureFlagWebGLDebug as s}from"../../../webgl/checkWebGLError.js";class r{constructor(e){this._context=e,this._nodes=new o}destroy(){this._nodes.forEach((e=>e.destroy())),this._nodes.clear()}add(e){this._nodes.push(e),s&&console.log(`Registered render nodes: ${this._nodes.map((({declaredClass:e})=>e)).join(", ")}`)}remove(e){this._nodes.remove(e),s&&console.log(`Registered render nodes: ${this._nodes.map((({declaredClass:e})=>e)).join(", ")}`)}produces(e){return this._nodes.some((({produces:o})=>o===e))}require(e,o){return this._nodes.reduce(((s,{consumes:r,produces:t})=>s+(r.required.includes(e)&&t===o?1:0)),0)}optional(e,o){return this._nodes.reduce(((s,{consumes:r,produces:t})=>s+(r.optional?.includes(e)&&t===o?1:0)),0)}updateAnimation(){return this._nodes.reduce(((e,o)=>o.updateAnimation()||e),!1)}render(o,s,r){const t=o.name,n=this._nodes.filter((({produces:e})=>e===t));return 0===n.length||(n.forEach((n=>{const c=[o];for(const e of n.consumes.required){if(e===t)continue;const o=s.get(e);if(!o)return void r(c);c.push(o)}if(n.consumes.optional)for(const e of n.consumes.optional){if(e===t)continue;const o=s.get(e);o&&c.push(o)}try{const e=n.doRender(c,this._context);e&&e!==o&&(o.release(),o=e,s.set(t,o))}catch(d){e.getLogger(n).errorOnce(d)}r(c)})),this._context.rctx.enforceState()),o}}export{r as RenderNodes};
|