@arcgis/core 4.27.0-rc.0 → 4.27.0-rc.1
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/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/OrderBy.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0407bf97ad621c89a734.js +1 -0
- package/assets/esri/core/workers/chunks/0610691a0c0d9fbbd6d2.js +1 -0
- package/assets/esri/core/workers/chunks/{7ec6be2bc0f354011e46.js → 07651ef8348f702d59ac.js} +1 -1
- package/assets/esri/core/workers/chunks/0a02ac5628d1739372c6.js +1 -0
- package/assets/esri/core/workers/chunks/0a86c458916e83d6c523.js +1 -0
- package/assets/esri/core/workers/chunks/14145959a3dab1437818.js +1 -0
- package/assets/esri/core/workers/chunks/16db0bc87d87a7313dc4.js +1 -0
- package/assets/esri/core/workers/chunks/183e2e0cb86c1c640d94.js +1 -0
- package/assets/esri/core/workers/chunks/19d329b9d4ec2eff1d13.js +1 -0
- package/assets/esri/core/workers/chunks/1b8074269800b384ecf6.js +1 -0
- package/assets/esri/core/workers/chunks/2154d395f405be3cd3ba.js +1 -0
- package/assets/esri/core/workers/chunks/{33dbba3b7fc648437e50.js → 21e1f3b11e7d363b727a.js} +1 -1
- package/assets/esri/core/workers/chunks/{31a158c73994603c169d.js → 2446e336b1f7256d4fde.js} +1 -1
- package/assets/esri/core/workers/chunks/29290a44fd3b183c24e3.js +1 -0
- package/assets/esri/core/workers/chunks/{f498c4d4831141125781.js → 2f5639886f577baedbca.js} +1 -1
- package/assets/esri/core/workers/chunks/33901eb1574e46abd9af.js +1 -0
- package/assets/esri/core/workers/chunks/{9c78ad5ab57e0d47ac43.js → 3ba2fcb9110230f8790c.js} +1 -1
- package/assets/esri/core/workers/chunks/3e239bfad611985e50fb.js +1 -0
- package/assets/esri/core/workers/chunks/42f3421740a5479559dc.js +1 -0
- package/assets/esri/core/workers/chunks/474d9b334812533bab36.js +1 -0
- package/assets/esri/core/workers/chunks/53ad34bf32f5f3d4fe18.js +1 -0
- package/assets/esri/core/workers/chunks/{97cdbec7532cfcdf9ad2.js → 595a2baa04d92de59558.js} +1 -1
- package/assets/esri/core/workers/chunks/624521961fe1f2c4f2c5.js +1 -0
- package/assets/esri/core/workers/chunks/{212d59764c275c763941.js → 659b7bad7281c0e2aed3.js} +1 -1
- package/assets/esri/core/workers/chunks/6a3d611e8842afbb50ab.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/6e562fa57c0347091154.js +1 -0
- package/assets/esri/core/workers/chunks/7479dc0c790337af7597.js +1 -0
- package/assets/esri/core/workers/chunks/{e88cff2537be52da6531.js → 74fd2059ddda9083cbcc.js} +1 -1
- package/assets/esri/core/workers/chunks/7dc6774c77c822b68c99.js +1 -0
- package/assets/esri/core/workers/chunks/82a103a8b5382300889d.js +1 -0
- package/assets/esri/core/workers/chunks/{3fe357df92afa1bee70a.js → 90da1ed112b82712d0ef.js} +1 -1
- package/assets/esri/core/workers/chunks/{9849f64793f2ad39366b.js → 9290b0d330f02233d803.js} +1 -1
- package/assets/esri/core/workers/chunks/92e7f224a80195e606d6.js +1 -0
- package/assets/esri/core/workers/chunks/{36df72362b38759b895b.js → 9648a8f2b24f1ca3d637.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad18fb7bb54a0c4bdb38.js → a20361b4d3bdd7d196ca.js} +1 -1
- package/assets/esri/core/workers/chunks/a7fd2a95fde197c06828.js +1 -0
- package/assets/esri/core/workers/chunks/b0cda39b53ecd6c44cd0.js +1 -0
- package/assets/esri/core/workers/chunks/b2a423d9ce8bb784267c.js +1 -0
- package/assets/esri/core/workers/chunks/b5fc6f2044ed047c5afd.js +1 -0
- package/assets/esri/core/workers/chunks/{df0453cdfe685d6436cc.js → b6dc41fce601b9d3480e.js} +1 -1
- package/assets/esri/core/workers/chunks/b8e6c64792a512df4c4d.js +1 -0
- package/assets/esri/core/workers/chunks/c6617a937440701c0180.js +1 -0
- package/assets/esri/core/workers/chunks/c6efe2e04ea6a55bb6e3.js +1 -0
- package/assets/esri/core/workers/chunks/d8607326a199dd994844.js +1 -0
- package/assets/esri/core/workers/chunks/d8bd3f498b3fa8153404.js +1 -0
- package/assets/esri/core/workers/chunks/{39e473586579d11d6732.js → e2432871f1329f47465d.js} +1 -1
- package/assets/esri/core/workers/chunks/ee5ee03dd2c7dc940272.js +1 -0
- package/assets/esri/core/workers/chunks/{c83669cf08391a62fb72.js → f1da7b29eecad0e9efae.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e627c94e57c924e5917.js → f339db2b599fa9585283.js} +1 -1
- package/assets/esri/core/workers/chunks/f505ebd4bd3bfb6c790d.js +1 -0
- package/assets/esri/core/workers/chunks/{3c6c082157c916f8ddba.js → ffe61d5a6a9b34bee9d4.js} +1 -1
- package/assets/esri/themes/base/widgets/_Bookmarks.scss +5 -0
- package/assets/esri/themes/base/widgets/_Features.scss +5 -7
- package/assets/esri/themes/base/widgets/_Popup.scss +3 -3
- package/assets/esri/themes/base/widgets/_Swipe.scss +11 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/SSAO.glsl.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/support/DoubleArray.js +1 -1
- package/geometry/support/meshUtils/bounds.js +5 -0
- package/geometry/support/meshUtils/georeference.js +1 -1
- package/interfaces.d.ts +2 -2
- package/kernel.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/attributeSupport.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/support/FeatureReductionBinning.js +1 -1
- package/layers/support/FeatureReductionCluster.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/rasterFunctions/colormaps.js +1 -1
- package/package.json +2 -2
- package/renderers/support/utils.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/effects/EffectBuffer.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/views/2d/layers/features/Store2D.js +1 -1
- package/views/2d/layers/features/sources/StreamSource.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/webStyleUtils.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/materials/pbrUtils.js +5 -0
- package/webdoc/support/writeUtils.js +1 -1
- package/widgets/Bookmarks/css.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/Features.js +1 -1
- package/assets/esri/core/workers/chunks/0b03165dbf289797cefa.js +0 -1
- package/assets/esri/core/workers/chunks/0c1c0024879f944f44c4.js +0 -1
- package/assets/esri/core/workers/chunks/13a48796905613bc1679.js +0 -1
- package/assets/esri/core/workers/chunks/1ea1104651ab15f9a13c.js +0 -1
- package/assets/esri/core/workers/chunks/2108cfc7921430f0b805.js +0 -1
- package/assets/esri/core/workers/chunks/2eacca322737aafd8f0c.js +0 -1
- package/assets/esri/core/workers/chunks/39577683e334eb4d904c.js +0 -1
- package/assets/esri/core/workers/chunks/4d3deeb0ebd0ce8c1215.js +0 -1
- package/assets/esri/core/workers/chunks/576bddc3fa7d91a7e5bd.js +0 -1
- package/assets/esri/core/workers/chunks/623d6710a4f800c622ce.js +0 -1
- package/assets/esri/core/workers/chunks/6782cc3feb713676d544.js +0 -1
- package/assets/esri/core/workers/chunks/6e7178de0b2c3d2f7e6b.js +0 -1
- package/assets/esri/core/workers/chunks/78ce0b1af62435d8ebf4.js +0 -1
- package/assets/esri/core/workers/chunks/79d2baf392589588ef9b.js +0 -1
- package/assets/esri/core/workers/chunks/7bbdba52157da13a01fc.js +0 -1
- package/assets/esri/core/workers/chunks/84860b535a70ec448cfe.js +0 -1
- package/assets/esri/core/workers/chunks/9035d9e09a4e7cb94d37.js +0 -1
- package/assets/esri/core/workers/chunks/956b0fef7bc849415354.js +0 -1
- package/assets/esri/core/workers/chunks/9ab98321a4a7eaeeb018.js +0 -1
- package/assets/esri/core/workers/chunks/9cb7a68ff46e5c43e1d2.js +0 -1
- package/assets/esri/core/workers/chunks/a0f7f7f578521970c714.js +0 -1
- package/assets/esri/core/workers/chunks/a60eac45d3c65bd0216f.js +0 -1
- package/assets/esri/core/workers/chunks/aca5260f6984952a6e3d.js +0 -1
- package/assets/esri/core/workers/chunks/b05be356743fa5d24573.js +0 -1
- package/assets/esri/core/workers/chunks/ba6024465308c248170b.js +0 -1
- package/assets/esri/core/workers/chunks/d0983f808008920514f2.js +0 -1
- package/assets/esri/core/workers/chunks/dab832799bc06b0fec34.js +0 -1
- package/assets/esri/core/workers/chunks/e45d36aef2bc69ee9132.js +0 -1
- package/assets/esri/core/workers/chunks/e5bbd4cc5edbf7ab3624.js +0 -1
- package/assets/esri/core/workers/chunks/e700cf4d1f99291a4396.js +0 -1
- package/assets/esri/core/workers/chunks/f398a5cf33c3fd2522a5.js +0 -1
- package/assets/esri/core/workers/chunks/f4ee94a6cde4ea8837f1.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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Handles.js";import has from"../../../core/has.js";import s from"../../../core/Logger.js";import a from"../../../core/PooledArray.js";import{EsriPromiseMixin as r}from"../../../core/Promise.js";import{isAbortError as d}from"../../../core/promiseUtils.js";import{watch as o,initial as n,sync as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingRect as _}from"../../../geometry/projection.js";import{create as c,intersectsSphere as p}from"../../../geometry/support/aaBoundingRect.js";import{makeDehydratedPoint as m}from"../dehydratedFeatures.js";import{PromiseQueue as g}from"../../support/PromiseQueue.js";import{viewingModeFromString as y}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as x}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{addCallback as f}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as b}from"../../../views/3d/layers/i3s/I3SIndex.js";import N from"../../../views/3d/layers/i3s/I3SLodHandling.js";import{NodeState as w,CacheState as v}from"../../../views/3d/layers/i3s/I3SNode.js";import C from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as D}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as L,getIndexCrs as S,findIntersectingNodes as V}from"../../../views/3d/layers/i3s/I3SUtil.js";import I from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{FadeDirection as A}from"../../../views/3d/layers/support/I3SLayerView.js";import{toBoundingRect as F}from"../../../views/3d/support/extentUtils.js";import{ClientType as M,maxDownloadSlots as O}from"../../../views/3d/support/index.js";import{extractSafeScaleBounds as U,scaleBoundsPredicate as P}from"../../../views/support/layerViewUtils.js";import{noBudget as G}from"../../../views/support/Scheduler.js";const q="esri.layers.graphics.controllers.I3SOnDemandController",j=s.getLogger(q),Q=100,T=2,E=1e4,H=1e-4,R=1.2,k=500,B=1.5;let z=class extends(r(t)){get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store?.lodType}get isGraphics3D(){return"points"===this.layer.profile}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(null==this.layer.priority||"High"===this.layer.priority)}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(M.I3S_INDEX);return new D(e,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(M.I3S_DATA);return new D(e,this.layer.apiKey)}get crsVertex(){return L(this.layer)}get crsIndex(){return S(this.layer)}get layer(){return this.layerView.i3slayer}get running(){return this.updating}get rootNodeVisible(){if(null!=this._index){const e=this._index.rootNode;if(null!=e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}constructor(e){super(e),this.screenSizeFactor=0,this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.scaleVisibilityEnabled=!0,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new a({deallocator:null}),this._loadedNodeScales=new Map,this._modificationsNodeFilteringArray=new a,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._handles=new i,this._idleQueue=new g,this._elevationUpdateNodes=new a({deallocator:null}),this._errorCount=0}initialize(){const{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new N(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=has("disable-feature:idb-cache"),"fields"in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then((([i])=>{if(this.destroyed||!e||e.destroyed||!i)return;const{view:s,clientGeometry:a}=e,{resourceController:r}=s;if(this._setClippingArea(s.clippingArea),this.addHandles([o((()=>s?.pointsOfInterest?.focus?.renderLocation),(e=>this._pointOfInterestChanged(e)),n),o((()=>r.memoryController.memoryFactor),(()=>this._setCameraDirty()),l),o((()=>e.contentVisible),(e=>{const t=e?()=>this._updateIdleState(!0):()=>this._updateViewData(),i=e?()=>this._updateIdleState(!1):()=>{};e&&null!=this._index&&this._index.invalidateAllElevationRanges(),this._idleStateCallbacks?(e||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=r.scheduler.registerIdleStateCallbacks(t,i)}),n),f(e.view.resourceController.scheduler,this),o((()=>e.uncompressedTextureDownsamplingEnabled),(()=>this.restartNodeLoading())),o((()=>[this.featureTarget,this.fixedFeatureTarget]),(()=>{this._setCameraDirty(),this._stableFeatureLOD=!1})),o((()=>s.state?.contentCamera),(()=>this._setCameraDirty())),o((()=>t.elevationInfo),(e=>this._elevationInfoChanged(e))),o((()=>t.effectiveScaleRange),(()=>this._scaleBoundsChanged())),o((()=>e.lodFactor),(()=>this._setCameraDirty())),o((()=>e.availableFields),(()=>this._requiredFieldsChange())),o((()=>e.holeFilling),(e=>null!=this._index&&(this._index.holeFilling=e)))]),this._updateScaleHandles(),this._viewportQueries=new I(this.crsIndex,s.renderCoordsHelper,s.state.contentCamera,!s.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?s.basemapTerrain:s.elevationProvider,y(s.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new x(this.layer.uid,this.crsIndex,s.renderCoordsHelper.spatialReference,this.layerView.view.resourceController.memoryController),this._index=new b(t,i,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,j,e.holeFilling,(t=>e.isNodeLoaded(t)),(t=>e.isNodeReloading(t)),(e=>this._shouldLoadNode(e)),(e=>this._enableFromGPUCache(e,w.Leaf)),(e=>this._needsUpdate(e)),(()=>!this.indexStreamController.busy),(t=>e.computeVisibilityObb?e.computeVisibilityObb(t):null),e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),null!=a){for(const e of a)this._addMesh(e.mesh,e.oid);this.addHandles(a.on("change",(e=>{for(const t of e.removed)this._removeMesh(t.oid);for(const t of e.added)this._addMesh(t.mesh,t.oid)})))}this._startNodeLoading()}))),this._tmpPoint=m(0,0,0,this.crsIndex)}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;null!=t&&i?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll((e=>{const i=t.getNode(e);null!=i&&this._modificationsNodeFilteringArray.push(i)})),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._handles.destroy(),this._nodeLoader=null,K.prune(),null!=W&&(W.hide(),W=null)}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map((i=>{const s=$(e,i),a=$(t,i);return s>=0&&a>=0?{index:s,name:t[a].name,field:t[a],attributeStorageInfo:e[s]}:null})).filter((e=>null!=e&&e.name!==i))}_requiredFieldsChange(){const e=this._getRequiredAttributes();X(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=c();F(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){null!=this._viewportQueries&&(this._viewportQueries.setPointOfInterest(e),null!=this._index&&(this._index.progressiveLoadPenalty=J.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),null!=this._viewportQueries&&null!=this._index&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_addMesh(e,t){if(null==this._index)return;const i=this._clientNodeLoader.createMeshNodeInfo(e,t),s=this._index.addClientNodeToIndex(i.id,i.mbs);this._clientNodeLoader.addMeshNode(s,i),this._evaluateUpdating(),this.notifyChange("rootNodeVisible")}_removeMesh(e){const t=this._clientNodeLoader.getMeshNodeIndex(e);if(null==this._index||null==t)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const e=(e,t)=>{this.layerView.removeNode(t),this._loadedNodeScales.delete(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&null!=e&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},i=(e,t,i)=>{this._clientNodeLoader.updateNodeIndex(e,t,i),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,i)};this._index.removeClientNodeFromIndex(t,e,i),this.notifyChange("rootNodeVisible")}}updateElevationChanged(e,t){const i=this._index;if(null==i||null==i.rootNode||null==t)return null;this.crsIndex.equals(t)||(_(e,t,Y,this.crsIndex),e=Y);const s=this._elevationUpdateNodes;return s.clear(),V(e,i.rootNode,i,(e=>s.push(e.index))),s.length&&(s.forAll((e=>i.updateElevationChanged(e))),this._setCameraDirty()),s}removeAllGeometryObbs(){null!=this._index&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return null!=this._viewportQueries?this._viewportQueries.getRenderMbs(e):null}_elevationInfoChanged(e){null!=this._index&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}_updateScaleHandles(){const e="scale-bounds";this._handles.remove(e),this._areScaleBoundsActive&&this._handles.add(this.layerView.view.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),e)}_scaleBoundsChanged(){this._areScaleBoundsActive||this._loadedNodeScales.clear(),this._updateScaleHandles(),this._setCameraDirty()}_scaleUpdateHandler(e){this._updateScaleInBoundingRect(e.extent,e.spatialReference),this._setCameraDirty()}_updateScaleInBoundingRect(e,t){const i=this._index;if(null==i)return;null!=i.rootNode&&_(e,t,Y,this.crsIndex)&&this._loadedNodeScales.forEach(((e,t)=>{const s=i.getNode(t);null!=s&&p(Y,s.mbs)&&this._loadedNodeScales.set(t,this._computeScale(s))}))}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(e,t){return this._idleQueue.push(e,t)}reschedule(e,t){return this._idleQueue.unshift(e,t)}get _isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get _areScaleBoundsActive(){const{minScale:e,maxScale:t}=U(this.layer);return this.scaleVisibilityEnabled&&(e>0||t>0)}get unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(e,t){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadNodeData(e,t)}get indexDepth(){return null!=this._index?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData||(this._disableMemCache=!0),this._disableMemCache=e}runTask(e,t){return this.layerView.contentVisible?this.layerView.visible&&null!=this._index?(this._processWithErrorLogging(e,t),this._index.maxPriority):-1/0:(this._updateViewData(),this._evaluateUpdating(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(i){this._errorCount<50?j.error("Error during processing: "+i):50===this._errorCount&&j.error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null!=this._nodeLoader&&null!=this._index&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(e.enabled=!1),e.run((()=>this._processIndex(e))),this._updateFeatureLOD(),e.run((()=>this._processCache(e))),this._isIntegratedMesh&&(e.enabled=!0),e.run((()=>this._processNodes(e,t))),this._idleQueue.runTask(e),e.run((()=>this._prefetchIndex())),t.numIndexLoading+=this._index.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run((()=>this._lodHandling.lodGlobalHandling(e))),this._evaluateUpdating())}_processIndex(e){if(null==this._index)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),e,(e=>this.updateNodeModificationStatus(e))),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(null==this._index||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||null==this._index||null==this._viewportQueries)return;const e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.indexMissing>k){if(this._featureLOD<=H)return;this._featureLOD/=B,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=E||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this._lod,a=this._index.checkFeatureTarget(t,s);a!==s&&(this._featureLOD=a/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*R||e&&i.estimate>t))return;if(this._featureLOD<=H)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(E,Math.max(H,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(null==t)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);null!=s&&(!this.layerView.isNodeLoaded(s.index)&&this._isNodeInScaleBounds(s));s=t.getParent(s.index))if(this._enableFromGPUCache(s,w.Hole)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(null==this._index)return!1;let i=(this._isIdle?Q:T)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());null!=t&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const a=this._index.getNode(s.add.back());if(null==a||a.cacheState!==v.Cached&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(a),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach((e=>e.abort())),this._loadingNodes.clear(),this._updatingNodes.forEach((e=>e.abort())),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=T)&&(this._downloadingCount<O&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView){if(this.layerView.contentVisible){const i=(null!=this._index?this._index.indexMissing:0)+3*(null!=this._index?this._index.updates.add.length:0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.running||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||null!=this._index&&this._index.isPrefetching),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}else e=this._cameraDirty,t=e?0:1;this.updating=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||null==this._index||null==this._viewportQueries)return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this.screenSizeFactor=1/(t.perScreenPixelRatio/2),this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=J.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.resourceController.memoryController.memoryFactor<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const e=this.layerView.lodFactor,t=this.layerView.view.resourceController.memoryController.memoryFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*t}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;const e=this.layerView.view.resourceController.memoryController;return(Math.min(e.memoryFactor,.5)-e.minQuality)/(.5-e.minQuality)}isGeometryVisible(e){return null!=this._index&&this._index.isGeometryVisible(e.index)}updateVisibility(e){null!=this._index&&this._index.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){null!=this._index&&this._index.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){null!=this._index&&this._index.invalidateVisibilityObbs()}modificationsChanged(){null!=this._index&&this._index.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&(!(null==this._index||!this._index.isGeometryVisible(e.index))&&this._isNodeInScaleBounds(e))}_shouldDropNode(e){if(null==this._viewportQueries)return!1;const t=this._lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||null==e||null==this._viewportQueries)return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,uncompressedTextureDownsamplingEnabled:this.layerView.uncompressedTextureDownsamplingEnabled,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new C(this.layer,this.dataStreamController,j,this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e=>this._isNodeInScaleBounds(e)),((e,t)=>this._removeNodes(e,t,Z.fadeout)),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(e){const t=this._index;if(null==t||null==this._viewportQueries)return!1;K.clear(),this.layerView.getLoadedNodeIndices(K);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return K.filterInPlace((e=>{const i=t.getNode(e);return null==i||!t.isGeometryVisible(e)||s(i)||!this._isNodeInScaleBounds(i)})),K.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(K,e,Z.pop),!(i&&this._lodDropFactor<1)&&(0===K.length||(K.clear(),!1))}markNodeToRemove(e){K.push(e)}removeMarkedNodes(){this._removeNodes(K,G,Z.pop)}_removeNodes(e,t,i){const s=e.length;if(0!==s&&!t.done){for(null!=this._index&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),a=this._index;i===Z.fadeout&&this.layerView.nodeFadeoutEnabled&&null!=a&&a.isGeometryVisible(s)?this.layerView.fadeNode(s,A.FadeOut,!0):this.layerView.removeNode(s),t.madeProgress()}if(this._loadedNodeScales.size>0)for(let t=e.length;t<s;t++){const i=e.data[t];this._loadedNodeScales.delete(i)}}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}async _updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t),this._evaluateUpdating();try{const i=X(this.layerView.getLoadedAttributes(e.index),this._requiredAttributes);let s=null;s=i?await Promise.resolve(this.layerView.getAttributeData(e.index)):e.index>=0?await this._nodeLoader.loadAttributes(e,this._requiredAttributes,t.signal):{},await this.schedule((()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:s},t.signal)),t.signal)}catch(i){if(!d(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)}this._updatingNodes.delete(e.index),this._evaluateUpdating()}_loadNode(e){if(this._loadingNodes.has(e.index))return void j.error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateUpdating(),this._loadAndAddNode(e,t.signal).then((i=>{i&&null!=this._index&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())})).catch((e=>{if(!d(e))throw e})).finally((()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateUpdating()}))}_loadAndAddNode(e,t){return e.cacheState===v.Uncached?this._loadUncached(e,t).then((()=>!1)):this._loadCached(e,t).then((t=>!t&&(e.cacheState=v.Uncached,!0))).catch((t=>!d(t)&&(e.cacheState=v.Uncached,!0)))}_enableFromGPUCache(e,t){if(this._disableMemCache||null==this._index)return!1;if(t===w.Hole&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e.index);return null!=t&&null!=t.attributeInfo&&X(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){null!=this._index&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateLoadStatus(e,t){const i=this._index;null!=i&&i.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,w.Leaf))return!0;const i=this.layerView;if(this.disableIDBCache||!i.loadCachedNodeData||!i.addCachedNodeData)return!1;const s=(t,i)=>this._nodeLoader.loadTextures(e,t,i),a=(t,i)=>this._clientNodeLoader.loadTextures(e,t,i),r=e.index>=0?s:a,d=await this.schedule((()=>i.loadCachedNodeData(e,t,r)),t);if(null==d)return!1;const o=this._requiredAttributes,n=e.index>=0?await this.reschedule((()=>this._nodeLoader.loadAttributes(e,o,t)),t):null;return await this.reschedule((()=>i.addCachedNodeData(e,d,{loadedAttributes:o,attributeData:n},t)),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).catch((e=>{throw this._downloadingCount--,e})).then((i=>(this._downloadingCount--,this.schedule((()=>this.layerView.addNode(e,i,t)),t)))).then((()=>{this._nodeAdded(),e.cacheState=v.Cached})).catch((t=>{if(!d(t))throw j.error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,null!=this._index&&this._index.requestUpdate(),t}))}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateUpdating(),e&&this._index&&null!=this._index&&this._index.resetFailedNodes())}_getScale(e){if(this._loadedNodeScales.has(e.index))return this._loadedNodeScales.get(e.index);const t=this._computeScale(e);return this.layerView.isNodeLoaded(e.index)&&this._loadedNodeScales.set(e.index,t),t}_computeScale(e){this._tmpPoint.x=e.mbs[0],this._tmpPoint.y=e.mbs[1],this._tmpPoint.z=e.mbs[2];const t=e.mbs[3];return this.layerView.view.basemapTerrain.getSphereScale(this._tmpPoint,t)}_isNodeInScaleBounds(e){if(!this._areScaleBoundsActive)return!0;const t=this._getScale(e),{minScale:i,maxScale:s}=U(this.layer);return P(t,i,s)}updateStats(e){e.index=null!=this._index?this._index.size:0,this.isGraphics3D&&(e.detail=this._featureLOD,e.target=this.featureTarget*this._baseLOD),null!=this._index&&this._index.updateStats(e)}get test(){const e=this;return{index:this._index,set disableUpdates(t){e._updatesDisabled=t,t?e.cancelNodeLoading():e.requestUpdate()},set disableIDBCache(t){e.disableIDBCache=t},set ignoreServiceObb(t){null!=e._index&&(e._index.ignoreServiceObb=t)},shouldLoadNode:t=>e._shouldLoadNode(t)}}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),null!=this._index&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;null!=t&&t.layerFilterChanged(e),this._setCameraDirty()}};e([h({readOnly:!0})],z.prototype,"isMeshPyramid",null),e([h({readOnly:!0})],z.prototype,"isGraphics3D",null),e([h({readOnly:!0})],z.prototype,"useMaximumNumberOfFeatures",null),e([h({readOnly:!0})],z.prototype,"indexStreamController",null),e([h({readOnly:!0})],z.prototype,"dataStreamController",null),e([h({readOnly:!0})],z.prototype,"crsVertex",null),e([h({readOnly:!0})],z.prototype,"crsIndex",null),e([h()],z.prototype,"screenSizeFactor",void 0),e([h()],z.prototype,"featureTarget",void 0),e([h()],z.prototype,"fixedFeatureTarget",void 0),e([h()],z.prototype,"layerView",void 0),e([h()],z.prototype,"layer",null),e([h()],z.prototype,"updating",void 0),e([h({readOnly:!0})],z.prototype,"running",null),e([h()],z.prototype,"updatingProgress",void 0),e([h({readOnly:!0})],z.prototype,"leavesReached",void 0),e([h({constructOnly:!0})],z.prototype,"scaleVisibilityEnabled",void 0),e([h({readOnly:!0,dependsOn:[]})],z.prototype,"rootNodeVisible",null),z=e([u(q)],z);const K=new a({deallocator:null});let W;function X(e,t){return null!=e&&e.length===t.length&&e.every((e=>$(t,e.name)>=0))}function $(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const J={factorIM:.2,factor3dObject:.05,distancePenalty:10},Y=c();var Z;!function(e){e[e.pop=0]="pop",e[e.fadeout=1]="fadeout"}(Z||(Z={}));const ee=z;export{ee as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Handles.js";import has from"../../../core/has.js";import s from"../../../core/Logger.js";import a from"../../../core/PooledArray.js";import{EsriPromiseMixin as r}from"../../../core/Promise.js";import{isAbortError as d}from"../../../core/promiseUtils.js";import{watch as o,initial as n,sync as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingRect as _}from"../../../geometry/projection.js";import{create as c,intersectsSphere as p}from"../../../geometry/support/aaBoundingRect.js";import{makeDehydratedPoint as m}from"../dehydratedFeatures.js";import{PromiseQueue as g}from"../../support/PromiseQueue.js";import{viewingModeFromString as y}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as x}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{addCallback as f}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as b}from"../../../views/3d/layers/i3s/I3SIndex.js";import N from"../../../views/3d/layers/i3s/I3SLodHandling.js";import{NodeState as w,CacheState as v}from"../../../views/3d/layers/i3s/I3SNode.js";import C from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as D}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as L,getIndexCrs as S,findIntersectingNodes as V}from"../../../views/3d/layers/i3s/I3SUtil.js";import I from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{FadeDirection as A}from"../../../views/3d/layers/support/I3SLayerView.js";import{toBoundingRect as F}from"../../../views/3d/support/extentUtils.js";import{ClientType as M,maxDownloadSlots as O}from"../../../views/3d/support/index.js";import{extractSafeScaleBounds as U,scaleBoundsPredicate as P}from"../../../views/support/layerViewUtils.js";import{noBudget as G}from"../../../views/support/Scheduler.js";const q="esri.layers.graphics.controllers.I3SOnDemandController",j=s.getLogger(q),Q=100,T=2,E=1e4,H=1e-4,R=1.2,k=500,B=1.5;let z=class extends(r(t)){get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store?.lodType}get isGraphics3D(){return"points"===this.layer.profile}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(null==this.layer.priority||"High"===this.layer.priority)}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(M.I3S_INDEX);return new D(e,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(M.I3S_DATA);return new D(e,this.layer.apiKey)}get crsVertex(){return L(this.layer)}get crsIndex(){return S(this.layer)}get layer(){return this.layerView.i3slayer}get running(){return this.updating}get rootNodeVisible(){if(null!=this._index){const e=this._index.rootNode;if(null!=e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}constructor(e){super(e),this.screenSizeFactor=0,this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.scaleVisibilityEnabled=!0,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new a({deallocator:null}),this._loadedNodeScales=new Map,this._modificationsNodeFilteringArray=new a,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._handles=new i,this._idleQueue=new g,this._elevationUpdateNodes=new a({deallocator:null}),this._errorCount=0}initialize(){const{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new N(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=has("disable-feature:idb-cache"),"fields"in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then((([i])=>{if(this.destroyed||!e||e.destroyed||!i)return;const{view:s,clientGeometry:a}=e,{resourceController:r}=s;if(this._setClippingArea(s.clippingArea),this.addHandles([o((()=>s?.pointsOfInterest?.focus?.renderLocation),(e=>this._pointOfInterestChanged(e)),n),o((()=>r.memoryController.memoryFactor),(()=>this._setCameraDirty()),l),o((()=>e.contentVisible),(e=>{const t=e?()=>this._updateIdleState(!0):()=>this._updateViewData(),i=e?()=>this._updateIdleState(!1):()=>{};e&&null!=this._index&&this._index.invalidateAllElevationRanges(),this._idleStateCallbacks?(e||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=r.scheduler.registerIdleStateCallbacks(t,i)}),n),f(e.view.resourceController.scheduler,this),o((()=>e.uncompressedTextureDownsamplingEnabled),(()=>this.restartNodeLoading())),o((()=>[this.featureTarget,this.fixedFeatureTarget]),(()=>{this._setCameraDirty(),this._stableFeatureLOD=!1})),o((()=>s.state?.contentCamera),(()=>this._setCameraDirty())),o((()=>t.elevationInfo),(e=>this._elevationInfoChanged(e))),o((()=>t.effectiveScaleRange),(()=>this._scaleBoundsChanged())),o((()=>e.lodFactor),(()=>this._setCameraDirty())),o((()=>e.availableFields),(()=>this._requiredFieldsChange())),o((()=>e.holeFilling),(e=>null!=this._index&&(this._index.holeFilling=e)))]),this._updateScaleHandles(),this._viewportQueries=new I(this.crsIndex,s.renderCoordsHelper,s.state.contentCamera,!s.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?s.basemapTerrain:s.elevationProvider,y(s.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new x(this.layer.uid,this.crsIndex,s.renderCoordsHelper.spatialReference,this.layerView.view.resourceController.memoryController),this._index=new b(t,i,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,j,e.holeFilling,(t=>e.isNodeLoaded(t)),(t=>e.isNodeReloading(t)),(e=>this._shouldLoadNode(e)),(e=>this._enableFromGPUCache(e,w.Leaf)),(e=>this._needsUpdate(e)),(()=>!this.indexStreamController.busy),(t=>e.computeVisibilityObb?e.computeVisibilityObb(t):null),e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),null!=a){for(const e of a)this._addMesh(e.mesh,e.oid);this.addHandles(a.on("change",(e=>{for(const t of e.removed)this._removeMesh(t.oid);for(const t of e.added)this._addMesh(t.mesh,t.oid)})))}this._startNodeLoading()}))),this._tmpPoint=m(0,0,0,this.crsIndex)}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;null!=t&&i?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll((e=>{const i=t.getNode(e);null!=i&&this._modificationsNodeFilteringArray.push(i)})),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._handles.destroy(),this._nodeLoader=null,K.prune(),null!=W&&(W.hide(),W=null)}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map((i=>{const s=$(e,i),a=$(t,i);return s>=0&&a>=0?{index:s,name:t[a].name,field:t[a],attributeStorageInfo:e[s]}:null})).filter((e=>null!=e&&e.name!==i))}_requiredFieldsChange(){const e=this._getRequiredAttributes();X(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=c();F(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){null!=this._viewportQueries&&(this._viewportQueries.setPointOfInterest(e),null!=this._index&&(this._index.progressiveLoadPenalty=J.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),null!=this._viewportQueries&&null!=this._index&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_addMesh(e,t){if(null==this._index)return;const i=this._clientNodeLoader.createMeshNodeInfo(e,t),s=this._index.addClientNodeToIndex(i.id,i.mbs);this._clientNodeLoader.addMeshNode(s,i),this._evaluateUpdating(),this.notifyChange("rootNodeVisible")}_removeMesh(e){const t=this._clientNodeLoader.getMeshNodeIndex(e);if(null==this._index||null==t)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const e=(e,t)=>{this.layerView.removeNode(t),this._loadedNodeScales.delete(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&null!=e&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},i=(e,t,i)=>{this._clientNodeLoader.updateNodeIndex(e,t,i),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,i)};this._index.removeClientNodeFromIndex(t,e,i),this.notifyChange("rootNodeVisible")}}updateElevationChanged(e,t){const i=this._index;if(null==i||null==i.rootNode||null==t)return null;this.crsIndex.equals(t)||(_(e,t,Y,this.crsIndex),e=Y);const s=this._elevationUpdateNodes;return s.clear(),V(e,i.rootNode,i,(e=>s.push(e.index))),s.length&&(s.forAll((e=>i.updateElevationChanged(e))),this._setCameraDirty()),s}removeAllGeometryObbs(){null!=this._index&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return null!=this._viewportQueries?this._viewportQueries.getRenderMbs(e):null}_elevationInfoChanged(e){null!=this._index&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}_updateScaleHandles(){const e="scale-bounds";this._handles.remove(e),this._areScaleBoundsActive&&this._handles.add(this.layerView.view.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),e)}_scaleBoundsChanged(){this._areScaleBoundsActive||this._loadedNodeScales.clear(),this._updateScaleHandles(),this._setCameraDirty()}_scaleUpdateHandler(e){this._updateScaleInBoundingRect(e.extent,e.spatialReference),this._setCameraDirty()}_updateScaleInBoundingRect(e,t){const i=this._index;if(null==i)return;null!=i.rootNode&&_(e,t,Y,this.crsIndex)&&this._loadedNodeScales.forEach(((e,t)=>{const s=i.getNode(t);null!=s&&p(Y,s.mbs)&&this._loadedNodeScales.set(t,this._computeScale(s))}))}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(e,t){return this._idleQueue.push(e,t)}reschedule(e,t){return this._idleQueue.unshift(e,t)}get _isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get _areScaleBoundsActive(){const{minScale:e,maxScale:t}=U(this.layer);return this.scaleVisibilityEnabled&&(e>0||t>0)}get unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(e,t){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadNodeData(e,t)}async _loadAttributes(e,t,i){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,i)}get indexDepth(){return null!=this._index?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData||(this._disableMemCache=!0),this._disableMemCache=e}runTask(e,t){return this.layerView.contentVisible?this.layerView.visible&&null!=this._index?(this._processWithErrorLogging(e,t),this._index.maxPriority):-1/0:(this._updateViewData(),this._evaluateUpdating(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(i){this._errorCount<50?j.error("Error during processing: "+i):50===this._errorCount&&j.error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null!=this._nodeLoader&&null!=this._index&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(e.enabled=!1),e.run((()=>this._processIndex(e))),this._updateFeatureLOD(),e.run((()=>this._processCache(e))),this._isIntegratedMesh&&(e.enabled=!0),e.run((()=>this._processNodes(e,t))),this._idleQueue.runTask(e),e.run((()=>this._prefetchIndex())),t.numIndexLoading+=this._index.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run((()=>this._lodHandling.lodGlobalHandling(e))),this._evaluateUpdating())}_processIndex(e){if(null==this._index)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),e,(e=>this.updateNodeModificationStatus(e))),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(null==this._index||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||null==this._index||null==this._viewportQueries)return;const e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.indexMissing>k){if(this._featureLOD<=H)return;this._featureLOD/=B,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=E||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this._lod,a=this._index.checkFeatureTarget(t,s);a!==s&&(this._featureLOD=a/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*R||e&&i.estimate>t))return;if(this._featureLOD<=H)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(E,Math.max(H,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(null==t)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);null!=s&&(!this.layerView.isNodeLoaded(s.index)&&this._isNodeInScaleBounds(s));s=t.getParent(s.index))if(this._enableFromGPUCache(s,w.Hole)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(null==this._index)return!1;let i=(this._isIdle?Q:T)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());null!=t&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const a=this._index.getNode(s.add.back());if(null==a||a.cacheState!==v.Cached&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(a),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach((e=>e.abort())),this._loadingNodes.clear(),this._updatingNodes.forEach((e=>e.abort())),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=T)&&(this._downloadingCount<O&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView){if(this.layerView.contentVisible){const i=(null!=this._index?this._index.indexMissing:0)+3*(null!=this._index?this._index.updates.add.length:0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.running||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||null!=this._index&&this._index.isPrefetching),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}else e=this._cameraDirty,t=e?0:1;this.updating=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||null==this._index||null==this._viewportQueries)return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this.screenSizeFactor=1/(t.perScreenPixelRatio/2),this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=J.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.resourceController.memoryController.memoryFactor<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const e=this.layerView.lodFactor,t=this.layerView.view.resourceController.memoryController.memoryFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*t}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;const e=this.layerView.view.resourceController.memoryController;return(Math.min(e.memoryFactor,.5)-e.minQuality)/(.5-e.minQuality)}isGeometryVisible(e){return null!=this._index&&this._index.isGeometryVisible(e.index)}updateVisibility(e){null!=this._index&&this._index.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){null!=this._index&&this._index.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){null!=this._index&&this._index.invalidateVisibilityObbs()}modificationsChanged(){null!=this._index&&this._index.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&(!(null==this._index||!this._index.isGeometryVisible(e.index))&&this._isNodeInScaleBounds(e))}_shouldDropNode(e){if(null==this._viewportQueries)return!1;const t=this._lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||null==e||null==this._viewportQueries)return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,uncompressedTextureDownsamplingEnabled:this.layerView.uncompressedTextureDownsamplingEnabled,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new C(this.layer,this.dataStreamController,j,this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e=>this._isNodeInScaleBounds(e)),((e,t)=>this._removeNodes(e,t,Z.fadeout)),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(e){const t=this._index;if(null==t||null==this._viewportQueries)return!1;K.clear(),this.layerView.getLoadedNodeIndices(K);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return K.filterInPlace((e=>{const i=t.getNode(e);return null==i||!t.isGeometryVisible(e)||s(i)||!this._isNodeInScaleBounds(i)})),K.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(K,e,Z.pop),!(i&&this._lodDropFactor<1)&&(0===K.length||(K.clear(),!1))}markNodeToRemove(e){K.push(e)}removeMarkedNodes(){this._removeNodes(K,G,Z.pop)}_removeNodes(e,t,i){const s=e.length;if(0!==s&&!t.done){for(null!=this._index&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),a=this._index;i===Z.fadeout&&this.layerView.nodeFadeoutEnabled&&null!=a&&a.isGeometryVisible(s)?this.layerView.fadeNode(s,A.FadeOut,!0):this.layerView.removeNode(s),t.madeProgress()}if(this._loadedNodeScales.size>0)for(let t=e.length;t<s;t++){const i=e.data[t];this._loadedNodeScales.delete(i)}}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}async _updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t),this._evaluateUpdating();try{const i=X(this.layerView.getLoadedAttributes(e.index),this._requiredAttributes);let s=null;s=i?await Promise.resolve(this.layerView.getAttributeData(e.index)):await this._loadAttributes(e,this._requiredAttributes,t.signal),await this.schedule((()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:s},t.signal)),t.signal)}catch(i){if(!d(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)}this._updatingNodes.delete(e.index),this._evaluateUpdating()}_loadNode(e){if(this._loadingNodes.has(e.index))return void j.error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateUpdating(),this._loadAndAddNode(e,t.signal).then((i=>{i&&null!=this._index&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())})).catch((e=>{if(!d(e))throw e})).finally((()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateUpdating()}))}_loadAndAddNode(e,t){return e.cacheState===v.Uncached?this._loadUncached(e,t).then((()=>!1)):this._loadCached(e,t).then((t=>!t&&(e.cacheState=v.Uncached,!0))).catch((t=>!d(t)&&(e.cacheState=v.Uncached,!0)))}_enableFromGPUCache(e,t){if(this._disableMemCache||null==this._index)return!1;if(t===w.Hole&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e.index);return null!=t&&null!=t.attributeInfo&&X(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){null!=this._index&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateLoadStatus(e,t){const i=this._index;null!=i&&i.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,w.Leaf))return!0;const i=this.layerView;if(this.disableIDBCache||!i.loadCachedNodeData||!i.addCachedNodeData)return!1;const s=(t,i)=>this._nodeLoader.loadTextures(e,t,i),a=(t,i)=>this._clientNodeLoader.loadTextures(e,t,i),r=e.index>=0?s:a,d=await this.schedule((()=>i.loadCachedNodeData(e,t,r)),t);if(null==d)return!1;const o=this._requiredAttributes,n=await this.reschedule((()=>this._loadAttributes(e,o,t)),t);return await this.reschedule((()=>i.addCachedNodeData(e,d,{loadedAttributes:o,attributeData:n},t)),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).catch((e=>{throw this._downloadingCount--,e})).then((i=>(this._downloadingCount--,this.schedule((()=>this.layerView.addNode(e,i,t)),t)))).then((()=>{this._nodeAdded(),e.cacheState=v.Cached})).catch((t=>{if(!d(t))throw j.error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,null!=this._index&&this._index.requestUpdate(),t}))}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateUpdating(),e&&this._index&&null!=this._index&&this._index.resetFailedNodes())}_getScale(e){if(this._loadedNodeScales.has(e.index))return this._loadedNodeScales.get(e.index);const t=this._computeScale(e);return this.layerView.isNodeLoaded(e.index)&&this._loadedNodeScales.set(e.index,t),t}_computeScale(e){this._tmpPoint.x=e.mbs[0],this._tmpPoint.y=e.mbs[1],this._tmpPoint.z=e.mbs[2];const t=e.mbs[3];return this.layerView.view.basemapTerrain.getSphereScale(this._tmpPoint,t)}_isNodeInScaleBounds(e){if(!this._areScaleBoundsActive)return!0;const t=this._getScale(e),{minScale:i,maxScale:s}=U(this.layer);return P(t,i,s)}updateStats(e){e.index=null!=this._index?this._index.size:0,this.isGraphics3D&&(e.detail=this._featureLOD,e.target=this.featureTarget*this._baseLOD),null!=this._index&&this._index.updateStats(e)}get test(){const e=this;return{index:this._index,set disableUpdates(t){e._updatesDisabled=t,t?e.cancelNodeLoading():e.requestUpdate()},set disableIDBCache(t){e.disableIDBCache=t},set ignoreServiceObb(t){null!=e._index&&(e._index.ignoreServiceObb=t)},shouldLoadNode:t=>e._shouldLoadNode(t)}}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),null!=this._index&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;null!=t&&t.layerFilterChanged(e),this._setCameraDirty()}};e([h({readOnly:!0})],z.prototype,"isMeshPyramid",null),e([h({readOnly:!0})],z.prototype,"isGraphics3D",null),e([h({readOnly:!0})],z.prototype,"useMaximumNumberOfFeatures",null),e([h({readOnly:!0})],z.prototype,"indexStreamController",null),e([h({readOnly:!0})],z.prototype,"dataStreamController",null),e([h({readOnly:!0})],z.prototype,"crsVertex",null),e([h({readOnly:!0})],z.prototype,"crsIndex",null),e([h()],z.prototype,"screenSizeFactor",void 0),e([h()],z.prototype,"featureTarget",void 0),e([h()],z.prototype,"fixedFeatureTarget",void 0),e([h()],z.prototype,"layerView",void 0),e([h()],z.prototype,"layer",null),e([h()],z.prototype,"updating",void 0),e([h({readOnly:!0})],z.prototype,"running",null),e([h()],z.prototype,"updatingProgress",void 0),e([h({readOnly:!0})],z.prototype,"leavesReached",void 0),e([h({constructOnly:!0})],z.prototype,"scaleVisibilityEnabled",void 0),e([h({readOnly:!0,dependsOn:[]})],z.prototype,"rootNodeVisible",null),z=e([u(q)],z);const K=new a({deallocator:null});let W;function X(e,t){return null!=e&&e.length===t.length&&e.every((e=>$(t,e.name)>=0))}function $(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const J={factorIM:.2,factor3dObject:.05,distancePenalty:10},Y=c();var Z;!function(e){e[e.pop=0]="pop",e[e.fadeout=1]="fadeout"}(Z||(Z={}));const ee=z;export{ee 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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{PositionHint as e,indexOf as t}from"../../../core/arrayUtils.js";import i from"../../../core/Error.js";import{clone as s}from"../../../core/lang.js";import{removeMaybe as r,destroyMaybe as a}from"../../../core/maybe.js";import{MemCacheStorage as n,MemCache as u}from"../../../core/MemCache.js";import{throwIfAborted as o}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as l}from"../../../core/unitUtils.js";import{set as c,NEGATIVE_INFINITY as h,create as p,expandWithAABB as m}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as f,create as d}from"../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as y}from"../../../geometry/support/boundsUtils.js";import{fromJSON as g,isExtent as _,isPolygon as x}from"../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as w}from"../../../geometry/support/normalizeUtils.js";import{equals as S,isValid as F}from"../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as R}from"../featureConversionUtils.js";import{getWhereClause as Q,validateFields as I,validateFieldTypes as j,validateWhere as E,validateHaving as A,validNumericTypesKebabDict as b,validDateTypesKebabDict as C,hasInvalidFieldType as P}from"./attributeSupport.js";import{checkProjectionSupport as T,project as B,projectMany as k}from"./projectionSupport.js";import{queryCapabilities as q}from"./QueryEngineCapabilities.js";import{QueryEngineResult as v}from"./QueryEngineResult.js";import{getSpatialQueryOperator as z,canQueryWithRBush as O,checkSpatialQuerySupport as G}from"./spatialQuerySupport.js";import{getTimeExtent as M,getTimeOperator as U}from"./timeSupport.js";import{QUERY_ENGINE_EMPTY_RESULT as N,cleanFromGeometryEngine as Z,normalizeQuery as V,getGeometry as H}from"./utils.js";import L from"../../support/FieldsIndex.js";import{loadArcade as D}from"../../../support/arcadeOnDemand.js";import{noBudget as J}from"../../../views/support/Scheduler.js";function W(e){return null!=e&&e.every((e=>"exceedslimit"!==e.statisticType))}const $="feature-store:unsupported-query";class K{constructor(e,t=null,i,s,r){this.attributes=e,this.geometry=i,this.centroid=s,this.filterFlags=r,this.groupId=-1,this.displayId=t}}const X=new n(2e6);let Y=0;class ee{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:q},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",(()=>this.clearCache())),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new u(Y+++"$$",X)),this.fieldsIndex=new L(e.fields),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=r(this._frameTask),this.clearCache(),a(this._geometryQueryCache),this._changeHandle=r(this._changeHandle),a(this.fieldsIndex)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null}async executeQuery(e,t){try{return(await this._executeQuery(e,{},t)).createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},t)).createQueryResponseForCount()}catch(i){if(i!==N)throw i;return 0}}async executeQueryForExtent(e,t){const i=e.outSR;try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),r=s.size;if(!r)return{count:0,extent:null};return{count:r,extent:await this._getBounds(s.items,s.spatialReference,i||this.spatialReference)}}catch(s){if(s===N)return{count:0,extent:null};throw s}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then((e=>Array.from(e)))}async executeQueryForIdSet(e,t){try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),s=i.items,r=new Set;return await this._reschedule((()=>{for(const e of s)r.add(i.featureAdapter.getObjectId(e))}),t),r}catch(i){if(i===N)return new Set;throw i}}async executeQueryForSnapping(e,t){const{point:i,distance:s,returnEdge:r,returnVertex:a}=e;if(!r&&!a)return{candidates:[]};const n=await this._reschedule((()=>this._checkQuerySupport(e.query)),t),u=!S(i.spatialReference,this.spatialReference);u&&await T(i.spatialReference,this.spatialReference);const o="number"==typeof s?s:s.x,l="number"==typeof s?s:s.y,c={xmin:i.x-o,xmax:i.x+o,ymin:i.y-l,ymax:i.y+l,spatialReference:i.spatialReference},h=u?B(c,this.spatialReference):c;if(!h)return{candidates:[]};const p=(await w(g(i),null,{signal:t}))[0],m=(await w(g(h),null,{signal:t}))[0];if(null==p||null==m)return{candidates:[]};const f=new v(await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(m.toJSON()))),t),n,this);await this._reschedule((()=>this._executeObjectIdsQuery(f)),t),await this._reschedule((()=>this._executeTimeQuery(f)),t),await this._reschedule((()=>this._executeAttributesQuery(f)),t);const d=p.toJSON(),y=u?B(d,this.spatialReference):d,_=u?Math.max(h.xmax-h.xmin,h.ymax-h.ymin)/2:s;return f.createSnappingResponse({...e,point:y,distance:_},i.spatialReference)}async executeQueryForLatestObservations(e,t){if(!this.timeInfo||!this.timeInfo.trackIdField)throw new i($,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const i=await this._executeQuery(e,{},t);return await this._reschedule((()=>this._filterLatest(i)),t),i.createQueryResponse()}catch(s){if(s!==N)throw s;return new v([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,i){const{field:s,normalizationField:r,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:s,normalizationField:r,valueExpression:a},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,i){const{field:s,field2:r,field3:a,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:s,field2:r,field3:a,valueExpression:n},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,i){const{field:s,normalizationField:r,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:s,normalizationField:r,valueExpression:a},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,i){const{field:s,normalizationField:r,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:s,normalizationField:r,valueExpression:a},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const[t,i]=await Promise.all(["getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getBounds(await this._getAllFeatures(),this.spatialReference,this.spatialReference),null!=this._timeExtentPromise?this._timeExtentPromise:this._timeExtentPromise=M(this.timeInfo,this.featureStore)]);return o(e),{fullExtent:t,timeExtent:i}}async _getBounds(e,t,i){const s=c(p(),h);await this.featureStore.forEachBounds(e,(e=>m(s,e)));const r={xmin:s[0],ymin:s[1],xmax:s[3],ymax:s[4],spatialReference:Z(this.spatialReference)};this.hasZ&&isFinite(s[2])&&isFinite(s[5])&&(r.zmin=s[2],r.zmax=s[5]);const a=B(r,t,i);if(a.spatialReference=Z(i),a.xmax-a.xmin==0){const e=l(a.spatialReference);a.xmin-=e,a.xmax+=e}if(a.ymax-a.ymin==0){const e=l(a.spatialReference);a.ymin-=e,a.ymax+=e}if(this.hasZ&&null!=a.zmin&&null!=a.zmax&&a.zmax-a.zmin==0){const e=l(a.spatialReference);a.zmin-=e,a.zmax+=e}return a}async _schedule(e,t){return null!=this._frameTask?this._frameTask.schedule(e,t):e(J)}async _reschedule(e,t){return null!=this._frameTask?this._frameTask.reschedule(e,t):e(J)}async _getAllFeaturesQueryEngineResult(e){return new v(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach((t=>e.push(t)))})().then((()=>e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,i){e=s(e),e=await this._schedule((()=>V(e,this.definitionExpression,this.spatialReference)),i),e=await this._reschedule((()=>this._checkQuerySupport(e)),i),e={...e,...t};const r=await this._reschedule((()=>this._executeSceneFilterQuery(e,i)),i),a=await this._reschedule((()=>this._executeGeometryQuery(e,r,i)),i);return await this._reschedule((()=>this._executeAggregateIdsQuery(a)),i),await this._reschedule((()=>this._executeObjectIdsQuery(a)),i),await this._reschedule((()=>this._executeTimeQuery(a)),i),await this._reschedule((()=>this._executeAttributesQuery(a)),i),a}async _executeSceneFilterQuery(e,t){if(null==e.sceneFilter)return null;const{outSR:i,returnGeometry:s,returnCentroid:r}=e,a=this.featureStore.featureSpatialReference,n=e.sceneFilter.geometry,u=null==a||S(a,n.spatialReference)?n:B(n,a);if(!u)return null;const o=s||r,l=F(i)&&!S(this.spatialReference,i)&&o?async e=>this._project(e,i):e=>e,c=this.featureAdapter,h=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(u))),t);if("disjoint"===e.sceneFilter.spatialRelationship){if(!h.length)return null;const i=new Set;for(const e of h)i.add(c.getObjectId(e));const s=await this._reschedule((()=>this._getAllFeatures()),t),r=await this._reschedule((async()=>{const r=await z("esriSpatialRelDisjoint",u,this.geometryType,this.hasZ,this.hasM),a=e=>!i.has(c.getObjectId(e))||r(c.getGeometry(e)),n=await this._runSpatialFilter(s,a,t);return new v(n,e,this)}),t);return l(r)}if(!h.length)return new v([],e,this);if(this._canExecuteSinglePass(u,e))return l(new v(h,e,this));const p=await z("esriSpatialRelContains",u,this.geometryType,this.hasZ,this.hasM),m=await this._runSpatialFilter(h,(e=>p(c.getGeometry(e))),t);return l(new v(m,e,this))}async _executeGeometryQuery(i,s,r){if(null!=s&&0===s.items.length)return s;i=null!=s?s.query:i;const{geometry:a,outSR:n,spatialRel:u,returnGeometry:o,returnCentroid:l}=i,c=this.featureStore.featureSpatialReference,h=!a||null==c||S(c,a.spatialReference)?a:B(a,c),p=o||l,m=F(n)&&!S(this.spatialReference,n),f=this._geometryQueryCache&&null==s?m&&p?JSON.stringify({originalFilterGeometry:a,spatialRelationship:u,outSpatialReference:n}):JSON.stringify({originalFilterGeometry:a,spatialRelationship:u}):null,d=f?this._geometryQueryCache.get(f):null;if(null!=d)return new v(d,i,this);const y=async e=>(m&&p&&await this._project(e,n),f&&this._geometryQueryCache.put(f,e.items,e.items.length+1),e);if(!h)return y(null!=s?s:await this._getAllFeaturesQueryEngineResult(i));const g=this.featureAdapter;let _=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(a))),r);if("esriSpatialRelDisjoint"===u){if(!_.length)return y(null!=s?s:await this._getAllFeaturesQueryEngineResult(i));const e=new Set;for(const i of _)e.add(g.getObjectId(i));const t=null!=s?s.items:await this._reschedule((()=>this._getAllFeatures()),r),a=await this._reschedule((async()=>{const s=await z(u,h,this.geometryType,this.hasZ,this.hasM),a=t=>!e.has(g.getObjectId(t))||s(g.getGeometry(t)),n=await this._runSpatialFilter(t,a,r);return new v(n,i,this)}),r);return y(a)}if(null!=s){const i=new e;_=_.filter((e=>t(s.items,e,s.items.length,i)>=0))}if(!_.length){const e=new v([],i,this);return f&&this._geometryQueryCache.put(f,e.items,1),e}if(this._canExecuteSinglePass(h,i))return y(new v(_,i,this));const x=await z(u,h,this.geometryType,this.hasZ,this.hasM),w=await this._runSpatialFilter(_,(e=>x(g.getGeometry(e))),r);return y(new v(w,i,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds||!e.query.aggregateIds.length||null==this.aggregateAdapter)return;const t=new Set;for(const s of e.query.aggregateIds){this.aggregateAdapter.getFeatureObjectIds(s).forEach((e=>t.add(e)))}const i=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(i(e))))}_executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds||!e.query.objectIds.length)return;const t=new Set(e.query.objectIds),i=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(i(e))))}_executeTimeQuery(e){if(0===e.items.length)return;const t=U(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(0===e.items.length)return;const t=Q(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter((e=>t.testFeature(e,this.featureAdapter)))}}async _runSpatialFilter(e,t,i){if(!t)return e;if(null==this._frameTask)return e.filter((e=>t(e)));let s=0;const r=new Array,a=async n=>{for(;s<e.length;){const u=e[s++];t(u)&&(r.push(u),n.madeProgress()),n.done&&await this._reschedule((e=>a(e)),i)}};return this._reschedule((e=>a(e)),i).then((()=>r))}_filterLatest(e){const{trackIdField:t,startTimeField:i,endTimeField:s}=this.timeInfo,r=s||i,a=new Map,n=this.featureAdapter.getAttribute;for(const u of e.items){const e=n(u,t),i=n(u,r),s=a.get(e);(!s||i>n(s,r))&&a.set(e,u)}e.items=Array.from(a.values())}_canExecuteSinglePass(e,t){const{spatialRel:i}=t;return O(e)&&("esriSpatialRelEnvelopeIntersects"===i||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===i||"esriSpatialRelContains"===i||"esriSpatialRelWithin"===i))}async _project(e,t){if(!t||S(this.spatialReference,t))return e;const i=this.featureAdapter,s=await k(e.items.map((e=>H(this.geometryType,this.hasZ,this.hasM,i.getGeometry(e)))),this.spatialReference,t);return e.items=s.map(((t,s)=>i.cloneWithGeometry(e.items[s],R(t,this.hasZ,this.hasM)))),e}_getQueryBBoxes(e){if(O(e)){if(_(e))return[f(e.xmin,e.ymin,e.xmax,e.ymax)];if(x(e))return e.rings.map((e=>f(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1]))))}return[y(d(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map((e=>this.featureStore.forEachInBounds(e,(e=>t.add(e))))));const i=Array.from(t.values());return t.clear(),i}async _checkStatisticsSupport(e,t){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new i($,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),Promise.all([this._checkStatisticsParamsSupport(t),G(e,this.geometryType,this.spatialReference),T(this.spatialReference,e.outSR)]).then((()=>e))}async _checkStatisticsParamsSupport(e){let t=[];if(e.valueExpression){const{arcadeUtils:i}=await D();t=i.extractFieldNames(e.valueExpression)}if(e.field&&t.push(e.field),e.field2&&t.push(e.field2),e.field3&&t.push(e.field3),e.normalizationField&&t.push(e.normalizationField),!t.length&&!e.valueExpression)throw new i($,"field or valueExpression is required",{params:e});I(this.fieldsIndex,t,{errorMessage:"Cannot calculate statistics for missing fields"}),j(this.fieldsIndex,t,{expressionName:"statistics"})}async _checkQuerySupport(e){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new i($,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),this._checkStatisticsQuerySupport(e),Promise.all([G(e,this.geometryType,this.spatialReference),T(this.spatialReference,e.outSR)]).then((()=>e))}_checkAttributesQuerySupport(e){const{outFields:t,orderByFields:s,returnDistinctValues:r,outStatistics:a}=e,n=a?a.map((e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase())).filter(Boolean):[];if(s&&s.length>0){const e=" asc",t=" desc",i=s.map((i=>{const s=i.toLowerCase();return s.includes(e)?s.split(e)[0]:s.includes(t)?s.split(t)[0]:i})).filter((e=>!n.includes(e)));I(this.fieldsIndex,i,{expressionName:"orderByFields"})}if(t&&t.length>0)I(this.fieldsIndex,t,{expressionName:"outFields"});else if(r)throw new i($,"outFields should be specified for returnDistinctValues",{query:e});E(this.fieldsIndex,e.where)}_checkStatisticsQuerySupport(e){const{outStatistics:t,groupByFieldsForStatistics:s,having:r}=e,a=s&&s.length,n=t&&t.length;if(r){if(!a||!n)throw new i($,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:e});A(this.fieldsIndex,r,t)}if(n){if(!W(t))return;const r=t.map((e=>e.onStatisticField)).filter(Boolean);I(this.fieldsIndex,r,{expressionName:"onStatisticFields"}),a&&I(this.fieldsIndex,s,{expressionName:"groupByFieldsForStatistics"});const n=new Set([...b.jsonValues,...C.jsonValues]),u=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...b.apiValues,...C.apiValues]);for(const s of t){const{onStatisticField:t,statisticType:r}=s;if(("percentile_disc"===r||"percentile_cont"===r)&&"statisticParameters"in s){const{statisticParameters:t}=s;if(!t)throw new i($,"statisticParamters should be set for percentile type",{definition:s,query:e})}else if("count"!==r&&t&&P(t,this.fieldsIndex,n))throw new i($,`outStatistics only supports ${u} field types`,{definition:s,query:e})}}}async _getQueryEngineResultForStats(e,t,i){e=s(e);try{e=await this._schedule((()=>V(e,this.definitionExpression,this.spatialReference)),i),e=await this._reschedule((()=>this._checkStatisticsSupport(e,t)),i);const s=await this._reschedule((()=>this._executeSceneFilterQuery(e,i)),i),r=await this._reschedule((()=>this._executeGeometryQuery(e,s,i)),i);return await this._reschedule((()=>this._executeAggregateIdsQuery(r)),i),await this._reschedule((()=>this._executeObjectIdsQuery(r)),i),await this._reschedule((()=>this._executeTimeQuery(r)),i),await this._reschedule((()=>this._executeAttributesQuery(r)),i),r}catch(r){if(r!==N)throw r;return new v([],e,this)}}}export{K as Feature,ee as QueryEngine};
|
|
5
|
+
import{PositionHint as e,indexOf as t}from"../../../core/arrayUtils.js";import i from"../../../core/Error.js";import{clone as s}from"../../../core/lang.js";import{removeMaybe as r,destroyMaybe as a}from"../../../core/maybe.js";import{MemCacheStorage as n,MemCache as u}from"../../../core/MemCache.js";import{throwIfAborted as o}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as l}from"../../../core/unitUtils.js";import{set as c,NEGATIVE_INFINITY as h,create as p,expandWithAABB as m}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as f,create as d}from"../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as y}from"../../../geometry/support/boundsUtils.js";import{fromJSON as g,isExtent as _,isPolygon as x}from"../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as w}from"../../../geometry/support/normalizeUtils.js";import{equals as S,isValid as F}from"../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as R}from"../featureConversionUtils.js";import{getWhereClause as Q,validateFields as I,validateFieldTypes as j,validateWhere as E,validateHaving as A,validNumericTypesKebabDict as b,validDateTypesKebabDict as q,hasInvalidFieldType as C}from"./attributeSupport.js";import{checkProjectionSupport as P,project as T,projectMany as B}from"./projectionSupport.js";import{queryCapabilities as k}from"./QueryEngineCapabilities.js";import{QueryEngineResult as v}from"./QueryEngineResult.js";import{getSpatialQueryOperator as z,canQueryWithRBush as O,checkSpatialQuerySupport as G}from"./spatialQuerySupport.js";import{getTimeExtent as M,getTimeOperator as U}from"./timeSupport.js";import{QUERY_ENGINE_EMPTY_RESULT as N,cleanFromGeometryEngine as Z,normalizeQuery as V,getGeometry as H}from"./utils.js";import L from"../../support/FieldsIndex.js";import{loadArcade as D}from"../../../support/arcadeOnDemand.js";import{noBudget as J}from"../../../views/support/Scheduler.js";function W(e){return null!=e&&e.every((e=>"exceedslimit"!==e.statisticType))}const $="feature-store:unsupported-query";class K{constructor(e,t=null,i,s,r){this.attributes=e,this.geometry=i,this.centroid=s,this.filterFlags=r,this.groupId=-1,this.displayId=t}}const X=new n(2e6);let Y=0;class ee{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:k},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",(()=>this.clearCache())),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new u(Y+++"$$",X)),this.fieldsIndex=new L(e.fields),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=r(this._frameTask),this.clearCache(),a(this._geometryQueryCache),this._changeHandle=r(this._changeHandle),a(this.fieldsIndex)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null}async executeQuery(e,t){try{return(await this._executeQuery(e,{},t)).createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},t)).createQueryResponseForCount()}catch(i){if(i!==N)throw i;return 0}}async executeQueryForExtent(e,t){const i=e.outSR;try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),r=s.size;if(!r)return{count:0,extent:null};return{count:r,extent:await this._getBounds(s.items,s.spatialReference,i||this.spatialReference)}}catch(s){if(s===N)return{count:0,extent:null};throw s}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then((e=>Array.from(e)))}async executeQueryForIdSet(e,t){try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),s=i.items,r=new Set;return await this._reschedule((()=>{for(const e of s)r.add(i.featureAdapter.getObjectId(e))}),t),r}catch(i){if(i===N)return new Set;throw i}}async executeQueryForSnapping(e,t){const{point:i,distance:s,returnEdge:r,returnVertex:a}=e;if(!r&&!a)return{candidates:[]};const n=await this._reschedule((()=>this._checkQuerySupport(e.query)),t),u=!S(i.spatialReference,this.spatialReference);u&&await P(i.spatialReference,this.spatialReference);const o="number"==typeof s?s:s.x,l="number"==typeof s?s:s.y,c={xmin:i.x-o,xmax:i.x+o,ymin:i.y-l,ymax:i.y+l,spatialReference:i.spatialReference},h=u?T(c,this.spatialReference):c;if(!h)return{candidates:[]};const p=(await w(g(i),null,{signal:t}))[0],m=(await w(g(h),null,{signal:t}))[0];if(null==p||null==m)return{candidates:[]};const f=new v(await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(m.toJSON()))),t),n,this);await this._reschedule((()=>this._executeObjectIdsQuery(f)),t),await this._reschedule((()=>this._executeTimeQuery(f)),t),await this._reschedule((()=>this._executeAttributesQuery(f)),t);const d=p.toJSON(),y=u?T(d,this.spatialReference):d,_=u?Math.max(h.xmax-h.xmin,h.ymax-h.ymin)/2:s;return f.createSnappingResponse({...e,point:y,distance:_},i.spatialReference)}async executeQueryForLatestObservations(e,t){if(!this.timeInfo||!this.timeInfo.trackIdField)throw new i($,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const i=await this._executeQuery(e,{},t);return await this._reschedule((()=>this._filterLatest(i)),t),i.createQueryResponse()}catch(s){if(s!==N)throw s;return new v([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,i){const{field:s,normalizationField:r,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:s,normalizationField:r,valueExpression:a},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,i){const{field:s,field2:r,field3:a,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:s,field2:r,field3:a,valueExpression:n},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,i){const{field:s,normalizationField:r,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:s,normalizationField:r,valueExpression:a},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,i){const{field:s,normalizationField:r,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:s,normalizationField:r,valueExpression:a},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const[t,i]=await Promise.all(["getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getBounds(await this._getAllFeatures(),this.spatialReference,this.spatialReference),null!=this._timeExtentPromise?this._timeExtentPromise:this._timeExtentPromise=M(this.timeInfo,this.featureStore)]);return o(e),{fullExtent:t,timeExtent:i}}async _getBounds(e,t,i){const s=c(p(),h);await this.featureStore.forEachBounds(e,(e=>m(s,e)));const r={xmin:s[0],ymin:s[1],xmax:s[3],ymax:s[4],spatialReference:Z(this.spatialReference)};this.hasZ&&isFinite(s[2])&&isFinite(s[5])&&(r.zmin=s[2],r.zmax=s[5]);const a=T(r,t,i);if(a.spatialReference=Z(i),a.xmax-a.xmin==0){const e=l(a.spatialReference);a.xmin-=e,a.xmax+=e}if(a.ymax-a.ymin==0){const e=l(a.spatialReference);a.ymin-=e,a.ymax+=e}if(this.hasZ&&null!=a.zmin&&null!=a.zmax&&a.zmax-a.zmin==0){const e=l(a.spatialReference);a.zmin-=e,a.zmax+=e}return a}async _schedule(e,t){return null!=this._frameTask?this._frameTask.schedule(e,t):e(J)}async _reschedule(e,t){return null!=this._frameTask?this._frameTask.reschedule(e,t):e(J)}async _getAllFeaturesQueryEngineResult(e){return new v(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach((t=>e.push(t)))})().then((()=>e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,i){e=s(e),e=await this._schedule((()=>V(e,this.definitionExpression,this.spatialReference)),i),e=await this._reschedule((()=>this._checkQuerySupport(e)),i),e={...e,...t};const r=await this._reschedule((()=>this._executeSceneFilterQuery(e,i)),i),a=await this._reschedule((()=>this._executeGeometryQuery(e,r,i)),i);return await this._reschedule((()=>this._executeAggregateIdsQuery(a)),i),await this._reschedule((()=>this._executeObjectIdsQuery(a)),i),await this._reschedule((()=>this._executeTimeQuery(a)),i),await this._reschedule((()=>this._executeAttributesQuery(a)),i),a}async _executeSceneFilterQuery(e,t){if(null==e.sceneFilter)return null;const{outSR:i,returnGeometry:s,returnCentroid:r}=e,a=this.featureStore.featureSpatialReference,n=e.sceneFilter.geometry,u=null==a||S(a,n.spatialReference)?n:T(n,a);if(!u)return null;const o=s||r,l=F(i)&&!S(this.spatialReference,i)&&o?async e=>this._project(e,i):e=>e,c=this.featureAdapter,h=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(u))),t);if("disjoint"===e.sceneFilter.spatialRelationship){if(!h.length)return null;const i=new Set;for(const e of h)i.add(c.getObjectId(e));const s=await this._reschedule((()=>this._getAllFeatures()),t),r=await this._reschedule((async()=>{const r=await z("esriSpatialRelDisjoint",u,this.geometryType,this.hasZ,this.hasM),a=e=>!i.has(c.getObjectId(e))||r(c.getGeometry(e)),n=await this._runSpatialFilter(s,a,t);return new v(n,e,this)}),t);return l(r)}if(!h.length)return new v([],e,this);if(this._canExecuteSinglePass(u,e))return l(new v(h,e,this));const p=await z("esriSpatialRelContains",u,this.geometryType,this.hasZ,this.hasM),m=await this._runSpatialFilter(h,(e=>p(c.getGeometry(e))),t);return l(new v(m,e,this))}async _executeGeometryQuery(i,s,r){if(null!=s&&0===s.items.length)return s;i=null!=s?s.query:i;const{geometry:a,outSR:n,spatialRel:u,returnGeometry:o,returnCentroid:l}=i,c=this.featureStore.featureSpatialReference,h=!a||null==c||S(c,a.spatialReference)?a:T(a,c),p=o||l,m=F(n)&&!S(this.spatialReference,n),f=this._geometryQueryCache&&null==s?m&&p?JSON.stringify({originalFilterGeometry:a,spatialRelationship:u,outSpatialReference:n}):JSON.stringify({originalFilterGeometry:a,spatialRelationship:u}):null,d=f?this._geometryQueryCache.get(f):null;if(null!=d)return new v(d,i,this);const y=async e=>(m&&p&&await this._project(e,n),f&&this._geometryQueryCache.put(f,e.items,e.items.length+1),e);if(!h)return y(null!=s?s:await this._getAllFeaturesQueryEngineResult(i));const g=this.featureAdapter;let _=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(a))),r);if("esriSpatialRelDisjoint"===u){if(!_.length)return y(null!=s?s:await this._getAllFeaturesQueryEngineResult(i));const e=new Set;for(const i of _)e.add(g.getObjectId(i));const t=null!=s?s.items:await this._reschedule((()=>this._getAllFeatures()),r),a=await this._reschedule((async()=>{const s=await z(u,h,this.geometryType,this.hasZ,this.hasM),a=t=>!e.has(g.getObjectId(t))||s(g.getGeometry(t)),n=await this._runSpatialFilter(t,a,r);return new v(n,i,this)}),r);return y(a)}if(null!=s){const i=new e;_=_.filter((e=>t(s.items,e,s.items.length,i)>=0))}if(!_.length){const e=new v([],i,this);return f&&this._geometryQueryCache.put(f,e.items,1),e}if(this._canExecuteSinglePass(h,i))return y(new v(_,i,this));const x=await z(u,h,this.geometryType,this.hasZ,this.hasM),w=await this._runSpatialFilter(_,(e=>x(g.getGeometry(e))),r);return y(new v(w,i,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds||!e.query.aggregateIds.length||null==this.aggregateAdapter)return;const t=new Set;for(const s of e.query.aggregateIds){this.aggregateAdapter.getFeatureObjectIds(s).forEach((e=>t.add(e)))}const i=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(i(e))))}_executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds||!e.query.objectIds.length)return;const t=new Set(e.query.objectIds),i=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(i(e))))}_executeTimeQuery(e){if(0===e.items.length)return;const t=U(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(0===e.items.length)return;const t=Q(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter((e=>t.testFeature(e,this.featureAdapter)))}}async _runSpatialFilter(e,t,i){if(!t)return e;if(null==this._frameTask)return e.filter((e=>t(e)));let s=0;const r=new Array,a=async n=>{for(;s<e.length;){const u=e[s++];t(u)&&(r.push(u),n.madeProgress()),n.done&&await this._reschedule((e=>a(e)),i)}};return this._reschedule((e=>a(e)),i).then((()=>r))}_filterLatest(e){const{trackIdField:t,startTimeField:i,endTimeField:s}=this.timeInfo,r=s||i,a=new Map,n=this.featureAdapter.getAttribute;for(const u of e.items){const e=n(u,t),i=n(u,r),s=a.get(e);(!s||i>n(s,r))&&a.set(e,u)}e.items=Array.from(a.values())}_canExecuteSinglePass(e,t){const{spatialRel:i}=t;return O(e)&&("esriSpatialRelEnvelopeIntersects"===i||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===i||"esriSpatialRelContains"===i||"esriSpatialRelWithin"===i))}async _project(e,t){if(!t||S(this.spatialReference,t))return e;const i=this.featureAdapter,s=await B(e.items.map((e=>H(this.geometryType,this.hasZ,this.hasM,i.getGeometry(e)))),this.spatialReference,t);return e.items=s.map(((t,s)=>i.cloneWithGeometry(e.items[s],R(t,this.hasZ,this.hasM)))),e}_getQueryBBoxes(e){if(O(e)){if(_(e))return[f(e.xmin,e.ymin,e.xmax,e.ymax)];if(x(e))return e.rings.map((e=>f(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1]))))}return[y(d(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map((e=>this.featureStore.forEachInBounds(e,(e=>t.add(e))))));const i=Array.from(t.values());return t.clear(),i}async _checkStatisticsSupport(e,t){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new i($,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),Promise.all([this._checkStatisticsParamsSupport(t,e),G(e,this.geometryType,this.spatialReference),P(this.spatialReference,e.outSR)]).then((()=>e))}async _checkStatisticsParamsSupport(e,t){let s=[];if(e.valueExpression){const{arcadeUtils:t}=await D();s=t.extractFieldNames(e.valueExpression)}if(e.field&&s.push(e.field),e.field2&&s.push(e.field2),e.field3&&s.push(e.field3),e.normalizationField&&s.push(e.normalizationField),!s.length&&!e.valueExpression)throw new i($,"field or valueExpression is required",{params:e});I(this.fieldsIndex,s,{errorMessage:"Cannot calculate statistics for missing fields",query:t}),j(this.fieldsIndex,s,{expressionName:"statistics",query:t})}async _checkQuerySupport(e){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new i($,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),this._checkStatisticsQuerySupport(e),Promise.all([G(e,this.geometryType,this.spatialReference),P(this.spatialReference,e.outSR)]).then((()=>e))}_checkAttributesQuerySupport(e){const{outFields:t,orderByFields:s,returnDistinctValues:r,outStatistics:a}=e,n=a?a.map((e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase())).filter(Boolean):[];if(s&&s.length>0){const t=" asc",i=" desc",r=s.map((e=>{const s=e.toLowerCase();return s.includes(t)?s.split(t)[0]:s.includes(i)?s.split(i)[0]:e})).filter((e=>!n.includes(e)));I(this.fieldsIndex,r,{expressionName:"orderByFields",query:e})}if(t&&t.length>0)I(this.fieldsIndex,t,{expressionName:"outFields",query:e});else if(r)throw new i($,"outFields should be specified for returnDistinctValues",{query:e});E(this.fieldsIndex,e.where,e)}_checkStatisticsQuerySupport(e){const{outStatistics:t,groupByFieldsForStatistics:s,having:r}=e,a=s&&s.length,n=t&&t.length;if(r){if(!a||!n)throw new i($,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:e});A(this.fieldsIndex,r,t,e)}if(n){if(!W(t))return;const r=t.map((e=>e.onStatisticField)).filter(Boolean);I(this.fieldsIndex,r,{expressionName:"onStatisticFields",query:e}),a&&I(this.fieldsIndex,s,{expressionName:"groupByFieldsForStatistics",query:e});const n=new Set([...b.jsonValues,...q.jsonValues]),u=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...b.apiValues,...q.apiValues]);for(const s of t){const{onStatisticField:t,statisticType:r}=s;if(("percentile_disc"===r||"percentile_cont"===r)&&"statisticParameters"in s){const{statisticParameters:t}=s;if(!t)throw new i($,"statisticParamters should be set for percentile type",{definition:s,query:e})}else if("count"!==r&&t&&C(t,this.fieldsIndex,n))throw new i($,`outStatistics only supports ${u} field types`,{definition:s,query:e})}}}async _getQueryEngineResultForStats(e,t,i){e=s(e);try{e=await this._schedule((()=>V(e,this.definitionExpression,this.spatialReference)),i),e=await this._reschedule((()=>this._checkStatisticsSupport(e,t)),i);const s=await this._reschedule((()=>this._executeSceneFilterQuery(e,i)),i),r=await this._reschedule((()=>this._executeGeometryQuery(e,s,i)),i);return await this._reschedule((()=>this._executeAggregateIdsQuery(r)),i),await this._reschedule((()=>this._executeObjectIdsQuery(r)),i),await this._reschedule((()=>this._executeTimeQuery(r)),i),await this._reschedule((()=>this._executeAttributesQuery(r)),i),r}catch(r){if(r!==N)throw r;return new v([],e,this)}}}export{K as Feature,ee as QueryEngine};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../core/Error.js";import{JSONMap as s}from"../../../core/jsonMap.js";import{WhereClauseCache as i}from"../../../core/sql/WhereClauseCache.js";const n=new i(50,500),r="feature-store:unsupported-query",t=" as ",o=new s({esriFieldTypeString:"string"}),a=new s({esriFieldTypeOID:"oid",esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long"}),l=new s({esriFieldTypeDate:"date"}),d=new s({esriFieldTypeGUID:"guid",esriFieldTypeGlobalId:"global-id"}),p=new Set([...a.jsonValues,...l.jsonValues,...o.jsonValues,...d.jsonValues]),u=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...a.apiValues,...l.apiValues,...o.apiValues,...d.apiValues]);function g(s,i,n={}){const t=
|
|
5
|
+
import e from"../../../core/Error.js";import{JSONMap as s}from"../../../core/jsonMap.js";import{WhereClauseCache as i}from"../../../core/sql/WhereClauseCache.js";const n=new i(50,500),r="feature-store:unsupported-query",t=" as ",o=new s({esriFieldTypeString:"string"}),a=new s({esriFieldTypeOID:"oid",esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long"}),l=new s({esriFieldTypeDate:"date"}),d=new s({esriFieldTypeGUID:"guid",esriFieldTypeGlobalId:"global-id"}),p=new Set([...a.jsonValues,...l.jsonValues,...o.jsonValues,...d.jsonValues]),u=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...a.apiValues,...l.apiValues,...o.apiValues,...d.apiValues]);function g(s,i,n={}){const t=y(s,i);if(!t)throw new e(r,"invalid SQL expression",{expression:s});const o=n.expressionName||"expression";if(n.validateStandardized&&!t.isStandardized)throw new e(r,`${o} is not standard`,{expression:s});if(n.validateAggregate&&!t.isAggregate)throw new e(r,`${o} does not contain a valid aggregate function`,{expression:s});return t.fieldNames}function c(e,s,i){if(!s)return!0;const n="where clause",r=g(s,e,{validateStandardized:!0,expressionName:n});return m(e,r,{expressionName:n,query:i}),x(e,r,{expressionName:n,query:i}),!0}function f(s,i,t,o){if(!i)return!0;const a="having",l=g(i,s,{validateAggregate:!0,expressionName:a});m(s,l,{expressionName:a,query:o}),x(s,l,{expressionName:a,query:o});const d=n.get(i,s),p=d?.getExpressions().every((e=>{const{aggregateType:i,field:n}=e,r=s.get(n)?.name;return t.some((e=>{const{onStatisticField:n,statisticType:t}=e,o=s.get(n)?.name;return o===r&&t.toLowerCase().trim()===i}))}));if(!p)throw new e(r,"expressions in having should also exist in outStatistics",{having:i});return!0}function y(e,s){return e?n.get(e,s):null}function m(e,s,i={}){i.errorMessage||(i.errorMessage=i.expressionName?`${i.expressionName} contains invalid fields`:"Fields are invalid"),h(e,s,((e,s)=>s.has(e)),i)}function x(e,s,i={}){i.errorMessage||(i.errorMessage=i.expressionName?`${i.expressionName} only supports ${u} field types`:`Only ${u} field types are supported`),h(e,s,((e,s)=>!F(e,s)),i)}function h(s,i,n,t={}){const o=t.verifyExpression??!0,a=[];for(const e of i){const i=n(e,s);if("*"!==e&&!i)if(o){const i=w(e);try{h(s,g(i,s,{validateStandardized:!0}),n,t)}catch(l){const s=l?.details;if(s?.expression)throw l;s?.invalidFields?a.push(...s.invalidFields):a.push(e)}}else a.push(e)}if(a.length)throw new e(r,t.errorMessage,{invalidFields:a,query:t.query})}function w(e){return e.split(t)[0]}function v(e){return e.split(t)[1]}function F(e,s,i=p){const n=s.get(e);return!!n&&!i.has(n.type)}export{v as getAliasFromFieldName,w as getExpressionFromFieldName,y as getWhereClause,F as hasInvalidFieldType,l as validDateTypesKebabDict,d as validGuidTypesKebabDict,a as validNumericTypesKebabDict,x as validateFieldTypes,m as validateFields,f as validateHaving,c as validateWhere};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import{fromJSON as r}from"../../renderers/support/jsonUtils.js";import{rendererTypes as o}from"../../renderers/support/types.js";import"../../core/workers/workers.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{initializeProjection as a,project as n}from"../../geometry/projection.js";import{WGS84 as p}from"../../geometry/support/spatialReferenceUtils.js";import l from"../Layer.js";import y from"../graphics/data/FeatureStore.js";import{QueryEngine as u}from"../graphics/data/QueryEngine.js";import{createCapabilities as m,createDrawingInfo as d}from"../graphics/sources/support/clientSideDefaults.js";import{MOCK_OID_FIELD_NAME as h,MOCK_LAYOUT_GEOMETRY_FIELD_NAME as c}from"./KnowledgeGraphLayerDataManager.js";import{KnowledgeGraphSublayerBase as g}from"./KnowledgeGraphSublayerBase.js";import{BlendLayer as f}from"../mixins/BlendLayer.js";import{FeatureReductionLayer as j}from"../mixins/FeatureReductionLayer.js";import{RefreshableLayer as b}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as T}from"../mixins/ScaleRangeLayer.js";import w from"../support/Field.js";import{fixRendererFields as S}from"../support/fieldUtils.js";import F from"../../rest/support/FeatureSet.js";import x from"../../rest/support/Query.js";import{createPopupTemplate as Q}from"../../support/popupUtils.js";import O from"../../core/workers/RemoteClient.js";import v from"../../geometry/Extent.js";import E from"../../geometry/Polygon.js";import L from"../../geometry/Polyline.js";import{featureGeometryTypeKebabDictionary as N}from"../../geometry/support/typeUtils.js";let M=class extends(j(g(f(T(b(l)))))){constructor(e){if(super(e),this.capabilities=m(!1,!1),this.definitionExpression="",this.displayField="",this.elevationInfo=null,this.geometryType=null,this.geometryFieldName=null,this.graphType=null,this.hasM=!1,this.hasZ=!1,this.labelsVisible=null,this.labelingInfo=null,this.objectIdField=h,this.objectType=null,this.parentCompositeLayer=null,this.popupTemplate=null,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new O(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=x.fromJSON(e);return this.queryFeaturesJSON(r,t)}}},(()=>null)),[e.port2]}))},this.type="knowledge-graph-sublayer","link-chart"===e.parentCompositeLayer.type)"relationship"===e.graphType?this.geometryType="polyline":this.geometryType="point",this.geometryFieldName=c;else if(e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name)?.geometryType&&"esriGeometryNull"!==e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name)?.geometryType){const t=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name);this.geometryFieldName=t?.name??null,this.geometryType=t?.geometryType?N.fromJSON(t.geometryType):null;const r=t?.name,o=r?e.objectType.properties?.[r]:null;o?(this.hasM=o.hasM??!1,this.hasZ=o.hasZ??!1):(this.hasM=!1,this.hasZ=!1)}else this.geometryType=null;e.objectType.properties?.forEach((e=>{let t=null,r=e.fieldType;"esriFieldTypeOID"===r&&(r="esriFieldTypeInteger"),this.fields.push(w.fromJSON({name:e.name,type:r,alias:e.alias,defaultValue:t,editable:e.editable,nullable:e.nullable}))})),this.fields.push(w.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1})),e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel?.spatialReference&&(this.spatialReference=e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel.spatialReference),"link-chart"===e.parentCompositeLayer.type?"relationship"===e.graphType?this.renderer=r(d(N.toJSON("polyline")).renderer):this.renderer=r(d(N.toJSON("point")).renderer):this.renderer=r(d(N.toJSON(this.geometryType)).renderer)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){S(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return Q(this,e)}createQuery(){return new x({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t<this.fields.length;t++)if(this.fields[t].name===e)return this.fields[t];throw new Error("Field not found")}getFieldDomain(e,t){return null}async queryFeatures(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e),s=F.fromJSON(await o.executeQuery(r.toJSON(),t?.signal));return s.features.forEach((e=>{e.sourceLayer=this})),s}async queryFeaturesJSON(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return await o.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return o.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){const r={...e,returnGeometry:!0},{resolvedQuery:o,queryEngine:s}=await this._setupQueryObjects(r),i=await s.executeQueryForExtent(o.toJSON(),t?.signal);let a;return a=null!=i.extent?.xmin&&null!=i.extent?.xmax&&null!=i.extent?.ymin&&null!=i.extent?.ymax?new v(i.extent):new v,{count:i.count,extent:a}}async queryObjectIds(e,t){const r=x.from(e);let o;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);o=this.loadQueryEngine(e)}return o.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new y({geometryType:N.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new u({fields:this.fields.map((e=>e.toJSON())),geometryType:N.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:null,featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new x({where:"1=1",outFields:[h]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}async _setupQueryObjects(e,t){const r=x.from(e),o=r.geometry;let s;if(o&&!o.spatialReference?.isWGS84&&(await a(o.spatialReference,p),r.geometry=n(o instanceof E||o instanceof L?o:o.extent,p)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)s=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);s=this.loadQueryEngine(e)}return{resolvedQuery:r,queryEngine:s}}};e([s()],M.prototype,"capabilities",void 0),e([s({readOnly:!0})],M.prototype,"defaultPopupTemplate",null),e([s()],M.prototype,"definitionExpression",void 0),e([s()],M.prototype,"displayField",void 0),e([s()],M.prototype,"elevationInfo",void 0),e([s()],M.prototype,"geometryType",void 0),e([s()],M.prototype,"geometryFieldName",void 0),e([s()],M.prototype,"graphType",void 0),e([s()],M.prototype,"hasM",void 0),e([s()],M.prototype,"hasZ",void 0),e([s()],M.prototype,"labelsVisible",void 0),e([s()],M.prototype,"labelingInfo",void 0),e([s()],M.prototype,"objectIdField",void 0),e([s()],M.prototype,"objectType",void 0),e([s()],M.prototype,"parentCompositeLayer",void 0),e([s({type:t,json:{name:"popupInfo",write:!0}})],M.prototype,"popupTemplate",void 0),e([s({types:o,json:{write:{target:"layerDefinition.drawingInfo.renderer"}}})],M.prototype,"renderer",null),e([s()],M.prototype,"source",void 0),e([s({json:{read:!1}})],M.prototype,"type",void 0),M=e([i("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],M);const C=M;export{C as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import{fromJSON as r}from"../../renderers/support/jsonUtils.js";import{rendererTypes as o}from"../../renderers/support/types.js";import"../../core/workers/workers.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{initializeProjection as a,project as n}from"../../geometry/projection.js";import{WGS84 as p}from"../../geometry/support/spatialReferenceUtils.js";import l from"../Layer.js";import y from"../graphics/data/FeatureStore.js";import{QueryEngine as u}from"../graphics/data/QueryEngine.js";import{createCapabilities as m,createDrawingInfo as d}from"../graphics/sources/support/clientSideDefaults.js";import{MOCK_OID_FIELD_NAME as h,MOCK_LAYOUT_GEOMETRY_FIELD_NAME as c}from"./KnowledgeGraphLayerDataManager.js";import{KnowledgeGraphSublayerBase as g}from"./KnowledgeGraphSublayerBase.js";import{BlendLayer as f}from"../mixins/BlendLayer.js";import{FeatureReductionLayer as j}from"../mixins/FeatureReductionLayer.js";import{RefreshableLayer as b}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as T}from"../mixins/ScaleRangeLayer.js";import w from"../support/Field.js";import{fixRendererFields as S}from"../support/fieldUtils.js";import F from"../../rest/support/FeatureSet.js";import x from"../../rest/support/Query.js";import{createPopupTemplate as Q}from"../../support/popupUtils.js";import O from"../../core/workers/RemoteClient.js";import v from"../../geometry/Extent.js";import E from"../../geometry/Polygon.js";import L from"../../geometry/Polyline.js";import{featureGeometryTypeKebabDictionary as N}from"../../geometry/support/typeUtils.js";let M=class extends(j(g(f(T(b(l)))))){constructor(e){if(super(e),this.capabilities=m(!1,!1),this.definitionExpression="",this.displayField="",this.elevationInfo=null,this.geometryType=null,this.geometryFieldName=null,this.graphType=null,this.hasM=!1,this.hasZ=!1,this.labelsVisible=null,this.labelingInfo=null,this.objectIdField=h,this.objectType=null,this.parentCompositeLayer=null,this.popupTemplate=null,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new O(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=x.fromJSON(e);return this.queryFeaturesJSON(r,t)}}},(()=>null)),[e.port2]}))},this.type="knowledge-graph-sublayer","link-chart"===e.parentCompositeLayer.type)"relationship"===e.graphType?this.geometryType="polyline":this.geometryType="point",this.geometryFieldName=c;else if(e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name)?.geometryType&&"esriGeometryNull"!==e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name)?.geometryType){const t=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name);this.geometryFieldName=t?.name??null,this.geometryType=t?.geometryType?N.fromJSON(t.geometryType):null;const r=t?.name,o=r?e.objectType.properties?.[r]:null;o?(this.hasM=o.hasM??!1,this.hasZ=o.hasZ??!1):(this.hasM=!1,this.hasZ=!1)}else this.geometryType=null;e.objectType.properties?.forEach((e=>{let t=null,r=e.fieldType;"esriFieldTypeOID"===r&&(r="esriFieldTypeInteger"),this.fields.push(w.fromJSON({name:e.name,type:r,alias:e.alias,defaultValue:t,editable:e.editable,nullable:e.nullable}))})),this.fields.push(w.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1})),this._set("fields",[...this.fields]),e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel?.spatialReference&&(this.spatialReference=e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel.spatialReference),"link-chart"===e.parentCompositeLayer.type?"relationship"===e.graphType?this.renderer=r(d(N.toJSON("polyline")).renderer):this.renderer=r(d(N.toJSON("point")).renderer):this.renderer=r(d(N.toJSON(this.geometryType)).renderer)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){S(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return Q(this,e)}createQuery(){return new x({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t<this.fields.length;t++)if(this.fields[t].name===e)return this.fields[t];throw new Error("Field not found")}getFieldDomain(e,t){return null}async queryFeatures(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e),s=F.fromJSON(await o.executeQuery(r.toJSON(),t?.signal));return s.features.forEach((e=>{e.sourceLayer=this})),s}async queryFeaturesJSON(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return await o.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return o.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){const r={...e,returnGeometry:!0},{resolvedQuery:o,queryEngine:s}=await this._setupQueryObjects(r),i=await s.executeQueryForExtent(o.toJSON(),t?.signal);let a;return a=null!=i.extent?.xmin&&null!=i.extent?.xmax&&null!=i.extent?.ymin&&null!=i.extent?.ymax?new v(i.extent):new v,{count:i.count,extent:a}}async queryObjectIds(e,t){const r=x.from(e);let o;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);o=this.loadQueryEngine(e)}return o.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new y({geometryType:N.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new u({fields:this.fields.map((e=>e.toJSON())),geometryType:N.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:null,featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new x({where:"1=1",outFields:[h]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}async _setupQueryObjects(e,t){const r=x.from(e),o=r.geometry;let s;if(o&&!o.spatialReference?.isWGS84&&(await a(o.spatialReference,p),r.geometry=n(o instanceof E||o instanceof L?o:o.extent,p)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)s=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);s=this.loadQueryEngine(e)}return{resolvedQuery:r,queryEngine:s}}};e([s()],M.prototype,"capabilities",void 0),e([s({readOnly:!0})],M.prototype,"defaultPopupTemplate",null),e([s()],M.prototype,"definitionExpression",void 0),e([s()],M.prototype,"displayField",void 0),e([s()],M.prototype,"elevationInfo",void 0),e([s()],M.prototype,"geometryType",void 0),e([s()],M.prototype,"geometryFieldName",void 0),e([s()],M.prototype,"graphType",void 0),e([s()],M.prototype,"hasM",void 0),e([s()],M.prototype,"hasZ",void 0),e([s()],M.prototype,"labelsVisible",void 0),e([s()],M.prototype,"labelingInfo",void 0),e([s()],M.prototype,"objectIdField",void 0),e([s()],M.prototype,"objectType",void 0),e([s()],M.prototype,"parentCompositeLayer",void 0),e([s({type:t,json:{name:"popupInfo",write:!0}})],M.prototype,"popupTemplate",void 0),e([s({types:o,json:{write:{target:"layerDefinition.drawingInfo.renderer"}}})],M.prototype,"renderer",null),e([s()],M.prototype,"source",void 0),e([s({json:{read:!1}})],M.prototype,"type",void 0),M=e([i("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],M);const C=M;export{C 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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import{read as o}from"../../renderers/support/jsonUtils.js";import{rendererTypes as t}from"../../renderers/support/types.js";import{clone as s}from"../../core/lang.js";import{setDeepValue as i}from"../../core/object.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{enumeration as n}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../../core/accessorSupport/decorators/writer.js";import m from"./AggregateField.js";import{labelsVisible as c,popupEnabled as u}from"./commonProperties.js";import{createDefaultRenderer as f}from"./featureLayerUtils.js";import{FeatureReduction as j}from"./FeatureReduction.js";import y from"./LabelClass.js";var b;const g="esri.layers.support.FeatureReductionBinning";let h=b=class extends j{constructor(e){super(e),this.type="binning",this.binType="geohash",this.fixedBinLevel=3,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.fields=[],this.renderer=null}writeFields(e,r,o){const t=e.filter((e=>"avg_angle"!==e.statisticType)).map((e=>e.toJSON()));i(o,t,r)}readRenderer(e,r,t){const s=r.drawingInfo?.renderer;return s?o(s,r,t)??void 0:f(r,t)}clone(){return new b({fields:s(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:s(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:s(this.popupTemplate),renderer:s(this.renderer)})}};e([n({binning:"binning"})],h.prototype,"type",void 0),e([n({geohash:"geohash"})],h.prototype,"binType",void 0),e([p({type:Number,range:{min:1,max:9},json:{write:!0}})],h.prototype,"fixedBinLevel",void 0),e([p({type:[y],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],h.prototype,"labelingInfo",void 0),e([p(c)],h.prototype,"labelsVisible",void 0),e([p({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],h.prototype,"maxScale",void 0),e([p(u)],h.prototype,"popupEnabled",void 0),e([p({type:r,json:{name:"popupInfo",write:!0}})],h.prototype,"popupTemplate",void 0),e([p({type:[m],json:{write:!0}})],h.prototype,"fields",void 0),e([d("fields")],h.prototype,"writeFields",null),e([p({types:t,json:{write:{target:"drawingInfo.renderer"}}})],h.prototype,"renderer",void 0),e([a("renderer",["drawingInfo.renderer"])],h.prototype,"readRenderer",null),h=b=e([l(g)],h);const v=h;export{v 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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import t from"../../renderers/SimpleRenderer.js";import
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import t from"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import{read as o}from"../../renderers/support/jsonUtils.js";import{rendererTypes as s}from"../../renderers/support/types.js";import{symbolTypesCluster as i}from"../../symbols.js";import{JSONSupport as p}from"../../core/JSONSupport.js";import{clone as n}from"../../core/lang.js";import{setDeepValue as l}from"../../core/object.js";import{toPt as a}from"../../core/screenUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{reader as u}from"../../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{writer as c}from"../../core/accessorSupport/decorators/writer.js";import f from"./AggregateField.js";import{popupEnabled as y,labelsVisible as b}from"./commonProperties.js";import{createDefaultRenderer as j}from"./featureLayerUtils.js";import h from"./LabelClass.js";var g;const S="esri.layers.support.FeatureReductionCluster";function w(e){return"simple"===e.type&&!e.visualVariables?.length}let I=g=class extends p{constructor(e){super(e),this.type="cluster",this.clusterRadius=a("80px"),this.clusterMinSize=a("12px"),this.clusterMaxSize=a("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=null}readRenderer(e,r,t){const s=r.drawingInfo?.renderer;return s?.authoringInfo?.isAutoGenerated?null:s?w(s)?null:o(s,r,t)??void 0:j(r,t)}readSymbol(e,r,t){const s=r.drawingInfo?.renderer;if(s?.authoringInfo?.isAutoGenerated)return null;if(s&&w(s)){const e=o(s,r,t);return e?.symbol}return null}writeSymbol(e,r,o,s){const i=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||i){const o=new t({symbol:e});r.drawingInfo={renderer:o.write({},s)}}}writeFields(e,r,t){const o=e.filter((e=>"avg_angle"!==e.statisticType)).map((e=>e.toJSON()));l(t,o,r)}readFields(e,r,t){return e.filter((e=>!e.isAutoGenerated)).map((e=>f.fromJSON(e)))}clone(){return new g({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:n(this.labelingInfo),labelsVisible:this.labelsVisible,fields:n(this.fields),maxScale:this.maxScale,renderer:n(this.renderer),symbol:n(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:n(this.popupTemplate)})}};e([d({type:["cluster"],readOnly:!0,json:{write:!0}})],I.prototype,"type",void 0),e([d({type:Number,cast:e=>"auto"===e?e:a(e),json:{write:!0}})],I.prototype,"clusterRadius",void 0),e([d({type:Number,cast:a,json:{write:!0}})],I.prototype,"clusterMinSize",void 0),e([d({type:Number,cast:a,json:{write:!0}})],I.prototype,"clusterMaxSize",void 0),e([d({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],I.prototype,"maxScale",void 0),e([d(y)],I.prototype,"popupEnabled",void 0),e([d({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],I.prototype,"popupTemplate",void 0),e([d({types:s,json:{write:{target:"drawingInfo.renderer"}}})],I.prototype,"renderer",void 0),e([u("renderer",["drawingInfo.renderer"])],I.prototype,"readRenderer",null),e([d({types:i})],I.prototype,"symbol",void 0),e([u("symbol",["drawingInfo.renderer"])],I.prototype,"readSymbol",null),e([c("symbol")],I.prototype,"writeSymbol",null),e([d({type:[h],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],I.prototype,"labelingInfo",void 0),e([d(b)],I.prototype,"labelsVisible",void 0),e([d({type:[f],json:{write:!0}})],I.prototype,"fields",void 0),e([c("fields")],I.prototype,"writeFields",null),e([u("fields")],I.prototype,"readFields",null),I=g=e([m(S)],I);const v=I;export{v 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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{id as t}from"../../kernel.js";import e from"../../core/Error.js";import{JSONMap as
|
|
5
|
+
import{id as t}from"../../kernel.js";import{symbolTypesRenderer as e}from"../../symbols.js";import r from"../../core/Error.js";import{JSONMap as n}from"../../core/jsonMap.js";import{parseWhereClause as o}from"../../core/sql.js";import{createTypeReader as s}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import{getOwningPortalUrl as a}from"./layerUtils.js";import i from"../../renderers/SimpleRenderer.js";import u from"../../renderers/UniqueValueRenderer.js";import c from"../../rest/support/AttachmentQuery.js";import p from"../../rest/support/Query.js";import l from"../../rest/support/RelationshipQuery.js";const d=new n({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function y(t,e,n,o){const s=await C(t);if(await f(t,e,o),!s.addAttachment)throw new r(o,"Layer source does not support addAttachment capability");return s.addAttachment(e,n)}function f(t,e,n){const{attributes:o}=e,{objectIdField:s}=t;return t.get("capabilities.data.supportsAttachment")?e?o?s&&o[s]?Promise.resolve():Promise.reject(new r(n,`feature is missing the identifying attribute ${s}`)):Promise.reject(new r(n,"'attributes' are required on a feature to query attachments")):Promise.reject(new r(n,"A feature is required to add/delete/update attachments")):Promise.reject(new r(n,"this layer doesn't support attachments"))}async function m(t,e,n,o,s){const a=await C(t);if(await f(t,e,s),!a.updateAttachment)throw new r(s,"Layer source does not support updateAttachment capability");return a.updateAttachment(e,n,o)}async function h(t,e,r){const{applyEdits:n}=await import("../graphics/editingSupport.js"),o=await t.load();return n(o,o.source,e,r)}async function w(t,e,r){const{uploadAssets:n}=await import("../graphics/editingSupport.js"),o=await t.load();return n(o,o.source,e,r)}async function b(t,e,n,o){const s=await C(t);if(await f(t,e,o),!s.deleteAttachments)throw new r(o,"Layer source does not support deleteAttachments capability");return s.deleteAttachments(e,n)}async function g(t,e,n){const o=(await t.load({signal:e?.signal})).source;if(!o.fetchRecomputedExtents)throw new r(n,"Layer source does not support fetchUpdates capability");return o.fetchRecomputedExtents(e)}async function j(t,e,n,o){e=c.from(e),await t.load();const s=t.source,a=t.capabilities;if(!a?.data?.supportsAttachment)throw new r(o,"this layer doesn't support attachments");const{attachmentTypes:i,objectIds:u,globalIds:p,num:l,size:d,start:y,where:f}=e;if(!a?.operations?.supportsQueryAttachments){if(i?.length>0||p?.length>0||d?.length>0||l||y||f)throw new r(o,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e)}if(!(u?.length||p?.length||f))throw new r(o,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!s.queryAttachments)throw new r(o,"Layer source does not support queryAttachments capability",e);return s.queryAttachments(e)}async function q(t,e,n,o){const s=await C(t);if(!s.queryObjectIds)throw new r(o,"Layer source does not support queryObjectIds capability");return s.queryObjectIds(p.from(e)??t.createQuery(),n)}async function F(t,e,n,o){const s=await C(t);if(!s.queryFeatureCount)throw new r(o,"Layer source does not support queryFeatureCount capability");return s.queryFeatureCount(p.from(e)??t.createQuery(),n)}async function I(t,e,n,o){const s=await C(t);if(!s.queryExtent)throw new r(o,"Layer source does not support queryExtent capability");return s.queryExtent(p.from(e)??t.createQuery(),n)}async function P(t,e,n,o){const s=await C(t);if(!s.queryRelatedFeatures)throw new r(o,"Layer source does not support queryRelatedFeatures capability");return s.queryRelatedFeatures(l.from(e),n)}async function A(t,e,n,o){const s=await C(t);if(!s.queryRelatedFeaturesCount)throw new r(o,"Layer source does not support queryRelatedFeaturesCount capability");return s.queryRelatedFeaturesCount(l.from(e),n)}async function O(t){const e=t.source;if(e?.refresh)try{const{dataChanged:r,updates:n}=await e.refresh();if(null!=n&&(t.sourceJSON={...t.sourceJSON,...n},t.read(n,{origin:"service",url:t.parsedUrl})),r)return!0}catch{}if(t.definitionExpression)try{return(await o(t.definitionExpression,t.fieldsIndex)).hasDateFunctions}catch{}return!1}function E(t){const e=new p,r=t.get("capabilities.data"),n=t.get("capabilities.query");e.historicMoment=t.historicMoment,e.gdbVersion=t.gdbVersion,e.returnGeometry=!0,n&&(e.compactGeometryEnabled=n.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&null!=t.returnZ&&(e.returnZ=t.returnZ),r.supportsM&&null!=t.returnM&&(e.returnM=t.returnM)),e.outFields=["*"];const{timeOffset:o,timeExtent:s}=t;return e.timeExtent=null!=o&&null!=s?s.offset(-o.value,o.unit):s||null,e.multipatchOption="multipatch"===t.geometryType?"xyFootprint":null,e}function S(t){const{globalIdField:e,fields:r}=t;if(e)return e;if(r)for(const n of r)if("esriFieldTypeGlobalID"===n.type)return n.name}function R(t){const{objectIdField:e,fields:r}=t;if(e)return e;if(r)for(const n of r)if("esriFieldTypeOID"===n.type)return n.name}function x(t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}async function C(t){return(await t.load()).source}async function L(e,r){if(!t)return;if(t.findCredential(e))return;let n;try{const o=await a(e,r);o&&(n=await t.checkSignInStatus(`${o}/sharing`))}catch(o){}if(n)try{const n=null!=r?r.signal:null;await t.getCredential(e,{signal:n})}catch(o){}}async function M(t,e){const r=t.parsedUrl?.path;r&&G(t)&&await L(r,e)}function G(t){const e=t.editFieldsInfo;return!(!e?.creatorField&&!e?.editorField)||(t.userHasUpdateItemPrivileges?t.hasUpdateItemRestrictions:!!t.userHasFullEditingPrivileges&&t.hasFullEditingRestrictions)}function Q(t){return!t.sourceJSON?.isMultiServicesView&&(t.userHasUpdateItemPrivileges||t.editingEnabled)}const U=s({types:e});function v(t,e){if(t.defaultSymbol)return t.types&&t.types.length?new u({defaultSymbol:U(t.defaultSymbol,t,e),field:t.typeIdField,uniqueValueInfos:t.types.map((t=>({id:t.id,symbol:U(t.symbol,t,e)})))}):new i({symbol:U(t.defaultSymbol,t,e)})}export{y as addAttachment,h as applyEdits,Q as computeEffectiveEditingEnabled,v as createDefaultRenderer,E as createQuery,b as deleteAttachments,M as ensureLayerCredential,g as fetchRecomputedExtents,d as geometryTypeKebabDict,O as hasDataChanged,j as queryAttachments,I as queryExtent,F as queryFeatureCount,q as queryObjectIds,P as queryRelatedFeatures,A as queryRelatedFeaturesCount,S as readGlobalIdField,R as readObjectIdField,x as readVersion,m as updateAttachment,w as uploadAssets};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{convertColorRampToColors as r}from"../../../renderers/support/colorRampUtils.js";const t=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],o=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function e(t,o){const e=[],n=[];for(let r=0;r<t.length-1;r++)e.push({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:t[r].slice(1),toColor:t[r+1].slice(1)}),n.push(t[r+1][0]-t[r][0]);const s=t[t.length-1][0];return r({type:"multipart",colorRamps:e},{numColors:s,weights:o=o??n})}function n(){return e([[0,0,191,191],[51,0,255
|
|
5
|
+
import{convertColorRampToColors as r}from"../../../renderers/support/colorRampUtils.js";const t=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],o=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function e(t,o){const e=[],n=[];for(let r=0;r<t.length-1;r++)e.push({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:t[r].slice(1),toColor:t[r+1].slice(1)}),n.push(t[r+1][0]-t[r][0]);const s=t[t.length-1][0];return r({type:"multipart",colorRamps:e},{numColors:s,weights:o=o??n})}function n(){return e([[0,0,191,191],[51,0,0,255],[102,255,0,255],[153,255,0,127],[204,191,63,127],[256,20,20,20]])}function s(){const r=e([[0,255,255,255],[70,0,255,0],[80,205,173,193],[100,150,150,150],[110,120,51,100],[130,120,100,200],[140,28,3,144],[160,6,0,55],[180,10,25,30],[201,6,7,27]]);for(let t=r.length;t<256;t++)r.push([6,27,7]);return r}function l(){return r({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:[0,0,0],toColor:[255,255,255]})}function i(){const r=[];for(let t=0;t<256;t++){const t=[];for(let r=0;r<3;r++)t.push(Math.round(255*Math.random()));r.push(t)}return r}function a(){return e([[0,38,41,54],[69,79,82,90],[131,156,156,156],[256,253,253,241]],[.268,.238,.495])}function c(r){let e;switch(r){case"elevation":e=n();break;case"gray":e=l();break;case"hillshade":e=a();break;case"ndvi":e=t;break;case"ndvi2":e=s();break;case"ndvi3":e=o;break;case"random":e=i()}return e?(e=e.map(((r,t)=>[t,...r])),e):null}export{c as getColormapByName};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "4.27.0-rc.
|
|
3
|
+
"version": "4.27.0-rc.1",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@esri/arcgis-html-sanitizer": "~3.0.1",
|
|
29
29
|
"@esri/calcite-colors": "~6.1.0",
|
|
30
|
-
"@esri/calcite-components": "^1.4.
|
|
30
|
+
"@esri/calcite-components": "^1.4.2",
|
|
31
31
|
"@popperjs/core": "~2.11.7",
|
|
32
32
|
"focus-trap": "~7.4.3",
|
|
33
33
|
"luxon": "~3.3.0",
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{unique as e,isSome as l}from"../../core/arrayUtils.js";import t from"../../core/Logger.js";import{getOrCreateMapValue as i}from"../../core/MapUtils.js";import{convertDateFormatToIntlOptions as o,formatDate as a}from"../../intl/date.js";import{format as n,round as s}from"./numberUtils.js";import r from"../visualVariables/support/ColorStop.js";import{getColorFromSymbol as u}from"../../symbols/support/utils.js";import{getRampStops as f}from"../../widgets/Legend/support/colorRampUtils.js";import{getHeatmapRampStops as d}from"../../widgets/Legend/support/heatmapRampUtils.js";const p=t.getLogger("esri.renderers.support.utils"),m={lte:"<=",gte:">=",lt:"<",gt:">",pct:"%",ld:"–"},c={millisecond:0,second:1,minute:2,hour:3,day:4,month:5,year:6},y={millisecond:"long-month-day-year-long-time",second:"long-month-day-year-long-time",minute:"long-month-day-year-short-time",hour:"long-month-day-year-short-time",day:"long-month-day-year",month:"long-month-day-year",year:"year"},g=o("short-date");async function h(e,l,t){i(e,l,(()=>[])).push(...t)}async function b(l){const t=new Map;if(!l)return t;if("visualVariables"in l&&l.visualVariables){const e=l.visualVariables.filter((e=>"color"===e.type));for(const l of e){const e=(await f(l)??[]).map((e=>e.color));await h(t,l.field||l.valueExpression,e)}}if("heatmap"===l.type){const e=d(l).map((e=>e.color));await h(t,l.field||l.valueExpression,e)}else if("pie-chart"===l.type){for(const e of l.attributes)await h(t,e.field||e.valueExpression,[e.color]);await h(t,"default",[l?.othersCategory?.color,u(l.backgroundFillSymbol,null)])}else if("dot-density"===l.type){for(const e of l.attributes)await h(t,e.field||e.valueExpression,[e.color]);await h(t,"default",[l.backgroundColor])}else if("unique-value"===l.type)if("predominance"===l.authoringInfo?.type)for(const e of l.uniqueValueInfos??[])await h(t,e.value.toString(),[u(e.symbol,null)]);else{const e=(l.uniqueValueInfos??[]).map((e=>u(e.symbol,null))),{field:i,field2:o,field3:a,valueExpression:n}=l;(i||n)&&await h(t,i||n,e),o&&await h(t,o,e),a&&await h(t,a,e)}else if("class-breaks"===l.type){const e=l.classBreakInfos.map((e=>u(e.symbol,null))),{field:i,valueExpression:o}=l;await h(t,i??o,e)}else"simple"===l.type&&await h(t,"default",[u(l.symbol,null)]);return"defaultSymbol"in l&&l.defaultSymbol&&await h(t,"default",[u(l.defaultSymbol,null)]),t.forEach(((l,i)=>{const o=e(l.filter(Boolean),((e,l)=>JSON.stringify(e)===JSON.stringify(l)));t.set(i,o)})),t}async function v(e,l,t){const o=i(e,l,(()=>new Map));for(const i of t)o.set(i.value,i.color)}async function w(e){const l=new Map;if(!e)return l;if("unique-value"!==e.type||e.authoringInfo?.type)if("class-breaks"===e.type){const t=e.classBreakInfos.map((e=>({value:e.minValue,color:u(e.symbol,null)}))).reverse(),{field:i,valueExpression:o}=e;await v(l,i??o,t)}else"simple"===e.type&&await v(l,"default",[{value:
|
|
5
|
+
import{unique as e,isSome as l}from"../../core/arrayUtils.js";import t from"../../core/Logger.js";import{getOrCreateMapValue as i}from"../../core/MapUtils.js";import{convertDateFormatToIntlOptions as o,formatDate as a}from"../../intl/date.js";import{format as n,round as s}from"./numberUtils.js";import r from"../visualVariables/support/ColorStop.js";import{getColorFromSymbol as u}from"../../symbols/support/utils.js";import{getRampStops as f}from"../../widgets/Legend/support/colorRampUtils.js";import{getHeatmapRampStops as d}from"../../widgets/Legend/support/heatmapRampUtils.js";const p=t.getLogger("esri.renderers.support.utils"),m={lte:"<=",gte:">=",lt:"<",gt:">",pct:"%",ld:"–"},c={millisecond:0,second:1,minute:2,hour:3,day:4,month:5,year:6},y={millisecond:"long-month-day-year-long-time",second:"long-month-day-year-long-time",minute:"long-month-day-year-short-time",hour:"long-month-day-year-short-time",day:"long-month-day-year",month:"long-month-day-year",year:"year"},g=o("short-date");async function h(e,l,t){i(e,l,(()=>[])).push(...t)}async function b(l){const t=new Map;if(!l)return t;if("visualVariables"in l&&l.visualVariables){const e=l.visualVariables.filter((e=>"color"===e.type));for(const l of e){const e=(await f(l)??[]).map((e=>e.color));await h(t,l.field||l.valueExpression,e)}}if("heatmap"===l.type){const e=d(l).map((e=>e.color));await h(t,l.field||l.valueExpression,e)}else if("pie-chart"===l.type){for(const e of l.attributes)await h(t,e.field||e.valueExpression,[e.color]);await h(t,"default",[l?.othersCategory?.color,u(l.backgroundFillSymbol,null)])}else if("dot-density"===l.type){for(const e of l.attributes)await h(t,e.field||e.valueExpression,[e.color]);await h(t,"default",[l.backgroundColor])}else if("unique-value"===l.type)if("predominance"===l.authoringInfo?.type)for(const e of l.uniqueValueInfos??[])await h(t,e.value.toString(),[u(e.symbol,null)]);else{const e=(l.uniqueValueInfos??[]).map((e=>u(e.symbol,null))),{field:i,field2:o,field3:a,valueExpression:n}=l;(i||n)&&await h(t,i||n,e),o&&await h(t,o,e),a&&await h(t,a,e)}else if("class-breaks"===l.type){const e=l.classBreakInfos.map((e=>u(e.symbol,null))),{field:i,valueExpression:o}=l;await h(t,i??o,e)}else"simple"===l.type&&await h(t,"default",[u(l.symbol,null)]);return"defaultSymbol"in l&&l.defaultSymbol&&await h(t,"default",[u(l.defaultSymbol,null)]),t.forEach(((l,i)=>{const o=e(l.filter(Boolean),((e,l)=>JSON.stringify(e)===JSON.stringify(l)));t.set(i,o)})),t}async function v(e,l,t){const o=i(e,l,(()=>new Map));for(const i of t)o.set(i.value,i.color)}async function w(e){const l=new Map;if(!e)return l;if("unique-value"!==e.type||e.authoringInfo?.type)if("class-breaks"===e.type){const t=e.classBreakInfos.map((e=>({value:e.minValue,color:u(e.symbol,null)}))).reverse(),{field:i,valueExpression:o}=e;await v(l,i??o,t)}else"simple"===e.type&&await v(l,"default",[{value:"default",color:u(e.symbol,null)}]);else{const t=(e.uniqueValueInfos??[]).map((e=>({value:e.value,color:u(e.symbol,null)}))),{field:i,field2:o,field3:a,valueExpression:n,fieldDelimiter:s}=e,r=[i,o,a].filter(Boolean).join(s||"");(r||n)&&await v(l,r||n,t)}if("defaultSymbol"in e&&e.defaultSymbol&&await v(l,"default",[{value:"default",color:u(e.defaultSymbol,null)}]),"visualVariables"in e&&e.visualVariables){const t=e.visualVariables.filter((e=>"color"===e.type));for(const e of t){const t=await f(e)??[];await v(l,e.field||e.valueExpression,t)}}return l}function V(e,l,t){let i="";return 0===l?i=m.lt+" ":l===t&&(i=m.gt+" "),i+e}function x(e){const{values:l,colors:t,labelIndexes:i,isDate:o,dateFormatOptions:s}=e;return l.map(((e,u)=>{let f=null;if(!i||i.includes(u)){let t;t=o?a(e,s):n(e),t&&(f=V(t,u,l.length-1))}return new r({value:e,color:t[u],label:f})}))}function E(e){let l=e.minValue,t=e.maxValue;const i=e.isFirstBreak?"":m.gt+" ",o="percent-of-total"===e.normalizationType?m.pct:"";return l=null==l?"":n(l),t=null==t?"":n(t),i+l+o+" "+m.ld+" "+t+o}function F(e){const l=e.classBreakInfos,t=e.normalizationType;let i=[];if(l&&l.length)if("standard-deviation"!==e.classificationMethod)if(e.round){i.push(l[0].minValue);for(const e of l)i.push(e.maxValue);i=s(i),l.forEach(((e,l)=>{e.label=E({minValue:0===l?i[0]:i[l],maxValue:i[l+1],isFirstBreak:0===l,normalizationType:t})}))}else l.forEach(((e,l)=>{e.label=E({minValue:e.minValue,maxValue:e.maxValue,isFirstBreak:0===l,normalizationType:t})}));else p.warn("setLabelsForClassBreaks","cannot set labels for class breaks generated using 'standard-deviation' method.")}function z(e){const l=e.map((e=>new Date(e))),t=l.length;let i=1/0,o=null;for(let a=0;a<t-1;a++){const e=l[a];let n=1/0,s=null;for(let i=a+1;i<t;i++){const t=l[i],o=(e.getFullYear()!==t.getFullYear()?"year":e.getMonth()!==t.getMonth()&&"month")||e.getDate()!==t.getDate()&&"day"||e.getHours()!==t.getHours()&&"hour"||e.getMinutes()!==t.getMinutes()&&"minute"||e.getSeconds()!==t.getSeconds()&&"second"||"millisecond",a=c[o];a<n&&(n=a,s=o)}n<i&&(i=n,o=s)}return o}function I(e){const{value:l,domain:t,fieldInfo:i,dateFormatInterval:s}=e;let r=String(l);const u=t&&"codedValues"in t&&t.codedValues?t.getName(l):null;return u?r=u:"number"==typeof l&&(r=i&&"date"===i.type?a(l,s&&o(y[s])):n(l)),r}function S(e,l){return"normalizationField"in e&&e.normalizationField?j(e.field,e.normalizationField):"field"in e&&e.field?k(e.field):"valueExpression"in e&&e.valueExpression?B(e.valueExpression,e.valueExpressionTitle,l):null}function k(e){return{type:"field",field:e}}function j(e,l){return{type:"normalized-field",field:e,normalizationField:l}}function B(e,l,t){return{type:"expression",expression:e,title:l,returnType:t}}function M(t,i){const o=[];if("class-breaks"===t.type||"heatmap"===t.type)o.push(S(t,"number"));else if("unique-value"===t.type){const e=t.authoringInfo;if(e&&"relationship"===e.type){if(e.field1&&e.field2){const l=e.field1.field,t=e.field2.field,i=e.field1.normalizationField,a=e.field2.normalizationField;o.push(S({field:l,normalizationField:i})),o.push(S({field:t,normalizationField:a}))}}else{const e=t.uniqueValueInfos?.[0];let l=null;if(e&&e.value){const e=typeof t.uniqueValueInfos[0].value;"string"!==e&&"number"!==e||(l=e)}o.push(S(t,l)),[t.field2,t.field3].forEach((e=>e&&o.push(k(e))))}}else"attributes"in t&&t.attributes?.forEach((e=>o.push(S(e,"number"))));const a=i?i(t):"visualVariables"in t?t.visualVariables:null;return a&&a.forEach((e=>o.push(S(e,"number")))),e(o.filter(l),((e,l)=>"field"===e.type&&"field"===l.type?e.field===l.field:"normalized-field"===e.type&&"normalized-field"===l.type?e.field===l.field&&e.normalizationField===l.normalizationField:"expression"===e.type&&"expression"===l.type&&e.expression===l.expression))}export{z as calculateDateFormatInterval,E as createClassBreakLabel,x as createColorStops,I as createUniqueValueLabel,S as getAttribute,M as getAttributes,w as getColorsForRendererValues,b as getColorsFromRenderer,F as setLabelsForClassBreaks,g as timelineDateFormatOptions};
|
package/support/arcadeUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../geometry.js";import{p as e,c as r,e as n,a as t,r as o,l as s,b as i,d as a,f as u,s as l,g as c}from"../chunks/arcade.js";export{h as arcade}from"../chunks/arcade.js";import f from"../arcade/Dictionary.js";import p from"../arcade/Feature.js";import{m,o as y,k as d,c as v,a as g,b as x,p as j,r as w,q as b}from"../chunks/languageUtils.js";import{clone as E}from"../core/lang.js";import
|
|
5
|
+
import"../geometry.js";import{p as e,c as r,e as n,a as t,r as o,l as s,b as i,d as a,f as u,s as l,g as c}from"../chunks/arcade.js";export{h as arcade}from"../chunks/arcade.js";import f from"../arcade/Dictionary.js";import p from"../arcade/Feature.js";import{m,o as y,k as d,c as v,a as g,b as x,p as j,r as w,q as b}from"../chunks/languageUtils.js";import{clone as E}from"../core/lang.js";import S from"../geometry/Point.js";import F from"../geometry/Polygon.js";import $ from"../geometry/Polyline.js";import R from"../geometry/Multipoint.js";import C from"../geometry/Extent.js";const k=/^\$(feature|aggregatedFeatures)\./i,z={vars:{$feature:"any",$view:"any"},spatialReference:null};function M(e){return e.replaceAll(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function P(e){return null==e?null:m(e)||y(e)?"array":d(e)?"date":v(e)?"text":g(e)?"boolean":x(e)?"number":e instanceof f?"dictionary":j(e)?"feature":e instanceof S?"point":e instanceof F?"polygon":e instanceof $?"polyline":e instanceof R?"multipoint":e instanceof C?"extent":w(e)?"featureSet":b(e)?"featureSetCollection":null}function A(r){if(!r)return null;try{return e(r)}catch(n){}return null}function I(e,n){const t="string"==typeof e?A(e):e;if(!t)return null;try{return n=n||E(z),r(t,n)}catch(o){}return null}function G(e,r){return{vars:{$feature:null==e?new p:p.createFromGraphic(e,null),$view:r&&r.view},spatialReference:r&&r.sr}}function V(e,r,n){return p.createFromGraphicLikeObject(r,e,n,null)}function q(e,r){null!=e.vars&&(e.vars.$feature=r)}function L(e,r){let t;try{t=n(e,r)}catch(o){t=null}return t}function T(e,r){let n;try{n=e?e(r):null}catch(t){n=null}return n}function D(e,r){try{return e?e(r):Promise.resolve(null)}catch(n){return Promise.resolve(null)}}function J(e,r){if(!e)return[];const n="string"==typeof e?A(e):e;if(!n)return[];const o=t(n);let s=new Array;o.forEach((e=>{k.test(e)&&(e=e.replace(k,""),s.push(e))}));const i=s.filter((e=>e.includes("*")));return s=s.filter((e=>!i.includes(e))),r&&i.forEach((e=>{const n=new RegExp(`^${e.split(/\*+/).map(M).join(".*")}$`,"i");r.forEach((e=>n.test(e)?s.push(e):null))})),[...new Set(s.sort())]}function O(e){return o(e,"$view")}function U(e,r){return!!e&&o(e,r)}function B(e){if(!e||null==e.spatialReference&&(null==e.scale||null==e.viewingMode))return;return{view:e.viewingMode&&null!=e.scale?new f({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function H({url:e,spatialReference:r,lrucache:n,interceptor:t}){const o=u();return o?o.createFeatureSetCollectionFromService(e,r,n,t):null}function K({layer:e,spatialReference:r,outFields:n,returnGeometry:t,lrucache:o,interceptor:s}){if(null===e)return null;const i=u();return i?i.constructFeatureSet(e,r,n,t??!0,o,s):null}function N(e){if(null===e?.map)return null;const r=u();return r?r.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function Q(e,r){return f.convertJsonToArcade(e,r)}function W(e,r,n=[]){return s(e,r,n)}function X(){return i()}function Y(){return a()}function Z(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type||"dot-density"===e.type||"dictionary"===e.type||"pie-chart"===e.type}function _(e){return"esri.layers.support.LabelClass"===e.declaredClass}function ee(e){return"esri.PopupTemplate"===e.declaredClass}function re(e,r){if(!e)return!1;if("string"==typeof e)return r(e);const n=e;if(Z(n)){if("dot-density"===n.type){const e=n.attributes?.some((e=>r(e.valueExpression)));if(e)return e}const e=n.visualVariables,t=!!e&&e.some((e=>{let n=r(e.valueExpression);return"size"===e.type&&(ie(e.minSize)&&(n=n||r(e.minSize.valueExpression)),ie(e.maxSize)&&(n=n||r(e.maxSize.valueExpression))),n}));return!(!("valueExpression"in n)||!r(n.valueExpression))||t}if(_(n)){const e=n.labelExpressionInfo&&n.labelExpressionInfo.expression;return!(!e||!r(e))||!1}return!!ee(n)&&(!!n.expressionInfos&&n.expressionInfos.some((e=>r(e.expression)))||Array.isArray(n.content)&&n.content.some((e=>"expression"===e.type&&r(e.expressionInfo?.expression))))}function ne(e){const r=A(e);return!!r&&l(r)}function te(e){return re(e,ne)}function oe(e){const r=A(e);return!!r&&c(r)}function se(e){return re(e,oe)}function ie(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}export{f as Dictionary,p as arcadeFeature,K as convertFeatureLayerToFeatureSet,Q as convertJsonToArcade,N as convertMapToFeatureSetCollection,H as convertServiceUrlToWorkspace,G as createExecContext,V as createFeature,I as createFunction,A as createSyntaxTree,O as dependsOnView,Y as enableFeatureSetOperations,X as enableGeometryOperations,L as evalSyntaxTree,D as executeAsyncFunction,T as executeFunction,J as extractFieldNames,P as getArcadeType,B as getViewInfo,te as hasGeometryFunctions,se as hasGeometryOperations,U as hasVariable,W as loadScriptDependencies,q as updateExecContext};
|
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const c="
|
|
5
|
+
const c="20230531",e="89ce9b45825f265dc4f8cee62271da5c3694c01c";export{c as buildDate,e as commitHash};
|