@arcgis/core 4.34.0-next.15 → 4.34.0-next.16
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/applications/Components/sanitizerUtils.d.ts +3 -0
- package/applications/Components/sanitizerUtils.js +5 -0
- package/applications/MapViewer/layerUtils.d.ts +3 -0
- package/applications/MapViewer/layerUtils.js +5 -0
- package/applications/SceneViewer/layerUtils.d.ts +2 -2
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{a08ce98672ab94d19613.js → 04e558a970c6a77f243e.js} +1 -1
- package/assets/esri/core/workers/chunks/0d99579d8cdeddc0fc9c.js +1 -0
- package/assets/esri/core/workers/chunks/1443520c9fb23381f8d5.js +1 -0
- package/assets/esri/core/workers/chunks/1a7570bd2b79194ff94b.js +42 -0
- package/assets/esri/core/workers/chunks/{0ed4ec00ef16aa58a33d.js → 254c4f7e277ae9915dce.js} +1 -1
- package/assets/esri/core/workers/chunks/2990145d7ac3af0d68be.js +1 -0
- package/assets/esri/core/workers/chunks/2d51d0a24cdc89bafa1c.js +1 -0
- package/assets/esri/core/workers/chunks/2d89e354eeadadca4f7f.js +1 -0
- package/assets/esri/core/workers/chunks/3f8cc157b65a9d570921.js +1 -0
- package/assets/esri/core/workers/chunks/{2254989ca3ff3960f2fe.js → 400a4c9fa62964f8fa1d.js} +1 -1
- package/assets/esri/core/workers/chunks/445ddf57d2f503a0b98b.js +1 -0
- package/assets/esri/core/workers/chunks/513dc2467e9b8b8c6df4.js +1 -0
- package/assets/esri/core/workers/chunks/52239e958a82ebcd2e7a.js +1 -0
- package/assets/esri/core/workers/chunks/{e980a81c4d1e05f07141.js → 53e43798d08ad2075c1f.js} +1 -1
- package/assets/esri/core/workers/chunks/{8b93cd4132934b0d7d39.js → 54814a269d44855f0673.js} +1 -1
- package/assets/esri/core/workers/chunks/55ce214a10fb6fc2e901.js +1 -0
- package/assets/esri/core/workers/chunks/66c8816e91e3f9e214d4.js +346 -0
- package/assets/esri/core/workers/chunks/7c56740cac444419e5b4.js +1 -0
- package/assets/esri/core/workers/chunks/{7f14d6cb754c7e94748c.js → 827919fe23e06e40a330.js} +139 -115
- package/assets/esri/core/workers/chunks/87986f31061c426e761b.js +1 -0
- package/assets/esri/core/workers/chunks/{7ae88c141a5d85e5bb88.js → 87a743df7d8556d5e253.js} +1 -1
- package/assets/esri/core/workers/chunks/8855f1a6224ffbd0bb66.js +1 -0
- package/assets/esri/core/workers/chunks/885e8e90dfe5dbd5053d.js +1 -0
- package/assets/esri/core/workers/chunks/93e66d9c49eaeb503bff.js +1 -0
- package/assets/esri/core/workers/chunks/9959a91c8de6fef499c2.js +1 -0
- package/assets/esri/core/workers/chunks/c1a72e1dbd1ba7b41965.js +1 -0
- package/assets/esri/core/workers/chunks/c4065934637b820cad5b.js +1 -0
- package/assets/esri/core/workers/chunks/cc1328cacc4ac07eb548.js +1 -0
- package/assets/esri/core/workers/chunks/{05f2133f05f86266d8c7.js → d2139307f62ea8bf999a.js} +1 -1
- package/assets/esri/core/workers/chunks/{3f58da371633967a61ca.js → ddb66fe6fcd0764daa7a.js} +1 -1
- package/assets/esri/core/workers/chunks/{70e5848aa372475fc8fa.js → eac7af86166c09c6a9be.js} +1 -1
- package/assets/esri/core/workers/chunks/{7317346ed8d7c5bb859d.js → f537a02dc2fc9e6435a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e1906d35a764f7f10b0.js → fe1129f03476825a7344.js} +1 -1
- package/chunks/DefaultMaterial.glsl.js +30 -28
- package/chunks/RealisticTree.glsl.js +25 -22
- package/chunks/aiServices.js +1 -1
- package/config.js +1 -1
- package/core/LRUCache.js +1 -1
- package/core/MemCache.js +1 -1
- package/core/urlUtils.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/WorkerHandle.js +1 -1
- package/interfaces.d.ts +51 -19
- package/kernel.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/fetchService.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/package.json +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/loadUtils.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
- package/rest/support/TranslateParameters.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/WaterSymbol3DLayer.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/symbols/support/utils.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
- package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SLodHandling.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/layers/support/makeScheduleFunction.js +1 -1
- package/views/3d/layers/support/symbolColorUtils.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/StreamDataLoader.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/RenderSubmitSystem.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstanceColor.glsl.js +11 -0
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/MaskedColor.glsl.js +18 -0
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +40 -26
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +35 -24
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +12 -8
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +3 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +26 -8
- package/views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Float3DrawUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Float4BindUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Float4DrawUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Float4sPassUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/FloatDrawUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Matrix4sDrawUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Matrix4sPassUniform.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/support/ItemList.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/dateUtils.js +1 -1
- package/widgets/support/symbolPreviewUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0dbb350ce651bc236ec8.js +0 -1
- package/assets/esri/core/workers/chunks/0ff6f15d46d7ddf6fe4d.js +0 -1
- package/assets/esri/core/workers/chunks/1f559f1e7f0bc0f4bf20.js +0 -346
- package/assets/esri/core/workers/chunks/462cc6966d060be59c7c.js +0 -1
- package/assets/esri/core/workers/chunks/4a805e7a57d25c4b595f.js +0 -66
- package/assets/esri/core/workers/chunks/58f92100b1b2343111c6.js +0 -1
- package/assets/esri/core/workers/chunks/5dcc8fa321f0a7c49f36.js +0 -1
- package/assets/esri/core/workers/chunks/5e539ce4751bcfa57145.js +0 -1
- package/assets/esri/core/workers/chunks/6194636638b0439fccd8.js +0 -1
- package/assets/esri/core/workers/chunks/622c0552ca3cd674d46c.js +0 -1
- package/assets/esri/core/workers/chunks/64f5f27e7c5649d79cbc.js +0 -1
- package/assets/esri/core/workers/chunks/658e82c9b722852e02d0.js +0 -1
- package/assets/esri/core/workers/chunks/679d7baea233faf3fdbc.js +0 -1
- package/assets/esri/core/workers/chunks/7aef81778155be373d3e.js +0 -1
- package/assets/esri/core/workers/chunks/97b69fec3e87f11210ba.js +0 -1
- package/assets/esri/core/workers/chunks/a250a5c6e055e33bd25c.js +0 -1
- package/assets/esri/core/workers/chunks/b4273381dc069f4e1fa2.js +0 -1
- package/assets/esri/core/workers/chunks/b72137c63b7f2a525d9e.js +0 -1
- package/assets/esri/core/workers/chunks/c2264451d12f1fbaad22.js +0 -1
- package/assets/esri/core/workers/chunks/c6c86cbe65a58c3093ae.js +0 -1
- package/assets/esri/core/workers/chunks/fe3703ec198cbfebec30.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import i from"../../../core/Logger.js";import s from"../../../core/PooledArray.js";import r from"../../../core/Promise.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{watch as d,initial as o,sync as n}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingRect as u}from"../../../geometry/projection/projectBoundingRect.js";import{create as _}from"../../../geometry/support/aaBoundingRect.js";import{PromiseQueue as c}from"../../support/PromiseQueue.js";import{viewingModeFromString as p}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as g}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{addCallback as m}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as y}from"../../../views/3d/layers/i3s/I3SIndex.js";import f from"../../../views/3d/layers/i3s/I3SLodHandling.js";import{NodeState as x,CacheState as N}from"../../../views/3d/layers/i3s/I3SNode.js";import b from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as w}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as v,getIndexCrs as C,findIntersectingNodes as L}from"../../../views/3d/layers/i3s/I3SUtil.js";import D from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{FadeDirection as V}from"../../../views/3d/layers/support/I3SLayerView.js";import{toBoundingRect as I}from"../../../views/3d/support/extentUtils.js";import{ClientType as A,maxDownloadSlots as S}from"../../../views/3d/support/index.js";import{minQuality as M}from"../../../views/3d/support/MemoryController.js";import{noBudget as F}from"../../../views/support/Scheduler.js";const O=100,P=2,U=1e4,q=1e-4,G=1.2,Q=500,j=1.5;let T=class extends(r.EsriPromiseMixin(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(A.I3S_INDEX);return new w(e,this.layer.customParameters,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(A.I3S_DATA);return new w(e,this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return v(this.layer)}get crsIndex(){return C(this.layer)}get layer(){return this.layerView.i3slayer}get running(){return this.updating}get rootNodeVisible(){if(this._index){const e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new s({deallocator:null}),this._modificationsNodeFilteringArray=new s,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._idleQueue=new c,this._elevationUpdateNodes=new s({deallocator:null}),this._errorCount=0}initialize(){const{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new f(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((([s])=>{if(this.destroyed||!e||e.destroyed||!s)return;const{view:r,clientGeometry:a}=e,{resourceController:l}=r;if(this._setClippingArea(r.clippingArea),this.addHandles([d((()=>r?.pointsOfInterest?.focus?.renderLocation),(e=>this._pointOfInterestChanged(e)),o),d((()=>r.quality),(()=>this._setCameraDirty()),n),d((()=>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=l.scheduler.registerIdleStateCallbacks(t,i)}),o),m(e.view.resourceController.scheduler,this),d((()=>[this.featureTarget,this.fixedFeatureTarget]),(()=>{this._setCameraDirty(),this._stableFeatureLOD=!1})),d((()=>r.state?.contentCamera),(()=>this._setCameraDirty())),d((()=>t.elevationInfo),(e=>this._elevationInfoChanged(e))),d((()=>e.lodFactor),(()=>this._setCameraDirty())),d((()=>e.availableFields),(()=>this._requiredFieldsChange())),d((()=>e.holeFilling),(e=>null!=this._index&&(this._index.holeFilling=e)))]),this._viewportQueries=new D(this.crsIndex,r.renderCoordsHelper,r.state.contentCamera,!r.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?r.basemapTerrain:r.elevationProvider,p(r.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new g(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:r.renderCoordsHelper.spatialReference},r.resourceController.memoryController,this.worker),this._index=new y(p(r.viewingMode),t,s,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,i.getLogger(this),e.holeFilling,(t=>e.isNodeLoaded(t)),(t=>e.isNodeReloading(t)),(e=>this._shouldLoadNode(e)),(e=>this._enableFromGPUCache(e,x.Leaf)),(e=>this._needsUpdate(e)),(()=>!this.indexStreamController.busy),(t=>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),this._index.layerFilterChanged(!!e.hasGeometryFilter),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()})))}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._nodeLoader=null,k.prune()}get viewportQueries(){return this._viewportQueries}_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=R(e,i),r=R(t,i);return s>=0&&r>=0?{index:s,name:t[r].name,field:t[r],attributeStorageInfo:e[s]}:null})).filter((e=>null!=e&&e.name!==i))}_requiredFieldsChange(){const e=this._getRequiredAttributes();E(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=_();I(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=H.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!=t){if(null==this._index)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const e=(e,t)=>{this.layerView.removeNode(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?.rootNode||null==t)return null;this.crsIndex.equals(t)||(u(e,t,B,this.crsIndex),e=B);const s=this._elevationUpdateNodes;return s.clear(),L(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.getServiceMbsInRenderSR(e):null}_elevationInfoChanged(e){null!=this._index&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}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 unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):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=e:this._disableMemCache=!0}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(s){this._errorCount<50?i.getLogger(this).error(`Error during processing: ${s} at ${s.stack}`):50===this._errorCount&&i.getLogger(this).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>Q){if(this._featureLOD<=q)return;this._featureLOD/=j,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=U||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this._lod,r=this._index.checkFeatureTarget(t,s);r!==s&&(this._featureLOD=r/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*G||e&&i.estimate>t))return;if(this._featureLOD<=q)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(U,Math.max(q,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);s=t.getParent(s.index))if(this._enableFromGPUCache(s,x.Hole)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(null==this._index)return!1;let i=(this._isIdle?O:P)-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 r=this._index.getNode(s.add.back());if(null==r||r.cacheState!==N.Cached&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(r),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>=P)&&(this._downloadingCount<S&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView){if(this.layerView.contentVisible){const i=(this._index?.indexMissing??0)+3*(this._index?.updates.add.length??0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||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._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=H.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;return(Math.min(this.layerView.view.quality,.5)-M)/(.5-M)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){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))}_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,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new b(this.layer,this.dataStreamController,i.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading(((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)})),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,F,z.pop)}_removeNodes(e,t,i){if(0!==e.length&&!t.done)for(null!=this._index&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),r=this._index;i===z.fadeout&&this.layerView.nodeFadeoutEnabled&&null!=r&&r.isGeometryVisible(s)?this.layerView.fadeNode(s,V.FadeOut,!0):this.layerView.removeNode(s),t.madeProgress()}}_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=this.layerView.getLoadedAttributes(e.index),s=E(i,this._requiredAttributes)?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(!a(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 i.getLogger(this).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(!a(e))throw e})).finally((()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateUpdating()}))}_loadAndAddNode(e,t){return e.cacheState===N.Uncached?this._loadUncached(e,t).then((()=>!1)):this._loadCached(e,t).then((t=>!t&&(e.cacheState=N.Uncached,!0))).catch((t=>!a(t)&&(e.cacheState=N.Uncached,!0)))}_enableFromGPUCache(e,t){if(this._disableMemCache||null==this._index)return!1;if(t===x.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?.attributeInfo&&E(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,x.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),r=(t,i)=>this._clientNodeLoader.loadTextures(e,t,i),a=e.index>=0?s:r,d=await this.schedule((()=>i.loadCachedNodeData(e,t,a)),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=N.Cached})).catch((t=>{if(!a(t))throw i.getLogger(this).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())}get test(){}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([l({readOnly:!0})],T.prototype,"isMeshPyramid",null),e([l({readOnly:!0})],T.prototype,"isGraphics3D",null),e([l({readOnly:!0})],T.prototype,"useMaximumNumberOfFeatures",null),e([l({readOnly:!0})],T.prototype,"indexStreamController",null),e([l({readOnly:!0})],T.prototype,"dataStreamController",null),e([l({readOnly:!0})],T.prototype,"crsVertex",null),e([l({readOnly:!0})],T.prototype,"crsIndex",null),e([l()],T.prototype,"featureTarget",void 0),e([l()],T.prototype,"fixedFeatureTarget",void 0),e([l()],T.prototype,"layerView",void 0),e([l()],T.prototype,"layer",null),e([l()],T.prototype,"updating",void 0),e([l({readOnly:!0})],T.prototype,"running",null),e([l()],T.prototype,"updatingProgress",void 0),e([l({readOnly:!0})],T.prototype,"leavesReached",void 0),e([l({constructOnly:!0})],T.prototype,"worker",void 0),e([l({readOnly:!0,dependsOn:[]})],T.prototype,"rootNodeVisible",null),T=e([h("esri.layers.graphics.controllers.I3SOnDemandController")],T);const k=new s({deallocator:null});function E(e,t){return null!=e&&e.length===t.length&&e.every((e=>R(t,e.name)>=0))}function R(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 H={distancePenalty:10},B=_();var z;!function(e){e[e.pop=0]="pop",e[e.fadeout=1]="fadeout"}(z||(z={}));export{T as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import r from"../../../core/PooledArray.js";import a 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/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingRect as _}from"../../../geometry/projection/projectBoundingRect.js";import{create as c}from"../../../geometry/support/aaBoundingRect.js";import{PromiseQueue as p}from"../../support/PromiseQueue.js";import{viewingModeFromString as g}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as m}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{addCallback as y}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as f}from"../../../views/3d/layers/i3s/I3SIndex.js";import x from"../../../views/3d/layers/i3s/I3SLodHandling.js";import{NodeState as N,CacheState as b}from"../../../views/3d/layers/i3s/I3SNode.js";import w from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as v}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as C,getIndexCrs as L,findIntersectingNodes as D}from"../../../views/3d/layers/i3s/I3SUtil.js";import V from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{FadeDirection as I}from"../../../views/3d/layers/support/I3SLayerView.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{ClientType as S,maxDownloadSlots as M}from"../../../views/3d/support/index.js";import{minQuality as F}from"../../../views/3d/support/MemoryController.js";import{noBudget as O}from"../../../views/support/Scheduler.js";const P=100,U=2,q=1e4,G=1e-4,Q=1.2,j=500,k=1.5;let T=class extends(a.EsriPromiseMixin(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(S.I3S_INDEX);return new v(e,this.layer.customParameters,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(S.I3S_DATA);return new v(e,this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return C(this.layer)}get crsIndex(){return L(this.layer)}get layer(){return this.layerView.i3slayer}get running(){return this.updating}get rootNodeVisible(){if(this._index){const e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new r({deallocator:null}),this._modificationsNodeFilteringArray=new r,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._idleQueue=new p,this._elevationUpdateNodes=new r({deallocator:null}),this._errorCount=0}initialize(){const{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new x(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((([s])=>{if(this.destroyed||!e||e.destroyed||!s)return;const{view:r,clientGeometry:a}=e,{resourceController:d}=r;if(this._setClippingArea(r.clippingArea),this.addHandles([o((()=>r?.pointsOfInterest?.focus?.renderLocation),(e=>this._pointOfInterestChanged(e)),n),o((()=>r.quality),(()=>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=d.scheduler.registerIdleStateCallbacks(t,i)}),n),y(e.view.resourceController.scheduler,this),o((()=>[this.featureTarget,this.fixedFeatureTarget]),(()=>{this._setCameraDirty(),this._stableFeatureLOD=!1})),o((()=>r.state?.contentCamera),(()=>this._setCameraDirty())),o((()=>t.elevationInfo),(e=>this._elevationInfoChanged(e))),o((()=>e.lodFactor),(()=>this._setCameraDirty())),o((()=>e.availableFields),(()=>this._requiredFieldsChange())),o((()=>e.holeFilling),(e=>null!=this._index&&(this._index.holeFilling=e)))]),this._viewportQueries=new V(this.crsIndex,r.renderCoordsHelper,r.state.contentCamera,!r.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?r.basemapTerrain:r.elevationProvider,g(r.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new m(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:r.renderCoordsHelper.spatialReference},r.resourceController.memoryController,this.worker),this._index=new f(g(r.viewingMode),t,s,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,i.getLogger(this),e.holeFilling,(t=>e.isNodeLoaded(t)),(t=>e.isNodeReloading(t)),(e=>this._shouldLoadNode(e)),(e=>this._enableFromGPUCache(e,N.Leaf)),(e=>this._needsUpdate(e)),(()=>!this.indexStreamController.busy),(t=>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),this._index.layerFilterChanged(!!e.hasGeometryFilter),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()})))}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._nodeLoader=null,E.prune(),this._index=null,this._lodHandling=s(this._lodHandling),this._nodeLoader=null,this._clientNodeLoader=null,this._viewportQueries=null,this._set("worker",null)}get viewportQueries(){return this._viewportQueries}_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=H(e,i),r=H(t,i);return s>=0&&r>=0?{index:s,name:t[r].name,field:t[r],attributeStorageInfo:e[s]}:null})).filter((e=>null!=e&&e.name!==i))}_requiredFieldsChange(){const e=this._getRequiredAttributes();R(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=c();A(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=B.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!=t){if(null==this._index)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const e=(e,t)=>{this.layerView.removeNode(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?.rootNode||null==t)return null;this.crsIndex.equals(t)||(_(e,t,z,this.crsIndex),e=z);const s=this._elevationUpdateNodes;return s.clear(),D(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.getServiceMbsInRenderSR(e):null}_elevationInfoChanged(e){null!=this._index&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}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 unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):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=e:this._disableMemCache=!0}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(s){this._errorCount<50?i.getLogger(this).error(`Error during processing: ${s} at ${s.stack}`):50===this._errorCount&&i.getLogger(this).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>j){if(this._featureLOD<=G)return;this._featureLOD/=k,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=q||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this._lod,r=this._index.checkFeatureTarget(t,s);r!==s&&(this._featureLOD=r/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*Q||e&&i.estimate>t))return;if(this._featureLOD<=G)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(q,Math.max(G,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);s=t.getParent(s.index))if(this._enableFromGPUCache(s,N.Hole)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(null==this._index)return!1;let i=(this._isIdle?P:U)-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 r=this._index.getNode(s.add.back());if(null==r||r.cacheState!==b.Cached&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(r),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>=U)&&(this._downloadingCount<M&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView){if(this.layerView.contentVisible){const i=(this._index?.indexMissing??0)+3*(this._index?.updates.add.length??0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||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._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=B.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;return(Math.min(this.layerView.view.quality,.5)-F)/(.5-F)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){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))}_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,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new w(this.layer,this.dataStreamController,i.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading(((e,t)=>this._removeNodes(e,t,$.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;E.clear(),this.layerView.getLoadedNodeIndices(E);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return E.filterInPlace((e=>{const i=t.getNode(e);return null==i||!t.isGeometryVisible(e)||s(i)})),E.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(E,e,$.pop),!(i&&this._lodDropFactor<1)&&(0===E.length||(E.clear(),!1))}markNodeToRemove(e){E.push(e)}removeMarkedNodes(){this._removeNodes(E,O,$.pop)}_removeNodes(e,t,i){if(0!==e.length&&!t.done)for(null!=this._index&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),r=this._index;i===$.fadeout&&this.layerView.nodeFadeoutEnabled&&null!=r&&r.isGeometryVisible(s)?this.layerView.fadeNode(s,I.FadeOut,!0):this.layerView.removeNode(s),t.madeProgress()}}_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=this.layerView.getLoadedAttributes(e.index),s=R(i,this._requiredAttributes)?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 i.getLogger(this).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===b.Uncached?this._loadUncached(e,t).then((()=>!1)):this._loadCached(e,t).then((t=>!t&&(e.cacheState=b.Uncached,!0))).catch((t=>!d(t)&&(e.cacheState=b.Uncached,!0)))}_enableFromGPUCache(e,t){if(this._disableMemCache||null==this._index)return!1;if(t===N.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?.attributeInfo&&R(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,N.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),r=(t,i)=>this._clientNodeLoader.loadTextures(e,t,i),a=e.index>=0?s:r,d=await this.schedule((()=>i.loadCachedNodeData(e,t,a)),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=b.Cached})).catch((t=>{if(!d(t))throw i.getLogger(this).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())}get test(){}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})],T.prototype,"isMeshPyramid",null),e([h({readOnly:!0})],T.prototype,"isGraphics3D",null),e([h({readOnly:!0})],T.prototype,"useMaximumNumberOfFeatures",null),e([h({readOnly:!0})],T.prototype,"indexStreamController",null),e([h({readOnly:!0})],T.prototype,"dataStreamController",null),e([h({readOnly:!0})],T.prototype,"crsVertex",null),e([h({readOnly:!0})],T.prototype,"crsIndex",null),e([h()],T.prototype,"featureTarget",void 0),e([h()],T.prototype,"fixedFeatureTarget",void 0),e([h()],T.prototype,"layerView",void 0),e([h()],T.prototype,"layer",null),e([h()],T.prototype,"updating",void 0),e([h({readOnly:!0})],T.prototype,"running",null),e([h()],T.prototype,"updatingProgress",void 0),e([h({readOnly:!0})],T.prototype,"leavesReached",void 0),e([h({constructOnly:!0})],T.prototype,"worker",void 0),e([h({readOnly:!0,dependsOn:[]})],T.prototype,"rootNodeVisible",null),T=e([u("esri.layers.graphics.controllers.I3SOnDemandController")],T);const E=new r({deallocator:null});function R(e,t){return null!=e&&e.length===t.length&&e.every((e=>H(t,e.name)>=0))}function H(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 B={distancePenalty:10},z=c();var $;!function(e){e[e.pop=0]="pop",e[e.fadeout=1]="fadeout"}($||($={}));export{T 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import{clone as i}from"../../core/lang.js";import r from"../../core/Logger.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as s}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import d from"../../geometry/Extent.js";import a from"../../geometry/HeightModelInfo.js";import u from"../../geometry/SpatialReference.js";import{sanitizeUrlWithLayerId as y,writeUrlWithLayerId as c}from"../support/arcgisLayerUrl.js";import{elevationInfo as m,maxScale as f,minScale as h,url as v}from"../support/commonProperties.js";import g from"../support/EditFieldsInfo.js";import{FeatureIndex as I}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as F,hasCurrentUser as j,isLayerCacheStale as S,supportsQueryOnly as b,readGlobalIdField as E,readObjectIdField as x,readVersion as U}from"../support/featureLayerUtils.js";import O from"../support/GeometryFieldsInfo.js";import D from"../support/LayerFloorInfo.js";import{isPreferredUrlApplicable as T,getPreferredUrl as w}from"../support/layerUtils.js";import M from"../support/Relationship.js";import{getFeatureLayerCapabilities as B}from"../support/serviceCapabilitiesUtils.js";import C from"../support/Subtype.js";import{timeZoneProperty as R}from"../../time/timeZoneUtils.js";const A=A=>{let Q=class extends A{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.fieldsIndex=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(I)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=u.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.uniqueIdFields=null,this.version=void 0}getFieldDomain(){throw new Error("Not implemented")}getField(e){return this.fieldsIndex.get(e)}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:i,editing:r}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(i.supportsEditing&&!(r.supportsUpdateByOthers&&r.supportsUpdateByAnonymous&&r.supportsDeleteByOthers&&r.supportsDeleteByAnonymous))return"load"}if(j(this.serviceDefinitionExpression)||j(this.definitionExpression))return"load";if(this.userHasUpdateItemPrivileges){if(S(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return B(t,this.url)}readEditingInfo(e,t){const{editingInfo:i}=t;return i?{lastEditDate:null!=i.lastEditDate?new Date(i.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=i(e),{operations:r,editing:o}=t;return b(this)?(this.userHasUpdateItemPrivileges&&(r.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(r.supportsAdd=r.supportsDelete=r.supportsEditing=r.supportsQuery=r.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&r.supportsEditing&&(r.supportsAdd=r.supportsDelete=r.supportsUpdate=o.supportsGeometryUpdate=!0),t)}get effectiveEditingEnabled(){return!1}readGlobalIdFieldFromService(e,t){return E(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||b(this))return!1;const{operations:t,editing:i}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&i.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:i}=e;return b(this)?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&i.supportsDeleteByOthers&&i.supportsGeometryUpdate&&i.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return x(t)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readUniqueIdFields(e,t){return t.uniqueIdInfo?.OIDFieldContainsHashValue?t.uniqueIdInfo.fields:null}set url(e){if(null==e)return void this._set("url",e);const t=y({layer:this,url:e,nonStandardUrlAllowed:!0,logger:r.getLogger(this)});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,i,r){c(this,e,null,t,r)}readVersion(e,t){return U(t)}applyPreferredHost(e){const{url:t,portalItem:i}=this;if(!t||!T(i))return;const r=w(t,e);r&&this._set("url",r)}};return e([o({readOnly:!0})],Q.prototype,"authenticationTriggerEvent",null),e([o({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],Q.prototype,"copyright",void 0),e([o({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","maxUniqueIDCount","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],Q.prototype,"capabilities",void 0),e([s("service","capabilities")],Q.prototype,"readCapabilitiesFromService",null),e([o(R("dateFieldsTimeReference"))],Q.prototype,"dateFieldsTimeZone",void 0),e([o({type:Boolean})],Q.prototype,"datesInUnknownTimezone",void 0),e([o({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Q.prototype,"definitionExpression",void 0),e([o({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],Q.prototype,"displayField",void 0),e([o({readOnly:!0,type:g})],Q.prototype,"editFieldsInfo",void 0),e([o({readOnly:!0})],Q.prototype,"editingInfo",void 0),e([s("editingInfo")],Q.prototype,"readEditingInfo",null),e([o({readOnly:!0})],Q.prototype,"effectiveCapabilities",null),e([o()],Q.prototype,"effectiveEditingEnabled",null),e([o((()=>{const e=i(m),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],Q.prototype,"elevationInfo",void 0),e([o()],Q.prototype,"fieldsIndex",void 0),e([o({type:D,json:{name:"layerDefinition.floorInfo",write:{layerContainerTypes:l}}})],Q.prototype,"floorInfo",void 0),e([o({type:d,json:{origins:{service:{read:{source:"extent"}}}}})],Q.prototype,"fullExtent",void 0),e([o()],Q.prototype,"gdbVersion",void 0),e([o({readOnly:!0,type:O,json:{read:{source:"geometryProperties"}}})],Q.prototype,"geometryFieldsInfo",void 0),e([o({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:F.read}}}})],Q.prototype,"geometryType",void 0),e([o({type:String})],Q.prototype,"globalIdField",void 0),e([s("service","globalIdField",["globalIdField","fields"])],Q.prototype,"readGlobalIdFieldFromService",null),e([o({readOnly:!0})],Q.prototype,"hasFullEditingRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],Q.prototype,"hasM",void 0),e([o({readOnly:!0})],Q.prototype,"hasUpdateItemRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],Q.prototype,"hasZ",void 0),e([o({readOnly:!0,type:a})],Q.prototype,"heightModelInfo",void 0),e([o({type:Date})],Q.prototype,"historicMoment",void 0),e([o({type:t.ofType(I),readOnly:!0})],Q.prototype,"indexes",void 0),e([o({readOnly:!0})],Q.prototype,"isTable",void 0),e([s("service","isTable",["type"])],Q.prototype,"readIsTableFromService",null),e([o({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],Q.prototype,"layerId",void 0),e([o(f)],Q.prototype,"maxScale",void 0),e([s("service","maxScale",["maxScale","effectiveMaxScale"])],Q.prototype,"readMaxScale",null),e([o(h)],Q.prototype,"minScale",void 0),e([s("service","minScale",["minScale","effectiveMinScale"])],Q.prototype,"readMinScale",null),e([o({type:String})],Q.prototype,"objectIdField",void 0),e([s("service","objectIdField",["objectIdField","fields"])],Q.prototype,"readObjectIdFieldFromService",null),e([o(R("preferredTimeReference"))],Q.prototype,"preferredTimeZone",void 0),e([o({type:[M],readOnly:!0})],Q.prototype,"relationships",void 0),e([o({type:Boolean})],Q.prototype,"returnM",void 0),e([o({type:Boolean})],Q.prototype,"returnZ",void 0),e([o({readOnly:!0,json:{write:!1}})],Q.prototype,"serverGens",void 0),e([o({readOnly:!0})],Q.prototype,"serviceDefinitionExpression",void 0),e([s("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],Q.prototype,"readServiceDefinitionExpression",null),e([o({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,"serviceItemId",void 0),e([o()],Q.prototype,"sourceJSON",void 0),e([o({type:u,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],Q.prototype,"spatialReference",void 0),e([o({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],Q.prototype,"subtypeField",void 0),e([o({type:[C],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,"subtypes",void 0),e([o({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],Q.prototype,"trackIdField",void 0),e([o({type:[String],readOnly:!0})],Q.prototype,"uniqueIdFields",void 0),e([s("service","uniqueIdFields",["uniqueIdInfo.OIDFieldContainsHashValue","uniqueIdInfo.fields"])],Q.prototype,"readUniqueIdFields",null),e([o(v)],Q.prototype,"url",null),e([p("url")],Q.prototype,"writeUrl",null),e([o({json:{origins:{service:{read:!0}},read:!1}})],Q.prototype,"version",void 0),e([s("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],Q.prototype,"readVersion",null),Q=e([n("esri.layers.mixins.FeatureLayerBase")],Q),Q};export{A as FeatureLayerBase};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{hasSameOrigin as o,getHost as s,changeHost as n}from"../../core/urlUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as u}from"../../core/accessorSupport/layerContainerType.js";import{OriginId as c,idToName as y}from"../../core/accessorSupport/PropertyOrigin.js";import f from"../../geometry/Extent.js";import m from"../../geometry/HeightModelInfo.js";import h from"../../geometry/SpatialReference.js";import{sanitizeUrlWithLayerId as v,writeUrlWithLayerId as g}from"../support/arcgisLayerUrl.js";import{elevationInfo as I,maxScale as F,minScale as S,url as j}from"../support/commonProperties.js";import b from"../support/EditFieldsInfo.js";import{FeatureIndex as E}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as U,hasCurrentUser as x,isLayerCacheStale as O,supportsQueryOnly as D,readGlobalIdField as M,readObjectIdField as T,readVersion as w}from"../support/featureLayerUtils.js";import R from"../support/GeometryFieldsInfo.js";import C from"../support/LayerFloorInfo.js";import{isPreferredUrlApplicable as B,getPreferredUrl as H,applyPreferredHostToPortalItem as A,getPreferredHost as Q}from"../support/layerUtils.js";import P from"../support/Relationship.js";import{getFeatureLayerCapabilities as q}from"../support/serviceCapabilitiesUtils.js";import V from"../support/Subtype.js";import{hasTypeKeyword as _,typeKeyword as G}from"../../portal/support/portalItemUtils.js";import{timeZoneProperty as Z}from"../../time/timeZoneUtils.js";const k=k=>{let L=class extends k{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.fieldsIndex=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(E)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=h.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.uniqueIdFields=null,this.version=void 0,this._isUrlHostModified=!1}getFieldDomain(){throw new Error("Not implemented")}getField(e){return this.fieldsIndex.get(e)}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:r,editing:i}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(r.supportsEditing&&!(i.supportsUpdateByOthers&&i.supportsUpdateByAnonymous&&i.supportsDeleteByOthers&&i.supportsDeleteByAnonymous))return"load"}if(x(this.serviceDefinitionExpression)||x(this.definitionExpression))return"load";if(this.userHasUpdateItemPrivileges){if(O(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return q(t,this.url)}readEditingInfo(e,t){const{editingInfo:r}=t;return r?{lastEditDate:null!=r.lastEditDate?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=r(e),{operations:i,editing:o}=t;return D(this)?(this.userHasUpdateItemPrivileges&&(i.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(i.supportsAdd=i.supportsDelete=i.supportsEditing=i.supportsQuery=i.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&i.supportsEditing&&(i.supportsAdd=i.supportsDelete=i.supportsUpdate=o.supportsGeometryUpdate=!0),t)}get effectiveEditingEnabled(){return!1}readGlobalIdFieldFromService(e,t){return M(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||D(this))return!1;const{operations:t,editing:r}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:r}=e;return D(this)?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return T(t)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readUniqueIdFields(e,t){return t.uniqueIdInfo?.OIDFieldContainsHashValue?t.uniqueIdInfo.fields:null}set url(e){if(null==e)return void this._set("url",e);const t=v({layer:this,url:e,nonStandardUrlAllowed:!0,logger:i.getLogger(this)});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){g(this,e,null,t,i)}readVersion(e,t){return w(t)}get isUrlHostModified(){const{loaded:e,url:t,_isUrlHostModified:r}=this;if(r)return!0;if(!e||!t)return!1;if(this.originIdOf("url")<c.USER)return!1;const i=this.sourceJSON?.preferredHost;if(!i)return!1;if(!o(t,`https://${i}`,!0))return!1;for(let s=c.USER-1;s>=c.PORTAL_ITEM;s--){const e=this.getAtOrigin("url",y(s));if(e)return!o(t,e,!0)}return!1}applyPreferredHost(e){const{url:t,portalItem:r}=this;if(!t||!B(r))return;const i=H(t,e);i&&(this._set("url",i),this._isUrlHostModified=!0,r&&A(r,Q(e)))}applyHostFromPortalItem(){const{url:e,portalItem:t}=this;if(!e||this.originIdOf("url")===c.USER||!t?.url||!B(t)||!_(t,G.HOSTED_SERVICE)||o(e,t.url,!0))return;const r=s(t.url);this._set("url",n(e,r)),this._isUrlHostModified=!0}};return e([p({readOnly:!0})],L.prototype,"authenticationTriggerEvent",null),e([p({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],L.prototype,"copyright",void 0),e([p({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","maxUniqueIDCount","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],L.prototype,"capabilities",void 0),e([l("service","capabilities")],L.prototype,"readCapabilitiesFromService",null),e([p(Z("dateFieldsTimeReference"))],L.prototype,"dateFieldsTimeZone",void 0),e([p({type:Boolean})],L.prototype,"datesInUnknownTimezone",void 0),e([p({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],L.prototype,"definitionExpression",void 0),e([p({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],L.prototype,"displayField",void 0),e([p({readOnly:!0,type:b})],L.prototype,"editFieldsInfo",void 0),e([p({readOnly:!0})],L.prototype,"editingInfo",void 0),e([l("editingInfo")],L.prototype,"readEditingInfo",null),e([p({readOnly:!0})],L.prototype,"effectiveCapabilities",null),e([p()],L.prototype,"effectiveEditingEnabled",null),e([p((()=>{const e=r(I),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],L.prototype,"elevationInfo",void 0),e([p()],L.prototype,"fieldsIndex",void 0),e([p({type:C,json:{name:"layerDefinition.floorInfo",write:{layerContainerTypes:u}}})],L.prototype,"floorInfo",void 0),e([p({type:f,json:{origins:{service:{read:{source:"extent"}}}}})],L.prototype,"fullExtent",void 0),e([p()],L.prototype,"gdbVersion",void 0),e([p({readOnly:!0,type:R,json:{read:{source:"geometryProperties"}}})],L.prototype,"geometryFieldsInfo",void 0),e([p({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:U.read}}}})],L.prototype,"geometryType",void 0),e([p({type:String})],L.prototype,"globalIdField",void 0),e([l("service","globalIdField",["globalIdField","fields"])],L.prototype,"readGlobalIdFieldFromService",null),e([p({readOnly:!0})],L.prototype,"hasFullEditingRestrictions",null),e([p({type:Boolean,json:{origins:{service:{read:!0}}}})],L.prototype,"hasM",void 0),e([p({readOnly:!0})],L.prototype,"hasUpdateItemRestrictions",null),e([p({type:Boolean,json:{origins:{service:{read:!0}}}})],L.prototype,"hasZ",void 0),e([p({readOnly:!0,type:m})],L.prototype,"heightModelInfo",void 0),e([p({type:Date})],L.prototype,"historicMoment",void 0),e([p({type:t.ofType(E),readOnly:!0})],L.prototype,"indexes",void 0),e([p({readOnly:!0})],L.prototype,"isTable",void 0),e([l("service","isTable",["type"])],L.prototype,"readIsTableFromService",null),e([p({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],L.prototype,"layerId",void 0),e([p(F)],L.prototype,"maxScale",void 0),e([l("service","maxScale",["maxScale","effectiveMaxScale"])],L.prototype,"readMaxScale",null),e([p(S)],L.prototype,"minScale",void 0),e([l("service","minScale",["minScale","effectiveMinScale"])],L.prototype,"readMinScale",null),e([p({type:String})],L.prototype,"objectIdField",void 0),e([l("service","objectIdField",["objectIdField","fields"])],L.prototype,"readObjectIdFieldFromService",null),e([p(Z("preferredTimeReference"))],L.prototype,"preferredTimeZone",void 0),e([p({type:[P],readOnly:!0})],L.prototype,"relationships",void 0),e([p({type:Boolean})],L.prototype,"returnM",void 0),e([p({type:Boolean})],L.prototype,"returnZ",void 0),e([p({readOnly:!0,json:{write:!1}})],L.prototype,"serverGens",void 0),e([p({readOnly:!0})],L.prototype,"serviceDefinitionExpression",void 0),e([l("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],L.prototype,"readServiceDefinitionExpression",null),e([p({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],L.prototype,"serviceItemId",void 0),e([p()],L.prototype,"sourceJSON",void 0),e([p({type:h,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],L.prototype,"spatialReference",void 0),e([p({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],L.prototype,"subtypeField",void 0),e([p({type:[V],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],L.prototype,"subtypes",void 0),e([p({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],L.prototype,"trackIdField",void 0),e([p({type:[String],readOnly:!0})],L.prototype,"uniqueIdFields",void 0),e([l("service","uniqueIdFields",["uniqueIdInfo.OIDFieldContainsHashValue","uniqueIdInfo.fields"])],L.prototype,"readUniqueIdFields",null),e([p(j)],L.prototype,"url",null),e([a("url")],L.prototype,"writeUrl",null),e([p({json:{origins:{service:{read:!0}},read:!1}})],L.prototype,"version",void 0),e([l("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],L.prototype,"readVersion",null),e([p({readOnly:!0})],L.prototype,"isUrlHostModified",null),L=e([d("esri.layers.mixins.FeatureLayerBase")],L),L};export{k as FeatureLayerBase};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import{urlToObject as r,getFilename as a}from"../../core/urlUtils.js";import{parse as t,parseNonStandardSublayerUrl as s}from"./arcgisLayerUrl.js";import{findAssociatedFeatureService as l}from"./associatedFeatureServiceUtils.js";import{getLayerModuleType as o,fetchFeatureService as n}from"./fetchService.js";import{getPreferredUrl as c,sceneServiceLayerTypeToClassName as i}from"./layerUtils.js";import{layerLookupMap as u}from"./lazyLayerLoader.js";import{fetchArcGISServiceJSON as y}from"../../support/requestPresets.js";const f={FeatureLayer:!0,SceneLayer:!0,VideoLayer:!0};async function p(e){const{properties:r,url:a}=e,t={...r,url:a},s=await v(a,r?.customParameters),{Constructor:l,layerId:o,sourceJSON:n,parsedUrl:c,preferredUrl:i,layers:u,tables:y}=s;if(i&&(t.url=i),u.length+y.length===0)return null!=o&&(t.layerId=o),null!=n&&(t.sourceJSON=n),new l(t);const f=new(0,(await import("../GroupLayer.js")).default)({title:c.title});return await w(f,s,t),f}function m(e,r){return e?e.find((({id:e})=>e===r)):null}function d(e,r,a,t,s){const l={...s,layerId:r};return null!=e&&(l.url=e),null!=a&&(l.sourceJSON=a),"sublayerTitleMode"in t.prototype&&(l.sublayerTitleMode="service-name"),new t(l)}async function w(e,r,a){const t=r.sublayerConstructorProvider;for(const{id:s,serverUrl:l}of r.layers){const o=m(r.sublayerInfos,s),n=d(l,s,o,(o&&t?.(o))??r.Constructor,a);e.add(n)}if(r.tables.length){const t=await L("FeatureLayer");r.tables.forEach((({id:s,serverUrl:l})=>{const o=d(l,s,m(r.tableInfos,s),t,a);e.tables.add(o)}))}}async function v(r,a){let s=t(r);if(null==s&&(s=await S(r,a)),null==s)throw new e("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:l,sublayer:n}=s;let u;const p={FeatureServer:"FeatureLayer",KnowledgeGraphServer:"KnowledgeGraphLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer",VideoServer:"VideoLayer"},m="FeatureServer"===l,d="SceneServer"===l,w={parsedUrl:s,Constructor:null,layerId:m||d?n??void 0:void 0,layers:[],tables:[]};switch(l){case"MapServer":if(null!=n){const{type:t}=await y(r,{customParameters:a});switch(u="FeatureLayer",t){case"Catalog Layer":u="CatalogLayer";break;case"Catalog Dynamic Group Layer":throw new e("arcgis-layers:unsupported",`fromUrl() not supported for "${t}" layers`)}}else{u=await g(r,a)?"TileLayer":"MapImageLayer"}break;case"ImageServer":{const e=await y(r,{customParameters:a}),{tileInfo:t,cacheType:s}=e;u=t?"LERC"!==t?.format?.toUpperCase()||s&&"elevation"!==s.toLowerCase()?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const e=await y(s.url.path,{customParameters:a});if(u="SceneLayer",e){const r=e?.layers;if("Voxel"===e?.layerType)u="VoxelLayer";else if(r?.length){const e=r[0]?.layerType;null!=e&&null!=i[e]&&(u=i[e])}}break}case"3DTilesServer":throw new e("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(u="FeatureLayer",null!=n){const e=await y(r,{customParameters:a});w.sourceJSON=e,w.preferredUrl=c(r,e),u=o(e.type)}break;default:u=p[l]}if(f[u]&&null==n){const e=await h(r,l,a);m&&(w.preferredUrl=e.preferredUrl,w.sublayerInfos=e.layerInfos,w.tableInfos=e.tableInfos);if(1!==e.layers.length+e.tables.length)w.layers=e.layers,w.tables=e.tables,m&&e.layerInfos?.length&&(w.sublayerConstructorProvider=await P(e.layerInfos));else if(m||d){const r=e.layerInfos?.[0]??e.tableInfos?.[0];if(w.layerId=e.layers[0]?.id??e.tables[0]?.id,w.sourceJSON=r,m){const e=r?.type;u=o(e)}}}return w.Constructor=await L(u),w}async function S(e,t){const l=await y(e,{customParameters:t});let o=null,n=null;const c=l.type;if("Feature Layer"===c||"Table"===c?(o="FeatureServer",n=l.id??null):"indexedVector"===c?o="VectorTileServer":l.hasOwnProperty("mapName")?o="MapServer":l.hasOwnProperty("bandCount")&&l.hasOwnProperty("pixelSizeX")?o="ImageServer":l.hasOwnProperty("maxRecordCount")&&l.hasOwnProperty("allowGeometryUpdates")?o="FeatureServer":l.hasOwnProperty("streamUrls")?o="StreamServer":b(l)?(o="SceneServer",n=l.id):l.hasOwnProperty("layers")&&b(l.layers?.[0])&&(o="SceneServer"),!o)return null;const i=null!=n?s(e):null;return{title:null!=i&&l.name||a(e),serverType:o,sublayer:n,url:{path:null!=i?i.serviceUrl:r(e).path}}}function b(e){return null!=e&&e.hasOwnProperty("store")&&e.hasOwnProperty("id")&&"number"==typeof e.id}async function h(e,r,a){let t,s,l,o=!1;switch(r){case"FeatureServer":{const r=await n(e,{customParameters:a});l=r.
|
|
5
|
+
import e from"../../core/Error.js";import{urlToObject as r,getFilename as a}from"../../core/urlUtils.js";import{parse as t,parseNonStandardSublayerUrl as s}from"./arcgisLayerUrl.js";import{findAssociatedFeatureService as l}from"./associatedFeatureServiceUtils.js";import{getLayerModuleType as o,fetchFeatureService as n}from"./fetchService.js";import{getPreferredUrl as c,sceneServiceLayerTypeToClassName as i}from"./layerUtils.js";import{layerLookupMap as u}from"./lazyLayerLoader.js";import{fetchArcGISServiceJSON as y}from"../../support/requestPresets.js";const f={FeatureLayer:!0,SceneLayer:!0,VideoLayer:!0};async function p(e){const{properties:r,url:a}=e,t={...r,url:a},s=await v(a,r?.customParameters),{Constructor:l,layerId:o,sourceJSON:n,parsedUrl:c,preferredUrl:i,layers:u,tables:y}=s;if(i&&(t.url=i),u.length+y.length===0)return null!=o&&(t.layerId=o),null!=n&&(t.sourceJSON=n),new l(t);const f=new(0,(await import("../GroupLayer.js")).default)({title:c.title});return await w(f,s,t),f}function m(e,r){return e?e.find((({id:e})=>e===r)):null}function d(e,r,a,t,s){const l={...s,layerId:r};return null!=e&&(l.url=e),null!=a&&(l.sourceJSON=a),"sublayerTitleMode"in t.prototype&&(l.sublayerTitleMode="service-name"),new t(l)}async function w(e,r,a){const t=r.sublayerConstructorProvider;for(const{id:s,serverUrl:l}of r.layers){const o=m(r.sublayerInfos,s),n=d(l,s,o,(o&&t?.(o))??r.Constructor,a);e.add(n)}if(r.tables.length){const t=await L("FeatureLayer");r.tables.forEach((({id:s,serverUrl:l})=>{const o=d(l,s,m(r.tableInfos,s),t,a);e.tables.add(o)}))}}async function v(r,a){let s=t(r);if(null==s&&(s=await S(r,a)),null==s)throw new e("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:l,sublayer:n}=s;let u;const p={FeatureServer:"FeatureLayer",KnowledgeGraphServer:"KnowledgeGraphLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer",VideoServer:"VideoLayer"},m="FeatureServer"===l,d="SceneServer"===l,w={parsedUrl:s,Constructor:null,layerId:m||d?n??void 0:void 0,layers:[],tables:[]};switch(l){case"MapServer":if(null!=n){const{type:t}=await y(r,{customParameters:a});switch(u="FeatureLayer",t){case"Catalog Layer":u="CatalogLayer";break;case"Catalog Dynamic Group Layer":throw new e("arcgis-layers:unsupported",`fromUrl() not supported for "${t}" layers`)}}else{u=await g(r,a)?"TileLayer":"MapImageLayer"}break;case"ImageServer":{const e=await y(r,{customParameters:a}),{tileInfo:t,cacheType:s}=e;u=t?"LERC"!==t?.format?.toUpperCase()||s&&"elevation"!==s.toLowerCase()?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const e=await y(s.url.path,{customParameters:a});if(u="SceneLayer",e){const r=e?.layers;if("Voxel"===e?.layerType)u="VoxelLayer";else if(r?.length){const e=r[0]?.layerType;null!=e&&null!=i[e]&&(u=i[e])}}break}case"3DTilesServer":throw new e("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(u="FeatureLayer",null!=n){const e=await y(r,{customParameters:a});w.sourceJSON=e,w.preferredUrl=c(r,e),u=o(e.type)}break;default:u=p[l]}if(f[u]&&null==n){const e=await h(r,l,a);m&&(w.preferredUrl=e.preferredUrl,w.sublayerInfos=e.layerInfos,w.tableInfos=e.tableInfos);if(1!==e.layers.length+e.tables.length)w.layers=e.layers,w.tables=e.tables,m&&e.layerInfos?.length&&(w.sublayerConstructorProvider=await P(e.layerInfos));else if(m||d){const r=e.layerInfos?.[0]??e.tableInfos?.[0];if(w.layerId=e.layers[0]?.id??e.tables[0]?.id,w.sourceJSON=r,m){const e=r?.type;u=o(e)}}}return w.Constructor=await L(u),w}async function S(e,t){const l=await y(e,{customParameters:t});let o=null,n=null;const c=l.type;if("Feature Layer"===c||"Table"===c?(o="FeatureServer",n=l.id??null):"indexedVector"===c?o="VectorTileServer":l.hasOwnProperty("mapName")?o="MapServer":l.hasOwnProperty("bandCount")&&l.hasOwnProperty("pixelSizeX")?o="ImageServer":l.hasOwnProperty("maxRecordCount")&&l.hasOwnProperty("allowGeometryUpdates")?o="FeatureServer":l.hasOwnProperty("streamUrls")?o="StreamServer":b(l)?(o="SceneServer",n=l.id):l.hasOwnProperty("layers")&&b(l.layers?.[0])&&(o="SceneServer"),!o)return null;const i=null!=n?s(e):null;return{title:null!=i&&l.name||a(e),serverType:o,sublayer:n,url:{path:null!=i?i.serviceUrl:r(e).path}}}function b(e){return null!=e&&e.hasOwnProperty("store")&&e.hasOwnProperty("id")&&"number"==typeof e.id}async function h(e,r,a){let t,s,l,o=!1;switch(r){case"FeatureServer":{const r=await n(e,{customParameters:a});l=c(e,{preferredHost:r.preferredHost}),o=!!r.layersJSON,t=r.layersJSON||r.serviceJSON;break}case"SceneServer":{const r=await I(e,a);t=r.serviceInfo,s=r.tableServerUrl;break}default:t=await y(e,{customParameters:a})}const i=t?.layers,u=t?.tables;return{preferredUrl:l,layers:i?.map((e=>({id:e.id}))).reverse()||[],tables:u?.map((e=>({serverUrl:s,id:e.id}))).reverse()||[],layerInfos:o?i:[],tableInfos:o?u:[]}}async function I(e,r){const a=await y(e,{customParameters:r}),t=a.layers?.[0];if(!t)return{serviceInfo:a};try{const{serverUrl:t}=await l(e),s=await y(t,{customParameters:r}).catch((()=>null));return s&&(a.tables=s.tables),{serviceInfo:a,tableServerUrl:t}}catch{return{serviceInfo:a}}}async function L(e){return(0,u[e])()}async function g(e,r){return(await y(e,{customParameters:r})).tileInfo}async function P(e){if(!e.length)return;const r=new Set,a=[];for(const{type:l}of e)r.has(l)||(r.add(l),a.push(L(o(l))));const t=await Promise.all(a),s=new Map;return Array.from(r).forEach(((e,r)=>{s.set(e,t[r])})),e=>s.get(e.type)}export{p as fromUrl};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getPreferredUrl as
|
|
5
|
+
import{getPreferredHost as e,getPreferredUrl as r}from"./layerUtils.js";import{fetchArcGISServiceJSON as t}from"../../support/requestPresets.js";const a=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function n(a,n){const{loadContext:s,...o}=n||{},y=s?await s.fetchServiceMetadata(a,o):await t(a,o),i=e(y);u(y),c(y);const l={serviceJSON:y,preferredHost:i};if((y.currentVersion??0)<10.5)return l;const f=`${r(a,y)??a}/layers`,L=s?await s.fetchServiceMetadata(f,o):await t(f,o);return u(L),c(L),l.layersJSON={layers:L.layers,tables:L.tables},l}function s(e){const{type:r}=e;return!!r&&a.has(r)}function o(e){return"Table"===e.type}function c(e){e.layers=e.layers?.filter(s),e.tables=e.tables?.filter(o)}function y(e){e.type||="Feature Layer"}function i(e){e.type||="Table"}function u(e){e.layers?.forEach(y),e.tables?.forEach(i)}function l(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}export{n as fetchFeatureService,l as getLayerModuleType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import{hasSameOrigin as r,changeHost as i}from"../../core/urlUtils.js";import{isLayerFromCatalog as u}from"../catalog/catalogUtils.js";function s(e){return d(e)||y(e)}function o(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}function a(e){return null!=e&&"object"==typeof e&&"type"in e&&"graphics"===e.type}function c(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-image"===e.type}function l(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-notes"===e.type&&"sublayers"in e}function f(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph"===e.type&&"layers"in e}function p(e){return null!=e&&"object"==typeof e&&"type"in e&&"link-chart"===e.type&&"layers"in e}function y(e){return"scene"===e?.type}function g(e){return null!=e&&"object"==typeof e&&"type"in e&&"subtype-group"===e.type&&"sublayers"in e}function b(e){return"subtype-sublayer"===e?.type}function d(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function m(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function h(e){return null!=e&&"type"in e&&"group"===e.type}const j={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function v(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function w(e){return"IntegratedMeshLayer"===e||"IntegratedMesh3DTilesLayer"===e}function L(e){return"integrated-mesh"===e||"integrated-mesh-3dtiles"===e}function S(e){return"voxel"===e?.type}function E(e){return"imagery-tile"===e?.type}function C(e,t){return null!=e?.parent&&"declaredClass"in e.parent&&"esri.Basemap"===e.parent.declaredClass&&e.parent[t].includes(e)}function M(e){return C(e,"baseLayers")}function x(e){return C(e,"referenceLayers")}function I(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function T(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function U(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function k(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach(((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)})),n.length>0)){let e;if(r){const t={};n.forEach((e=>{t[e[0]]=e[1]})),e=JSON.stringify(t)}else{const t=[];n.forEach((e=>{t.push(e[0]+":"+e[1])})),e=t.join(";")}return e}return null}function O(e){if(!e)return;const t=[];return e.forEach(((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))})),t.length?"{"+t.join(",")+"}":void 0}function B(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function P(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf("/rest/services");if(-1===u)return null;const s=`${n.slice(0,u)}/rest/info`,o=null!=r?r.signal:null,{data:a}=await t(s,{query:{f:"json"},responseType:"json",signal:o});return a?.owningSystemUrl||null}function q(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function D(e){return null!=e&&"object"==typeof e&&"isTable"in e&&!!e.isTable}function
|
|
5
|
+
import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import{hasSameOrigin as r,changeHost as i}from"../../core/urlUtils.js";import{isLayerFromCatalog as u}from"../catalog/catalogUtils.js";function s(e){return d(e)||y(e)}function o(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}function a(e){return null!=e&&"object"==typeof e&&"type"in e&&"graphics"===e.type}function c(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-image"===e.type}function l(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-notes"===e.type&&"sublayers"in e}function f(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph"===e.type&&"layers"in e}function p(e){return null!=e&&"object"==typeof e&&"type"in e&&"link-chart"===e.type&&"layers"in e}function y(e){return"scene"===e?.type}function g(e){return null!=e&&"object"==typeof e&&"type"in e&&"subtype-group"===e.type&&"sublayers"in e}function b(e){return"subtype-sublayer"===e?.type}function d(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function m(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function h(e){return null!=e&&"type"in e&&"group"===e.type}const j={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function v(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function w(e){return"IntegratedMeshLayer"===e||"IntegratedMesh3DTilesLayer"===e}function L(e){return"integrated-mesh"===e||"integrated-mesh-3dtiles"===e}function S(e){return"voxel"===e?.type}function E(e){return"imagery-tile"===e?.type}function C(e,t){return null!=e?.parent&&"declaredClass"in e.parent&&"esri.Basemap"===e.parent.declaredClass&&e.parent[t].includes(e)}function M(e){return C(e,"baseLayers")}function x(e){return C(e,"referenceLayers")}function I(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function T(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function U(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function k(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach(((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)})),n.length>0)){let e;if(r){const t={};n.forEach((e=>{t[e[0]]=e[1]})),e=JSON.stringify(t)}else{const t=[];n.forEach((e=>{t.push(e[0]+":"+e[1])})),e=t.join(";")}return e}return null}function O(e){if(!e)return;const t=[];return e.forEach(((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))})),t.length?"{"+t.join(",")+"}":void 0}function B(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function P(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf("/rest/services");if(-1===u)return null;const s=`${n.slice(0,u)}/rest/info`,o=null!=r?r.signal:null,{data:a}=await t(s,{query:{f:"json"},responseType:"json",signal:o});return a?.owningSystemUrl||null}function q(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function D(e){return null!=e&&"object"==typeof e&&"isTable"in e&&!!e.isTable}function H(e){return q(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function J(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function N(e){return!!J(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function $(e){if(!e)return[];return("subtypes"in e?e.subtypes:g(e.parent)?e.parent.subtypes:[])??[]}function F(e){return("imagery"===e.type||"imagery-tile"===e.type)&&"flow"===e.renderer?.type}function V(e){const t=new n;for(const n of e.allLayers.concat(e.allTables))"csv"===n.type||u(n)||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function z(e,t){const n=A(t);return!n||r(e,`https://${n}`,!0)?null:i(e,n)}function A(e){return e?.preferredHost}function G(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function K(e,t){if(!t||!G(e))return;const n=z(e.url,{preferredHost:t});n&&(e.url=n)}export{K as applyPreferredHostToPortalItem,N as getEffectiveEditingEnabled,H as getEffectiveLayerCapabilities,V as getLayersWithChartSupport,P as getOwningPortalUrl,A as getPreferredHost,z as getPreferredUrl,$ as getSubtypesFromLayer,B as getTileMaxtrixSetFromActiveLayer,M as isBaseLayer,s as isBasemap3DSupportedLayer,d as isBasemapSupportedTiledLayer,I as isFeatureCollectionLayer,o as isFeatureLayer,U as isFeatureServiceLayer,a as isGraphicsLayer,h as isGroupLayer,E as isImageryTileLayer,L as isIntegratedMeshLayer,w as isIntegratedMeshOperationalLayer,f as isKnowledgeGraphLayer,q as isLayerWithFeatureCapabilities,T as isLayerWithFeatureLayerSource,F as isLayerWithFlowRenderer,p as isLinkChartLayer,c as isMapImageLayer,l as isMapNotesLayer,G as isPreferredUrlApplicable,x as isReferenceLayer,y as isSceneLayer,v as isSceneServiceLayer,g as isSubtypeGroupLayer,b as isSubtypeSublayer,D as isTable,m as isTiledLayer,S as isVoxelLayer,j as sceneServiceLayerTypeToClassName,k as serializeLayerDefinitions,O as serializeTimeOptions};
|
package/package.json
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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import{parse as t}from"../../layers/support/arcgisLayerUrl.js";import{fetchFeatureService as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as a}from"../../layers/support/LayerLoadContext.js";import{
|
|
5
|
+
import e from"../../core/Error.js";import{parse as t}from"../../layers/support/arcgisLayerUrl.js";import{fetchFeatureService as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as a}from"../../layers/support/LayerLoadContext.js";import{applyPreferredHostToPortalItem as o,getPreferredHost as n,isPreferredUrlApplicable as s}from"../../layers/support/layerUtils.js";import l from"../Portal.js";import{createForItemRead as i}from"./jsonContext.js";import{instanceTypeToLayerTypes as p,getSublayersByLayerType as u,getFirstLayerOrTable as c,preprocessFSItemData as y,populateSceneServiceItemData as d,getNumLayersAndTables as f,layerTypeToLayerModuleType as m,createSublayerData as w}from"./loadUtils.js";import{hasTypeKeyword as h}from"./portalItemUtils.js";import{loadStyleRenderer as g}from"../../renderers/support/styleUtils.js";import{fetchArcGISServiceJSON as I}from"../../support/requestPresets.js";async function b(e,t){const r=e.instance.portalItem;if(r?.id)return await r.load(t),v(e),e.validateItem&&e.validateItem(r),L(e,t)}function v(t){const r=t.instance.portalItem;if(!r?.type||!t.supportedTypes.includes(r.type))throw new e("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r?.type,expectedType:t.supportedTypes.join(", ")})}async function L(e,t){const r=e.instance,o=r.portalItem;if(!o)return;let{url:n}=o;const{title:s}=o,l=i(o,"portal-item");if("group"===r.type)return S(r,l,e);n&&"media"!==r.type&&r.read({url:n},l);const p=new a,{data:u,preferredHost:c}=await x(e,p,t);return n=o.url,"isUrlHostModified"in r&&(c?r.applyPreferredHost({preferredHost:c}):r.applyHostFromPortalItem()),u&&r.read(u,l),r.resourceReferences={portalItem:o,paths:l.readResourcePaths??[]},"subtype-group"!==r.type&&r.read({title:s},l),g(r,l)}async function S(t,r,a){const o=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:n,type:s}=o;if("Group Layer"===s){if(!h(o,"Map"))throw new e("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return T(t,a)}return t.read({title:n},r),j(t,a)}async function T(t,r){const a=t.portalItem,o=await a.fetchData("json");if(!o)return;if(!r.populateGroupLayer)throw new e("portal:missing-populate-group-layer","Missing populate group layer");const n=i(a,"web-map");t.read(o,n),await r.populateGroupLayer(t,o,{context:n}),t.resourceReferences={portalItem:a,paths:n.readResourcePaths??[]}}async function j(t,r){let n;const{portalItem:s}=t;if(!s)return;const l=s.type,i=r.layerModuleTypeMap;if(!i)throw new e("portal:missing-layer-module-type-map","Layer module type map is required to construct sub layers");switch(l){case"Feature Service":case"Feature Collection":n=i.FeatureLayer;break;case"Stream Service":n=i.StreamLayer;break;case"Scene Service":n=i.SceneLayer;break;case"Video Service":n=i.VideoLayer;break;default:throw new e("portal:unsupported-item-type-as-group",`The item type '${l}' is not supported as a 'IGroupLayer'`)}const p="Video Service"===l,u=new a;let[m,{data:w}]=await Promise.all([n(),p?{data:null}:x(r,u)]),h=()=>m;if(p)return F(t,h,i);if("Feature Service"===l){const e=c(w)?.customParameters;w=s.url?(await y(w,s.url,u)).data:{},h=await E(w,i)||h;const{provider:r,preferredHost:a}=await U(s.url,{customParameters:e,loadContext:u});return o(s,a),await H(t,h,h,w,i,r)}return"Scene Service"===l&&s.url&&(w=await d(s,w,u)),f(w)>0?await H(t,h,null,w,i):await P(t,h,i)}async function P(e,t,r){const{portalItem:a}=e;if(!a?.url)return;const o=await I(a.url);o&&H(e,t,null,{layers:o.layers?.map(w),tables:o.tables?.map(w)},r)}async function F(e,t,r){const{portalItem:a}=e;if(!a?.url)return;const o=await I(a.url);o&&H(e,t,null,{layers:o.layers?.map((({id:e,name:t})=>({id:e,name:t})))},r)}async function H(e,t,r,a,o,n){let s=a.layers||[];const l=a.tables||[];if("Feature Collection"===e.portalItem?.type?(s.forEach(((e,t)=>{e.id=t,"Table"===e?.layerDefinition?.type&&l.push(e)})),s=s.filter((e=>"Table"!==e?.layerDefinition?.type))):(s.reverse(),l.reverse()),s.forEach((r=>{const o=n?.(r);if(o||!n){const n=M(e,t(r),a,r,o);e.add(n)}})),l.length){const t=r?null:await o.FeatureLayer();l.forEach((o=>{const s=n?.(o);if(s||!n){const n=M(e,r?r(o):t,a,o,s);e.tables.add(n)}}))}}function M(e,t,r,a,o){const n=e.portalItem,s={portalItem:n.clone(),layerId:a.id};null!=a.url&&(s.url=a.url);const i=new t(s);if("sourceJSON"in i&&(i.sourceJSON=o),"subtype-group"!==i.type&&"catalog"!==i.type&&(i.sublayerTitleMode="service-name"),"Feature Collection"===n.type){const e={origin:"portal-item",portal:n.portal||l.getDefault()};i.read(a,e);const t=r.showLegend;null!=t&&i.read({showLegend:t},e)}return i}async function x(e,t,r){if(!1===e.supportsData)return{data:void 0};const a=e.instance,n=a.portalItem;if(!n)return{data:void 0};let s=null;try{s=await n.fetchData("json",r)}catch(l){}if(C(a)){let e=null;const{count:r,preferredHost:l}=await G(n,s,t);if(o(n,l),(s?.layers||s?.tables)&&r>0){if(null==a.layerId){const e=p(a.type),t=e?.length?u(s,e)[0]:c(s);t&&(a.layerId=t.id)}e=k(s,a),"OrientedImageryLayer"===e?.layerType&&"oriented-imagery"===a.type&&a.supportedSourceTypes.add("Feature Layer"),e&&null!=s.showLegend&&(e.showLegend=s.showLegend)}return r>1&&"sublayerTitleMode"in a&&"service-name"!==a.sublayerTitleMode&&(a.sublayerTitleMode="item-title-and-service-name"),{data:e,preferredHost:l}}return{data:s}}async function G(e,r,a){if(r?.layers&&r?.tables)return{count:f(r)};const o=t(e.url);if(!o)return{count:1};const l=o.url.path,i=await a.fetchServiceMetadata(l,{customParameters:c(r)?.customParameters}).catch((()=>null));return{count:(r?.layers?.length??i?.layers?.length??0)+(r?.tables?.length??i?.tables?.length??0),preferredHost:s(e)?n(i):null}}function k(e,t){const{layerId:r}=t,a=e.layers?.find((e=>e.id===r))||e.tables?.find((e=>e.id===r));return a&&D(a,t)?a:null}function C(e){return"stream"!==e.type&&"layerId"in e}function D(e,t){const r="layerType"in e&&e.layerType,{type:a}=t;return!("feature"===a&&r&&"ArcGISFeatureLayer"!==e.layerType||"catalog"===a&&!r||"oriented-imagery"===a&&!r||"subtype-group"===a&&!r)}async function U(e,t){const{layersJSON:a,preferredHost:o}=await r(e,t);if(!a)return{provider:null,preferredHost:o};const n=[...a.layers,...a.tables];return{provider:e=>n.find((t=>t.id===e.id)),preferredHost:o}}async function E(e,t){const{layers:r,tables:a}=e,o=[...r??[],...a??[]];if(!o.length)return;const n=new Set,s=[];for(const{layerType:p}of o){const e=p??"ArcGISFeatureLayer";if(n.has(e))continue;n.add(e);const r=t[m(e)];s.push(r())}const l=await Promise.all(s),i=new Map;return Array.from(n).forEach(((e,t)=>{i.set(e,l[t])})),({layerType:e})=>{const t=e??"ArcGISFeatureLayer";return i.get(t)}}export{b as load};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{findAssociatedFeatureService as e}from"../../layers/support/associatedFeatureServiceUtils.js";import{getLayerModuleType as r}from"../../layers/support/fetchService.js";import{
|
|
5
|
+
import{findAssociatedFeatureService as e}from"../../layers/support/associatedFeatureServiceUtils.js";import{getLayerModuleType as r}from"../../layers/support/fetchService.js";import{getPreferredHost as t}from"../../layers/support/layerUtils.js";function a(e){const t={id:e.id,name:e.name},a=r(e.type);return"FeatureLayer"!==a&&(t.layerType=a),t}async function l(e,r,l){let n;if(null==e?.layers||null==e?.tables){const u=await l.fetchServiceMetadata(r,{customParameters:s(e)?.customParameters});n=t(u),(e=e||{}).layers=e.layers||u?.layers?.map(a),e.tables=e.tables||u?.tables?.map(a)}return{data:e,preferredHost:n}}function s(e){if(!e)return null;const{layers:r,tables:t}=e;return r?.length?r[0]:t?.length?t[0]:null}function n(e,r){if(null==r)return null;return[...e.layers||[],...e.tables||[]].find((e=>e.id===r))}function u(e,r){return[...e.layers||[],...e.tables||[]].filter((({layerType:e})=>e?r.includes(e):r.includes("ArcGISFeatureLayer")))}function c(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function o(e){switch(e){case"catalog":return["CatalogLayer"];case"feature":return["ArcGISFeatureLayer"];case"oriented-imagery":return["OrientedImageryLayer"];case"subtype-group":return["SubtypeGroupLayer","SubtypeGroupTable"]}return null}function i(e){switch(e){case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":case"SubtypeGroupTable":return"SubtypeGroupLayer"}return"FeatureLayer"}async function y(r,t,l){if(!r?.url)return t??{};if(t??={},!t.layers){const e=await l.fetchServiceMetadata(r.url);t.layers=e.layers?.map(a)}const{serverUrl:n,portalItem:u}=await e(r.url,{sceneLayerItem:r,customParameters:s(t)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==n)return t.tables=[],t;if(!t.tables&&u){const e=await u.fetchData().catch((()=>null));if(e?.tables)t.tables=e.tables.map(a);else{const r=await l.fetchServiceMetadata(n,{customParameters:s(e)?.customParameters}).catch((()=>null));t.tables=r?.tables?.map(a)}}if(t.tables)for(const e of t.tables)e.url=`${n}/${e.id}`;return t}export{a as createSublayerData,s as getFirstLayerOrTable,n as getLayerOrTable,c as getNumLayersAndTables,u as getSublayersByLayerType,o as instanceTypeToLayerTypes,i as layerTypeToLayerModuleType,y as populateSceneServiceItemData,l as preprocessFSItemData};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import{findAssociatedFeatureService as a}from"../../layers/support/associatedFeatureServiceUtils.js";import{getLayerModuleType as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as t}from"../../layers/support/LayerLoadContext.js";import{sceneServiceLayerTypeToClassName as s,
|
|
5
|
+
import e from"../../core/Error.js";import{findAssociatedFeatureService as a}from"../../layers/support/associatedFeatureServiceUtils.js";import{getLayerModuleType as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as t}from"../../layers/support/LayerLoadContext.js";import{sceneServiceLayerTypeToClassName as s,applyPreferredHostToPortalItem as c,getPreferredHost as n}from"../../layers/support/layerUtils.js";import{layerLookupMap as o}from"../../layers/support/lazyLayerLoader.js";import i from"../PortalItem.js";import{getFirstLayerOrTable as u,getNumLayersAndTables as l,preprocessFSItemData as y,getLayerOrTable as m,layerTypeToLayerModuleType as f,populateSceneServiceItemData as p}from"./loadUtils.js";import{hasTypeKeyword as d}from"./portalItemUtils.js";async function L(e){let{portalItem:a}=e;!a||a instanceof i||(a=new i(a));const r=await w(a);return new(0,r.constructor)({portalItem:a,...r.properties})}async function w(e){await e.load();const a=new t;return S(await N(e,a))}async function N(a,r){switch(a.type){case"3DTiles Service":return a.typeKeywords.includes("3DObject")?b():P();case"CSV":return F();case"Feature Collection":return M(a);case"Feature Service":return h(a,r);case"Feed":return x();case"GeoJson":return G();case"Group Layer":return J();case"Image Service":return g(a,r);case"KML":return V();case"Knowledge Graph Layer":return K();case"Map Service":return v(a,r);case"Media Layer":return k();case"Scene Service":return I(a,r);case"Stream Service":return j();case"Video Service":return T(a,r);case"Vector Tile Service":return C();case"WCS":return W();case"WFS":return U();case"WMS":return D();case"WMTS":return O();default:throw new e("portal:unknown-item-type","Unknown item type '${type}'",{type:a.type})}}async function S(e){const a=e.className,r=o[a];return{constructor:await r(),properties:e.properties}}async function v(e,a){return await $(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function h(e,a){const r=await A(e,a);if("object"==typeof r){const{sourceJSON:e,className:a}=r,t={sourceJSON:e};return null!=r.id&&(t.layerId=r.id),{className:a||"FeatureLayer",properties:t}}return{className:"GroupLayer"}}async function I(e,r){const t=await A(e,r,(async()=>{try{if(!e.url)return[];const{serverUrl:t}=await a(e.url,{sceneLayerItem:e}),s=await r.fetchServiceMetadata(t);return s?.tables??[]}catch{return[]}}));if("object"==typeof t){const a={};let c;if(null!=t.id?(a.layerId=t.id,c=`${e.url}/layers/${t.id}`):c=e.url,e.typeKeywords?.length)for(const r of Object.keys(s))if(e.typeKeywords.includes(r))return{className:s[r]};const n=await r.fetchServiceMetadata(c,{customParameters:await r.fetchCustomParameters(e,(e=>u(e)?.customParameters))});return{className:s[n?.layerType]||"SceneLayer",properties:a}}if(!1===t){const a=await r.fetchServiceMetadata(e.url);if("Voxel"===a?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}async function M(e){await e.load();const a=d(e,"Map Notes"),r=d(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if(d(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===l(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function g(e,a){await e.load();const r=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await a.fetchItemData(e),s=t?.layerType;if("ArcGISTiledImageServiceLayer"===s)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===s)return{className:"ImageryLayer"};const c=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),n=c.cacheType?.toLowerCase(),o=c.capabilities?.toLowerCase().includes("tilesonly"),i=c.tileInfo?.format?.toLowerCase()??"",u=null==n&&["jpg","jpeg","png","png8","png24","png32","mixed"].includes(i);return"map"===n||u||o?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function j(){return{className:"StreamLayer"}}async function T(e,a){return"object"==typeof await A(e,a)?{className:"VideoLayer"}:{className:"GroupLayer"}}function C(){return{className:"VectorTileLayer"}}function G(){return{className:"GeoJSONLayer"}}function P(){return{className:"IntegratedMesh3DTilesLayer"}}function b(){return{className:"UnsupportedLayer"}}function F(){return{className:"CSVLayer"}}function V(){return{className:"KMLLayer"}}function K(){return{className:"KnowledgeGraphLayer"}}function W(){return{className:"WCSLayer"}}function U(){return{className:"WFSLayer"}}function D(){return{className:"WMSLayer"}}function O(){return{className:"WMTSLayer"}}function x(){return{className:"StreamLayer"}}function J(){return{className:"GroupLayer"}}function k(){return{className:"MediaLayer"}}async function $(e,a){const{tileInfo:r}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return r}async function A(e,a,t){const{url:s,type:o}=e,i="Feature Service"===o;if(!s)return{};if(/\/\d+$/.test(s)){if(i){const t=await a.fetchServiceMetadata(s,{customParameters:await a.fetchCustomParameters(e,(e=>u(e)?.customParameters))});return c(e,n(t)),{id:t.id,className:r(t.type),sourceJSON:t}}return{}}if("Video Service"===o){const e=await a.fetchServiceMetadata(s);return!((e.layers?.length??0)>1)&&{}}await e.load();let d=await a.fetchItemData(e);if(i){const{data:r,preferredHost:t}=await y(d,s,a);c(e,t);const n=E(r);if("object"==typeof n){const e=m(r,n.id);n.className=f(e?.layerType)}return n}"Scene Service"===o&&(d=await p(e,d,a));if(l(d)>0)return E(d);const L=await a.fetchServiceMetadata(s);return t&&(L.tables=await t()),E(L)}function E(e){return 1===l(e)&&{id:u(e)?.id}}export{L as fromItem,N as selectLayerClassPath};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../Color.js";import n from"../../../Graphic.js";import{neverReached as
|
|
5
|
+
import e from"../../../Color.js";import n from"../../../Graphic.js";import{neverReached as i}from"../../../core/compilerUtils.js";import t from"../../../core/Logger.js";import{meterIn as a}from"../../support/lengthUtils.js";import{InputValueType as r,isValidNumber as l,TransformationType as s,isSizeVariable as o}from"./sizeVariableUtils.js";const c=()=>t.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),u=e=>c().warn(`The visualVariable should be an instance of esri.renderers.visualVariables.${e}`),f=()=>c().error("Use of arcade expressions requires an arcade context"),p=new n,d=Math.PI,v=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function m(n,i,t){const a="visualVariables"in n?n.visualVariables?.find((e=>"color"===e.type)):n;if(!a)return;if("esri.renderers.visualVariables.ColorVariable"!==a.declaredClass)return void u("ColorVariable");const r="number"==typeof i,s=r?null:i,o=s?.attributes;let c=r?i:null;const p=a.field,{ipData:d,hasExpression:v}=a.cache;let m=a.cache.compiledFunc;if(!p&&!v){const e=a.stops;return e&&e[0]&&e[0].color}if("number"!=typeof c)if(v){if(null==t?.arcade)return void f();const e={viewingMode:t.viewingMode,scale:t.scale,spatialReference:t.spatialReference},n=t.arcade.arcadeUtils,i=n.getViewInfo(e),r=n.createExecContext(s,i,t.timeZone);if(!m){const e=n.createSyntaxTree(a.valueExpression);m=n.createFunction(e),a.cache.compiledFunc=m}c=n.executeFunction(m,r)}else o&&(c=o[p]);const h=a.normalizationField,b=null!=o&&null!=h?parseFloat(o[h]):void 0;if(null!=c&&(!h||r||!isNaN(b)&&0!==b)){l(b)&&!r&&(c/=b);const n=T(c,d);if(n){const i=n[0],r=n[1],l=i===r?a.stops[i].color:e.blendColors(a.stops[i].color,a.stops[r].color,n[2],null!=t?t.color:void 0);return new e(l)}}}function h(e,n,i){const t="visualVariables"in e?e.visualVariables?.find((e=>"opacity"===e.type)):e;if(!t)return;if("esri.renderers.visualVariables.OpacityVariable"!==t.declaredClass)return void u("OpacityVariable");const a="number"==typeof n,r=a?null:n,s=r?.attributes;let o=a?n:null;const c=t.field,{ipData:p,hasExpression:d}=t.cache;let v=t.cache.compiledFunc;if(!c&&!d){const e=t.stops;return e&&e[0]&&e[0].opacity}if("number"!=typeof o)if(d){if(null==i?.arcade)return void f();const e={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},n=i.arcade.arcadeUtils,a=n.getViewInfo(e),l=n.createExecContext(r,a,i.timeZone);if(!v){const e=n.createSyntaxTree(t.valueExpression);v=n.createFunction(e),t.cache.compiledFunc=v}o=n.executeFunction(v,l)}else s&&(o=s[c]);const m=t.normalizationField,h=null!=s&&null!=m?parseFloat(s[m]):void 0;if(null!=o&&(!m||a||!isNaN(h)&&0!==h)){l(h)&&!a&&(o/=h);const e=T(o,p);if(e){const n=e[0],i=e[1];if(n===i)return t.stops[n].opacity;{const a=t.stops[n].opacity;return a+(t.stops[i].opacity-a)*e[2]}}}}function b(e,n,i){const t="visualVariables"in e?e.visualVariables?.find((e=>"rotation"===e.type)):e;if(!t)return;if("esri.renderers.visualVariables.RotationVariable"!==t.declaredClass)return void u("RotationVariable");const a=t.axis||"heading",r="heading"===a&&"arithmetic"===t.rotationType?90:0,l="heading"===a&&"arithmetic"===t.rotationType?-1:1,s="number"==typeof n?null:n,o=s?.attributes,c=t.field,{hasExpression:p}=t.cache;let d=t.cache.compiledFunc,v=null;if(!c&&!p)return v;if(p){if(null==i?.arcade)return void f();const e={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},n=i.arcade.arcadeUtils,a=n.getViewInfo(e),r=n.createExecContext(s,a,i.timeZone);if(!d){const e=n.createSyntaxTree(t.valueExpression);d=n.createFunction(e),t.cache.compiledFunc=d}v=n.executeFunction(d,r)}else o&&(v=o[c]);return v="number"!=typeof v||isNaN(v)?null:r+l*v,v}function V(e,n,i){const t="number"==typeof n,a=t?null:n,s=a?.attributes;let o=t?n:null;const{isScaleDriven:c}=e.cache;let u=e.cache.compiledFunc;if(c){const n=null!=i?i.scale:void 0,t=null!=i?i.view:void 0;o=null==n||"3d"===t?x(e):n}else if(!t)switch(e.inputValueType){case r.Expression:{if(null==i?.arcade)return void f();const n={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},t=i.arcade.arcadeUtils,r=t.getViewInfo(n),l=t.createExecContext(a,r,i.timeZone);if(!u){const n=t.createSyntaxTree(e.valueExpression);u=t.createFunction(n),e.cache.compiledFunc=u}o=t.executeFunction(u,l);break}case r.Field:s&&(o=s[e.field]);break;case r.Unknown:o=null}if(!l(o))return null;if(t||!e.normalizationField)return o;const p=s?parseFloat(s[e.normalizationField]):null;return l(p)&&0!==p?o/p:null}function x(e){let n=null,i=null;const t=e.stops;return t?(n=t[0].value,i=t[t.length-1].value):(n=e.minDataValue||0,i=e.maxDataValue||0),(n+i)/2}function y(e,n,i){const t="visualVariables"in e?e.visualVariables?.find((e=>"size"===e.type)):e;if(!t)return;if("esri.renderers.visualVariables.SizeVariable"!==t.declaredClass)return void u("SizeVariable");const a=R(V(t,n,i),t,n,i,t.cache.ipData);return null==a||isNaN(a)?void 0:a}function g(e,n,i){return null==e?null:o(e)?y(e,n,i):l(e)?e:null}function w(e,n,i){return l(i)&&e>i?i:l(n)&&e<n?n:e}function z(e,n,i,t){const a=g(n.minSize,i,t)||n.minDataValue;return null==e&&null==a?null:(e??0)+(a??0)}function F(e,n,i){const t=e.stops;let a=t?.length&&t[0].size;return null==a&&(a=e.minSize),g(a,n,i)}function S(e,n,i,t){const a=g(n.minSize,i,t);if(null==e)return a;const{minDataValue:r,maxDataValue:l}=n;if(null==r||null==l)return null;const s=(e-r)/(l-r),o=g(n.maxSize,i,t),c=null!=t?t.shape:void 0;if(e<=r)return a;if(e>=l)return o;if(null==a||null==o)return null;if("area"===n.scaleBy&&c){const e="circle"===c,n=e?d*(a/2)**2:a*a,i=n+s*((e?d*(o/2)**2:o*o)-n);return e?2*Math.sqrt(i/d):Math.sqrt(i)}return a+s*(o-a)}function E(e,n,i,t){const a=g(n.minSize,i,t);if(null==e||null==a)return a;const r=null!=t?t.shape:void 0,{minDataValue:l}=n;if(null==l)return null;const s=e/l,o=g(n.maxSize,i,t);let c=null;return c="circle"===r?2*Math.sqrt(s*(a/2)**2):"square"===r||"diamond"===r||"image"===r?Math.sqrt(s*a**2):s*a,w(c,a,o)}function C(e,n,i,t,a){if(null==e)return null;const[r,l,s]=T(e,a);if(r===l)return g(n.stops?.[r].size,i,t);{const e=g(n.stops?.[r].size,i,t),a=g(n.stops?.[l].size,i,t);return null==e||null==a?null:e+(a-e)*s}}function M(e,n,i,t){const r=(t?.resolution??1)*a[n.valueUnit],l=g(n.minSize,i,t),s=g(n.maxSize,i,t),{valueRepresentation:o}=n;if(null==e)return l;let c=null;return c="area"===o?2*Math.sqrt(e/d)/r:"radius"===o||"distance"===o?2*e/r:e/r,w(c,l,s)}function k(e){return e}function R(e,n,i,t,a){switch(n.transformationType){case s.Additive:return z(e,n,i,t);case s.Constant:return F(n,i,t);case s.ClampedLinear:return S(e,n,i,t);case s.Proportional:return E(e,n,i,t);case s.Stops:return C(e,n,i,t,a);case s.RealWorldSize:return M(e,n,i,t);case s.Identity:return k(e);case s.Unknown:return null}}function U(e,n,i){const{isScaleDriven:t}=e.cache;if(!(t&&"3d"===i||n))return null;const a={scale:n,view:i};let r=g(e.minSize,p,a),l=g(e.maxSize,p,a);if(null!=r||null!=l){if(r>l){const e=l;l=r,r=e}return{minSize:r,maxSize:l}}}function D(e,n,i){if(!e.visualVariables)return;const t=[],a=[],r=[],l=[],s=[];for(const o of e.visualVariables)switch(o.type){case"color":a.push(o);break;case"opacity":r.push(o);break;case"rotation":s.push(o);break;case"size":l.push(o)}return a.forEach((e=>{const a=m(e,n,i);t.push({variable:e,value:a})})),r.forEach((e=>{const a=h(e,n,i);t.push({variable:e,value:a})})),s.forEach((e=>{const a=b(e,n,i);t.push({variable:e,value:a})})),l.forEach((e=>{const a=y(e,n,i);t.push({variable:e,value:a})})),t}function T(e,n){if(!n)return;let i=0,t=n.length-1;return n.some(((n,a)=>e<n?(t=a,!0):(i=a,!1))),[i,t,(e-n[i])/(n[t]-n[i])]}function N(e,n,t){const a=["proportional","proportional","proportional"];for(const r of e){const e=r.useSymbolValue?"symbol-value":y(r,n,t)??"proportional";switch(r.axis){case"width":a[0]=e;break;case"depth":a[1]=e;break;case"height":a[2]=e;break;case"width-and-depth":a[0]=e,a[1]=e;break;case"all":case void 0:case null:a[0]=e,a[1]=e,a[2]=e;break;default:i(r.axis)}}return a}export{N as getAllSizes,m as getColor,h as getOpacity,b as getRotationAngle,y as getSize,R as getSizeForValue,g as getSizeFromNumberOrVariable,U as getSizeRangeAtScale,D as getVisualVariableValues,v as viewScaleRE};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import r from"../../core/JSONSupport.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import{apiKey as s}from"./commonProperties.js";import p from"./TranslateContent.js";let i=class extends r{constructor(t){super(t),this.to=null,this.contents=null,this.portalUrl="https://www.arcgis.com",this.translator="esri",this.from=null,this.apiKey=null,this.requestSource=null}};t([o({type:[String],json:{write:!0}})],i.prototype,"to",void 0),t([o({type:[p],json:{write:!0}})],i.prototype,"contents",void 0),t([o({type:String,json:{write:!0}})],i.prototype,"portalUrl",void 0),t([o({type:String,json:{write:!0,default:"esri"}})],i.prototype,"translator",void 0),t([o({type:String,json:{write:!0}})],i.prototype,"from",void 0),t([o(s)],i.prototype,"apiKey",void 0),t([o({type:String,json:{name:"x-esri-request-source"}})],i.prototype,"requestSource",void 0),i=t([e("esri.rest.support.TranslateParameters")],i);export{i as default};
|
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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const b="20250613",c="bad155b134eda3bf7cef8dc3e8b9dc6becf6d0b7";export{b as buildDate,c as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import o from"../Color.js";import{
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import o from"../Color.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import{Integer as r}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{enumeration as s}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import i from"./Symbol3DLayer.js";var p;let l=class extends i{static{p=this}constructor(e){super(e),this.color=c.clone(),this.type="water",this.waterbodySize="medium",this.waveDirection=null,this.waveStrength="moderate"}clone(){return new p({color:this.color.clone(),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};e([t({type:o,nonNullable:!0,json:{type:[r],write:(e,t,r)=>t[r]=e.toArray(o.AlphaMode.UNLESS_OPAQUE),default:()=>c.clone(),defaultEquals:e=>e.toCss(!0)===c.toCss(!0)}})],l.prototype,"color",void 0),e([s({Water:"water"},{readOnly:!0})],l.prototype,"type",void 0),e([t({type:["small","medium","large"],json:{write:!0,default:"medium"}})],l.prototype,"waterbodySize",void 0),e([t({type:Number,json:{write:!0,default:null}})],l.prototype,"waveDirection",void 0),e([t({type:["calm","rippled","slight","moderate"],json:{write:!0,default:"moderate"}})],l.prototype,"waveStrength",void 0),l=p=e([a("esri.symbols.WaterSymbol3DLayer")],l);const c=new o([0,119,190]);export{l as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../core/has.js";import{px2pt as e}from"../../core/screenUtils.js";import{isSubtypeGroupLayer as t}from"../../layers/support/layerUtils.js";import{loadArcade as l}from"../../support/loadArcade.js";import{getStroke as a}from"./gfxUtils.js";import{SymbolSizeDefaults as i}from"./previewUtils.js";import{renderSymbol as r,renderOnce as s}from"./renderUtils.js";import{applyColorToSymbol as
|
|
5
|
+
import"../../core/has.js";import{px2pt as e}from"../../core/screenUtils.js";import{isSubtypeGroupLayer as t}from"../../layers/support/layerUtils.js";import{loadArcade as l}from"../../support/loadArcade.js";import{getStroke as a}from"./gfxUtils.js";import{SymbolSizeDefaults as i}from"./previewUtils.js";import{renderSymbol as r,renderOnce as s}from"./renderUtils.js";import{isSymbol3D as o}from"./typeUtils.js";import{applyColorToSymbol as n,applySizesToSymbol as c,applyRotationToSymbol as u,getCSSFilterFromEffectList as f,getColorFromSymbol as p,applyOpacityToColor as y}from"./utils.js";import{renderRelationshipRamp as h}from"../../widgets/Legend/styles/support/relationshipUtils.js";import{getRelationshipRampElement as m}from"../../widgets/Legend/support/relationshipRampUtils.js";let d=null;const b=[255,255,255];function g(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function w(e,t,l){const{backgroundColor:a,outline:r,dotSize:s}=e,o=l?.swatchSize||i.size,n=.8,c=Math.round(o*o/Math.max(s,.5)**2*n),u=window.devicePixelRatio,f=document.createElement("canvas"),p=o*u;f.width=p,f.height=p,f.style.width=f.width/u+"px",f.style.height=f.height/u+"px";const y=f.getContext("2d");if(a&&(y.fillStyle=a.toCss(!0),y.fillRect(0,0,p,p),y.fill()),y.fillStyle=t?.toCss(!0)??"",d&&d.length/2===c)for(let i=0;i<2*c;i+=2){const e=d[i],t=d[i+1];y.fillRect(e,t,s*u,s*u),y.fill()}else{d=[];for(let e=0;e<2*c;e+=2){const e=g(0,p),t=g(0,p);d.push(e,t),y.fillRect(e,t,s*u,s*u),y.fill()}}r&&(r.color&&(y.strokeStyle=r.color.toCss(!0)),y.lineWidth=r.width,y.strokeRect(0,0,p,p));const h=new Image(o,o);return h.src=f.toDataURL(),h.ariaLabel=l?.ariaLabel??null,h.alt=l?.ariaLabel??"",h}function S(e,t={}){const l=t.radius||40,i=2*Math.PI*l,s=e.length,o=i/s,n=[],c=a(t.outline);null!=c?.width&&(c.width*=2),(c||t.backgroundColor)&&n.push({shape:{type:"circle",cx:l,cy:l,r:l},fill:t.backgroundColor,stroke:c,offset:[0,0]});const u=t.values,f=u&&u.length===s&&100===u.reduce(((e,t)=>e+t),0),p=[0];for(let a=0;a<s;a++){let t=null;f&&(t=u[a]*i/100,p.push(t+p[a])),n.push({shape:{type:"circle",cx:l,cy:l,r:l/2},fill:[0,0,0,0],stroke:{width:l,dashArray:`${(t??o)/2} ${i}`,dashoffset:"-"+(f?p[a]/2:a*(o/2)),color:e[a]},offset:[0,0]})}let y=null;const h=2*l+(c?.width||0),m=t.holePercentage;if(m){c&&n.push({shape:{type:"circle",cx:l,cy:l,r:l*m},fill:null,stroke:c,offset:[0,0]});const e=h/2;y=[[{shape:{type:"circle",cx:e,cy:e,r:e},fill:b,stroke:c?{...c,color:b}:null,offset:[0,0]},{shape:{type:"circle",cx:e,cy:e,r:l*m},fill:[0,0,0],stroke:null,offset:[0,0]}]]}return r([n],[h,h],{effectView:t.effectList,ignoreStrokeWidth:!0,masking:y,rotations:[-90],ariaLabel:t.ariaLabel})}function v(e,t={}){const l=e?.authoringInfo;if(!("relationship"===l?.type)||!l?.numClasses||!e.uniqueValueInfos)return null;const{focus:a,numClasses:i}=l,r=m({focus:a,numClasses:i,infos:e.uniqueValueInfos}),o=t?.node||document.createElement("div");return s(o,(()=>h(r,t.id||"relationship",{opacity:t.opacity||1,effectList:t.effectList,ariaLabel:t.ariaLabel}))),o}function V(e,t={}){const l=24,a=75,i="horizontal"===t.align,r=i?a:l,s=i?l:a,o=t.width??r,n=t.height??s,c=t.gradient??!0,u=window.devicePixelRatio,f=o*u,p=n*u,y=document.createElement("canvas");y.width=f,y.height=p,y.ariaLabel=t.ariaLabel??null,y.style.width=`${o}px`,y.style.height=`${n}px`;const h=y.getContext("2d"),m=i?f:0,d=i?0:p;if(c){const t=h.createLinearGradient(0,0,m,d),l=e.length,a=1===l?0:1/(l-1);e.forEach(((e,l)=>t.addColorStop(l*a,e.toString()))),h.fillStyle=t,h.fillRect(0,0,f,p)}else{const t=i?f/e.length:f,l=i?p:p/e.length;let a=0,r=0;for(const s of e)h.fillStyle=s.toString(),h.fillRect(a,r,t,l),a=i?a+t:0,r=i?0:r+l}const b=document.createElement("div");return b.style.width=`${o}px`,b.style.height=`${n}px`,k(b,t?.effectList),b.appendChild(y),b}function k(e,t){if(!t)return;e.style.filter=f(t);const l=t.effects;if(l)for(const a of l)if("drop-shadow"===a?.type){a.offsetX<0?e.style.marginLeft=`${Math.abs(a.offsetX)}px`:e.style.marginRight=`${a.offsetX}px`;break}}async function L(e,t){switch(e.type){case"web-style":{const{previewWebStyleSymbol:l}=await import("./previewWebStyleSymbol.js");return l(e,L,t)}case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":{const{previewSymbol3D:l}=await import("./previewSymbol3D.js");return l(e,t)}case"simple-marker":case"simple-line":case"simple-fill":case"picture-marker":case"picture-fill":case"text":{const{previewSymbol2D:l}=await import("./previewSymbol2D.js");return l(e,t)}case"cim":{const{previewCIMSymbol:l}=await import("./previewCIMSymbol.js");return l(e,t)}default:return}}function x(e){return e&&"opacity"in e?e.opacity*x(e.parent):1}async function R(e,t){if(!e)return;const a=e.sourceLayer,i=(null!=t&&t.useSourceLayer?a:e.layer)??a,r=t?.ignoreOpacity?1:x(i);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):e.symbol.clone();return n(l,null,{add:r}),l}const s=t?.renderer??F(i);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!o)return;if(o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):o.clone(),!(s&&"visualVariables"in s&&s.visualVariables?.length&&j(o)))return n(o,null,{add:r}),o;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await l(),t=e}const{getColor:f,getOpacity:p,getAllSizes:y,getRotationAngle:h}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),m=[],d=[],b=[],g=[];for(const l of s.visualVariables)switch(l.type){case"color":m.push(l);break;case"opacity":d.push(l);break;case"rotation":g.push(l);break;case"size":l.target||b.push(l)}const w=!!m.length&&m[m.length-1],S=w?f(w,e,t):null,v=!!t?.ignoreOpacity,V=!!d.length&&d[d.length-1],k=V?p(V,e,t):null;if(n(o,S,v?void 0:{override:k,add:r}),b.length&&!0!==t?.ignoreSizeVariables){const l=y(b,e,t);await c(o,l)}if(!0!==t?.ignoreRotationVariables)for(const l of g)u(o,h(l,e,t),l.axis);return o}async function C(e,t){if(!e)return;const{layer:a,sourceLayer:i}=e,r=x(a??i);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):e.symbol.clone();return p(l,r)}const s=t?.renderer??F(a)??F(i);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):void 0;if(!o)return;o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):o.clone();const n=p(o,void 0);if(!s||!("visualVariables"in s)||"visualVariables"in s&&!s.visualVariables||"visualVariables"in s&&!s.visualVariables?.length||!j(o))return n?y(n,r):void 0;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await l(),t=e}const{getColor:c,getOpacity:u}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),f=[],h=[];if(s.visualVariables)for(const l of s.visualVariables)switch(l.type){case"color":f.push(l);break;case"opacity":h.push(l)}const m=f.length>0?f[f.length-1]:null,d=(m?c(m,e,t):void 0)??n,b=h.length>0?h[h.length-1]:null,g=b?u(b,e,t):null;return null!=d&&null!=g&&(d.a=g),d?y(d,r):null}function j(e){return!o(e)||"water"!==e.symbolLayers.at(0)?.type}function F(e){if(e)return"renderer"in e?e.renderer:void 0}async function U(e,t,l){if(!e)return;const{layer:a,sourceLayer:i}=e,r=l?.renderer??F(a)??F(i);if(!r)return null;if("visualVariables"in r&&r.visualVariables?.length){const{getRampStops:i}=await import("../../widgets/Legend/support/colorRampUtils.js"),{getRampStops:s}=await import("../../widgets/Legend/support/sizeRampUtils.js"),{getDateFormatOptions:o}=await import("../../widgets/Legend/support/utils.js");let n=null;for(const c of r.visualVariables){const u=t?o(a,c,t.timeZone):null;let f=null;switch(c.type){case"color":f=await i(c,null,u);break;case"opacity":f=await i(c);break;case"size":c.target||(f=await s(r,c,null,l?.scale||t?.scale,t,u))}if(f?.length){const t=f.find(((t,l)=>{const a=e.attributes[c.field];return 0===l?a>=t.value:l===f?.length-1?a<=t.value:t.value===a}));if(t){n=t.label;break}}}if(n)return n}switch(r.type){case"class-breaks":{const t="getClassBreakInfo"in r?await r.getClassBreakInfo(e,l):null;return t?.label??(t&&r.classBreakInfos?.length>1)?`${t.minValue} - ${t.maxValue}`:null}case"unique-value":{const t="getUniqueValueInfo"in r?await r.getUniqueValueInfo(e,l):null;return t?.label}}return null}async function z(l,a){l?.layer&&t(l.layer)&&((l=l.cloneShallow()).layer=l.layer.findSublayerForFeature(l)??null);const i=null===l?a?.fallbackSymbol??null:await R(l,{ignoreGraphicSymbol:!!l.layer,ignoreOpacity:a?.ignoreOpacity??!0,ignoreRotationVariables:a?.ignoreRotationVariables??!0,ignoreSizeVariables:a?.ignoreSizeVariables??!0})??a?.fallbackSymbol??null;if(!i)return null;const r=await L(i,{geometry:a.useGeometryForShape?l?.geometry??null:null,useMarkerSymbolSize:!1!==a.useMarkerSymbolSize,size:{width:e(a.widthInPixels??16),height:e(a.heightInPixels??16)},..."cim"===i?.type?{cimOptions:{feature:{attributes:l?.attributes??{}}}}:{}});if(!r)return null;return"element"===(a?.format??"element")?r:r.outerHTML}export{C as getDisplayedColor,R as getDisplayedSymbol,U as getLegendLabel,z as previewGraphic,V as renderColorRampPreviewHTML,w as renderDotDensityPreviewHTML,S as renderPieChartPreviewHTML,L as renderPreviewHTML,v as renderRelationshipRampPreviewHTML};
|