@arcgis/core 5.2.0-next.169 → 5.2.0-next.170
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/18e7fa4d3e0b1a084cc6.js +1 -0
- package/assets/esri/core/workers/chunks/6de64abd9e2b51fa2872.js +1 -0
- package/assets/esri/core/workers/chunks/7697bbbaf3724f8c4445.js +1 -0
- package/assets/esri/core/workers/chunks/86524ae8926228898d95.js +1 -0
- package/assets/esri/core/workers/chunks/{1b24a40c0fa197014873.js → 9c33e67bb6f93f6529bb.js} +1 -1
- package/assets/esri/core/workers/chunks/b71029a2ab7dbb3706f9.js +1 -0
- package/assets/esri/core/workers/chunks/b7c4bb0f3f9662bac726.js +1 -0
- package/assets/esri/core/workers/chunks/bc6fdd9faf8ed54be0cb.js +1 -0
- package/assets/esri/core/workers/chunks/bec375ff37c25a49e080.js +1 -0
- package/assets/esri/views/3d/environment/resources/milkyway-band.avif +0 -0
- package/chunks/EmissionComposite.glsl.js +1 -1
- package/chunks/Fog.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +176 -95
- package/config.d.ts +12 -9
- package/config.js +1 -1
- package/core/Collection.js +1 -1
- package/form/FormTemplate.d.ts +1 -1
- package/form/elements/AttachmentElement.d.ts +2 -0
- package/form/elements/FieldElement.d.ts +2 -2
- package/form/elements/FieldElement.js +1 -1
- package/form/elements/RelationshipElement.d.ts +1 -1
- package/form/elements/TextElement.d.ts +2 -2
- package/form/elements/UtilityNetworkAssociationsElement.d.ts +1 -1
- package/form/elements/inputs/inputUtils.js +1 -1
- package/form/elements/inputs/types.d.ts +19 -0
- package/form/elements/inputs.d.ts +3 -2
- package/form/elements/inputs.js +1 -1
- package/kernel.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/save/parquetLayerUtils.js +1 -1
- package/package.json +2 -2
- package/rest/route.d.ts +1 -1
- package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
- package/rest/support/LengthsParameters.d.ts +1 -1
- package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
- package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
- package/views/3d/terrain/ExtentHelper.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +3 -3
- package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/EmissiveTechniqueConfiguration.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/layers/LayerView.d.ts +10 -2
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +2 -2
- package/widgets/Editor/EditorViewModel.d.ts +10 -12
- package/widgets/FeatureTable/support/EditableColumnTemplateMixin.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/assets/esri/core/workers/chunks/6f897b4e7ddd1dd1672b.js +0 -1
- package/assets/esri/core/workers/chunks/9e04703ee5f5ec47db43.js +0 -1
- package/assets/esri/core/workers/chunks/9f358c7b052cdc0ac06f.js +0 -1
- package/assets/esri/core/workers/chunks/a43b33955aa78a2a8deb.js +0 -1
- package/assets/esri/core/workers/chunks/b5b9d42e1f84ee82429c.js +0 -1
- package/assets/esri/core/workers/chunks/c9feffb9884cfed52c4b.js +0 -1
- package/assets/esri/core/workers/chunks/cdacc3e42f01c3b852d6.js +0 -1
- package/assets/esri/core/workers/chunks/feb6e041dd0aa1c59c31.js +0 -1
- package/layers/geospatialPDF/CIM2DLayerview.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../Color.js";import{filterInPlace as n,difference as r}from"../../../core/arrayUtils.js";import i from"../../../core/CollectionFlattener.js";import{toConst as a}from"../../../core/compilerUtils.js";import{EventedAccessor as o}from"../../../core/Evented.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{clamp as c}from"../../../core/mathUtils.js";import{removeMaybe as l,destroyMaybe as u}from"../../../core/maybe.js";import{MemCachePool as ee}from"../../../core/MemCachePool.js";import d from"../../../core/ObjectPool.js";import f from"../../../core/PooledArray.js";import{throwIfAborted as te,isAbortError as p,isAborted as m}from"../../../core/promiseUtils.js";import{watch as h,syncAndInitial as g,initial as _,sync as v}from"../../../core/reactiveUtils.js";import"../../../core/scheduling.js";import{getMetersPerUnitForSR as ne}from"../../../core/units.js";import{property as y,subclass as re}from"../../../core/accessorSupport/decorators.js";import{exactEquals as ie,set as ae,copy as oe}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as se}from"../../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as ce,radiusModifier as le}from"../../../geometry/ellipsoidUtils.js";import x from"../../../geometry/SpatialReference.js";import{getProjector as S}from"../../../geometry/projection/projectors.js";import{projectPointToVector as C}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as ue}from"../../../geometry/projection/projectVectorToVector.js";import{create as w,equals as T,intersection as de,intersectsSphere as fe}from"../../../geometry/support/aaBoundingRect.js";import{copy as pe,create as me}from"../../../geometry/support/frustumPlanes.js";import{createSpatialReferenceCyclical as he}from"../../../geometry/support/normalizeUtils.js";import{isPlateCarree as ge}from"../../../geometry/support/spatialReferenceUtils.js";import{Sphere as _e}from"../../../geometry/support/sphere.js";import{ElevationQueryTileCache as ve}from"../../../layers/support/ElevationQueryTileCache.js";import{isBaseLayer as ye}from"../../../layers/support/layerUtils.js";import{queueHighPriority as be}from"../../../request/queue.js";import{debugFlags as E}from"../support/debugFlags.js";import{ElevationRange as D}from"../support/ElevationRange.js";import{ElevationUpdateEvent as xe}from"../support/ElevationUpdateEvent.js";import{calculateElevationUpdateExtents as Se}from"../support/elevationUpdateExtentUtils.js";import{toBoundingRect as Ce}from"../support/extentUtils.js";import{updatingProgress as we}from"../support/updatingProperties.js";import{ElevationBounds as O}from"./ElevationBounds.js";import{ElevationData as Te,sampleElevation as Ee}from"./ElevationData.js";import{create as De}from"./ExtentHelper.js";import{LayerClasses as Oe}from"./LayerClass.js";import{OverlayManager as ke}from"./OverlayManager.js";import{PlanarPatch as Ae}from"./PlanarPatch.js";import{Queue as je}from"./Queue.js";import{ScaleRangeQueries as Me}from"./ScaleRangeQueries.js";import{SphericalPatch as Ne}from"./SphericalPatch.js";import{SplitLimits as Pe}from"./SplitLimits.js";import{maxRootTiles as k,tooManyRootTilesAfterChangeError as Fe,tooManyRootTilesForLayerError as Ie,maxTileNeighborLevelDelta as A,maxMemoryLodBias as Le}from"./TerrainConst.js";import{TerrainRenderer as Re}from"./TerrainRenderer.js";import ze from"./TerrainSurfacePerformanceInfo.js";import{weakAssert as j,isVectorTileLayerView as M,internalAssert as N,oppositeEdge as Be,neighborEdgeIndices as P,isSurfaceLayerView as F,isGroupLayerView as I,isMapTileLayerView as L,isBlendableLayerView as R,isElevationLayerView as z,releaseTerrainData as B,oppositeCorner as Ve,enableTerrainInternalChecks as V,enableWaterproofTests as He,enableInternalTerrainChecks as Ue,enableTerrainWaterproofChecks as We,neighborCornerIndices as Ge}from"./terrainUtils.js";import{Tile as Ke,lijEquals as H}from"./Tile.js";import{printAllocations as qe}from"./TilePerLayerInfo.js";import{sortTiles as Je,IteratorPreorder as Ye,IteratorPostorder as Xe,compareTilesByLij as U,hasLoadableSiblings as Ze,sortTilesByPOI as Qe,traverseTilesPreorder as W}from"./tileUtils.js";import{TilingSchemeLogic as $e}from"./TilingSchemeLogic.js";import{getGroundTransparencyModeFromOpacity as et}from"./TransparencyMode.js";import{UpsampleInfo as tt}from"./UpsampleInfo.js";import{isCompositeBlendMode as nt,blendModeFromString as rt}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{hasLayerBasedScaleVisibility as it}from"../../support/layerViewUtils.js";import{ImmediateTask as G,TaskPriority as at,noBudget as ot}from"../../support/Scheduler.js";import{TextureCompressionTracker as st}from"../../support/TextureCompressionTracker.js";import{Yield as ct}from"../../support/Yield.js";var K;let q=class extends o{static{K=this}get allTilesCreated(){return this._allTilesCreated}get allTiles(){return a(this._allTiles)}get renderedTiles(){return Je(n(this._allTiles.toArray(),e=>e.visible&&e.rendered))}get demResolution(){let{_allTiles:e,tilingScheme:t}=this;if(e.length===0)return{min:1,max:1};let n=ne(t.spatialReference),r=1/0,i=-1/0;for(let a of e){let e=t.resolutionAtLevel(a.level)*n;r=Math.min(r,e),i=Math.max(i,e)}return{min:r,max:i}}constructor(e){super(e),this.terrainTextureCompressionTracker=new st,this._iteratorPool=new d(()=>new Ye,e=>e.remove=()=>this._iteratorPool.release(e)),this._postorderIterator=new Xe,this._hasPendingUpdates=!1,this._pendingUpdates=0,this._asyncWorkItems=0,this._allTilesDirty=!0,this._allTilesSorted=!0,this._allTilesCreated=!1,this._usedMemory=null,this._performanceInfo=new ze,this._waterproofnessErrorHandle=null,this._viewChanged=!1,this.heading=0,this._inFrameTask=!1,this._viewChangeUpdateDirty=!1,this._eyePosRenderSR=b(),this._eyePosSurfaceSR=b(),this._splitLimits=new Pe,this._layerViews=[[],[]],this._layerIndexByUid=[new Map,new Map],this._basemapLayerViewHandles=new Map,this._updatingHandles=new se,this._poiWatchHandle=null,this._frameTask=G,this._allTiles=new f,this._upsampleInfoPool=new d(()=>new tt),this._shouldEmitChangeEvent=!1,this._rootTilesExtent=w(),this.updatingProgress=.5,this._maxNumUpdating=1,this.maxTextureScale=1.2,this._spatialReference=x.WebMercator,this._elevationProjectorCache=new Map,this.visibleElevationRange=new D(1/0,-1/0),this._rootTileElevationRange=new D(1/0,-1/0),this._projectorCache=new Map,this._tilingSchemeSpatialReference=null,this._updatingRootTiles=!1,this._pendingTilesForElevationUpdateEvent=new Set,this._pendingTilesToUpdate=new Set,this.totalGeometryUpdates=0,this.totalTileUpdates=0,this._layerViewsDirty=!1,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._isWebMercator=!1,this._isWebMercatorOnPlateCarree=!1,this.enabled=!0;let{view:t}=e;this.overlayManager=new ke({...e,terrainSurface:this}),this._isGlobal=!t.state?.isLocal,this._isGeographic=this._spatialReference?.isGeographic??!1,this._tileConstructor=this._isGlobal?Ne:Ae,this._ellipsoid=ce(t.spatialReference),this._renderer=new Re(this.overlayManager.renderer,t.stage,this._allTiles,this.terrainTextureCompressionTracker,t.resourceController.memoryController),it()||(this._scaleRangeQueries=new Me)}initialize(){let{view:e}=this,{resourceController:t}=e,{memoryController:n}=t;this._tileCache=new ee((e,t)=>n.newCache(e,t),`terrain-tile`),this._upsampleMapCache=n.newCache(`terrain-upsample`,({tile:e})=>e.unloadMapData()),this._elevationQueryCache=new ve(n.newCache(`elevation-query`));let r=this.overlayManager;this.addHandles([h(()=>r.renderer.isEmpty,()=>this._evaluateTransparency()),h(()=>this.renderer.visible,e=>this.freeze=!e),h(()=>this.heading,e=>{this._renderer.updateHeading(e),this._updateTileTextures(0)},g)],`overlayManager`),this._updatingHandles.add(()=>({heading:e.camera?.heading,state:e.state?.mode}),({heading:e,state:t})=>{if(e==null)return;if(this.isGlobal&&this.isGeographic||this.isWebMercatorOnPlateCarree){this.heading=Math.round(e/90)*90%360;return}let n=Math.round(e)%360,r=Math.abs(n-this.heading);(t===2||Math.min(r,360-r)>=30)&&(this.heading=n)},_),this.addHandles([h(()=>this.baseOpacity,()=>{this._handleLayerViewChanges(),this._updateTileTextures(this._evaluateTransparency()?1:2)},g),h(()=>this.hasCompositeBlendMode,()=>this._updateTileTextures(this._evaluateTransparency()?1:2),g),h(()=>this.backgroundColor,(e,t)=>{e?.equals(t)||(this._handleLayerViewChanges(),this._renderer.updateTileBackground(e))},v),h(()=>this.snapLevel,()=>this._viewChanged=!0,v),h(()=>this.view.pointsOfInterest,e=>{this._renderer.pointsOfInterest=e,this._poiWatchHandle=l(this._poiWatchHandle),e&&(this._poiWatchHandle=this._updatingHandles.add(()=>e.focus?.renderLocation,()=>this._allTilesSorted=!1,{equals:ie}))}),h(()=>E.TERRAIN_TILE_TREE_SHOW_TILES,t=>{t&&!this._treeDebugger?import(`../layers/support/TerrainTileTree3DDebugger.js`).then(({TerrainTileTree3DDebugger:t})=>{!this._treeDebugger&&E.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new t({view:e}))}):t||(this._treeDebugger=u(this._treeDebugger))},_)]);let{spatialReference:a}=e;this._extentHelper=De(this.viewingMode,{layers:e.map.allLayers,layerViews:e.allLayerViews,viewSpatialReference:a});let o=new i({getCollections:()=>e.defaultsFromMap?.mapCollections?.map(({layers:e})=>e),getChildrenFunction:e=>e&&`layers`in e?e.layers:null}),s=new $e({layers:o,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:a});this._set(`tilingSchemeLogic`,s),this._updateTilingScheme();let c=t.scheduler;this._frameTask=c.registerTask(at.TERRAIN_SURFACE,this),this.addHandles([h(()=>this._extentHelper.stencilEnabledExtents,e=>this._renderer.setStencilEnabledLayerExtents(e),_),h(()=>this.tilingSchemeLogic.tilingScheme,()=>this._updateTilingScheme(),v),h(()=>this.groundExtent,()=>this._updateRootTiles(),_),e.on(`resize`,()=>this._viewChangeUpdate()),h(()=>{let t=e.state;return[this._lodBias,this.lodSnappingEnabled,e.quality,t.camera,t.contentCamera,t.fixedContentCamera]},()=>this._viewChangeUpdate(),g),h(()=>e.qualitySettings?.fadeDuration,e=>this._renderer.textureFadingEnabled=e>0,_),h(()=>e.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._renderer.pbrMode=e?5:0,_),h(()=>e.qualitySettings?.tiledSurface.elevationLevelDelta,()=>this._updateAllTileGeometries()),h(()=>this.userClippingExtent,()=>this._updateClippingExtent(),v)]),this.addHandles(e.allLayerViews.on(`after-changes`,()=>this._layerViewsDirty=!0)),this._layerViewsDirty=!0,this._handleLayerViewChanges(),this._renderer.updateTileBackground(this.backgroundColor)}clearHandles(){this._updatingHandles?.removeAll(),this.removeAllHandles(),this._basemapLayerViewHandles.forEach((e,t)=>this._unregisterTiledLayerView(t)),this._basemapLayerViewHandles.clear()}destroy(){this._waterproofnessErrorHandle?.remove(),this._waterproofnessErrorHandle=null,this._frameTask.remove(),this._frameTask=G,this._updatingHandles?.destroy(),this._removeAllTiles(),this._set(`tilingSchemeLogic`,u(this.tilingSchemeLogic)),this._basemapLayerViewHandles.forEach((e,t)=>this._unregisterTiledLayerView(t)),this._basemapLayerViewHandles.clear(),this._set(`overlayManager`,u(this.overlayManager)),this._tileCache=u(this._tileCache),this._allTiles.prune(),Ke.prune(),this._treeDebugger=u(this._treeDebugger),this._renderer.destroyed||this._renderer.destroy(),this._renderer=null,this._iteratorPool=u(this._iteratorPool),this._upsampleMapCache=u(this._upsampleMapCache),this._elevationQueryCache=u(this._elevationQueryCache),this._set(`view`,null),this._extentHelper=u(this._extentHelper),this._upsampleInfoPool=u(this._upsampleInfoPool),qe(),this._layerViews.forEach(e=>e.length=0),this._performanceInfo=null}get renderer(){return this._renderer}get frustum(){return this.view.state.camera.frustum}get snapLevel(){return this.lodSnappingEnabled?this.view.terrainLevel:null}get lodSnappingEnabled(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get hasStencilEnabledExtents(){return this._extentHelper.stencilEnabledExtents.length>0}get userClippingExtent(){let{spatialReference:e}=this,t=this.view?.clippingArea;if(t==null||e==null)return null;let n=w(),r=Ce(t,n,e)?n:null,i=this._get(`userClippingExtent`);return T(r,i)?i:r}get rootTilesExtent(){return this._rootTilesExtent}get groundExtent(){let e=de(this.fullGroundExtent,this.userClippingExtent,w()),t=this._get(`groundExtent`);return T(e,t)?t:e}get fullGroundExtent(){return this._tilingSchemeExtent==null?this._rootTilesExtent:this._tilingSchemeExtent}get _tilingSchemeExtent(){return this.tilingSchemeLogic?.extent}get updating(){return this._hasPendingUpdates||(this._maxNumUpdating=1),this.enabled&&!!((this.readyToRun||this._updatingHandles?.updating||this._asyncWorkItems>0)&&this.ready&&!this.freeze||this.overlayManager?.updating||this.terrainTextureCompressionTracker.compressing)}get readyToRun(){return this.enabled&&(this._hasPendingUpdates||this._viewChanged||this._allTilesDirty||!this._allTilesSorted||this._hasElevationSourceUpdates||this._layerViewsDirty||this._scaleRangeQueries?.updating||this._frameTask.updating)&&this.ready&&!this.freeze}get _hasElevationSourceUpdates(){return this._allTiles.some(e=>e.needsElevationSourceUpdate())}get updatingProgressValue(){return this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating),1-this._pendingUpdates/this._maxNumUpdating}get baseOpacity(){return this.view?.map?.ground?.opacity??1}set baseOpacity(e){this.view.map.ground.opacity=e}get viewingMode(){return this.view.state.viewingMode}get ready(){return!this.enabled||this._rootTiles!=null}get rootTiles(){return this._rootTiles}get spatialReference(){return this.tilingScheme?.spatialReference??null}get backgroundColor(){return this.view?.map?.ground?.surfaceColor}set backgroundColor(e){this.view.map.ground.surfaceColor=e}set slicePlaneEnabled(e){this._renderer.slicePlaneEnabled=e,this._set(`slicePlaneEnabled`,e),this._evaluateTransparency()}get tilingSchemeLocked(){return this.tilingSchemeLogic?.tilingSchemeLocked??!1}get wireframe(){return this._renderer?.wireframe}set wireframe(e){e!==this._renderer.wireframe&&(this._renderer.wireframe=e,this._updateAllTileGeometries())}get opaque(){return this._renderer.transparency===0}get invisible(){return this._renderer.transparency===3}set freeze(e){this._set(`freeze`,e),this._viewChangeUpdate()}get fadeDuration(){return this.view.qualitySettings.fadeDuration??0}intersect(e,t,n,r){this._renderer.intersectRay(e,t,n,r)}getElevationLevelDelta(e){return e<4?3:this.view.qualitySettings.tiledSurface.elevationLevelDelta}get _xNormalizer(){return he(this._spatialReference)}getElevation(e,t,n,r){let i=this._rootTiles;if(!i?.length||!this.enabled||i[0].layerInfo[0].length===0)return null;let a=this._elevationProjectorCache.get(r);if(a===void 0&&(a=S(r,this._spatialReference)??null,this._elevationProjectorCache.set(r,a)),a==null)return s.getLogger(this).error(`TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system`),null;let o=ae(J,e,t,n);a(o,0,o,0);let c=this._xNormalizer?.normalize(o[0])??o[0],l=o[1];return ft(i,c,l)}getElevations(e,t,n){let r=this._rootTiles,i=r?r[0].layerInfo[0].length:0;if(!r?.length||i===0||!this.enabled){for(let e=0;e<t;++e)n(e,null);return}for(let i=0;i<t;++i){let t=i*3,a=e[t],o=e[t+1],s=ft(r,a,o);n(i,s)}}getLayerIndexByUID(e,t){return this._layerIndexByUid[e].get(t)}getScale(e){if(!this.tilingScheme)return null;if(!C(e,J,this.spatialReference))return s.getLogger(this).error(`TerrainSurface.getScale(): could not project given point to tiling scheme coordinate system`),null;let t=this._rootTiles;if(t!=null){for(let e of t)if(e?.containsPoint(J)){let t=e;for(;t.children[0]&&!t.rendered;){let e=t.children[0].extent,n=0;J[0]>e[2]&&(n+=1),J[1]<e[1]&&(n+=2),t=t.children[n]}return this._getLodBiasCorrectedScale(t.level)}}return 1/0}_ensureProjector(e){let t=this._projectorCache.get(e);if(t)return t;let n=S(e,this._tilingSchemeSpatialReference)??null;return this._projectorCache.set(e,n),n}getSphereElevationRange(e,t){if(!this.enabled||this._rootTiles==null)return null;let n=this._ensureProjector(t);if(n==null)return s.getLogger(this).error(`TerrainSurface.getSphereElevationRange(): could not project given point to tiling scheme coordinate system`),null;Y.copyFrom(e),n(Y.center,0,Y.center,0);let r=new D,i=this._rootTiles;if(i!=null){let e=[];for(let t of i)e.push(t);let t=0;for(;t<e.length;){let n=e[t];if(++t,!fe(n.extent,Y))continue;let i=n.children;if(i[0]==null||n.rendered)r.expandElevationRangeValues(n.elevationBoundsMin,n.elevationBoundsMax);else for(let t of i)e.push(t)}}return r}getRootElevationRange(){return this.enabled&&this._rootTiles!=null?new D(this._rootTileElevationRange.minElevation,this._rootTileElevationRange.maxElevation):null}getLowerBoundRadius(){let e=(this._ellipsoid.radius+this.visibleElevationRange.minElevation)*le;return Math.min(e,this._ellipsoid.radius)}getSphereScale(e,t){if(!this.tilingScheme)return null;if(!C(e,Y.center,this.spatialReference))return s.getLogger(this).error(`TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system`),null;Y.radius=t;let n=null,r=e=>{if(e&&fe(e.extent,Y)){let t=e.children;if(t[0]&&!e.rendered)for(let e of t)r(e);else{let t=this._getLodBiasCorrectedScale(e.level);n=n==null?t:Math.min(n,t)}}},i=this._rootTiles;if(i!=null)for(let e of i)r(e);return n}queryVisibleScaleRange(e,t,n,r){if(!this._scaleRangeQueries)return;let i=t?this.tilingScheme.levelAtScale(t):0,a=n?this.tilingScheme.levelAtScale(n):1/0,o=this._lodBias;this._scaleRangeQueries.queryVisibleLevelRange(e,i+o,a+o,r)}_evaluateTransparency(){let e=this.baseOpacity,t=this.overlayManager.renderer.isEmpty,n=this._renderer.transparency,r=this._isFullyTransparent?et(0,t):e>=1&&!this.hasCompositeBlendMode&&!this._renderer.slicePlaneEnabled?0:1;return this._renderer.transparency=r,n!==r&&(this.notifyChange(`opaque`),this.notifyChange(`invisible`),!0)}_updateTilingScheme(){let{tilingScheme:e}=this.tilingSchemeLogic;if(e===this.tilingScheme)return;j(!!e,`tiling scheme cannot be reset to undefined`),this._isGlobal=!this.view?.state?.isLocal,this.tilingScheme&&this._removeAllTiles();let t=e?.spatialReference??x.WebMercator;this._spatialReference=t,this._isWebMercator=!!t?.isWebMercator,this._isWebMercatorOnPlateCarree=this._isWebMercator&&ge(this.view?.renderSpatialReference),this._isGeographic=t?.isGeographic??!1,this._set(`tilingScheme`,e),this._tilingSchemeSpatialReference=this.tilingScheme?.spatialReference,this._projectorCache.clear(),this._updateClippingExtent(),e&&(this._updateTiledLayers(),this._renderer.tileSize=e.pixelSize,this.overlayManager.spatialReference=e.spatialReference,this._updateRootTiles())}static{this._tileMemcacheKey=`TerrainTileMemcache`}_acquireTile(e,t,n,r){let i=this._tileCache.pop(K._tileMemcacheKey);return i?(i.init(e,t,n,r,this),i):new this._tileConstructor(e,t,n,r,this)}get updatingRootTiles(){return this._updatingRootTiles}_updateRootTiles(){let{groundExtent:e,tilingScheme:t}=this;if(!t)return;if(!this.enabled){this._setRootTiles(null);return}let n=ut,i=t.rootTilesInExtent(e,n,k*5);if(this._rootTiles!=null){if(i.length>k){s.getLogger(this).warn(Fe);return}let e=this._rootTiles.map(e=>e.lij),t=r(e,i,H);if(this._updatingRootTiles=!0,t.removed.length>0||t.added.length>0){let e=this._rootTiles.filter(e=>t.removed.findIndex(t=>H(t,e.lij))>-1?(this._purgeTile(e),!1):!0);t.added.forEach(t=>e.push(this._newRootTile(t))),this._setRootTiles(e)}}else this._updatingRootTiles=!0,i.length>k&&(s.getLogger(this).warn(Ie),i=t.rootTilesInExtent(e,n,k)),this._setRootTiles(i.map(e=>this._newRootTile(e)));T(n,this._rootTilesExtent)||(this._rootTilesExtent=w(n)),this.renderer.visible=!0,this._viewChangeUpdate(),this.overlayManager.setPlacementDirty(),this.notifyChange(`ready`),this._updateAllTileGeometries(),this._updatingRootTiles=!1,this.checkAllTilesWaterproofness(`root-tiles-updated`)}_updateAllTileGeometries(){let e=this._allTiles.filter(e=>this._canUpdateTileGeometry(e));if(e.length===0){this._pendingTilesToUpdate.clear();return}e.sort(U),e.forEach(e=>this._renderer.updateTileGeometryState(e)),e.forEach(e=>e.renderData.updateNeighborData()),this._updateTilesGeometries(e),this._pendingTilesToUpdate.clear()}_updateTilesGeometries(e){let t=e.filter(e=>this._canUpdateTileGeometry(e));if(t.length===0)return;let n=this.renderer;for(let e of t)n.updateGeometryIfNeeded(e);for(let e of t)this._pendingTilesForElevationUpdateEvent.add(e)}_canUpdateTileGeometry(e){return e.loaded&&e.intersectsClippingArea&&e.hasGeometryState}_shouldSplit(e){return e.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.snapLevel)===1}_newRootTile(e){let t=this._acquireTile(0,e[1],e[2],null);return this._shouldSplit(t)&&t.setPendingUpdate(1),this._loadTile(t),this._markTileToUpdate(t),this._updateRootTileElevationRange(),t}_setRootTiles(e){if(this._rootTiles=e,this._allTiles.clear(),e!=null){let t=this._iteratorPool.acquire();for(t.reset(e);!t.done;)this._allTiles.push(t.next());t.remove()}this._renderer.setRootTiles(this._rootTiles),this._updateTilesVisibility(e),this.notifyChange(`demResolution`),this.emit(`tiles-changed`,{allTiles:this.allTiles})}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){if(this.view&&!this.freeze&&this.tilingScheme&&this.renderer.visible){if(this._inFrameTask){this._viewChangeUpdateDirty=!0;return}this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateTilesVisibility(this._rootTiles)}}_updateClippingStatus(e){e.updateClippingStatus(this.groundExtent)&&e.resetPendingUpdate(8)&&this._updateTileGeometryState(e)}_updateTilesVisibility(e){if(e==null)return;let t=Ze(e),n=this.visibleElevationRange,r=t?n.minElevation:1/0,i=t?n.maxElevation:-1/0,a=this.groundExtent,o=this.view.state.contentCamera.viewProjectionMatrix;this.setTileTreeDirty(!1);let s=this._iteratorPool.acquire();for(s.reset(e);!s.done;){let e=s.next();e.updateClippingStatus(a)&&e.resetPendingUpdate(8)&&this._updateTileGeometryState(e),e.computeVisibility(),e.updateScreenDepth(o),e.renderData&&(r=Math.min(e.elevationBoundsMin,r),i=Math.max(e.elevationBoundsMax,i))}s.remove(),this._viewChanged=!0,this._allTilesDirty=!0,this._updatePendingTileGeometries(),isFinite(r)&&isFinite(i)&&(n.minElevation!==r||n.maxElevation!==i)&&(this.visibleElevationRange=new O(r,i))}_updateRootTileElevationRange(){let e=1/0,t=-1/0;this._rootTiles?.forEach(({elevationBoundsMin:n,elevationBoundsMax:r})=>{e=Math.min(e,n),t=Math.max(t,r)});let n=this._rootTileElevationRange;(n.minElevation!==e||n.maxElevation!==t)&&(this._rootTileElevationRange=new O(e,t))}_updateViewDependentParameters(){let{camera:e,contentCamera:t}=this.view.state,n=Math.tan(t.fovX*.5),r=Math.tan(t.fovY*.5),i=this.tilingScheme.pixelSize,a=2**-this._lodBias*e.pixelRatio;this._splitLimits.aboveGround=e.aboveGround,this._splitLimits.fovX=n,this._splitLimits.fovY=r,this._splitLimits.relativeWidthLimit=i/e.width*this.maxTextureScale*a,this._splitLimits.relativeHeightLimit=i/e.height*this.maxTextureScale*a,this._splitLimits.maxLod=this.tilingScheme.getMaxLod(),this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias,this.view.state.fixedContentCamera?this._splitLimits.frustum=pe(this._splitLimits.frustum??me(),t.frustum):this._splitLimits.frustum=null,oe(this._eyePosRenderSR,t.eye),ue(e.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateTileGeometryState(e){e.updateVisibility();let t=this._renderer.updateTileGeometryState(e);e.needsElevationSourceUpdate()&&(e.updateAgents(0),e.markElevationSourceUpdateRequested(),this.requestUpdate()),t&&this._markTileToUpdate(e),this.setMemoryDirty()}_markAllTileNeighborsForUpdate(e){e.forEachLoadedNeighbor(e=>{this._layerViews[1].some(M)&&e.setPendingUpdate(32),this._pendingTilesToUpdate.add(e)})}_updateTileTexture(e,t){let n=e.resetPendingUpdate(32)?32:e.resetPendingUpdate(16)?16:!1;n&&(this._renderer.updateTileTexture(e,n),this._usedMemory=null,t.madeProgress())}_emitElevationUpdateEventForTiles(){if(!this._shouldEmitChangeEvent)return;let e=this._pendingTilesForElevationUpdateEvent;if(e.size>0){let t=new Float64Array(4*e.size),n=0;for(let r of e)t.set(r.extent,4*n),++n;e.clear();for(let e of Se(t,this.spatialReference)){let t=new xe(this.spatialReference,e,`ground`);this.emit(`elevation-change`,t)}}this._shouldEmitChangeEvent=!1}runTask(e){this._handleLayerViewChanges(e),this._frameTask.processQueue(e),this.renderer.processScaleRangeQueries(this._scaleRangeQueries,e),this._inFrameTask=!0,this._pendingUpdates=0,this._hasPendingUpdates=!1,this._updateAllTilesStatus(e),this._sortTiles(e);let t=!this.view.state.fixedContentCamera;this._mergeAndSplit(e,t),this._updateElevation(e),this._updateElevationSources(e),this._updateTextures(e),t||this._mergeAndSplit(e,!0),this._inFrameTask=!1,this._runViewChangeUpdateIfDirty();let n=this._pendingTilesToUpdate.size>0,r=n&&this._hasPendingGeometryWithoutIndices();if((!e.done||r)&&this._updatePendingTileGeometries(),this._emitElevationUpdateEventForTiles(),e.done&&(e.hasProgressed||n&&!r)&&this.requestUpdate(),this.notifyChange(`updatingProgressValue`),!e.hasProgressed)return ct}_checkTileInvariant(){}_updateAllTilesStatus(e){if(!this._viewChanged||!this._rootTiles||e.done)return;this._viewChanged=!1;let t=!1,n=new je(this._allTiles.length);n.pushAll(this._rootTiles);let r=this.snapLevel,i=this._splitLimits,a=this._eyePosRenderSR;this._allTiles.forAll(e=>{e.maxLevelDeltaNeighborCount=0,e.unmergableChildCount=0});let o=this.view.state.contentCamera.viewProjectionMatrix;for(;!n.empty;){let e=n.pop(),s=e.parent?.hasPendingUpdate(4),c=s?4:e.shouldSplit(i,a,r),l=c===1;e.leaf?Z(e,l):n.pushAll(e.children),s?(e.resetPendingUpdate(1),e.leaf||(e.setPendingUpdate(4),t=!0),this._updateClippingStatus(e),e.updateVisibility(),e.updateScreenDepth(o)):l?(e.resetPendingUpdate(4),e.leaf&&(e.setPendingUpdate(1),t=!0)):(e.resetPendingUpdate(1)&&e.updateAgentSuspension(),c===2&&e.updateAgents(0),e.leaf||(e.setPendingUpdate(4),e.resetPendingUpdate(1),t=!0))}this._allTilesDirty=t,this.requestUpdate(),this._shortBatches&&this._updatePendingTileGeometries(),e.madeProgress()}_sortTiles(e){!e.done&&!this._allTilesSorted&&this.view.pointsOfInterest?.focus&&(Qe(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger?.update(),e.madeProgress())}_markTileToUpdate(e){N(e.loaded),e.intersectsClippingArea&&(this._pendingTilesToUpdate.add(e),this._markAllTileNeighborsForUpdate(e))}_hasPendingGeometryWithoutIndices(){for(let e of this._pendingTilesToUpdate)if(e.loaded&&e.intersectsClippingArea&&e.renderData?.vao?.indexBuffer==null)return!0;return!1}_updatePendingTileGeometries(){let e=this._pendingTilesToUpdate,t=[];if(e.forEach(e=>{this._canUpdateTileGeometry(e)&&t.push(e)}),t.length===0){e.clear();return}let n=(n,r)=>{!r||!this._canUpdateTileGeometry(r)||r.level<n.level||e.has(r)||(e.add(r),t.push(r),r.renderData.updateNeighborData())};t.sort(U);let r=t.length;for(let i=0;i<r;++i){let r=t[i];N(r.loaded),N(r.intersectsClippingArea);let a=r.renderData;if(!a?.geometryState)continue;a.updateNeighborData();let o=a.dirtyEdgeResolutions,s=a.geometryState,c=e=>{let t=Ge[e];n(r,s.cornerPeerNeighbors[e]?.findCorner(Ve(t),e=>e.loaded))};for(let t=0;t<4;++t)if(o&1<<t){let i=a.geometryState.edgePeerNeighbors[t];i&&i?.level>=r.level&&i.forAllSubtreeOnSide(Be(P[t]),t=>this._canUpdateTileGeometry(t)?(N(e.has(t)||U(r,t)<0),n(r,t),!0):!1),c((t+1)%4),c(t)}}e.clear(),this._updateTilesGeometries(t),this._shouldEmitChangeEvent=!0,V&&He&&this.checkAllTilesWaterproofness(`pending-geometries-updated`)}_mergeAndSplit(e,t){if(this.freeze||e.done||!this._allTilesDirty)return;this._allTilesDirty=!1,this.requestUpdate();let n=!1,r=this.view.state.fixedContentCamera,i=!1;for(;!e.done;){i=!0;let a=!1,o=!this._allTiles.some(i=>{if(!n&&!r&&!i.visible)return e.done;let o=i;if(i.hasPendingUpdate(4)){if(!t||i.unmergableChildCount>0)return e.done;for(i.resetPendingUpdate(4);o.parent!=null&&o.parent.unmergableChildCount===0&&o.parent.resetPendingUpdate(4);)o=o.parent;this._mergeTile(o),a=!0,e.madeProgress()}else if(i.resetPendingUpdate(1)){let t=!0,n=i.level;if(n>=A){let e=e=>e.leaf||n-e.level<A;for(let r=0;r<4;++r){let a=i.findNeighborTile(P[r],e);a!=null&&n-a.level===A&&(t=!1,V&&(N(a.leaf),N(a.hasPendingUpdate(1))))}}t?(this._splitTile(i),e.madeProgress(),a=!0):i.setPendingUpdate(1)}return e.done});if(a&&(this._allTilesSorted=!1,this._allTilesDirty=!0),o){if(!n){n=!0;continue}if(!a)break}else this._allTilesDirty=!0}i?e.madeProgress():this._allTilesDirty=!0,this._allTilesCreated=!this.allTiles.some(e=>e.hasPendingUpdate(1)||e.hasPendingUpdate(4)&&e.unmergableChildCount===0),this._sortTiles(e)}_updateElevation(e){e.done||this._allTiles.some(t=>(t.resetPendingUpdate(8)&&(this._updateTileGeometryState(t),e.madeProgress()),e.done))}_updateElevationSources(e){e.done||this._allTiles.some(t=>(t.needsElevationSourceUpdate()&&(t.updateAgents(0),t.markElevationSourceUpdateRequested(),e.madeProgress()),e.done))}_updateTextures(e){e.done||this._allTiles.some(t=>(this._updateTileTexture(t,e),e.done))}_updateClippingExtent(){this.spatialReference&&(this.updateOverlayParameters(),this.requestRender(1),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get _lodBias(){return this.view.qualitySettings.tiledSurface.lodBias-(1-this.view.quality)*Le}_getLodBiasCorrectedScale(e){let t=this.tilingScheme.levels,n=c(e-this._lodBias,0,t.length-1),r=n-Math.floor(n),i=t[Math.floor(n)].scale,a=t[Math.ceil(n)].scale;return i*(1-r)+a*r}_removeAllTiles(){this._pendingTilesToUpdate.clear(),this._pendingTilesForElevationUpdateEvent.clear(),this._rootTiles!=null&&(this._rootTiles.forEach(e=>this._purgeTile(e)),this._setRootTiles(null),this.notifyChange(`ready`)),this._allTiles.clear(),this.notifyChange(`demResolution`),this.emit(`tiles-changed`,{allTiles:this.allTiles}),this.renderer.visible=!1}_purgeSubtree(e){let t=e.children;t[0]&&(this._purgeTile(t[0]),this._purgeTile(t[1]),this._purgeTile(t[2]),this._purgeTile(t[3]),e.clearChildren())}_purgeTile(e){e.leaf?mt(e):this._purgeSubtree(e),this._allTiles.removeUnordered(e),this._unloadTile(e),e.dispose(),this._tileCache.put(K._tileMemcacheKey,e),this.notifyChange(`demResolution`),this.emit(`tiles-changed`,{allTiles:this.allTiles})}_unloadTile(e){this._pendingTilesToUpdate.delete(e),this._pendingTilesForElevationUpdateEvent.delete(e),e.unload()}_splitTile(e){j(e.leaf,`Tile that is already split should not be split again!`),j(e.rendered,`Tile marked to split is not rendered`),mt(e);let t=e.createChildren();this._allTiles.pushArray(t),this.notifyChange(`demResolution`),this.emit(`tiles-changed`,{allTiles:this.allTiles}),e.updateAgentSuspension(),j(e.rendered,`parent should be rendered`),t.forEach(e=>this._loadTile(e)),t.forEach(e=>this._pendingTilesToUpdate.add(e)),this._unloadTile(e),this._markAllTileNeighborsForUpdate(e),this._emitTileScaleChange(e,e.level+1),this._allTilesDirty=!0,this._shortBatches&&this._updatePendingTileGeometries(),t.forEach(e=>Z(e,e.hasPendingUpdate(1))),++this._performanceInfo.numSplit}_emitTileScaleChange(e,t=e.level){X.spatialReference=this.spatialReference,X.extent=e.extent,X.scale=this._getLodBiasCorrectedScale(t),this.emit(`scale-change`,X)}createTile(e,t,n,r){j(!!r,`createTile sanity check`);let i=this._acquireTile(e,t,n,r);return i.updateClippingStatus(this.groundExtent),i.updateScreenDepth(this.view.state.contentCamera.viewProjectionMatrix),this._shouldSplit(i)&&i.setPendingUpdate(1),i}get _shortBatches(){return this.view.state.mode!==2}_mergeTile(e){j(!e.hasPendingUpdate(1),`_mergeTile sanity check`),j(!e.leaf,`Cannot merge a leaf`),!e.leaf&&(this._purgeSubtree(e),j(!e.renderData,`Merging tile with existing render data?`),this._loadTile(e),this._markTileToUpdate(e),this._emitTileScaleChange(e),this._shortBatches&&this._updatePendingTileGeometries(),Z(e,!1),this._allTilesDirty=!0,++this._performanceInfo.numMerged)}_loadTile(e){e.load(),this.requestUpdate(),this._allTilesDirty=!0,this.overlayManager?.hasOverlays&&e.updateOverlayParameters(this.overlayManager)}_handleLayerViewChanges(e=ot){if(!this._layerViewsDirty)return;this._layerViewsDirty=!1;let t=!1,n=new Set,r=-1;for(let e=this.view.allLayerViews.length-1;e>=0;e--){let i=this.view.allLayerViews.items[e];if(n.add(i.uid),F(i)||I(i)){if(this._basemapLayerViewHandles.has(i.uid)&&!I(i)){let e=this._layerClassFromLayerView(i),n=this.getLayerIndexByUID(e,i.uid);n!=null&&((n<r||r==null)&&(t=!0),r=n)}else this._registerTiledLayerView(i),i.layer.loaded&&(t=!0)}}this._basemapLayerViewHandles.forEach((e,r)=>{n.has(r)||(this._unregisterTiledLayerView(r),t=!0)}),t&&this._updateTiledLayers(),this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._evaluateTransparency(),e.madeProgress()}get _isFullyTransparent(){if(this.view.map?.ground?.opacity>0)return!1;for(let e of this.view.allLayerViews.items)if(L(e)&&!ye(e.layer)&&e.fullOpacity!==0)return!1;return!0}_hasCompositeBlendMode(){for(let e of this.view.allLayerViews.items)if((R(e)||I(e))&&nt(rt[e.layer.blendMode]))return!0;return!1}_layerClassFromLayerView(e){return+!z(e)}_registerTiledLayerView(e){let t=[];if((R(e)||I(e))&&t.push(h(()=>e.layer.blendMode,()=>{this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._updateTileTextures(2)})),!I(e)){let n=this._layerClassFromLayerView(e);t.push(h(()=>!e.destroyed&&e.suspended,()=>this._updateTiledLayers())),t.push(h(()=>!e.destroyed&&e.fullOpacity,()=>this._updateTileTextures(2)));let{layer:r}=e;`effectiveScaleRange`in r&&t.push(h(()=>!e.destroyed&&r.effectiveScaleRange,()=>this._restartAllAgents(n))),t.push(e.on(`data-changed`,()=>{let t=this.getLayerIndexByUID(n,e.uid);t!=null&&this._invalidateLayerData(t,n)}))}this._unregisterTiledLayerView(e.uid),this._basemapLayerViewHandles.set(e.uid,t)}_unregisterTiledLayerView(e){let t=this._basemapLayerViewHandles.get(e);if(t){for(let e of t)e.remove();this._basemapLayerViewHandles.delete(e)}}_updateTiledLayers(){if(!this.tilingScheme||this.view.suspended)return;let e=this.view.allLayerViews,t=[[],[]],n=null;e.forEach(e=>{if(!e.layer||e.suspended||!F(e)||!e.fullExtent)return;let r=this._layerClassFromLayerView(e);if(r===1){let t=e.displayLevelRange.maxLevel;t!==1/0&&(n===null||t>n)&&(n=t)}t[r].push(e)});for(let e of Oe){let n=this._layerViews[e],r=t[e];r.reverse();let i=r.length,a=n.length!==i,o=Array(i),s=Array(n.length);this._layerIndexByUid[e].clear();for(let t=0;t<i;t++){let i=r[t].uid;this._layerIndexByUid[e].set(i,t);let c=n.indexOf(r[t]);o[t]=c,t!==c&&(a=!0),c>-1&&(s[c]=t)}if(a){let t=this._postorderIterator;for(t.reset(this._rootTiles);!t.done;)t.next().modifyLayers(s,o,e);this._layerViews[e]=r,this._restartAllAgents(e),this._updateTilesVisibility(this._rootTiles)}}this.tilingScheme.ensureMaxLod(n)&&(this._viewChangeUpdate(),this.notifyChange(`tilingScheme`))}_restartAllAgents(e){let t=this._postorderIterator;for(t.reset(this._rootTiles);!t.done;){let n=t.next();n.restartAgents(e),e===0&&n.computeElevationBounds()}this._updateRootTileElevationRange()}layerViewByIndex(e,t){return this._layerViews[t][e]}numLayers(e){return this._layerViews[e].length}_updateTileTextures(e){this._allTiles.forAll(t=>{t.updateAgents(1),e===1?this.renderer.updateTileTexture(t,16):t.updateRenderData(1,e)}),this._evaluateTransparency()}_invalidateLayerData(e,t){this._rootTiles!=null&&(W(this._rootTiles,n=>n.removeLayerAgent(e,t)),W(this._rootTiles,n=>{n.invalidateLayerData(e,t),n.restartAgents(t)}))}setTileTreeDirty(e){this._allTilesDirty=!0,e&&(this._allTilesCreated=!1)}requestRender(e=1){this.renderer.setNeedsRender(e)}requestUpdate(){++this._pendingUpdates===1&&(this._hasPendingUpdates=!0)}requestTileData(e,t,n,r){let i=this.layerViewByIndex(t,n),a=i.layer;return!a.tilemapCache||M(i)?this._requestTileData(e,n,i,r):(++this._asyncWorkItems,a.tilemapCache.fetchAvailability(e.level,e.lij[1],e.lij[2],{...r,timeout:6e3}).catch(t=>{throw te(r),p(t)||this._dataMissing(e,n,i),t}).then(()=>this._frameTask.schedule(()=>this._requestTileData(e,n,i,r),r.signal)).finally(()=>--this._asyncWorkItems))}_requestTileData(e,t,n,r){return this.destroying?Promise.resolve():t===0?z(n)?this._requestElevationTileData(e,n,r):Promise.reject():L(n)?this._requestMapTileData(e,n,r):Promise.reject()}_requestElevationTileData(e,t,n){++this._asyncWorkItems;let r=r=>{!m(n)&&r&&(this.setMemoryDirty(),this.requestUpdate(),this._elevationDataArrived(e,t,r))},i=n=>{p(n)||(s.getLogger(this).error(`Tile ${e.lij.toString()} layer 0/${t.uid} error ${n}`),this._dataMissing(e,0,t),this.requestUpdate())};return t.fetchElevationTile(e,{...be,...n}).then(e=>this._frameTask.schedule(()=>r(e)),i).finally(()=>--this._asyncWorkItems)}_elevationDataArrived(e,t,n){let r=this._layerIndexByUid[0].get(t.uid);if(r==null){s.getLogger(this).warn(`TerrainSurface: received data from unknown layer %d %s`,0,e.lij.toString());return}let i=new Te(e.lij,e.extent,n);e.dataArrived(r,0,i),this.emit(`tile-data-changed`,{tile:e,layerIndex:r,layerClass:0});let a=[e],o=e.level,c=this._iteratorPool.acquire();for(c.reset(a);!c.done;){let e=c.next();e.findElevationBoundsForLayer(r,o),e.computeElevationBounds()}o===0&&this._updateRootTileElevationRange(),c.remove(),this._updateTilesVisibility(a)}_requestMapTileData(e,t,n){++this._asyncWorkItems;let r=(r,i)=>{B(i),m(n)||(console.error(`Tile ${e.lij.toString()} layer 1/${t.uid} error ${r}`),this._dataMissing(e,1,t),this.requestUpdate())},i=e=>t=>r(t,e);return t.fetchTile(e.lij,n).then(r=>this._frameTask.schedule(()=>{this.requestUpdate(),m(n)?B(r):this._mapTileDataArrived(e,t,r)},n.signal,i(r)).catch(i(r)),(e,t=null)=>this._frameTask.schedule(()=>r(e,t))).finally(()=>--this._asyncWorkItems)}_mapTileDataArrived(e,t,n){let r=this.getLayerIndexByUID(1,t.uid);if(r==null){B(n),s.getLogger(this).warn(`TerrainSurface: received data from unknown layer`);return}e.dataArrived(r,1,n),this.emit(`tile-data-changed`,{tile:e,layerIndex:r,layerClass:1})}_dataMissing(e,t,n){let r=this.getLayerIndexByUID(t,n.uid);r==null?s.getLogger(this).warn(`TerrainSurface: received data from unknown layer`):(e.dataMissing(r,t),this.emit(`tile-data-changed`,{tile:e,layerIndex:r,layerClass:t}))}get performanceInfo(){let e=this._performanceInfo;return e.numNodes=this._allTiles.length,e.numLeaves=e.numVisible=e.numRendered=e.numLoadedPerLevel.length=e.numRenderedPerLevel.length=0,this._allTiles.forAll(t=>{t.leaf&&e.numLeaves++;let n=t.level;t.renderData&&(e.numLoadedPerLevel[n]=(e.numLoadedPerLevel[n]||0)+1),t.visible&&(e.numVisible++,t.rendered&&(e.numRenderedPerLevel[n]=(e.numRenderedPerLevel[n]||0)+1,e.numRendered++))}),e}setMemoryDirty(){this._usedMemory=null}get usedMemory(){return this.tilingScheme?(this._usedMemory??=this._recalculateUsedMemory(),this._usedMemory??0):0}_recalculateUsedMemory(){return this.tilingScheme?Math.round(this._allTiles.reduce((e,t)=>e+t.usedMemory,0)):null}getUsedMemoryForLayerView(e){let t=0,n=this._layerClassFromLayerView(e),r=this.getLayerIndexByUID(n,e.uid);return r!=null&&this._allTiles.forAll(e=>t+=e.getUsedMemoryForLayer(n,r)),t}get renderPatchBorders(){return this._renderer.renderPatchBorders}set renderPatchBorders(e){this._renderer.renderPatchBorders=e}get renderingDisabled(){return this._renderer.renderingDisabled}set renderingDisabled(e){this._renderer.renderingDisabled=e}get test(){}checkAllTilesWaterproofness(e=`render-patch-groups`){}get isGlobal(){return this._isGlobal}get isGeographic(){return this._isGeographic}get isWebMercator(){return this._isWebMercator}get isWebMercatorOnPlateCarree(){return this._isWebMercatorOnPlateCarree}isEastEndWrap(e){return this._isGlobal&&e[2]===this.lijEastEnd(e[0])-1}isWestEndWrap(e){return this._isGlobal&&e[2]===0}lijEastEnd(e){return 1<<e+ +!!this._isGeographic}wrapEastWest(e){let t=this.lijEastEnd(e[0]),n=e[2];if(0<=n&&n<t)return e;if(!this._isGlobal)return null;let r=(n+(n<0?t:0))%t;return[e[0],e[1],r]}enableInternalChecks(e){Ue(e)}enableWaterproofnessChecks(e){We(e)}static cleanupTerrainSurface(){dt.prune()}enable(e){e!==this.enabled&&(this._set(`enabled`,e),e?(this._updateRootTiles(),this.freeze=!1,this.view.elevationProvider.register(0,this)):(this.view.elevationProvider.unregister(this),this.freeze=!0,this._removeAllTiles(),this._setRootTiles(null)),this.notifyChange(`ready`))}updateOverlayParameters(){let{overlayManager:e}=this;this.allTiles.forAll(t=>t.updateOverlayParameters(e))}};e([y()],q.prototype,`_renderer`,void 0),e([y({constructOnly:!0})],q.prototype,`_scaleRangeQueries`,void 0),e([y({constructOnly:!0})],q.prototype,`view`,void 0),e([y({constructOnly:!0})],q.prototype,`overlayManager`,void 0),e([y({constructOnly:!0})],q.prototype,`terrainTextureCompressionTracker`,void 0),e([y()],q.prototype,`_hasPendingUpdates`,void 0),e([y()],q.prototype,`_asyncWorkItems`,void 0),e([y()],q.prototype,`_allTilesDirty`,void 0),e([y()],q.prototype,`_allTilesSorted`,void 0),e([y()],q.prototype,`allTilesCreated`,null),e([y()],q.prototype,`_allTilesCreated`,void 0),e([y()],q.prototype,`_viewChanged`,void 0),e([y({type:Number})],q.prototype,`heading`,void 0),e([y()],q.prototype,`_splitLimits`,void 0),e([y()],q.prototype,`_frameTask`,void 0),e([y()],q.prototype,`demResolution`,null),e([y({readOnly:!0})],q.prototype,`snapLevel`,null),e([y({readOnly:!0})],q.prototype,`lodSnappingEnabled`,null),e([y({readOnly:!0})],q.prototype,`userClippingExtent`,null),e([y()],q.prototype,`_rootTilesExtent`,void 0),e([y({readOnly:!0})],q.prototype,`groundExtent`,null),e([y({readOnly:!0})],q.prototype,`fullGroundExtent`,null),e([y({readOnly:!0})],q.prototype,`_tilingSchemeExtent`,null),e([y({readOnly:!0})],q.prototype,`updating`,null),e([y({readOnly:!0})],q.prototype,`readyToRun`,null),e([y(we)],q.prototype,`updatingProgress`,void 0),e([y({readOnly:!0})],q.prototype,`updatingProgressValue`,null),e([y()],q.prototype,`_maxNumUpdating`,void 0),e([y()],q.prototype,`baseOpacity`,null),e([y()],q.prototype,`hasCompositeBlendMode`,void 0),e([y({readOnly:!0})],q.prototype,`viewingMode`,null),e([y()],q.prototype,`maxTextureScale`,void 0),e([y({readOnly:!0})],q.prototype,`ready`,null),e([y({readOnly:!0})],q.prototype,`rootTiles`,null),e([y()],q.prototype,`_rootTiles`,void 0),e([y({readOnly:!0})],q.prototype,`spatialReference`,null),e([y({type:t})],q.prototype,`backgroundColor`,null),e([y({value:!1})],q.prototype,`slicePlaneEnabled`,null),e([y({readOnly:!0})],q.prototype,`tilingScheme`,void 0),e([y({readOnly:!0})],q.prototype,`tilingSchemeLocked`,null),e([y({readOnly:!0})],q.prototype,`tilingSchemeLogic`,void 0),e([y()],q.prototype,`wireframe`,null),e([y()],q.prototype,`opaque`,null),e([y()],q.prototype,`invisible`,null),e([y({value:!1})],q.prototype,`freeze`,null),e([y()],q.prototype,`fadeDuration`,null),e([y()],q.prototype,`_xNormalizer`,null),e([y()],q.prototype,`visibleElevationRange`,void 0),e([y()],q.prototype,`_rootTileElevationRange`,void 0),e([y()],q.prototype,`_layerViewsDirty`,void 0),e([y()],q.prototype,`renderPatchBorders`,null),e([y()],q.prototype,`renderingDisabled`,null),e([y({readOnly:!0})],q.prototype,`enabled`,void 0),q=K=e([re(`esri.views.3d.terrain.TerrainSurface`)],q);const lt=q,J=b(),Y=new _e,ut=w(),dt=new f,X={spatialReference:null,extent:null,scale:0};function ft(e,t,n){for(let r of e){if(!r.containsPointXY(t,n))continue;let e=r;for(;e&&!e.renderData;){let r=+(t>e.extentMidX)+(n<e.extentMidY?2:0);e=e.children[r]}let i=e?.renderData?.geometryState.samplerData??null;return Ee(t,n,i)}return null}function Z(e,t){!e.leaf||e.level<A||$(e,e=>{t&&pt(e);let n=Q(e);if(e.maxLevelDeltaNeighborCount++,n){let t=e.parent;for(;t;){let e=Q(t);if(t.unmergableChildCount++,e)t=t.parent;else break}}})}function pt(e){if(e.hasPendingUpdate(1))return;let t=e.parent;for(;t?.resetPendingUpdate(4);)t=t.parent;e.resetPendingUpdate(4),e.leaf&&e.setPendingUpdate(1),!(e.level<A)&&$(e,e=>{pt(e)})}function mt(e){e.level<A||$(e,e=>{if(e.maxLevelDeltaNeighborCount--,e.maxLevelDeltaNeighborCount===0&&e.unmergableChildCount===0){let t=e.parent;for(;t&&(t.unmergableChildCount--,Q(t));)t=t.parent}})}function Q(e){return e.maxLevelDeltaNeighborCount===0&&e.unmergableChildCount===0}function $(e,t){if(e.level<A)return;let n=e.level-A,r=e.lij[1]>>A,i=e.lij[2]>>A,a=e=>e.leaf||e.level===n;for(let o=0;o<4;++o){let s=e.findNeighborTile(P[o],a);if(!s||s.level!==n)continue;let c=s.lij;(c[1]!==r||c[2]!==i)&&t(s)}}export{lt as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Color.js";import{filterInPlace as n,difference as r}from"../../../core/arrayUtils.js";import i from"../../../core/CollectionFlattener.js";import{toConst as a}from"../../../core/compilerUtils.js";import{EventedAccessor as o}from"../../../core/Evented.js";import has from"../../../core/has.js";import s from"../../../core/Logger.js";import{clamp as c}from"../../../core/mathUtils.js";import{removeMaybe as l,destroyMaybe as u}from"../../../core/maybe.js";import{MemCachePool as ee}from"../../../core/MemCachePool.js";import d from"../../../core/ObjectPool.js";import f from"../../../core/PooledArray.js";import{throwIfAborted as te,isAbortError as p,isAborted as m}from"../../../core/promiseUtils.js";import{watch as h,syncAndInitial as g,initial as _,sync as v}from"../../../core/reactiveUtils.js";import"../../../core/scheduling.js";import{getMetersPerUnitForSR as ne}from"../../../core/units.js";import{property as y,subclass as re}from"../../../core/accessorSupport/decorators.js";import{exactEquals as ie,set as ae,copy as oe}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as se}from"../../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as ce,radiusModifier as le}from"../../../geometry/ellipsoidUtils.js";import{projectWithoutEngine as ue}from"../../../geometry/projectionUtils.js";import x from"../../../geometry/SpatialReference.js";import{getProjector as de}from"../../../geometry/projection/projectors.js";import{projectPointToVector as S}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as fe}from"../../../geometry/projection/projectVectorToVector.js";import{create as C,fromExtent as pe,equals as w,intersection as me,intersectsSphere as T}from"../../../geometry/support/aaBoundingRect.js";import{copy as he,create as ge}from"../../../geometry/support/frustumPlanes.js";import{createSpatialReferenceCyclical as _e}from"../../../geometry/support/normalizeUtils.js";import{isPlateCarree as ve}from"../../../geometry/support/spatialReferenceUtils.js";import{Sphere as ye}from"../../../geometry/support/sphere.js";import{ElevationQueryTileCache as be}from"../../../layers/support/ElevationQueryTileCache.js";import{isIntegratedMeshLayer as xe,isBaseLayer as Se}from"../../../layers/support/layerUtils.js";import{queueHighPriority as Ce}from"../../../request/queue.js";import{debugFlags as E}from"../support/debugFlags.js";import{ElevationRange as D}from"../support/ElevationRange.js";import{ElevationUpdateEvent as we}from"../support/ElevationUpdateEvent.js";import{calculateElevationUpdateExtents as Te}from"../support/elevationUpdateExtentUtils.js";import{toBoundingRect as Ee}from"../support/extentUtils.js";import{updatingProgress as De}from"../support/updatingProperties.js";import{ElevationBounds as O}from"./ElevationBounds.js";import{ElevationData as Oe,sampleElevation as ke}from"./ElevationData.js";import{create as Ae}from"./ExtentHelper.js";import{LayerClasses as je}from"./LayerClass.js";import{OverlayManager as Me}from"./OverlayManager.js";import{PlanarPatch as Ne}from"./PlanarPatch.js";import{Queue as Pe}from"./Queue.js";import{ScaleRangeQueries as Fe}from"./ScaleRangeQueries.js";import{SphericalPatch as Ie}from"./SphericalPatch.js";import{SplitLimits as Le}from"./SplitLimits.js";import{maxRootTiles as k,tooManyRootTilesAfterChangeError as Re,tooManyRootTilesForLayerError as ze,maxTileNeighborLevelDelta as A,maxMemoryLodBias as Be}from"./TerrainConst.js";import{TerrainRenderer as Ve}from"./TerrainRenderer.js";import He from"./TerrainSurfacePerformanceInfo.js";import{weakAssert as j,isVectorTileLayerView as M,internalAssert as N,oppositeEdge as Ue,neighborEdgeIndices as P,isSurfaceLayerView as F,isGroupLayerView as I,isMapTileLayerView as L,isBlendableLayerView as R,isElevationLayerView as z,releaseTerrainData as B,oppositeCorner as We,enableTerrainInternalChecks as V,enableWaterproofTests as Ge,enableInternalTerrainChecks as Ke,enableTerrainWaterproofChecks as qe,neighborCornerIndices as Je}from"./terrainUtils.js";import{Tile as Ye,lijEquals as H}from"./Tile.js";import{printAllocations as Xe}from"./TilePerLayerInfo.js";import{sortTiles as Ze,IteratorPreorder as Qe,IteratorPostorder as $e,compareTilesByLij as U,hasLoadableSiblings as et,sortTilesByPOI as tt,traverseTilesPreorder as W}from"./tileUtils.js";import{TilingSchemeLogic as nt}from"./TilingSchemeLogic.js";import{getGroundTransparencyModeFromOpacity as rt}from"./TransparencyMode.js";import{UpsampleInfo as it}from"./UpsampleInfo.js";import{isCompositeBlendMode as at,blendModeFromString as ot}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{hasLayerBasedScaleVisibility as st}from"../../support/layerViewUtils.js";import{ImmediateTask as G,TaskPriority as ct,noBudget as lt}from"../../support/Scheduler.js";import{TextureCompressionTracker as ut}from"../../support/TextureCompressionTracker.js";import{Yield as dt}from"../../support/Yield.js";var K;let q=class extends o{static{K=this}get allTilesCreated(){return this._allTilesCreated}get allTiles(){return a(this._allTiles)}get renderedTiles(){return Ze(n(this._allTiles.toArray(),e=>e.visible&&e.rendered))}get demResolution(){let{_allTiles:e,tilingScheme:t}=this;if(e.length===0)return{min:1,max:1};let n=ne(t.spatialReference),r=1/0,i=-1/0;for(let a of e){let e=t.resolutionAtLevel(a.level)*n;r=Math.min(r,e),i=Math.max(i,e)}return{min:r,max:i}}constructor(e){super(e),this.terrainTextureCompressionTracker=new ut,this._iteratorPool=new d(()=>new Qe,e=>e.remove=()=>this._iteratorPool.release(e)),this._postorderIterator=new $e,this._hasPendingUpdates=!1,this._pendingUpdates=0,this._asyncWorkItems=0,this._allTilesDirty=!0,this._allTilesSorted=!0,this._allTilesCreated=!1,this._usedMemory=null,this._performanceInfo=new He,this._waterproofnessErrorHandle=null,this._viewChanged=!1,this.heading=0,this._inFrameTask=!1,this._viewChangeUpdateDirty=!1,this._eyePosRenderSR=b(),this._eyePosSurfaceSR=b(),this._splitLimits=new Le,this._layerViews=[[],[]],this._layerIndexByUid=[new Map,new Map],this._basemapLayerViewHandles=new Map,this._updatingHandles=new se,this._poiWatchHandle=null,this._frameTask=G,this._allTiles=new f,this._upsampleInfoPool=new d(()=>new it),this._shouldEmitChangeEvent=!1,this._rootTilesExtent=C(),this.updatingProgress=.5,this._maxNumUpdating=1,this.maxTextureScale=1.2,this._spatialReference=x.WebMercator,this._elevationProjectorCache=new Map,this.visibleElevationRange=new D(1/0,-1/0),this._rootTileElevationRange=new D(1/0,-1/0),this._projectorCache=new Map,this._tilingSchemeSpatialReference=null,this._updatingRootTiles=!1,this._pendingTilesForElevationUpdateEvent=new Set,this._pendingTilesToUpdate=new Set,this.totalGeometryUpdates=0,this.totalTileUpdates=0,this._layerViewsDirty=!1,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._isWebMercator=!1,this._isWebMercatorOnPlateCarree=!1,this.enabled=!0;let{view:t}=e;this.overlayManager=new Me({...e,terrainSurface:this}),this._isGlobal=!t.state?.isLocal,this._isGeographic=this._spatialReference?.isGeographic??!1,this._tileConstructor=this._isGlobal?Ie:Ne,this._ellipsoid=ce(t.spatialReference),this._renderer=new Ve(this.overlayManager.renderer,t.stage,this._allTiles,this.terrainTextureCompressionTracker,t.resourceController.memoryController),st()||(this._scaleRangeQueries=new Fe)}initialize(){let{view:e}=this,{resourceController:t}=e,{memoryController:n}=t;this._tileCache=new ee((e,t)=>n.newCache(e,t),`terrain-tile`),this._upsampleMapCache=n.newCache(`terrain-upsample`,({tile:e})=>e.unloadMapData()),this._elevationQueryCache=new be(n.newCache(`elevation-query`));let r=this.overlayManager;this.addHandles([h(()=>r.renderer.isEmpty,()=>this._evaluateTransparency()),h(()=>this.renderer.visible,e=>this.freeze=!e),h(()=>this.heading,e=>{this._renderer.updateHeading(e),this._updateTileTextures(0)},g)],`overlayManager`),this._updatingHandles.add(()=>({heading:e.camera?.heading,state:e.state?.mode}),({heading:e,state:t})=>{if(e==null)return;if(this.isGlobal&&this.isGeographic||this.isWebMercatorOnPlateCarree){this.heading=Math.round(e/90)*90%360;return}let n=Math.round(e)%360,r=Math.abs(n-this.heading);(t===2||Math.min(r,360-r)>=30)&&(this.heading=n)},_),this.addHandles([h(()=>this.baseOpacity,()=>{this._handleLayerViewChanges(),this._updateTileTextures(this._evaluateTransparency()?1:2)},g),h(()=>this.hasCompositeBlendMode,()=>this._updateTileTextures(this._evaluateTransparency()?1:2),g),h(()=>this.backgroundColor,(e,t)=>{e?.equals(t)||(this._handleLayerViewChanges(),this._renderer.updateTileBackground(e))},v),h(()=>this.snapLevel,()=>this._viewChanged=!0,v),h(()=>this.view.pointsOfInterest,e=>{this._renderer.pointsOfInterest=e,this._poiWatchHandle=l(this._poiWatchHandle),e&&(this._poiWatchHandle=this._updatingHandles.add(()=>e.focus?.renderLocation,()=>this._allTilesSorted=!1,{equals:ie}))}),h(()=>E.TERRAIN_TILE_TREE_SHOW_TILES,t=>{t&&!this._treeDebugger?import(`../layers/support/TerrainTileTree3DDebugger.js`).then(({TerrainTileTree3DDebugger:t})=>{!this._treeDebugger&&E.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new t({view:e}))}):t||(this._treeDebugger=u(this._treeDebugger))},_)]);let{spatialReference:a}=e;this._extentHelper=Ae(this.viewingMode,{layers:e.map.allLayers,layerViews:e.allLayerViews,viewSpatialReference:a});let o=new i({getCollections:()=>e.defaultsFromMap?.mapCollections?.map(({layers:e})=>e),getChildrenFunction:e=>e&&`layers`in e?e.layers:null}),s=new nt({layers:o,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:a});this._set(`tilingSchemeLogic`,s),this._updateTilingScheme();let c=t.scheduler;this._frameTask=c.registerTask(ct.TERRAIN_SURFACE,this),this.addHandles([h(()=>this._stencilEnabledExtents,e=>this._renderer.setStencilEnabledLayerExtents(e),_),h(()=>this.tilingSchemeLogic.tilingScheme,()=>this._updateTilingScheme(),v),h(()=>this.groundExtent,()=>this._updateRootTiles(),_),e.on(`resize`,()=>this._viewChangeUpdate()),h(()=>{let t=e.state;return[this._lodBias,this.lodSnappingEnabled,e.quality,t.camera,t.contentCamera,t.fixedContentCamera]},()=>this._viewChangeUpdate(),g),h(()=>e.qualitySettings?.fadeDuration,e=>this._renderer.textureFadingEnabled=e>0,_),h(()=>e.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._renderer.pbrMode=e?5:0,_),h(()=>e.qualitySettings?.tiledSurface.elevationLevelDelta,()=>this._updateAllTileGeometries()),h(()=>this.userClippingExtent,()=>this._updateClippingExtent(),v)]),this.addHandles(e.allLayerViews.on(`after-changes`,()=>this._layerViewsDirty=!0)),this._layerViewsDirty=!0,this._handleLayerViewChanges(),this._renderer.updateTileBackground(this.backgroundColor)}clearHandles(){this._updatingHandles?.removeAll(),this.removeAllHandles(),this._basemapLayerViewHandles.forEach((e,t)=>this._unregisterTiledLayerView(t)),this._basemapLayerViewHandles.clear()}destroy(){this._waterproofnessErrorHandle?.remove(),this._waterproofnessErrorHandle=null,this._frameTask.remove(),this._frameTask=G,this._updatingHandles?.destroy(),this._removeAllTiles(),this._set(`tilingSchemeLogic`,u(this.tilingSchemeLogic)),this._basemapLayerViewHandles.forEach((e,t)=>this._unregisterTiledLayerView(t)),this._basemapLayerViewHandles.clear(),this._set(`overlayManager`,u(this.overlayManager)),this._tileCache=u(this._tileCache),this._allTiles.prune(),Ye.prune(),this._treeDebugger=u(this._treeDebugger),this._renderer.destroyed||this._renderer.destroy(),this._renderer=null,this._iteratorPool=u(this._iteratorPool),this._upsampleMapCache=u(this._upsampleMapCache),this._elevationQueryCache=u(this._elevationQueryCache),this._set(`view`,null),this._extentHelper=u(this._extentHelper),this._upsampleInfoPool=u(this._upsampleInfoPool),Xe(),this._layerViews.forEach(e=>e.length=0),this._performanceInfo=null}get renderer(){return this._renderer}get frustum(){return this.view.state.camera.frustum}get snapLevel(){return this.lodSnappingEnabled?this.view.terrainLevel:null}get lodSnappingEnabled(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get hasStencilEnabledExtents(){return!!this._stencilEnabledExtents?.length}get _stencilEnabledExtents(){let e=this.spatialReference,t=!!has(`enable-feature:im-as-ground`);return e==null?null:Iterator.from(this.view.allLayerViews).map(n=>{let{layer:r}=n;if(!xe(r)||t&&!r.isUsedAsGroundLayer)return null;let{fullExtent:i}=r,a=i==null||i.spatialReference.equals(e)?i:ue(i,i.spatialReference,e);return a?pe(a):null}).filter(e=>e!=null).toArray()}get userClippingExtent(){let{spatialReference:e}=this,t=this.view?.clippingArea;if(t==null||e==null)return null;let n=C(),r=Ee(t,n,e)?n:null,i=this._get(`userClippingExtent`);return w(r,i)?i:r}get rootTilesExtent(){return this._rootTilesExtent}get groundExtent(){let e=me(this.fullGroundExtent,this.userClippingExtent,C()),t=this._get(`groundExtent`);return w(e,t)?t:e}get fullGroundExtent(){return this._tilingSchemeExtent==null?this._rootTilesExtent:this._tilingSchemeExtent}get _tilingSchemeExtent(){return this.tilingSchemeLogic?.extent}get updating(){return this._hasPendingUpdates||(this._maxNumUpdating=1),this.enabled&&!!((this.readyToRun||this._updatingHandles?.updating||this._asyncWorkItems>0)&&this.ready&&!this.freeze||this.overlayManager?.updating||this.terrainTextureCompressionTracker.compressing)}get readyToRun(){return this.enabled&&(this._hasPendingUpdates||this._viewChanged||this._allTilesDirty||!this._allTilesSorted||this._hasElevationSourceUpdates||this._layerViewsDirty||this._scaleRangeQueries?.updating||this._frameTask.updating)&&this.ready&&!this.freeze}get _hasElevationSourceUpdates(){return this._allTiles.some(e=>e.needsElevationSourceUpdate())}get updatingProgressValue(){return this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating),1-this._pendingUpdates/this._maxNumUpdating}get baseOpacity(){return this.view?.map?.ground?.opacity??1}set baseOpacity(e){this.view.map.ground.opacity=e}get viewingMode(){return this.view.state.viewingMode}get ready(){return!this.enabled||this._rootTiles!=null}get rootTiles(){return this._rootTiles}get spatialReference(){return this.tilingScheme?.spatialReference??null}get backgroundColor(){return this.view?.map?.ground?.surfaceColor}set backgroundColor(e){this.view.map.ground.surfaceColor=e}set slicePlaneEnabled(e){this._renderer.slicePlaneEnabled=e,this._set(`slicePlaneEnabled`,e),this._evaluateTransparency()}get tilingSchemeLocked(){return this.tilingSchemeLogic?.tilingSchemeLocked??!1}get wireframe(){return this._renderer?.wireframe}set wireframe(e){e!==this._renderer.wireframe&&(this._renderer.wireframe=e,this._updateAllTileGeometries())}get opaque(){return this._renderer.transparency===0}get invisible(){return this._renderer.transparency===3}set freeze(e){this._set(`freeze`,e),this._viewChangeUpdate()}get fadeDuration(){return this.view.qualitySettings.fadeDuration??0}intersect(e,t,n,r){this._renderer.intersectRay(e,t,n,r)}getElevationLevelDelta(e){return e<4?3:this.view.qualitySettings.tiledSurface.elevationLevelDelta}get _xNormalizer(){return _e(this._spatialReference)}getElevation(e,t,n,r){let i=this._rootTiles;if(!i?.length||!this.enabled||i[0].layerInfo[0].length===0)return null;let a=this._elevationProjectorCache.get(r);if(a===void 0&&(a=de(r,this._spatialReference)??null,this._elevationProjectorCache.set(r,a)),a==null)return s.getLogger(this).error(`TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system`),null;let o=ae(J,e,t,n);a(o,0,o,0);let c=this._xNormalizer?.normalize(o[0])??o[0],l=o[1];return ht(i,c,l)}getElevations(e,t,n){let r=this._rootTiles,i=r?r[0].layerInfo[0].length:0;if(!r?.length||i===0||!this.enabled){for(let e=0;e<t;++e)n(e,null);return}for(let i=0;i<t;++i){let t=i*3,a=e[t],o=e[t+1],s=ht(r,a,o);n(i,s)}}getLayerIndexByUID(e,t){return this._layerIndexByUid[e].get(t)}getScale(e){if(!this.tilingScheme)return null;if(!S(e,J,this.spatialReference))return s.getLogger(this).error(`TerrainSurface.getScale(): could not project given point to tiling scheme coordinate system`),null;let t=this._rootTiles;if(t!=null){for(let e of t)if(e?.containsPoint(J)){let t=e;for(;t.children[0]&&!t.rendered;){let e=t.children[0].extent,n=0;J[0]>e[2]&&(n+=1),J[1]<e[1]&&(n+=2),t=t.children[n]}return this._getLodBiasCorrectedScale(t.level)}}return 1/0}_ensureProjector(e){let t=this._projectorCache.get(e);if(t)return t;let n=de(e,this._tilingSchemeSpatialReference)??null;return this._projectorCache.set(e,n),n}getSphereElevationRange(e,t){if(!this.enabled||this._rootTiles==null)return null;let n=this._ensureProjector(t);if(n==null)return s.getLogger(this).error(`TerrainSurface.getSphereElevationRange(): could not project given point to tiling scheme coordinate system`),null;Y.copyFrom(e),n(Y.center,0,Y.center,0);let r=new D,i=this._rootTiles;if(i!=null){let e=[];for(let t of i)e.push(t);let t=0;for(;t<e.length;){let n=e[t];if(++t,!T(n.extent,Y))continue;let i=n.children;if(i[0]==null||n.rendered)r.expandElevationRangeValues(n.elevationBoundsMin,n.elevationBoundsMax);else for(let t of i)e.push(t)}}return r}getRootElevationRange(){return this.enabled&&this._rootTiles!=null?new D(this._rootTileElevationRange.minElevation,this._rootTileElevationRange.maxElevation):null}getLowerBoundRadius(){let e=(this._ellipsoid.radius+this.visibleElevationRange.minElevation)*le;return Math.min(e,this._ellipsoid.radius)}getSphereScale(e,t){if(!this.tilingScheme)return null;if(!S(e,Y.center,this.spatialReference))return s.getLogger(this).error(`TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system`),null;Y.radius=t;let n=null,r=e=>{if(e&&T(e.extent,Y)){let t=e.children;if(t[0]&&!e.rendered)for(let e of t)r(e);else{let t=this._getLodBiasCorrectedScale(e.level);n=n==null?t:Math.min(n,t)}}},i=this._rootTiles;if(i!=null)for(let e of i)r(e);return n}queryVisibleScaleRange(e,t,n,r){if(!this._scaleRangeQueries)return;let i=t?this.tilingScheme.levelAtScale(t):0,a=n?this.tilingScheme.levelAtScale(n):1/0,o=this._lodBias;this._scaleRangeQueries.queryVisibleLevelRange(e,i+o,a+o,r)}_evaluateTransparency(){let e=this.baseOpacity,t=this.overlayManager.renderer.isEmpty,n=this._renderer.transparency,r=this._isFullyTransparent?rt(0,t):e>=1&&!this.hasCompositeBlendMode&&!this._renderer.slicePlaneEnabled?0:1;return this._renderer.transparency=r,n!==r&&(this.notifyChange(`opaque`),this.notifyChange(`invisible`),!0)}_updateTilingScheme(){let{tilingScheme:e}=this.tilingSchemeLogic;if(e===this.tilingScheme)return;j(!!e,`tiling scheme cannot be reset to undefined`),this._isGlobal=!this.view?.state?.isLocal,this.tilingScheme&&this._removeAllTiles();let t=e?.spatialReference??x.WebMercator;this._spatialReference=t,this._isWebMercator=!!t?.isWebMercator,this._isWebMercatorOnPlateCarree=this._isWebMercator&&ve(this.view?.renderSpatialReference),this._isGeographic=t?.isGeographic??!1,this._set(`tilingScheme`,e),this._tilingSchemeSpatialReference=this.tilingScheme?.spatialReference,this._projectorCache.clear(),this._updateClippingExtent(),e&&(this._updateTiledLayers(),this._renderer.tileSize=e.pixelSize,this.overlayManager.spatialReference=e.spatialReference,this._updateRootTiles())}static{this._tileMemcacheKey=`TerrainTileMemcache`}_acquireTile(e,t,n,r){let i=this._tileCache.pop(K._tileMemcacheKey);return i?(i.init(e,t,n,r,this),i):new this._tileConstructor(e,t,n,r,this)}get updatingRootTiles(){return this._updatingRootTiles}_updateRootTiles(){let{groundExtent:e,tilingScheme:t}=this;if(!t)return;if(!this.enabled){this._setRootTiles(null);return}let n=pt,i=t.rootTilesInExtent(e,n,k*5);if(this._rootTiles!=null){if(i.length>k){s.getLogger(this).warn(Re);return}let e=this._rootTiles.map(e=>e.lij),t=r(e,i,H);if(this._updatingRootTiles=!0,t.removed.length>0||t.added.length>0){let e=this._rootTiles.filter(e=>t.removed.findIndex(t=>H(t,e.lij))>-1?(this._purgeTile(e),!1):!0);t.added.forEach(t=>e.push(this._newRootTile(t))),this._setRootTiles(e)}}else this._updatingRootTiles=!0,i.length>k&&(s.getLogger(this).warn(ze),i=t.rootTilesInExtent(e,n,k)),this._setRootTiles(i.map(e=>this._newRootTile(e)));w(n,this._rootTilesExtent)||(this._rootTilesExtent=C(n)),this.renderer.visible=!0,this._viewChangeUpdate(),this.overlayManager.setPlacementDirty(),this.notifyChange(`ready`),this._updateAllTileGeometries(),this._updatingRootTiles=!1,this.checkAllTilesWaterproofness(`root-tiles-updated`)}_updateAllTileGeometries(){let e=this._allTiles.filter(e=>this._canUpdateTileGeometry(e));if(e.length===0){this._pendingTilesToUpdate.clear();return}e.sort(U),e.forEach(e=>this._renderer.updateTileGeometryState(e)),e.forEach(e=>e.renderData.updateNeighborData()),this._updateTilesGeometries(e),this._pendingTilesToUpdate.clear()}_updateTilesGeometries(e){let t=e.filter(e=>this._canUpdateTileGeometry(e));if(t.length===0)return;let n=this.renderer;for(let e of t)n.updateGeometryIfNeeded(e);for(let e of t)this._pendingTilesForElevationUpdateEvent.add(e)}_canUpdateTileGeometry(e){return e.loaded&&e.intersectsClippingArea&&e.hasGeometryState}_shouldSplit(e){return e.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.snapLevel)===1}_newRootTile(e){let t=this._acquireTile(0,e[1],e[2],null);return this._shouldSplit(t)&&t.setPendingUpdate(1),this._loadTile(t),this._markTileToUpdate(t),this._updateRootTileElevationRange(),t}_setRootTiles(e){if(this._rootTiles=e,this._allTiles.clear(),e!=null){let t=this._iteratorPool.acquire();for(t.reset(e);!t.done;)this._allTiles.push(t.next());t.remove()}this._renderer.setRootTiles(this._rootTiles),this._updateTilesVisibility(e),this.notifyChange(`demResolution`),this.emit(`tiles-changed`,{allTiles:this.allTiles})}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){if(this.view&&!this.freeze&&this.tilingScheme&&this.renderer.visible){if(this._inFrameTask){this._viewChangeUpdateDirty=!0;return}this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateTilesVisibility(this._rootTiles)}}_updateClippingStatus(e){e.updateClippingStatus(this.groundExtent)&&e.resetPendingUpdate(8)&&this._updateTileGeometryState(e)}_updateTilesVisibility(e){if(e==null)return;let t=et(e),n=this.visibleElevationRange,r=t?n.minElevation:1/0,i=t?n.maxElevation:-1/0,a=this.groundExtent,o=this.view.state.contentCamera.viewProjectionMatrix;this.setTileTreeDirty(!1);let s=this._iteratorPool.acquire();for(s.reset(e);!s.done;){let e=s.next();e.updateClippingStatus(a)&&e.resetPendingUpdate(8)&&this._updateTileGeometryState(e),e.computeVisibility(),e.updateScreenDepth(o),e.renderData&&(r=Math.min(e.elevationBoundsMin,r),i=Math.max(e.elevationBoundsMax,i))}s.remove(),this._viewChanged=!0,this._allTilesDirty=!0,this._updatePendingTileGeometries(),isFinite(r)&&isFinite(i)&&(n.minElevation!==r||n.maxElevation!==i)&&(this.visibleElevationRange=new O(r,i))}_updateRootTileElevationRange(){let e=1/0,t=-1/0;this._rootTiles?.forEach(({elevationBoundsMin:n,elevationBoundsMax:r})=>{e=Math.min(e,n),t=Math.max(t,r)});let n=this._rootTileElevationRange;(n.minElevation!==e||n.maxElevation!==t)&&(this._rootTileElevationRange=new O(e,t))}_updateViewDependentParameters(){let{camera:e,contentCamera:t}=this.view.state,n=Math.tan(t.fovX*.5),r=Math.tan(t.fovY*.5),i=this.tilingScheme.pixelSize,a=2**-this._lodBias*e.pixelRatio;this._splitLimits.aboveGround=e.aboveGround,this._splitLimits.fovX=n,this._splitLimits.fovY=r,this._splitLimits.relativeWidthLimit=i/e.width*this.maxTextureScale*a,this._splitLimits.relativeHeightLimit=i/e.height*this.maxTextureScale*a,this._splitLimits.maxLod=this.tilingScheme.getMaxLod(),this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias,this.view.state.fixedContentCamera?this._splitLimits.frustum=he(this._splitLimits.frustum??ge(),t.frustum):this._splitLimits.frustum=null,oe(this._eyePosRenderSR,t.eye),fe(e.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateTileGeometryState(e){e.updateVisibility();let t=this._renderer.updateTileGeometryState(e);e.needsElevationSourceUpdate()&&(e.updateAgents(0),e.markElevationSourceUpdateRequested(),this.requestUpdate()),t&&this._markTileToUpdate(e),this.setMemoryDirty()}_markAllTileNeighborsForUpdate(e){e.forEachLoadedNeighbor(e=>{this._layerViews[1].some(M)&&e.setPendingUpdate(32),this._pendingTilesToUpdate.add(e)})}_updateTileTexture(e,t){let n=e.resetPendingUpdate(32)?32:e.resetPendingUpdate(16)?16:!1;n&&(this._renderer.updateTileTexture(e,n),this._usedMemory=null,t.madeProgress())}_emitElevationUpdateEventForTiles(){if(!this._shouldEmitChangeEvent)return;let e=this._pendingTilesForElevationUpdateEvent;if(e.size>0){let t=new Float64Array(4*e.size),n=0;for(let r of e)t.set(r.extent,4*n),++n;e.clear();for(let e of Te(t,this.spatialReference)){let t=new we(this.spatialReference,e,`ground`);this.emit(`elevation-change`,t)}}this._shouldEmitChangeEvent=!1}runTask(e){this._handleLayerViewChanges(e),this._frameTask.processQueue(e),this.renderer.processScaleRangeQueries(this._scaleRangeQueries,e),this._inFrameTask=!0,this._pendingUpdates=0,this._hasPendingUpdates=!1,this._updateAllTilesStatus(e),this._sortTiles(e);let t=!this.view.state.fixedContentCamera;this._mergeAndSplit(e,t),this._updateElevation(e),this._updateElevationSources(e),this._updateTextures(e),t||this._mergeAndSplit(e,!0),this._inFrameTask=!1,this._runViewChangeUpdateIfDirty();let n=this._pendingTilesToUpdate.size>0,r=n&&this._hasPendingGeometryWithoutIndices();if((!e.done||r)&&this._updatePendingTileGeometries(),this._emitElevationUpdateEventForTiles(),e.done&&(e.hasProgressed||n&&!r)&&this.requestUpdate(),this.notifyChange(`updatingProgressValue`),!e.hasProgressed)return dt}_checkTileInvariant(){}_updateAllTilesStatus(e){if(!this._viewChanged||!this._rootTiles||e.done)return;this._viewChanged=!1;let t=!1,n=new Pe(this._allTiles.length);n.pushAll(this._rootTiles);let r=this.snapLevel,i=this._splitLimits,a=this._eyePosRenderSR;this._allTiles.forAll(e=>{e.maxLevelDeltaNeighborCount=0,e.unmergableChildCount=0});let o=this.view.state.contentCamera.viewProjectionMatrix;for(;!n.empty;){let e=n.pop(),s=e.parent?.hasPendingUpdate(4),c=s?4:e.shouldSplit(i,a,r),l=c===1;e.leaf?Z(e,l):n.pushAll(e.children),s?(e.resetPendingUpdate(1),e.leaf||(e.setPendingUpdate(4),t=!0),this._updateClippingStatus(e),e.updateVisibility(),e.updateScreenDepth(o)):l?(e.resetPendingUpdate(4),e.leaf&&(e.setPendingUpdate(1),t=!0)):(e.resetPendingUpdate(1)&&e.updateAgentSuspension(),c===2&&e.updateAgents(0),e.leaf||(e.setPendingUpdate(4),e.resetPendingUpdate(1),t=!0))}this._allTilesDirty=t,this.requestUpdate(),this._shortBatches&&this._updatePendingTileGeometries(),e.madeProgress()}_sortTiles(e){!e.done&&!this._allTilesSorted&&this.view.pointsOfInterest?.focus&&(tt(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger?.update(),e.madeProgress())}_markTileToUpdate(e){N(e.loaded),e.intersectsClippingArea&&(this._pendingTilesToUpdate.add(e),this._markAllTileNeighborsForUpdate(e))}_hasPendingGeometryWithoutIndices(){for(let e of this._pendingTilesToUpdate)if(e.loaded&&e.intersectsClippingArea&&e.renderData?.vao?.indexBuffer==null)return!0;return!1}_updatePendingTileGeometries(){let e=this._pendingTilesToUpdate,t=[];if(e.forEach(e=>{this._canUpdateTileGeometry(e)&&t.push(e)}),t.length===0){e.clear();return}let n=(n,r)=>{!r||!this._canUpdateTileGeometry(r)||r.level<n.level||e.has(r)||(e.add(r),t.push(r),r.renderData.updateNeighborData())};t.sort(U);let r=t.length;for(let i=0;i<r;++i){let r=t[i];N(r.loaded),N(r.intersectsClippingArea);let a=r.renderData;if(!a?.geometryState)continue;a.updateNeighborData();let o=a.dirtyEdgeResolutions,s=a.geometryState,c=e=>{let t=Je[e];n(r,s.cornerPeerNeighbors[e]?.findCorner(We(t),e=>e.loaded))};for(let t=0;t<4;++t)if(o&1<<t){let i=a.geometryState.edgePeerNeighbors[t];i&&i?.level>=r.level&&i.forAllSubtreeOnSide(Ue(P[t]),t=>this._canUpdateTileGeometry(t)?(N(e.has(t)||U(r,t)<0),n(r,t),!0):!1),c((t+1)%4),c(t)}}e.clear(),this._updateTilesGeometries(t),this._shouldEmitChangeEvent=!0,V&&Ge&&this.checkAllTilesWaterproofness(`pending-geometries-updated`)}_mergeAndSplit(e,t){if(this.freeze||e.done||!this._allTilesDirty)return;this._allTilesDirty=!1,this.requestUpdate();let n=!1,r=this.view.state.fixedContentCamera,i=!1;for(;!e.done;){i=!0;let a=!1,o=!this._allTiles.some(i=>{if(!n&&!r&&!i.visible)return e.done;let o=i;if(i.hasPendingUpdate(4)){if(!t||i.unmergableChildCount>0)return e.done;for(i.resetPendingUpdate(4);o.parent!=null&&o.parent.unmergableChildCount===0&&o.parent.resetPendingUpdate(4);)o=o.parent;this._mergeTile(o),a=!0,e.madeProgress()}else if(i.resetPendingUpdate(1)){let t=!0,n=i.level;if(n>=A){let e=e=>e.leaf||n-e.level<A;for(let r=0;r<4;++r){let a=i.findNeighborTile(P[r],e);a!=null&&n-a.level===A&&(t=!1,V&&(N(a.leaf),N(a.hasPendingUpdate(1))))}}t?(this._splitTile(i),e.madeProgress(),a=!0):i.setPendingUpdate(1)}return e.done});if(a&&(this._allTilesSorted=!1,this._allTilesDirty=!0),o){if(!n){n=!0;continue}if(!a)break}else this._allTilesDirty=!0}i?e.madeProgress():this._allTilesDirty=!0,this._allTilesCreated=!this.allTiles.some(e=>e.hasPendingUpdate(1)||e.hasPendingUpdate(4)&&e.unmergableChildCount===0),this._sortTiles(e)}_updateElevation(e){e.done||this._allTiles.some(t=>(t.resetPendingUpdate(8)&&(this._updateTileGeometryState(t),e.madeProgress()),e.done))}_updateElevationSources(e){e.done||this._allTiles.some(t=>(t.needsElevationSourceUpdate()&&(t.updateAgents(0),t.markElevationSourceUpdateRequested(),e.madeProgress()),e.done))}_updateTextures(e){e.done||this._allTiles.some(t=>(this._updateTileTexture(t,e),e.done))}_updateClippingExtent(){this.spatialReference&&(this.updateOverlayParameters(),this.requestRender(1),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get _lodBias(){return this.view.qualitySettings.tiledSurface.lodBias-(1-this.view.quality)*Be}_getLodBiasCorrectedScale(e){let t=this.tilingScheme.levels,n=c(e-this._lodBias,0,t.length-1),r=n-Math.floor(n),i=t[Math.floor(n)].scale,a=t[Math.ceil(n)].scale;return i*(1-r)+a*r}_removeAllTiles(){this._pendingTilesToUpdate.clear(),this._pendingTilesForElevationUpdateEvent.clear(),this._rootTiles!=null&&(this._rootTiles.forEach(e=>this._purgeTile(e)),this._setRootTiles(null),this.notifyChange(`ready`)),this._allTiles.clear(),this.notifyChange(`demResolution`),this.emit(`tiles-changed`,{allTiles:this.allTiles}),this.renderer.visible=!1}_purgeSubtree(e){let t=e.children;t[0]&&(this._purgeTile(t[0]),this._purgeTile(t[1]),this._purgeTile(t[2]),this._purgeTile(t[3]),e.clearChildren())}_purgeTile(e){e.leaf?_t(e):this._purgeSubtree(e),this._allTiles.removeUnordered(e),this._unloadTile(e),e.dispose(),this._tileCache.put(K._tileMemcacheKey,e),this.notifyChange(`demResolution`),this.emit(`tiles-changed`,{allTiles:this.allTiles})}_unloadTile(e){this._pendingTilesToUpdate.delete(e),this._pendingTilesForElevationUpdateEvent.delete(e),e.unload()}_splitTile(e){j(e.leaf,`Tile that is already split should not be split again!`),j(e.rendered,`Tile marked to split is not rendered`),_t(e);let t=e.createChildren();this._allTiles.pushArray(t),this.notifyChange(`demResolution`),this.emit(`tiles-changed`,{allTiles:this.allTiles}),e.updateAgentSuspension(),j(e.rendered,`parent should be rendered`),t.forEach(e=>this._loadTile(e)),t.forEach(e=>this._pendingTilesToUpdate.add(e)),this._unloadTile(e),this._markAllTileNeighborsForUpdate(e),this._emitTileScaleChange(e,e.level+1),this._allTilesDirty=!0,this._shortBatches&&this._updatePendingTileGeometries(),t.forEach(e=>Z(e,e.hasPendingUpdate(1))),++this._performanceInfo.numSplit}_emitTileScaleChange(e,t=e.level){X.spatialReference=this.spatialReference,X.extent=e.extent,X.scale=this._getLodBiasCorrectedScale(t),this.emit(`scale-change`,X)}createTile(e,t,n,r){j(!!r,`createTile sanity check`);let i=this._acquireTile(e,t,n,r);return i.updateClippingStatus(this.groundExtent),i.updateScreenDepth(this.view.state.contentCamera.viewProjectionMatrix),this._shouldSplit(i)&&i.setPendingUpdate(1),i}get _shortBatches(){return this.view.state.mode!==2}_mergeTile(e){j(!e.hasPendingUpdate(1),`_mergeTile sanity check`),j(!e.leaf,`Cannot merge a leaf`),!e.leaf&&(this._purgeSubtree(e),j(!e.renderData,`Merging tile with existing render data?`),this._loadTile(e),this._markTileToUpdate(e),this._emitTileScaleChange(e),this._shortBatches&&this._updatePendingTileGeometries(),Z(e,!1),this._allTilesDirty=!0,++this._performanceInfo.numMerged)}_loadTile(e){e.load(),this.requestUpdate(),this._allTilesDirty=!0,this.overlayManager?.hasOverlays&&e.updateOverlayParameters(this.overlayManager)}_handleLayerViewChanges(e=lt){if(!this._layerViewsDirty)return;this._layerViewsDirty=!1;let t=!1,n=new Set,r=-1;for(let e=this.view.allLayerViews.length-1;e>=0;e--){let i=this.view.allLayerViews.items[e];if(n.add(i.uid),F(i)||I(i)){if(this._basemapLayerViewHandles.has(i.uid)&&!I(i)){let e=this._layerClassFromLayerView(i),n=this.getLayerIndexByUID(e,i.uid);n!=null&&((n<r||r==null)&&(t=!0),r=n)}else this._registerTiledLayerView(i),i.layer.loaded&&(t=!0)}}this._basemapLayerViewHandles.forEach((e,r)=>{n.has(r)||(this._unregisterTiledLayerView(r),t=!0)}),t&&this._updateTiledLayers(),this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._evaluateTransparency(),e.madeProgress()}get _isFullyTransparent(){if(this.view.map?.ground?.opacity>0)return!1;for(let e of this.view.allLayerViews.items)if(L(e)&&!Se(e.layer)&&e.fullOpacity!==0)return!1;return!0}_hasCompositeBlendMode(){for(let e of this.view.allLayerViews.items)if((R(e)||I(e))&&at(ot[e.layer.blendMode]))return!0;return!1}_layerClassFromLayerView(e){return+!z(e)}_registerTiledLayerView(e){let t=[];if((R(e)||I(e))&&t.push(h(()=>e.layer.blendMode,()=>{this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._updateTileTextures(2)})),!I(e)){let n=this._layerClassFromLayerView(e);t.push(h(()=>!e.destroyed&&e.suspended,()=>this._updateTiledLayers())),t.push(h(()=>!e.destroyed&&e.fullOpacity,()=>this._updateTileTextures(2)));let{layer:r}=e;`effectiveScaleRange`in r&&t.push(h(()=>!e.destroyed&&r.effectiveScaleRange,()=>this._restartAllAgents(n))),t.push(e.on(`data-changed`,()=>{let t=this.getLayerIndexByUID(n,e.uid);t!=null&&this._invalidateLayerData(t,n)}))}this._unregisterTiledLayerView(e.uid),this._basemapLayerViewHandles.set(e.uid,t)}_unregisterTiledLayerView(e){let t=this._basemapLayerViewHandles.get(e);if(t){for(let e of t)e.remove();this._basemapLayerViewHandles.delete(e)}}_updateTiledLayers(){if(!this.tilingScheme||this.view.suspended)return;let e=this.view.allLayerViews,t=[[],[]],n=null;e.forEach(e=>{if(!e.layer||e.suspended||!F(e)||!e.fullExtent)return;let r=this._layerClassFromLayerView(e);if(r===1){let t=e.displayLevelRange.maxLevel;t!==1/0&&(n===null||t>n)&&(n=t)}t[r].push(e)});for(let e of je){let n=this._layerViews[e],r=t[e];r.reverse();let i=r.length,a=n.length!==i,o=Array(i),s=Array(n.length);this._layerIndexByUid[e].clear();for(let t=0;t<i;t++){let i=r[t].uid;this._layerIndexByUid[e].set(i,t);let c=n.indexOf(r[t]);o[t]=c,t!==c&&(a=!0),c>-1&&(s[c]=t)}if(a){let t=this._postorderIterator;for(t.reset(this._rootTiles);!t.done;)t.next().modifyLayers(s,o,e);this._layerViews[e]=r,this._restartAllAgents(e),this._updateTilesVisibility(this._rootTiles)}}this.tilingScheme.ensureMaxLod(n)&&(this._viewChangeUpdate(),this.notifyChange(`tilingScheme`))}_restartAllAgents(e){let t=this._postorderIterator;for(t.reset(this._rootTiles);!t.done;){let n=t.next();n.restartAgents(e),e===0&&n.computeElevationBounds()}this._updateRootTileElevationRange()}layerViewByIndex(e,t){return this._layerViews[t][e]}numLayers(e){return this._layerViews[e].length}_updateTileTextures(e){this._allTiles.forAll(t=>{t.updateAgents(1),e===1?this.renderer.updateTileTexture(t,16):t.updateRenderData(1,e)}),this._evaluateTransparency()}_invalidateLayerData(e,t){this._rootTiles!=null&&(W(this._rootTiles,n=>n.removeLayerAgent(e,t)),W(this._rootTiles,n=>{n.invalidateLayerData(e,t),n.restartAgents(t)}))}setTileTreeDirty(e){this._allTilesDirty=!0,e&&(this._allTilesCreated=!1)}requestRender(e=1){this.renderer.setNeedsRender(e)}requestUpdate(){++this._pendingUpdates===1&&(this._hasPendingUpdates=!0)}requestTileData(e,t,n,r){let i=this.layerViewByIndex(t,n),a=i.layer;return!a.tilemapCache||M(i)?this._requestTileData(e,n,i,r):(++this._asyncWorkItems,a.tilemapCache.fetchAvailability(e.level,e.lij[1],e.lij[2],{...r,timeout:6e3}).catch(t=>{throw te(r),p(t)||this._dataMissing(e,n,i),t}).then(()=>this._frameTask.schedule(()=>this._requestTileData(e,n,i,r),r.signal)).finally(()=>--this._asyncWorkItems))}_requestTileData(e,t,n,r){return this.destroying?Promise.resolve():t===0?z(n)?this._requestElevationTileData(e,n,r):Promise.reject():L(n)?this._requestMapTileData(e,n,r):Promise.reject()}_requestElevationTileData(e,t,n){++this._asyncWorkItems;let r=r=>{!m(n)&&r&&(this.setMemoryDirty(),this.requestUpdate(),this._elevationDataArrived(e,t,r))},i=n=>{p(n)||(s.getLogger(this).error(`Tile ${e.lij.toString()} layer 0/${t.uid} error ${n}`),this._dataMissing(e,0,t),this.requestUpdate())};return t.fetchElevationTile(e,{...Ce,...n}).then(e=>this._frameTask.schedule(()=>r(e)),i).finally(()=>--this._asyncWorkItems)}_elevationDataArrived(e,t,n){let r=this._layerIndexByUid[0].get(t.uid);if(r==null){s.getLogger(this).warn(`TerrainSurface: received data from unknown layer %d %s`,0,e.lij.toString());return}let i=new Oe(e.lij,e.extent,n);e.dataArrived(r,0,i),this.emit(`tile-data-changed`,{tile:e,layerIndex:r,layerClass:0});let a=[e],o=e.level,c=this._iteratorPool.acquire();for(c.reset(a);!c.done;){let e=c.next();e.findElevationBoundsForLayer(r,o),e.computeElevationBounds()}o===0&&this._updateRootTileElevationRange(),c.remove(),this._updateTilesVisibility(a)}_requestMapTileData(e,t,n){++this._asyncWorkItems;let r=(r,i)=>{B(i),m(n)||(console.error(`Tile ${e.lij.toString()} layer 1/${t.uid} error ${r}`),this._dataMissing(e,1,t),this.requestUpdate())},i=e=>t=>r(t,e);return t.fetchTile(e.lij,n).then(r=>this._frameTask.schedule(()=>{this.requestUpdate(),m(n)?B(r):this._mapTileDataArrived(e,t,r)},n.signal,i(r)).catch(i(r)),(e,t=null)=>this._frameTask.schedule(()=>r(e,t))).finally(()=>--this._asyncWorkItems)}_mapTileDataArrived(e,t,n){let r=this.getLayerIndexByUID(1,t.uid);if(r==null){B(n),s.getLogger(this).warn(`TerrainSurface: received data from unknown layer`);return}e.dataArrived(r,1,n),this.emit(`tile-data-changed`,{tile:e,layerIndex:r,layerClass:1})}_dataMissing(e,t,n){let r=this.getLayerIndexByUID(t,n.uid);r==null?s.getLogger(this).warn(`TerrainSurface: received data from unknown layer`):(e.dataMissing(r,t),this.emit(`tile-data-changed`,{tile:e,layerIndex:r,layerClass:t}))}get performanceInfo(){let e=this._performanceInfo;return e.numNodes=this._allTiles.length,e.numLeaves=e.numVisible=e.numRendered=e.numLoadedPerLevel.length=e.numRenderedPerLevel.length=0,this._allTiles.forAll(t=>{t.leaf&&e.numLeaves++;let n=t.level;t.renderData&&(e.numLoadedPerLevel[n]=(e.numLoadedPerLevel[n]||0)+1),t.visible&&(e.numVisible++,t.rendered&&(e.numRenderedPerLevel[n]=(e.numRenderedPerLevel[n]||0)+1,e.numRendered++))}),e}setMemoryDirty(){this._usedMemory=null}get usedMemory(){return this.tilingScheme?(this._usedMemory??=this._recalculateUsedMemory(),this._usedMemory??0):0}_recalculateUsedMemory(){return this.tilingScheme?Math.round(this._allTiles.reduce((e,t)=>e+t.usedMemory,0)):null}getUsedMemoryForLayerView(e){let t=0,n=this._layerClassFromLayerView(e),r=this.getLayerIndexByUID(n,e.uid);return r!=null&&this._allTiles.forAll(e=>t+=e.getUsedMemoryForLayer(n,r)),t}get renderPatchBorders(){return this._renderer.renderPatchBorders}set renderPatchBorders(e){this._renderer.renderPatchBorders=e}get renderingDisabled(){return this._renderer.renderingDisabled}set renderingDisabled(e){this._renderer.renderingDisabled=e}get test(){}checkAllTilesWaterproofness(e=`render-patch-groups`){}get isGlobal(){return this._isGlobal}get isGeographic(){return this._isGeographic}get isWebMercator(){return this._isWebMercator}get isWebMercatorOnPlateCarree(){return this._isWebMercatorOnPlateCarree}isEastEndWrap(e){return this._isGlobal&&e[2]===this.lijEastEnd(e[0])-1}isWestEndWrap(e){return this._isGlobal&&e[2]===0}lijEastEnd(e){return 1<<e+ +!!this._isGeographic}wrapEastWest(e){let t=this.lijEastEnd(e[0]),n=e[2];if(0<=n&&n<t)return e;if(!this._isGlobal)return null;let r=(n+(n<0?t:0))%t;return[e[0],e[1],r]}enableInternalChecks(e){Ke(e)}enableWaterproofnessChecks(e){qe(e)}static cleanupTerrainSurface(){mt.prune()}enable(e){e!==this.enabled&&(this._set(`enabled`,e),e?(this._updateRootTiles(),this.freeze=!1,this.view.elevationProvider.register(0,this)):(this.view.elevationProvider.unregister(this),this.freeze=!0,this._removeAllTiles(),this._setRootTiles(null)),this.notifyChange(`ready`))}updateOverlayParameters(){let{overlayManager:e}=this;this.allTiles.forAll(t=>t.updateOverlayParameters(e))}};e([y()],q.prototype,`_renderer`,void 0),e([y({constructOnly:!0})],q.prototype,`_scaleRangeQueries`,void 0),e([y({constructOnly:!0})],q.prototype,`view`,void 0),e([y({constructOnly:!0})],q.prototype,`overlayManager`,void 0),e([y({constructOnly:!0})],q.prototype,`terrainTextureCompressionTracker`,void 0),e([y()],q.prototype,`_hasPendingUpdates`,void 0),e([y()],q.prototype,`_asyncWorkItems`,void 0),e([y()],q.prototype,`_allTilesDirty`,void 0),e([y()],q.prototype,`_allTilesSorted`,void 0),e([y()],q.prototype,`allTilesCreated`,null),e([y()],q.prototype,`_allTilesCreated`,void 0),e([y()],q.prototype,`_viewChanged`,void 0),e([y({type:Number})],q.prototype,`heading`,void 0),e([y()],q.prototype,`_splitLimits`,void 0),e([y()],q.prototype,`_frameTask`,void 0),e([y()],q.prototype,`demResolution`,null),e([y({readOnly:!0})],q.prototype,`snapLevel`,null),e([y({readOnly:!0})],q.prototype,`lodSnappingEnabled`,null),e([y()],q.prototype,`_stencilEnabledExtents`,null),e([y({readOnly:!0})],q.prototype,`userClippingExtent`,null),e([y()],q.prototype,`_rootTilesExtent`,void 0),e([y({readOnly:!0})],q.prototype,`groundExtent`,null),e([y({readOnly:!0})],q.prototype,`fullGroundExtent`,null),e([y({readOnly:!0})],q.prototype,`_tilingSchemeExtent`,null),e([y({readOnly:!0})],q.prototype,`updating`,null),e([y({readOnly:!0})],q.prototype,`readyToRun`,null),e([y(De)],q.prototype,`updatingProgress`,void 0),e([y({readOnly:!0})],q.prototype,`updatingProgressValue`,null),e([y()],q.prototype,`_maxNumUpdating`,void 0),e([y()],q.prototype,`baseOpacity`,null),e([y()],q.prototype,`hasCompositeBlendMode`,void 0),e([y({readOnly:!0})],q.prototype,`viewingMode`,null),e([y()],q.prototype,`maxTextureScale`,void 0),e([y({readOnly:!0})],q.prototype,`ready`,null),e([y({readOnly:!0})],q.prototype,`rootTiles`,null),e([y()],q.prototype,`_rootTiles`,void 0),e([y({readOnly:!0})],q.prototype,`spatialReference`,null),e([y({type:t})],q.prototype,`backgroundColor`,null),e([y({value:!1})],q.prototype,`slicePlaneEnabled`,null),e([y({readOnly:!0})],q.prototype,`tilingScheme`,void 0),e([y({readOnly:!0})],q.prototype,`tilingSchemeLocked`,null),e([y({readOnly:!0})],q.prototype,`tilingSchemeLogic`,void 0),e([y()],q.prototype,`wireframe`,null),e([y()],q.prototype,`opaque`,null),e([y()],q.prototype,`invisible`,null),e([y({value:!1})],q.prototype,`freeze`,null),e([y()],q.prototype,`fadeDuration`,null),e([y()],q.prototype,`_xNormalizer`,null),e([y()],q.prototype,`visibleElevationRange`,void 0),e([y()],q.prototype,`_rootTileElevationRange`,void 0),e([y()],q.prototype,`_layerViewsDirty`,void 0),e([y()],q.prototype,`renderPatchBorders`,null),e([y()],q.prototype,`renderingDisabled`,null),e([y({readOnly:!0})],q.prototype,`enabled`,void 0),q=K=e([re(`esri.views.3d.terrain.TerrainSurface`)],q);const ft=q,J=b(),Y=new ye,pt=C(),mt=new f,X={spatialReference:null,extent:null,scale:0};function ht(e,t,n){for(let r of e){if(!r.containsPointXY(t,n))continue;let e=r;for(;e&&!e.renderData;){let r=+(t>e.extentMidX)+(n<e.extentMidY?2:0);e=e.children[r]}let i=e?.renderData?.geometryState.samplerData??null;return ke(t,n,i)}return null}function Z(e,t){!e.leaf||e.level<A||$(e,e=>{t&>(e);let n=Q(e);if(e.maxLevelDeltaNeighborCount++,n){let t=e.parent;for(;t;){let e=Q(t);if(t.unmergableChildCount++,e)t=t.parent;else break}}})}function gt(e){if(e.hasPendingUpdate(1))return;let t=e.parent;for(;t?.resetPendingUpdate(4);)t=t.parent;e.resetPendingUpdate(4),e.leaf&&e.setPendingUpdate(1),!(e.level<A)&&$(e,e=>{gt(e)})}function _t(e){e.level<A||$(e,e=>{if(e.maxLevelDeltaNeighborCount--,e.maxLevelDeltaNeighborCount===0&&e.unmergableChildCount===0){let t=e.parent;for(;t&&(t.unmergableChildCount--,Q(t));)t=t.parent}})}function Q(e){return e.maxLevelDeltaNeighborCount===0&&e.unmergableChildCount===0}function $(e,t){if(e.level<A)return;let n=e.level-A,r=e.lij[1]>>A,i=e.lij[2]>>A,a=e=>e.leaf||e.level===n;for(let o=0;o<4;++o){let s=e.findNeighborTile(P[o],a);if(!s||s.level!==n)continue;let c=s.lij;(c[1]!==r||c[2]!==i)&&t(s)}}export{ft as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/PooledArray.js";import{isImageryTileLayerView as t}from"./terrainUtils.js";class n{constructor(){this._queue=new e,this.remove=()=>{}}get done(){return this._queue.length===0&&(!this._last||this._last.leaf)}resetOne(e){this._queue.clear(),this._queue.push(e),this._last=void 0}reset(e=null){this._queue.clear(),e!=null&&this._queue.pushArray(e),this._last=void 0}skipSubtree(){this._last=void 0}next(){let e=this._last?.children;return e?.[0]&&this._queue.pushArray(e),this._last=this._queue.pop(),this._last}}class r{constructor(){this._q=new e}get done(){return this._q.length===0}reset(e){if(this._q.clear(),e!=null){this._q.pushArray(e);for(let e=0;e<this._q.length;++e){let t=this._q.data[e];t.leaf||this._q.pushArray(t.children)}}}next(){return this._q.pop()}}function i(e,t,n=()=>!0){if(Array.isArray(e))for(let r=0;r<e.length;r++)a(e[r],t,n);else a(e,t,n)}function a(e,t,n=()=>!0){if(t(e),!e.leaf&&n(e))for(let n of e.children)a(n,t)}function o(e,t){let n=e.extent;return!(t.xmin>n[2]||t.ymin>n[3]||t.xmax<n[0]||t.ymax<n[1])}function s(e,t,n){let r=e.surface.tilingScheme.levels[e.level].scale;return!(t&&t>0&&r>t*1.00000001||n&&n>0&&r<n*.99999999)}function c(e,t){if(t==null||t.destroyed)return!1;let n=l(t);return!(n?.fullExtent==null||!o(e,n.fullExtent)||!s(e,n.minScale,n.maxScale))}function l(e){return t(e)?{fullExtent:e.fullExtent,minScale:e.layer.minScale,maxScale:e.layer.maxScale}:e.layer}function u(e){return t(e)||!e.layer||!(`tilemapCache`in e.layer)?null:e.layer.tilemapCache}function d(e,t){let n=e.lij,r=t.lij;return n[0]-r[0]||n[1]-r[1]||n[2]-r[2]}function f(e,t=null){return t==null||t.length===0?e.sort(p):e.sort((e,n)=>h(e,n,t))}function p(e,t){let n=e.screenDepth-t.screenDepth;if(n!==0)return n;let r=e.lij,i=t.lij;return r[0]-i[0]||r[1]-i[1]||r[2]-i[2]}function m(e,t){let n=e.screenDepth,r=t.screenDepth;return n<r?-1:n>r?1:d(e,t)}function h(e,t,n){return g(e,n)===g(t,n)?m(e,t):e?1:-1}function g(e,t){
|
|
2
|
+
import e from"../../../core/PooledArray.js";import{isImageryTileLayerView as t}from"./terrainUtils.js";class n{constructor(){this._queue=new e,this.remove=()=>{}}get done(){return this._queue.length===0&&(!this._last||this._last.leaf)}resetOne(e){this._queue.clear(),this._queue.push(e),this._last=void 0}reset(e=null){this._queue.clear(),e!=null&&this._queue.pushArray(e),this._last=void 0}skipSubtree(){this._last=void 0}next(){let e=this._last?.children;return e?.[0]&&this._queue.pushArray(e),this._last=this._queue.pop(),this._last}}class r{constructor(){this._q=new e}get done(){return this._q.length===0}reset(e){if(this._q.clear(),e!=null){this._q.pushArray(e);for(let e=0;e<this._q.length;++e){let t=this._q.data[e];t.leaf||this._q.pushArray(t.children)}}}next(){return this._q.pop()}}function i(e,t,n=()=>!0){if(Array.isArray(e))for(let r=0;r<e.length;r++)a(e[r],t,n);else a(e,t,n)}function a(e,t,n=()=>!0){if(t(e),!e.leaf&&n(e))for(let n of e.children)a(n,t)}function o(e,t){let n=e.extent;return!(t.xmin>n[2]||t.ymin>n[3]||t.xmax<n[0]||t.ymax<n[1])}function s(e,t,n){let r=e.surface.tilingScheme.levels[e.level].scale;return!(t&&t>0&&r>t*1.00000001||n&&n>0&&r<n*.99999999)}function c(e,t){if(t==null||t.destroyed)return!1;let n=l(t);return!(n?.fullExtent==null||!o(e,n.fullExtent)||!s(e,n.minScale,n.maxScale))}function l(e){return t(e)?{fullExtent:e.fullExtent,minScale:e.layer.minScale,maxScale:e.layer.maxScale}:e.layer}function u(e){return t(e)||!e.layer||!(`tilemapCache`in e.layer)?null:e.layer.tilemapCache}function d(e,t){let n=e.lij,r=t.lij;return n[0]-r[0]||n[1]-r[1]||n[2]-r[2]}function f(e,t=null){return t==null||t.length===0?e.sort(p):e.sort((e,n)=>h(e,n,t))}function p(e,t){let n=e.screenDepth-t.screenDepth;if(n!==0)return n;let r=e.lij,i=t.lij;return r[0]-i[0]||r[1]-i[1]||r[2]-i[2]}function m(e,t){let n=e.screenDepth,r=t.screenDepth;return n<r?-1:n>r?1:d(e,t)}function h(e,t,n){return g(e,n)===g(t,n)?m(e,t):e?1:-1}function g(e,t){return t?.some(t=>e.intersectsExtent(t))??!1}function _(e,t){let n=e.distanceToPOI-t.distanceToPOI;if(n!==0)return n;let r=e.lij,i=t.lij;return r[0]-i[0]||r[1]-i[1]||r[2]-i[2]}function v(e,t){let n=e.length;for(let r=0;r<n;++r)e.at(r).updateDistanceToPOI(t);e.sort(_)}function y(e,t,n){let r=1,i=0,a=0;for(;e!==t;)if(r*=.5,i*=.5,a*=.5,e.lij[2]&1&&(i+=.5),e.lij[1]&1||(a+=.5),e=e.parent,e==null)throw Error(`tile was not a descendant of upsampleTile`);n.init(t,i,a,r)}function b(e){for(let t=0;t<e.length;t++){let n=e[t],r=n.parent;if(r)for(let e=0;e<4;e++){let t=r.children[e];if(t&&t!==n)return!0}}return!1}function x(e,t){if(!e||!t||e[0]===t[0])return!1;let n=e[0]<t[0],r=n?e:t,i=n?t:e,a=1<<i[0]-r[0];return Math.floor(i[1]/a)===r[1]&&Math.floor(i[2]/a)===r[2]}function S(e,t){if(t<=e[0])return[[...e]];let n=1<<t-e[0],r=[],i=e[1]*n,a=e[2]*n;for(let e=0;e<n;++e)for(let o=0;o<n;++o)r.push([t,e+i,o+a]);return r}export{r as IteratorPostorder,n as IteratorPreorder,m as compareTiles,d as compareTilesByLij,h as compareTilesWithStencil,y as computeUpsampleInfo,S as descendantsAtLevel,c as fallsWithinLayerView,u as getTileMapCache,b as hasLoadableSiblings,f as sortTiles,v as sortTilesByPOI,x as tilesAreRelated,i as traverseTilesPreorder,g as usesStencil};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{smoothstep as t,lerp as n}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{signal as o}from"../../../../../core/signal.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{add as c,normalize as l,length as u,dot as d,scale as f,lerp as p}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m,fromValues as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as g}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{heightLimit as _}from"../../../environment/weather.js";import{betaRayleigh as v,betaCombined as y}from"../atmosphere/atmosphereUtils.js";import{F as b}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as x}from"./FogTechnique.js";import{BlurEmission as S}from"../glow/BlurEmission.js";import{EmissiveTechniqueConfiguration as C}from"../../shaders/EmissiveTechniqueConfiguration.js";import{floatBlendReductionFactor as w}from"../../shaders/floatBlendScale.glsl.js";import{ColorAttachment1 as T,SizedPixelFormat as E,ColorAttachment0 as D,DepthStencilAttachment as O}from"../../../../webgl/enums.js";const k=.9*_,A=1.1*_;let j=class extends S{constructor(){super(...arguments),this._configuration=new C,this._newParameters=new M,this._oldParameters=new M,this._fadedParameters=new M,this._parameters=this._newParameters,this._passParameters=new b}initialize(){this.addHandles([i(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),a),i(()=>this.view.environment.weather,()=>this._updateEnabled(),a),i(()=>this._updateFogParameters(),()=>{},a),i(()=>this._fadeFactor,e=>this._fade(e),a)])}_updateEnabled(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){let{_newParameters:t,_oldParameters:n}=this;e>=1?(this._parameters=t,this._oldParameters.copy(this._newParameters)):e<=0?this._parameters=n:(this._fadedParameters.lerp(n,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){let{weather:e,weatherAvailable:t}=this.view.environment,n=e.type===`foggy`||e.type===`snowy`||e.type===`rainy`;this._newParameters.strength.value=t?e.scattering:0,this._newParameters.amount.value=+!!n,(e.type===`foggy`||e.type===`snowy`)&&(this._newParameters.fogBrightness=z),e.type===`rainy`&&(this._newParameters.fogBrightness=R),this._fadeFactor>=1&&this._oldParameters.copy(this._newParameters),this.requestRender(2)}get strength(){return this._parameters.strength.value*this._heightFade}get amount(){return this._parameters.amount.value*this._heightFade}get _heightFade(){let e=u(this.bindParameters.camera.eye);return 1-t(k,A,Math.abs(e-this._ellipsoid.radius))}precompile(){this._update(),this._passParameters.amount>0&&(super.precompile(),this.techniques.precompile(x,this._configuration))}get _needsEmissionBlur(){return this._configuration.hasEmissive}render(){let e=this.input,t=this._getTechnique();if(!t)return e;this._passParameters.emission=e.obtainAttachment(T),this._passParameters.inputScale=this._passParameters.emission?.attachment.descriptor.internalFormat===E.RGBA8?w:1;let n=this.renderingContext;this._passParameters.emission&&(this._renderEmissionMipMap(),this._configuration.useFloatBlend?(e.acquireColor(T,8,`emissive`),n.clearBuffer(1,g)):(this._passParameters.color=e.obtainAttachment(D),e.acquireColor(D,5),e.acquireColor(T,8,`emissive`)));let i=e.getAttachment(O);return e.attachDepth(null),n.bindFramebuffer(e.fbo),n.bindTechnique(t,this.bindParameters,this._passParameters),n.screen.draw(),this._passParameters.color=r(this._passParameters.color),this._passParameters.emission=r(this._passParameters.emission),this._passParameters.mipmapTexture=r(this._passParameters.mipmapTexture),e.attachDepth(i),this.fboCache.debugCallback?.(`fog-color`,e.fbo),e}_getTechnique(){return this.renders?this.techniques.get(x,this._configuration):null}get renders(){return this._update(),this._passParameters.amount>0}_update(){let e=this.bindParameters.camera;l(N,e.eye);let t=Math.max(0,d(N,this.bindParameters.lighting.mainLight.direction)),n=this._parameters.fogBrightness;f(this._passParameters.fogColor,I,n),f(P,I,n*.1),p(this._passParameters.fogColor,P,this._passParameters.fogColor,t);let r=u(e.eye);this._passParameters.atmosphereC=r**2-this._atmosphereRadius**2,this._passParameters.amount=this.amount,this._passParameters.strength=this._passParameters.scattering=this.strength,this._configuration.hasEmissive=this.bindParameters.hasEmission,this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value}get test(){return{parameters:this._passParameters}}};j=e([s(`esri.views.3d.webgl-engine.effects.fog.Fog`)],j);class M{constructor(){this.fogBrightness=0,this.strength=o(0),this.amount=o(0)}copy(e){this.fogBrightness=e.fogBrightness,this.strength.value=e.strength.value,this.amount.value=e.amount.value}lerp(e,t,r){this.fogBrightness=n(e.fogBrightness,t.fogBrightness,r),this.strength.value=n(e.strength.value,t.strength.value,r),this.amount.value=n(e.amount.value,t.amount.value,r)}}const N=m(),P=m(),F=h(3e-4,3e-4,3e-4),I=m();c(I,y,v),c(I,I,F),l(I,I);const L=I.reduce((e,t)=>e+t,0)/3,R=.5/L,z=1.5/L;export{j as Fog,M as FogParameters};
|
|
2
|
+
import{__decorate as e}from"tslib";import{smoothstep as t,lerp as n}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{signal as o}from"../../../../../core/signal.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{add as c,normalize as l,length as u,dot as d,scale as f,lerp as p}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m,fromValues as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as g}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{heightLimit as _}from"../../../environment/weather.js";import{betaRayleigh as v,betaCombined as y}from"../atmosphere/atmosphereUtils.js";import{F as b}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as x}from"./FogTechnique.js";import{BlurEmission as S}from"../glow/BlurEmission.js";import{EmissiveTechniqueConfiguration as C}from"../../shaders/EmissiveTechniqueConfiguration.js";import{floatBlendReductionFactor as w}from"../../shaders/floatBlendScale.glsl.js";import{ColorAttachment1 as T,SizedPixelFormat as E,ColorAttachment0 as D,DepthStencilAttachment as O}from"../../../../webgl/enums.js";const k=.9*_,A=1.1*_;let j=class extends S{constructor(){super(...arguments),this._configuration=new C,this._newParameters=new M,this._oldParameters=new M,this._fadedParameters=new M,this._parameters=this._newParameters,this._passParameters=new b}initialize(){this._configuration.hasFog=!0,this.addHandles([i(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),a),i(()=>this.view.environment.weather,()=>this._updateEnabled(),a),i(()=>this._updateFogParameters(),()=>{},a),i(()=>this._fadeFactor,e=>this._fade(e),a)])}_updateEnabled(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){let{_newParameters:t,_oldParameters:n}=this;e>=1?(this._parameters=t,this._oldParameters.copy(this._newParameters)):e<=0?this._parameters=n:(this._fadedParameters.lerp(n,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){let{weather:e,weatherAvailable:t}=this.view.environment,n=e.type===`foggy`||e.type===`snowy`||e.type===`rainy`;this._newParameters.strength.value=t?e.scattering:0,this._newParameters.amount.value=+!!n,(e.type===`foggy`||e.type===`snowy`)&&(this._newParameters.fogBrightness=z),e.type===`rainy`&&(this._newParameters.fogBrightness=R),this._fadeFactor>=1&&this._oldParameters.copy(this._newParameters),this.requestRender(2)}get strength(){return this._parameters.strength.value*this._heightFade}get amount(){return this._parameters.amount.value*this._heightFade}get _heightFade(){let e=u(this.bindParameters.camera.eye);return 1-t(k,A,Math.abs(e-this._ellipsoid.radius))}precompile(){this._update(),this._passParameters.amount>0&&(super.precompile(),this.techniques.precompile(x,this._configuration))}get _needsEmissionBlur(){return this._configuration.hasEmissive}render(){let e=this.input,t=this._getTechnique();if(!t)return e;this._passParameters.emission=e.obtainAttachment(T),this._passParameters.inputScale=this._passParameters.emission?.attachment.descriptor.internalFormat===E.RGBA8?w:1;let n=this.renderingContext;this._passParameters.emission&&(this._renderEmissionMipMap(),this._configuration.useFloatBlend?(e.acquireColor(T,8,`emissive`),n.clearBuffer(1,g)):(this._passParameters.color=e.obtainAttachment(D),e.acquireColor(D,5),e.acquireColor(T,8,`emissive`)));let i=e.getAttachment(O);return e.attachDepth(null),n.bindFramebuffer(e.fbo),n.bindTechnique(t,this.bindParameters,this._passParameters),n.screen.draw(),this._passParameters.color=r(this._passParameters.color),this._passParameters.emission=r(this._passParameters.emission),this._passParameters.mipmapTexture=r(this._passParameters.mipmapTexture),e.attachDepth(i),this.fboCache.debugCallback?.(`fog-color`,e.fbo),e}_getTechnique(){return this.renders?this.techniques.get(x,this._configuration):null}get renders(){return this._update(),this._passParameters.amount>0}_update(){let e=this.bindParameters.camera;l(N,e.eye);let t=Math.max(0,d(N,this.bindParameters.lighting.mainLight.direction)),n=this._parameters.fogBrightness;f(this._passParameters.fogColor,I,n),f(P,I,n*.1),p(this._passParameters.fogColor,P,this._passParameters.fogColor,t);let r=u(e.eye);this._passParameters.atmosphereC=r**2-this._atmosphereRadius**2,this._passParameters.amount=this.amount,this._passParameters.strength=this._passParameters.scattering=this.strength,this._configuration.hasEmissive=this.bindParameters.hasEmission,this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value}get test(){return{parameters:this._passParameters}}};j=e([s(`esri.views.3d.webgl-engine.effects.fog.Fog`)],j);class M{constructor(){this.fogBrightness=0,this.strength=o(0),this.amount=o(0)}copy(e){this.fogBrightness=e.fogBrightness,this.strength.value=e.strength.value,this.amount.value=e.amount.value}lerp(e,t,r){this.fogBrightness=n(e.fogBrightness,t.fogBrightness,r),this.strength.value=n(e.strength.value,t.strength.value,r),this.amount.value=n(e.amount.value,t.amount.value,r)}}const N=m(),P=m(),F=h(3e-4,3e-4,3e-4),I=m();c(I,y,v),c(I,I,F),l(I,I);const L=I.reduce((e,t)=>e+t,0)/3,R=.5/L,z=1.5/L;export{j as Fog,M as FogParameters};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../environment/FoggyWeather.js";import{ReadDepth as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../environment/FoggyWeather.js";import{ReadDepth as n}from"../../core/shaderLibrary/output/ReadDepth.glsl.js";import{FloatBindUniform as r}from"../../core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as i}from"../../core/shaderModules/FloatPassUniform.js";import{glsl as a}from"../../core/shaderModules/glsl.js";import{Texture2DBindUniform as o}from"../../core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as s}from"../../core/shaderModules/Texture2DPassUniform.js";import{parameter as c}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DistanceFalloffPassParameters as l,getDistanceFalloff as u}from"../raymarching/DistanceFalloff.glsl.js";import{FloatBlendScaleConfiguration as d,floatBlendScale as f}from"../../shaders/floatBlendScale.glsl.js";import{ToneMapping as p}from"../../shaders/ToneMapping.glsl.js";class m extends l{constructor(){super(...arguments),this.mipmapLevels=1,this.boost=1,this.scattering=1e-4}}class h extends d{constructor(){super(...arguments),this.hasFog=!1}}e([c()],h.prototype,`hasFog`,void 0);function g(e,c){e.include(f,c),e.include(u),e.include(n),e.include(p),e.uniforms.add(new s(`emissionTexture`,({emission:e})=>e?.attachment),new o(`depthTexture`,({mainDepth:e})=>e),new i(`scattering`,({scattering:e})=>e),new i(`boost`,({boost:e})=>1+e*.5),new i(`levels`,({mipmapLevels:e},{camera:t})=>e+1+Math.log2(t.pixelScale)),new r(`pixelRatioCorrection`,({camera:e})=>Math.log2(e.pixelScale)),new s(`mipmapTexture`,({mipmapTexture:e})=>e?.getTexture())).constants.add(`maxScattering`,`float`,t.maxScattering).constants.add(`maxDispersion`,`float`,c.hasFog?1:.1).code.add(a`vec3 readEmission(float level) {
|
|
3
3
|
level *= levels;
|
|
4
4
|
level = max(0.0, level - pixelRatioCorrection);
|
|
5
5
|
return level < 1.0 ?
|
|
@@ -22,7 +22,7 @@ mainDepth = max(0.0, length(cameraSpaceRay));
|
|
|
22
22
|
}
|
|
23
23
|
vec3 rayDir = normalize(worldRay);
|
|
24
24
|
float dispersionPerPixel = getDistanceFalloff(mainDepth, rayDir, scattering * 0.5);
|
|
25
|
-
float mainPoint = pow(dispersionPerPixel,
|
|
25
|
+
float mainPoint = pow(dispersionPerPixel, 4.0) * maxDispersion;
|
|
26
26
|
vec3 emission = vec3(0.0);
|
|
27
27
|
float weights = 0.0;
|
|
28
28
|
float baseSigmaSq = 0.003 + 0.03 * (boost - 1.0);
|
|
@@ -39,4 +39,4 @@ weights += weight;
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
return emission * boost / weights;
|
|
42
|
-
}`)}export{
|
|
42
|
+
}`)}export{h as EmissiveGlowConfiguration,m as EmissiveGlowPassParameters,g as applyEmissiveGlow};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{fetchAsset as t}from"../../../../../assets.js";import{createTask as n}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import i from"../../../../../core/Logger.js";import{abortMaybe as a,disposeMaybe as o}from"../../../../../core/maybe.js";import{isAbortError as s,throwIfAborted as c}from"../../../../../core/promiseUtils.js";import{watch as l,initial as u,syncAndInitial as d}from"../../../../../core/reactiveUtils.js";import{subclass as f}from"../../../../../core/accessorSupport/decorators.js";import{copy as p,rotateZ as m,multiply as h,invertOrIdentity as g}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{squaredLength as _}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{getReferenceEllipsoid as v}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as y}from"../../../webgl.js";import{glLayout as b}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as x}from"../OpaqueEnvironment.js";import{DeepSkyPassParameters as S,DeepSkyTechnique as C}from"./DeepSkyTechnique.js";import{StarPassParameters as w,StarsTechnique as T,layout as E}from"./StarsTechnique.js";import{getDailyRotationCoefficient as D,computeDayDuration as O,eq2ec as k,ec2eq as A}from"./starsUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{fetchAsset as t}from"../../../../../assets.js";import{createTask as n}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import i from"../../../../../core/Logger.js";import{abortMaybe as a,disposeMaybe as o}from"../../../../../core/maybe.js";import{isAbortError as s,throwIfAborted as c}from"../../../../../core/promiseUtils.js";import{watch as l,initial as u,syncAndInitial as d}from"../../../../../core/reactiveUtils.js";import{subclass as f}from"../../../../../core/accessorSupport/decorators.js";import{copy as p,rotateZ as m,multiply as h,invertOrIdentity as g}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{squaredLength as _}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{getReferenceEllipsoid as v}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as y}from"../../../webgl.js";import{glLayout as b}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as x}from"../OpaqueEnvironment.js";import{DeepSkyPassParameters as S,DeepSkyTechnique as C}from"./DeepSkyTechnique.js";import{StarPassParameters as w,StarsTechnique as T,layout as E}from"./StarsTechnique.js";import{getDailyRotationCoefficient as D,computeDayDuration as O,eq2ec as k,ec2eq as A}from"./starsUtils.js";import{VertexArrayObject as j}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as M,PrimitiveType as N}from"../../../../webgl/enums.js";import P from"../../../../webgl/Texture.js";import{TextureDescriptor as F}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";let L=class extends x{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new w,this._deepSkyPassParameters=new S}initialize(){this.addHandles([l(()=>this.view.environment.starsEnabled,e=>e?this._enable():this._disable(),u),l(()=>this.view.environment.lighting.type===`virtual`?null:this.view.environment.lighting.date,e=>this._update(e),d)])}_enable(){super._enable(),this._bandTextureTask=this._createLoadBandTextureTask(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished||!!this._bandTextureTask&&!this._bandTextureTask.finished}destroy(){this._bandTextureTask=a(this._bandTextureTask),this._bandTexture=o(this._bandTexture),this._loadDataTask=a(this._loadDataTask),this._numPoints=0,this._vao=o(this._vao),this._starData=null}render(e){let t=e.find(({name:e})=>e===y.OPAQUE_ENVIRONMENT),n=this.techniques.getCompiled(T),r=this.techniques.getCompiled(C);if(this.loading||!n||!r)return this.requestRender(1),t;let i=this.renderingContext;return this._bandTexture&&(this._deepSkyPassParameters.bandTexture=this._bandTexture,this._deepSkyPassParameters.heightAboveSeaLevelSquared=_(this.bindParameters.camera.eye),i.bindTechnique(r,this.bindParameters,this._deepSkyPassParameters),i.setDrawBuffers([M]),i.screen.draw()),this._starData&&(this._vao??=this._ensureResources(this._starData),i.bindTechnique(n,this.bindParameters,this._passParameters),i.setDrawBuffers([M]),i.bindVAO(this._vao),i.drawArrays(N.POINTS,0,this._numPoints)),t}_ensureResources(e){this._numPoints=e.byteLength/G;let t=new Float32Array(e,0,this._numPoints*2),n=new Uint8Array(e,this._numPoints*2*4,this._numPoints);return R(this.renderingContext,t,n,this._numPoints)}_update(e){let t=v(this.view.spatialReference).radius,n=t*.05,r=t*.3;if(this._deepSkyPassParameters.radiusCloseToGround=(t+r)**2,this._deepSkyPassParameters.radiusBrightnessTransitionEnd=(t+r+n)**2,!e)return;let i=D(e),a=2*O(e),o=p(this._passParameters.modelMatrix,k);m(o,o,-a*Math.PI),h(o,A,o),m(o,o,-i*Math.PI),g(this._deepSkyPassParameters.inverseModelMatrix,o),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;let e=n(async e=>{let{data:n}=await t(H,{responseType:`array-buffer`,signal:e});z(n),this._starData=n});return e.promise.catch(e=>{s(e)||i.getLogger(this).error(e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}_createLoadBandTextureTask(){if(this._bandTexture)return null;let e=n(async e=>{let{data:n}=await t(U,{responseType:`blob`,signal:e});c(e);let r=await createImageBitmap(n,{colorSpaceConversion:`none`,premultiplyAlpha:`none`});try{c(e);let t=new F(r.width,r.height);t.wrapMode=33071,t.maxAnisotropy=8,t.pixelFormat=6407,this._bandTexture=new P(this.renderingContext,t,r)}finally{r.close()}});return e.promise.catch(e=>{s(e)||i.getLogger(this).warn(`Failed to load Milky Way band texture.`,e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}};L=e([f(`esri.views.3d.webgl-engine.effects.stars.Stars`)],L);function R(e,t,n,r){let i=E.createBuffer(r),a=i.position,o=i.color,s=i.size;for(let e=0;e<r;e++){let r=t[e*2],i=t[e*2+1];a.set(e,0,-Math.cos(r)*Math.sin(i)),a.set(e,1,-Math.sin(r)*Math.sin(i)),a.set(e,2,-Math.cos(i));let c=V(n[e]),l=B(W[c[1]]);o.set(e,0,l[0]),o.set(e,1,l[1]),o.set(e,2,l[2]),o.set(e,3,255),s.set(e,c[0])}return new j(e,new I(e,b(E),i.buffer))}function z(e){if(!e)throw new r(`stars:no-data-received`,`Failed to create stars because star catalogue is missing`);let t=e.byteLength/G;if(t%1!=0||t>5e4||t<5e3)throw new r(`stars:invalid-data`,`Failed to create stars because star catalogue data is invalid`)}function B(e){return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function V(e){return e>=192?[2.9,e-192]:e>=160?[2.5,e-160]:e>=128?[2,e-128]:e>=96?[1.5,e-96]:e>=64?[1,e-64]:e>=32?[.7,e-32]:[.4,e]}const H=`esri/views/3d/environment/resources/stars.wsv`,U=`esri/views/3d/environment/resources/milkyway-band.avif`,W=[`9bb2ff`,`9eb5ff`,`aabfff`,`bbccff`,`ccd8ff `,`dae2ff`,`e4e9ff`,`eeefff`,`f8f6ff`,`fff9fb`,`fff5ef`,`fff1e5`,`ffeddb`,`ffe9d2`,`ffe6ca`,`ffe3c3`,`ffe0bb`,`ffddb4`,`ffdaad`,`ffd6a5`,`ffd29c`,`ffcc8f`,`ffc178`,`ffa94b`,`ff7b00`],G=9;export{L as Stars};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o,set as s,positiveInfinity as c,equals as l}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as u}from"../../webgl.js";import{addWraparound as d}from"../../layers/i3s/I3SUtil.js";import f from"../../webgl/RenderNode.js";import{canRenderGaussianSplats as p,requiresPreciseColorDepth as m,prepareGaussianSplatPerspectiveParameters as h}from"./GaussianSplatRenderUtils.js";import{G as g}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as _}from"../shaders/GaussianSplatCompositionTechnique.js";import{GaussianSplatCompositionTechniqueConfiguration as v}from"../shaders/GaussianSplatCompositionTechniqueConfiguration.js";import{G as y}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as b}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatPassParameters as x}from"../shaders/GaussianSplatPassParameters.js";import{GaussianSplatTechnique as S}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as C}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as w,DepthStencilAttachment as T,PrimitiveType as E}from"../../../webgl/enums.js";let D=class extends f{constructor(e){super(e),this.consumes={required:[u.GAUSSIAN_SPLAT]},this.produces=u.GAUSSIAN_SPLAT,this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new x,this._compositionPassParameters=new g,this._depthCompositionPassParameters=new y,this._compositionConfiguration=new v,this._clipBox=o(),this._previousSortRequestCameraDirection=a(),this._cameraSortDirty=!1,this._tileCullingRevision=0,this._sortRequestDirectionEpsilon=.01,this._configuration=new C(e.view.state.isGlobal),s(this._clipBox,c)}async initialize(){this.addHandles([t(()=>this.view.state.camera,()=>this._onCameraChange()),t(()=>this.view.state.mode===2,e=>{e&&this._cameraSortDirty&&this._requestCameraSort(this.view.state.camera.ray.direction),this.requestRender(1)})])}precompile(){this._canRender&&(this._updateConfigurations(),this._compositionConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.hasEmission=this.bindParameters.hasOpaqueEmission,this.techniques.precompile(S,this._configuration),this.techniques.precompile(_,this._compositionConfiguration),this.techniques.precompile(b))}render(){let e=this.input;if(this._updateConfigurations(),this._fadeHelper.updateForFrame(this.view.stage.renderView.renderer.renderContext.time),!this._canRender)return e;let t=e.getAttachment(w);this._compositionConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.hasEmission=t!=null;let{fullWidth:n,fullHeight:r}=this.bindParameters.camera;this._prepareParameters();let i=this.renderingContext,a=this.fboCache,o=a.acquire(n,r,`gaussian color output`),s=e.getAttachment(T);o.attachDepth(s);let c=this.techniques.get(S,this._configuration);this._renderGaussianColorAndDepth(o,c);let l=a.acquire(n,r,this.produces);this._depthCompositionPassParameters.splatDepth=o.getTexture(w),l.attachDepth(e.getAttachment(T)),i.bindFramebuffer(l.fbo);let u=this.techniques.get(b);i.bindTechnique(u,this.bindParameters,this._depthCompositionPassParameters),i.screen.draw(),this._compositionPassParameters.color=e.getTexture(),this._compositionPassParameters.splatColor=o.getTexture(),t?(l.acquireColor(w,8,`emissive`),this._compositionPassParameters.emission=e.getTexture(w)):this._compositionPassParameters.emission=null,i.bindFramebuffer(l.fbo);let d=this.techniques.get(_,this._compositionConfiguration);return i.bindTechnique(d,this.bindParameters,this._compositionPassParameters),i.screen.draw(),o.release(),l}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){let t=e||c;this._hasSameClipBox(t)||(s(this._clipBox,t),this._tileCullingRevision=d(this._tileCullingRevision,1),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get tileCullingRevision(){return this._tileCullingRevision}get _clippingEnabled(){return!l(this._clipBox,c,(e,t)=>e===t)}get _isIdle(){return this.view.state.mode===2}get _data(){return this.layerView.data}get _canRender(){return p(this._data)}get _fadeHelper(){return this.layerView.fadeHelper}_updateConfigurations(){this._configuration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.receiveShadows=this.bindParameters.shadowMap.ready,this._configuration.fragmentShading=this._configuration.receiveShadows&&this.view.stage.renderer.isFeatureEnabled(12),this._configuration.preciseDepth=m(this.bindParameters),this._configuration.hasShadowHighlights=this._configuration.receiveShadows&&this.bindParameters.hasShadowHighlights,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&this.bindParameters.slicePlane!=null}_onCameraChange(){this._tileCullingRevision=d(this._tileCullingRevision,1);let e=this.view.state.camera.ray.direction;this._cameraSortDirty=!0,(this._isIdle||this._shouldRequestSort(e))&&this._requestCameraSort(e)}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_requestCameraSort(e){this._data.requestSort(),i(this._previousSortRequestCameraDirection,e),this._cameraSortDirty=!1}_prepareParameters(){h(this._passParameters,this.layerView,this.camera)}_hasSameClipBox(e){return l(this._clipBox,e,(e,t)=>e===t)}_renderGaussianColorAndDepth(e,t){let n=this.renderingContext;e.acquireColor(w,5,`gaussian depth output`),n.bindFramebuffer(e.fbo),n.setClearColor(0,0,0,0),n.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(E.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}};e([n()],D.prototype,`consumes`,void 0),e([n()],D.prototype,`produces`,void 0),e([n({constructOnly:!0})],D.prototype,`layerView`,void 0),D=e([r(`esri.views.3d.webgl-engine.lib.GaussianSplatRenderer`)],D);export{D as GaussianSplatRenderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o,set as s,positiveInfinity as c,equals as l}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as u}from"../../webgl.js";import{addWraparound as d}from"../../layers/i3s/I3SUtil.js";import f from"../../webgl/RenderNode.js";import{canRenderGaussianSplats as p,requiresPreciseColorDepth as m,prepareGaussianSplatPerspectiveParameters as h}from"./GaussianSplatRenderUtils.js";import{G as g}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as _}from"../shaders/GaussianSplatCompositionTechnique.js";import{GaussianSplatCompositionTechniqueConfiguration as v}from"../shaders/GaussianSplatCompositionTechniqueConfiguration.js";import{G as y}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as b}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatPassParameters as x}from"../shaders/GaussianSplatPassParameters.js";import{GaussianSplatTechnique as S}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as C}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as w,DepthStencilAttachment as T,PrimitiveType as E}from"../../../webgl/enums.js";let D=class extends f{constructor(e){super(e),this.consumes={required:[u.GAUSSIAN_SPLAT]},this.produces=u.GAUSSIAN_SPLAT,this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new x,this._compositionPassParameters=new g,this._depthCompositionPassParameters=new y,this._compositionConfiguration=new v,this._clipBox=o(),this._previousSortRequestCameraDirection=a(),this._cameraSortDirty=!1,this._tileCullingRevision=0,this._sortRequestDirectionEpsilon=.01,this._configuration=new C(e.view.state.isGlobal),s(this._clipBox,c)}async initialize(){this.addHandles([t(()=>this.view.state.camera,()=>this._onCameraChange()),t(()=>this.view.state.mode===2,e=>{e&&this._cameraSortDirty&&this._requestCameraSort(this.view.state.camera.ray.direction),this.requestRender(1)})])}precompile(){this._canRender&&(this._updateConfigurations(),this._compositionConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.hasEmission=this.bindParameters.hasOpaqueEmission,this.techniques.precompile(S,this._configuration),this.techniques.precompile(_,this._compositionConfiguration),this.techniques.precompile(b))}render(){let e=this.input;if(this._updateConfigurations(),this._fadeHelper.updateForFrame(this.view.stage.renderView.renderer.renderContext.time),!this._canRender)return e;let t=e.getAttachment(w);this._compositionConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.hasEmission=t!=null;let{fullWidth:n,fullHeight:r}=this.bindParameters.camera;this._prepareParameters();let i=this.renderingContext,a=this.fboCache,o=a.acquire(n,r,`gaussian color output`),s=e.getAttachment(T);o.attachDepth(s);let c=this.techniques.get(S,this._configuration);this._renderGaussianColorAndDepth(o,c);let l=a.acquire(n,r,this.produces);this._depthCompositionPassParameters.splatDepth=o.getTexture(w),l.attachDepth(e.getAttachment(T)),i.bindFramebuffer(l.fbo);let u=this.techniques.get(b);i.bindTechnique(u,this.bindParameters,this._depthCompositionPassParameters),i.screen.draw(),this._compositionPassParameters.color=e.getTexture(),this._compositionPassParameters.splatColor=o.getTexture(),t?(l.acquireColor(w,8,`emissive`),this._compositionPassParameters.emission=e.getTexture(w)):this._compositionPassParameters.emission=null,i.bindFramebuffer(l.fbo);let d=this.techniques.get(_,this._compositionConfiguration);return i.bindTechnique(d,this.bindParameters,this._compositionPassParameters),i.screen.draw(),o.release(),l}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){let t=e||c;this._hasSameClipBox(t)||(s(this._clipBox,t),this._tileCullingRevision=d(this._tileCullingRevision,1),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get tileCullingRevision(){return this._tileCullingRevision}get _clippingEnabled(){return!l(this._clipBox,c,(e,t)=>e===t)}get _isIdle(){return this.view.state.mode===2}get _data(){return this.layerView.data}get _canRender(){return p(this._data)}get _fadeHelper(){return this.layerView.fadeHelper}_updateConfigurations(){this._configuration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.receiveShadows=this.bindParameters.shadowMap.ready,this._configuration.fragmentShading=this._configuration.receiveShadows&&this.view.stage.renderer.isFeatureEnabled(12),this._configuration.preciseDepth=m(this.bindParameters),this._configuration.hasShadowHighlights=this._configuration.receiveShadows&&this.bindParameters.hasShadowHighlights,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&this.bindParameters.slicePlane!=null}_onCameraChange(){this._tileCullingRevision=d(this._tileCullingRevision,1);let e=this.view.state.camera.ray.direction;this._cameraSortDirty=!0,(this._isIdle||this._shouldRequestSort(e))&&this._requestCameraSort(e)}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_requestCameraSort(e){this._data.requestSort(),i(this._previousSortRequestCameraDirection,e),this._cameraSortDirty=!1}_prepareParameters(){h(this._passParameters,this.layerView,this.bindParameters.camera)}_hasSameClipBox(e){return l(this._clipBox,e,(e,t)=>e===t)}_renderGaussianColorAndDepth(e,t){let n=this.renderingContext;e.acquireColor(w,5,`gaussian depth output`),n.bindFramebuffer(e.fbo),n.setClearColor(0,0,0,0),n.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(E.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}};e([n()],D.prototype,`consumes`,void 0),e([n()],D.prototype,`produces`,void 0),e([n({constructOnly:!0})],D.prototype,`layerView`,void 0),D=e([r(`esri.views.3d.webgl-engine.lib.GaussianSplatRenderer`)],D);export{D as GaussianSplatRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{EmissiveGlowConfiguration as n}from"../effects/glow/applyEmissiveGlow.glsl.js";class r extends n{constructor(){super(...arguments),this.hasEmissive=!1}}e([t()],r.prototype,`hasEmissive`,void 0);export{r as EmissiveTechniqueConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import"../../core/has.js";import n from"../../core/Logger.js";import r from"../../core/Queue.js";import{createScreenPoint as i}from"../../core/screenUtils.js";import{property as a,subclass as o}from"../../core/accessorSupport/decorators.js";import{primaryKey as s,isSystemModifier as c}from"./keys.js";import{LatestPen as l}from"./handlers/LatestPen.js";import{LatestPointer as u}from"./handlers/LatestPointer.js";import{MultiTouch as d}from"./handlers/MultiTouch.js";import{PropertiesPool as f}from"../support/PropertiesPool.js";class p{constructor(){this.id=0,this.type=`mouse`,this.location=i()}}class m{constructor(){this.tiltX=0,this.tiltY=0}}let h=class extends t{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=s,this._propertiesPool=new f({latestPointerInfo:()=>new p,latestPenInfo:()=>new m},this),this._latestPointerInfo=void 0,this._latestPenInfo=void 0,this._paused=!1,this._testTimestamp=void 0}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this.eventSource.onKeyModifierReceived=this._updateKeyModifiers.bind(this),this._installRecognizers()}destroy(){let e=Object.keys(this._nameToGroup);for(let t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(e=>e.handler.hasPendingInputs)}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get latestPointerInfo(){return this._latestPointerInfo}get latestPenInfo(){return this._latestPenInfo}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,t,n=_.INTERNAL){if(this._nameToGroup[e]||t.length===0)return;let r={name:e,handlers:t.map(e=>({handler:e,active:!0,removed:!1,priorityIndex:0,groupPriority:n,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[e]=r;for(let e=r.handlers.length-1;e>=0;e--){let t=r.handlers[e];this._handlers.push(t),t.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(e,n,r,i,a)=>{this._emitInputEvent(t.priorityIndex+1,e,n,r,a,i)},setPointerCapture:(e,n)=>{this._setPointerCapture(r,t,e,n)},setEventCallback:e=>{t.eventCallback=e},setUninstallCallback:e=>{t.uninstallCallback=e},refreshHasPendingInputs:()=>{this.notifyChange(`hasPendingInputs`)}})}this.updateDependencies()}uninstallHandlers(e){let t=this._nameToGroup[e];if(!t){n.getLogger(this).error("There is no InputHandler group registered under the name `"+e+"`");return}t.handlers.forEach(e=>{e.removed=!0,e.uninstallCallback?.()}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()}hasHandlers(e){return this._nameToGroup[e]!==void 0}isModifierKeyDown(e){return this._activeKeyModifiers.has(e)}updateDependencies(){if(this._currentPropagation){this._updateDependenciesAfterPropagation=!0;return}this._updateDependenciesAfterPropagation=!1;let e=new Set,t=new Set;this._handlersPriority=[];for(let e=this._handlers.length-1;e>=0;e--){let t=this._handlers[e];t.priorityIndex=e,this._handlersPriority.push(t)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let n=this._handlersPriority.length-1;n>=0;n--){let r=this._handlersPriority[n];r.priorityIndex=n;let i=r.handler.hasSideEffects;if(!i){for(let t of r.handler.outgoingEventTypes)if(e.has(t)){i=!0;break}}if(i)for(let n of r.handler.incomingEventMatches){e.add(n.eventType);for(let e of n.keyModifiers)c(e)||t.add(e)}r.active=i}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add(`pointer-capture-lost`),this._keyModifiers.size>0&&(this._sourceEvents.add(`key-down`),this._sourceEvents.add(`key-up`)),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents,this.eventSource.modifierKeys=this._keyModifiers)}_setLatestPointer(e,t,n,r){let i=this._latestPointerInfo;if(i==null||i.id!==e||i.type!==t||i.location.x!==n||i.location.y!==r){let i=this._propertiesPool.get(`latestPointerInfo`);i.id=e,i.type=t,i.location.x=n,i.location.y=r,this._latestPointerInfo=i}}_setLatestPen(e,t){let n=this._latestPenInfo,r=n!=null&&e===0&&t===0,i=r?n?.tiltX:e,a=r?n?.tiltY:t;if(i==null||a==null){n!=null&&(this._latestPenInfo=void 0);return}if(n==null||n.tiltX!==i||n.tiltY!==a){let e=this._propertiesPool.get(`latestPenInfo`);e.tiltX=i,e.tiltY=a,this._latestPenInfo=e}}_onEventReceived(e,t){if(e===`pointer-capture-lost`){let e=t;this._pointerCaptures.delete(e.native.pointerId)}this._updateKeyModifiers(e,t);let n=this._testTimestamp??t.native?.timestamp,r=t.native?.cancelable;this._emitInputEventFromSource(e,t,n,r)}_updateKeyModifiers(e,t){if(!t)return;let n=!1,r=()=>{n||=(this._activeKeyModifiers=new Set(this._activeKeyModifiers),!0)},i=(e,t)=>{t&&!this._activeKeyModifiers.has(e)?(r(),this._activeKeyModifiers.add(e)):!t&&this._activeKeyModifiers.has(e)&&(r(),this._activeKeyModifiers.delete(e))};if(e===`key-down`||e===`key-up`){let n=t.key;this._keyModifiers.has(n)&&i(n,e===`key-down`)}let a=t.native;i(`Alt`,!!a?.altKey),i(`Control`,!!a?.ctrlKey),i(`Ctrl`,!!a?.ctrlKey),i(`Shift`,!!a?.shiftKey),i(`Meta`,!!a?.metaKey),i(`Primary`,this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new u((e,t,n,r)=>this._setLatestPointer(e,t,n,r)),this._latestPenHandler=new l((e,t)=>this._setLatestPen(e,t)),this._multiTouchHandler=new d,this.installHandlers(`input-manager-logic`,[this._latestPointerHandler,this._latestPenHandler,this._multiTouchHandler],_.ALWAYS),this.recognizers.length>0&&this.installHandlers(`default`,this.recognizers,_.INTERNAL)}_setPointerCapture(e,t,n,r){let i=e.name+`-`+t.priorityIndex,a=this._pointerCaptures.get(n.pointerId)||new Set;this._pointerCaptures.set(n.pointerId,a),r?(a.add(i),a.size===1&&this.eventSource&&this.eventSource.setPointerCapture(n,!0)):a.has(i)&&(a.delete(i),a.size===0&&(this._pointerCaptures.delete(n.pointerId),this.eventSource&&this.eventSource.setPointerCapture(n,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(e=>!e.removed),this.updateDependencies()}_emitInputEventFromSource(e,t,n,r){this._emitInputEvent(0,e,t,n,r)}_emitInputEvent(e,t,n,r,i,a){let o=r??this._currentPropagation?.timestamp??performance.now(),s=i??!1,c={event:new g(t,n,o,a||this._activeKeyModifiers,s),priorityIndex:e};if(this._currentPropagation){this._currentPropagation.events.push(c);return}this._doNewPropagation(c)}_doNewPropagation(e){this._currentPropagation={events:new r,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){this._paused=!1;let e=this._currentPropagation;if(e){for(;e.events.length>0;){let{event:t,priorityIndex:n}=e.events.pop(),r=t.data?.eventId;if(!(r!=null&&this._stoppedPropagationEventIds.has(r)))for(e.currentHandler=this._handlersPriority[n];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!t.shouldStopPropagation()&&e.currentHandler.eventCallback?.(t),t.shouldStopPropagation()){r!=null&&this._stoppedPropagationEventIds.add(r);break}if(t.shouldPausePropagation(()=>this._continuePropagation())){this._pausePropagation({event:t,priorityIndex:e.currentHandler.priorityIndex+1});return}}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){let t=new r;t.push(e);let n=this._currentPropagation;if(n){for(;n.events.length;)t.push(n.events.pop());n.events=t,n.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(let n of e.handler.incomingEventMatches)for(let e of t.handler.incomingEventMatches){if(n.eventType!==e.eventType)continue;let t=n.keyModifiers.filter(t=>e.keyModifiers.includes(t));if(t.length===n.keyModifiers.length!=(t.length===e.keyModifiers.length))return n.keyModifiers.length>e.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){let t=[];for(let n of e){let e=0;for(;e<t.length&&this._compareHandlerPriority(n,t[e])>=0;)e++;t.splice(e,0,n)}return t}get test(){}};e([a({readOnly:!0})],h.prototype,`hasPendingInputs`,null),e([a({constructOnly:!0})],h.prototype,`eventSource`,void 0),e([a({constructOnly:!0})],h.prototype,`recognizers`,void 0),e([a()],h.prototype,`multiTouchActive`,null),e([a()],h.prototype,`_latestPointerInfo`,void 0),e([a()],h.prototype,`latestPointerInfo`,null),e([a()],h.prototype,`_latestPenInfo`,void 0),e([a()],h.prototype,`latestPenInfo`,null),e([a()],h.prototype,`_paused`,void 0),e([a({readOnly:!0})],h.prototype,`updating`,null),h=e([o(`esri.views.input.InputManager`)],h);class g{constructor(e,t,n,r,i){this.type=e,this.data=t,this.timestamp=n,this.modifiers=r,this.cancelable=i,this._propagationState=0,this._resumeCallback=null}stopPropagation(){this._propagationState|=1}shouldStopPropagation(){return!!(this._propagationState&1)}defer(e){this._propagationState|=2;let t=(e,t)=>{this._propagationState&=-3;let n=this._resumeCallback;if(this._resumeCallback=null,n&&n(),t)throw e;return e};return(typeof e==`function`?e():e).then(e=>t(e,!1),e=>t(e,!0))}shouldPausePropagation(e){return this._propagationState&2?(this._resumeCallback=e,!0):!1}preventDefault(){this.data.native.preventDefault()}}const _={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};export{h as InputManager,m as LatestPenInfo,p as LatestPointerInfo,_ as ViewEventPriorities};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import"../../core/has.js";import n from"../../core/Logger.js";import r from"../../core/Queue.js";import{createScreenPoint as i}from"../../core/screenUtils.js";import{property as a,subclass as o}from"../../core/accessorSupport/decorators.js";import{primaryKey as s,isSystemModifier as c}from"./keys.js";import{LatestPen as l}from"./handlers/LatestPen.js";import{LatestPointer as u}from"./handlers/LatestPointer.js";import{MultiTouch as d}from"./handlers/MultiTouch.js";import{PropertiesPool as f}from"../support/PropertiesPool.js";class p{constructor(){this.id=0,this.type=`mouse`,this.location=i()}}class m{constructor(){this.tiltX=0,this.tiltY=0}}let h=class extends t{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=s,this._propertiesPool=new f({latestPointerInfo:()=>new p,latestPenInfo:()=>new m},this),this._latestPointerInfo=void 0,this._latestPenInfo=void 0,this._paused=!1,this._testTimestamp=void 0}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this.eventSource.onKeyModifierReceived=this._updateKeyModifiers.bind(this),this._installRecognizers()}destroy(){let e=Object.keys(this._nameToGroup);for(let t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(e=>e.handler.hasPendingInputs)}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get latestPointerInfo(){return this._latestPointerInfo}get latestPenInfo(){return this._latestPenInfo}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,t,n=_.INTERNAL){if(this._nameToGroup[e]||t.length===0)return;let r={name:e,handlers:t.map(e=>({handler:e,active:!0,removed:!1,priorityIndex:0,groupPriority:n,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[e]=r;for(let e=r.handlers.length-1;e>=0;e--){let t=r.handlers[e];this._handlers.push(t),t.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(e,n,r,i,a)=>{this._emitInputEvent(t.priorityIndex+1,e,n,r,a,i)},setPointerCapture:(e,n)=>{this._setPointerCapture(r,t,e,n)},setEventCallback:e=>{t.eventCallback=e},setUninstallCallback:e=>{t.uninstallCallback=e},refreshHasPendingInputs:()=>{this.notifyChange(`hasPendingInputs`)}})}this.updateDependencies()}uninstallHandlers(e){let t=this._nameToGroup[e];if(!t){n.getLogger(this).error("There is no InputHandler group registered under the name `"+e+"`");return}t.handlers.forEach(e=>{e.removed=!0,e.uninstallCallback?.()}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()}hasHandlers(e){return this._nameToGroup[e]!==void 0}isModifierKeyDown(e){return this._activeKeyModifiers.has(e)}updateDependencies(){if(this._currentPropagation){this._updateDependenciesAfterPropagation=!0;return}this._updateDependenciesAfterPropagation=!1;let e=new Set,t=new Set;this._handlersPriority=[];for(let e=this._handlers.length-1;e>=0;e--){let t=this._handlers[e];t.priorityIndex=e,this._handlersPriority.push(t)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let n=this._handlersPriority.length-1;n>=0;n--){let r=this._handlersPriority[n];r.priorityIndex=n;let i=r.handler.hasSideEffects;if(!i){for(let t of r.handler.outgoingEventTypes)if(e.has(t)){i=!0;break}}if(i)for(let n of r.handler.incomingEventMatches){e.add(n.eventType);for(let e of n.keyModifiers)c(e)||t.add(e)}r.active=i}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add(`pointer-capture-lost`),this._keyModifiers.size>0&&(this._sourceEvents.add(`key-down`),this._sourceEvents.add(`key-up`)),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents,this.eventSource.modifierKeys=this._keyModifiers)}_setLatestPointer(e,t,n,r){let i=this._latestPointerInfo;if(i==null||i.id!==e||i.type!==t||i.location.x!==n||i.location.y!==r){let i=this._propertiesPool.get(`latestPointerInfo`);i.id=e,i.type=t,i.location.x=n,i.location.y=r,this._latestPointerInfo=i}}_setLatestPen(e,t){let n=this._latestPenInfo,r=n!=null&&e===0&&t===0,i=r?n?.tiltX:e,a=r?n?.tiltY:t;if(i==null||a==null){n!=null&&(this._latestPenInfo=void 0);return}if(n==null||n.tiltX!==i||n.tiltY!==a){let e=this._propertiesPool.get(`latestPenInfo`);e.tiltX=i,e.tiltY=a,this._latestPenInfo=e}}_onEventReceived(e,t){if(e===`pointer-capture-lost`){let e=t;this._pointerCaptures.delete(e.native.pointerId)}this._updateKeyModifiers(e,t);let n=`native`in t?t.native:void 0,r=this._testTimestamp??n?.timeStamp,i=n?.cancelable;this._emitInputEventFromSource(e,t,r,i)}_updateKeyModifiers(e,t){if(!t)return;let n=!1,r=()=>{n||=(this._activeKeyModifiers=new Set(this._activeKeyModifiers),!0)},i=(e,t)=>{t&&!this._activeKeyModifiers.has(e)?(r(),this._activeKeyModifiers.add(e)):!t&&this._activeKeyModifiers.has(e)&&(r(),this._activeKeyModifiers.delete(e))};if(e===`key-down`||e===`key-up`){let n=t.key;this._keyModifiers.has(n)&&i(n,e===`key-down`)}let a=t.native;i(`Alt`,!!a?.altKey),i(`Control`,!!a?.ctrlKey),i(`Ctrl`,!!a?.ctrlKey),i(`Shift`,!!a?.shiftKey),i(`Meta`,!!a?.metaKey),i(`Primary`,this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new u((e,t,n,r)=>this._setLatestPointer(e,t,n,r)),this._latestPenHandler=new l((e,t)=>this._setLatestPen(e,t)),this._multiTouchHandler=new d,this.installHandlers(`input-manager-logic`,[this._latestPointerHandler,this._latestPenHandler,this._multiTouchHandler],_.ALWAYS),this.recognizers.length>0&&this.installHandlers(`default`,this.recognizers,_.INTERNAL)}_setPointerCapture(e,t,n,r){let i=e.name+`-`+t.priorityIndex,a=this._pointerCaptures.get(n.pointerId)||new Set;this._pointerCaptures.set(n.pointerId,a),r?(a.add(i),a.size===1&&this.eventSource&&this.eventSource.setPointerCapture(n,!0)):a.has(i)&&(a.delete(i),a.size===0&&(this._pointerCaptures.delete(n.pointerId),this.eventSource&&this.eventSource.setPointerCapture(n,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(e=>!e.removed),this.updateDependencies()}_emitInputEventFromSource(e,t,n,r){this._emitInputEvent(0,e,t,n,r)}_emitInputEvent(e,t,n,r,i,a){let o=r??this._currentPropagation?.timestamp??performance.now(),s=i??!1,c={event:new g(t,n,o,a||this._activeKeyModifiers,s),priorityIndex:e};if(this._currentPropagation){this._currentPropagation.events.push(c);return}this._doNewPropagation(c)}_doNewPropagation(e){this._currentPropagation={events:new r,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){this._paused=!1;let e=this._currentPropagation;if(e){for(;e.events.length>0;){let{event:t,priorityIndex:n}=e.events.pop(),r=t.data?.eventId;if(!(r!=null&&this._stoppedPropagationEventIds.has(r)))for(e.currentHandler=this._handlersPriority[n];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!t.shouldStopPropagation()&&e.currentHandler.eventCallback?.(t),t.shouldStopPropagation()){r!=null&&this._stoppedPropagationEventIds.add(r);break}if(t.shouldPausePropagation(()=>this._continuePropagation())){this._pausePropagation({event:t,priorityIndex:e.currentHandler.priorityIndex+1});return}}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){let t=new r;t.push(e);let n=this._currentPropagation;if(n){for(;n.events.length;)t.push(n.events.pop());n.events=t,n.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(let n of e.handler.incomingEventMatches)for(let e of t.handler.incomingEventMatches){if(n.eventType!==e.eventType)continue;let t=n.keyModifiers.filter(t=>e.keyModifiers.includes(t));if(t.length===n.keyModifiers.length!=(t.length===e.keyModifiers.length))return n.keyModifiers.length>e.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){let t=[];for(let n of e){let e=0;for(;e<t.length&&this._compareHandlerPriority(n,t[e])>=0;)e++;t.splice(e,0,n)}return t}get test(){}};e([a({readOnly:!0})],h.prototype,`hasPendingInputs`,null),e([a({constructOnly:!0})],h.prototype,`eventSource`,void 0),e([a({constructOnly:!0})],h.prototype,`recognizers`,void 0),e([a()],h.prototype,`multiTouchActive`,null),e([a()],h.prototype,`_latestPointerInfo`,void 0),e([a()],h.prototype,`latestPointerInfo`,null),e([a()],h.prototype,`_latestPenInfo`,void 0),e([a()],h.prototype,`latestPenInfo`,null),e([a()],h.prototype,`_paused`,void 0),e([a({readOnly:!0})],h.prototype,`updating`,null),h=e([o(`esri.views.input.InputManager`)],h);class g{constructor(e,t,n,r,i){this.type=e,this.data=t,this.timestamp=n,this.modifiers=r,this.cancelable=i,this._propagationState=0,this._resumeCallback=null}stopPropagation(){this._propagationState|=1}shouldStopPropagation(){return!!(this._propagationState&1)}defer(e){this._propagationState|=2;let t=(e,t)=>{this._propagationState&=-3;let n=this._resumeCallback;if(this._resumeCallback=null,n&&n(),t)throw e;return e};return(typeof e==`function`?e():e).then(e=>t(e,!1),e=>t(e,!0))}shouldPausePropagation(e){return this._propagationState&2?(this._resumeCallback=e,!0):!1}preventDefault(){this.data.native.preventDefault()}}const _={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};export{h as InputManager,m as LatestPenInfo,p as LatestPointerInfo,_ as ViewEventPriorities};
|
|
@@ -42,9 +42,17 @@ export default abstract class LayerView extends LayerViewSuperclass {
|
|
|
42
42
|
*/
|
|
43
43
|
get spatialReferenceSupported(): boolean;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
45
|
+
* Indicates whether the layer view is suspended. While suspended, the layer is not rendered
|
|
46
|
+
* in the associated view and is excluded from the results of the
|
|
47
|
+
* [Map](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/#hitTest)
|
|
48
|
+
* and [Scene](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-scene/#hitTest)
|
|
49
|
+
* component's `hitTest()` methods.
|
|
47
50
|
*
|
|
51
|
+
* Data already loaded by the layer view may be retained for reuse when the layer view is no longer suspended.
|
|
52
|
+
*
|
|
53
|
+
* @see [visible](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/#visible)
|
|
54
|
+
* @see [visibleAtCurrentScale](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/#visibleAtCurrentScale)
|
|
55
|
+
* @see [visibleAtCurrentTimeExtent](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/#visibleAtCurrentTimeExtent)
|
|
48
56
|
* @see [spatialReferenceSupported](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/#spatialReferenceSupported)
|
|
49
57
|
*/
|
|
50
58
|
get suspended(): boolean;
|
|
@@ -2,7 +2,7 @@ import type Graphic from "../../../Graphic.js";
|
|
|
2
2
|
import type Field from "../../../layers/support/Field.js";
|
|
3
3
|
import type EditableInput from "./EditableInput.js";
|
|
4
4
|
import type GroupInput from "./GroupInput.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { InputUnion } from "../../../form/elements/inputs/types.js";
|
|
6
6
|
import type { FieldValue } from "../../../layers/support/fieldUtils.js";
|
|
7
7
|
import type { NumericRange } from "../../../layers/support/NumericRange.js";
|
|
8
8
|
import type { DomainUnion as Domain } from "../../../layers/support/types.js";
|
|
@@ -68,7 +68,7 @@ export default class FieldInput extends EditableInput<any> {
|
|
|
68
68
|
*/
|
|
69
69
|
get includeTimeOffset(): boolean;
|
|
70
70
|
/** The configured input for this field. */
|
|
71
|
-
get input():
|
|
71
|
+
get input(): InputUnion | null | undefined;
|
|
72
72
|
/** @internal */
|
|
73
73
|
accessor inputController: InputController | null;
|
|
74
74
|
/** An array of features that do not have a valid value for this field. */
|
|
@@ -26,10 +26,10 @@ import type { SketchTooltipOptionsProperties } from "../../views/interactive/ske
|
|
|
26
26
|
import type { SketchValueOptionsProperties } from "../../views/interactive/sketch/SketchValueOptions.js";
|
|
27
27
|
|
|
28
28
|
export interface EditorViewModelProperties extends Partial<Pick<EditorViewModel, "formSystem" | "layerInfos" | "selectionManager" | "syncViewSelection" | "useLegacyCreateTools" | "useViewOptions" | "view">> {
|
|
29
|
-
/** The [AttachmentsViewModel]
|
|
29
|
+
/** The [AttachmentsViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Attachments/AttachmentsViewModel/) for supporting the editor widget. Attachment editing is enabled by default if the layer has support for it. */
|
|
30
30
|
attachmentsViewModel?: AttachmentsViewModelProperties;
|
|
31
31
|
/**
|
|
32
|
-
* The [FeatureTemplatesViewModel]
|
|
32
|
+
* The [FeatureTemplatesViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTemplates/FeatureTemplatesViewModel/)
|
|
33
33
|
* for supporting the editor widget.
|
|
34
34
|
*/
|
|
35
35
|
featureTemplatesViewModel?: FeatureTemplatesViewModelProperties;
|
|
@@ -145,7 +145,7 @@ export default class EditorViewModel extends EventedAccessor {
|
|
|
145
145
|
* @see [Sample - Popup with edit action](https://developers.arcgis.com/javascript/latest/sample-code/popup-editaction/)
|
|
146
146
|
*/
|
|
147
147
|
get activeWorkflow(): CreateFeaturesWorkflow | UpdateWorkflow | null | undefined;
|
|
148
|
-
/** The [AttachmentsViewModel]
|
|
148
|
+
/** The [AttachmentsViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Attachments/AttachmentsViewModel/) for supporting the editor widget. Attachment editing is enabled by default if the layer has support for it. */
|
|
149
149
|
get attachmentsViewModel(): AttachmentsViewModel;
|
|
150
150
|
set attachmentsViewModel(value: AttachmentsViewModelProperties);
|
|
151
151
|
/** Convenience property that indicates at least one layer supports a `create-features` workflow. */
|
|
@@ -167,12 +167,13 @@ export default class EditorViewModel extends EventedAccessor {
|
|
|
167
167
|
*/
|
|
168
168
|
get failures(): FailedOperation[];
|
|
169
169
|
/**
|
|
170
|
-
* The [FeatureFormViewModel]
|
|
171
|
-
*
|
|
170
|
+
* The [FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/FeatureFormViewModel/) for supporting the editor widget.
|
|
171
|
+
*
|
|
172
|
+
* @deprecated since 5.2. Please use [formViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/EditorViewModel/#formViewModel) instead.
|
|
172
173
|
*/
|
|
173
174
|
get featureFormViewModel(): FeatureFormViewModel | null | undefined;
|
|
174
175
|
/**
|
|
175
|
-
* The [FeatureTemplatesViewModel]
|
|
176
|
+
* The [FeatureTemplatesViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTemplates/FeatureTemplatesViewModel/)
|
|
176
177
|
* for supporting the editor widget.
|
|
177
178
|
*/
|
|
178
179
|
get featureTemplatesViewModel(): FeatureTemplatesViewModel;
|
|
@@ -189,8 +190,8 @@ export default class EditorViewModel extends EventedAccessor {
|
|
|
189
190
|
accessor formSystem: "legacy" | "next";
|
|
190
191
|
/**
|
|
191
192
|
* The form's view model used to support the Editor widget.
|
|
192
|
-
* This can be either the [BatchAttributeFormViewModel]
|
|
193
|
-
* or the [FeatureFormViewModel]
|
|
193
|
+
* This can be either the [BatchAttributeFormViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/BatchAttributeFormViewModel/)
|
|
194
|
+
* or the [FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/FeatureFormViewModel/) and is dependent on the active workflow.
|
|
194
195
|
*
|
|
195
196
|
* @since 4.33
|
|
196
197
|
*/
|
|
@@ -247,10 +248,7 @@ export default class EditorViewModel extends EventedAccessor {
|
|
|
247
248
|
* @since 5.0
|
|
248
249
|
*/
|
|
249
250
|
accessor selectionManager: SelectionManager | null | undefined;
|
|
250
|
-
/**
|
|
251
|
-
* The [SketchViewModel][SketchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/)
|
|
252
|
-
* for supporting the editor widget.
|
|
253
|
-
*/
|
|
251
|
+
/** The [SketchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/) for supporting the editor widget. */
|
|
254
252
|
get sketchViewModel(): SketchViewModel | null | undefined;
|
|
255
253
|
/**
|
|
256
254
|
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/) for sketching. It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/#selfEnabled) and [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/#featureEnabled) snapping.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{types as r}from"../../../form/elements/inputs.js";const i=i=>{let a=i,o=class extends a{constructor(){super(...arguments),this.editable=!0,this.hint=null,this.input=null,this.required=!1}};return e([t({type:Boolean,json:{write:!0}})],o.prototype,`editable`,void 0),e([t({type:String,json:{write:!0}})],o.prototype,`hint`,void 0),e([t({types:r,json:{read:{source:`inputType`},write:{target:`inputType`}}})],o.prototype,`input`,void 0),e([t()],o.prototype,`required`,void 0),o=e([n(`esri.widgets.FeatureTable.support.EditableColumnTemplateMixin`)],o),o};export{i as EditableColumnTemplateMixin};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{types as r}from"../../../form/elements/inputs/inputUtils.js";const i=i=>{let a=i,o=class extends a{constructor(){super(...arguments),this.editable=!0,this.hint=null,this.input=null,this.required=!1}};return e([t({type:Boolean,json:{write:!0}})],o.prototype,`editable`,void 0),e([t({type:String,json:{write:!0}})],o.prototype,`hint`,void 0),e([t({types:r,json:{read:{source:`inputType`},write:{target:`inputType`}}})],o.prototype,`input`,void 0),e([t()],o.prototype,`required`,void 0),o=e([n(`esri.widgets.FeatureTable.support.EditableColumnTemplateMixin`)],o),o};export{i as EditableColumnTemplateMixin};
|
|
@@ -84,7 +84,7 @@ export interface HistogramRangeSliderEvents extends CommonSliderEvents {}
|
|
|
84
84
|
*
|
|
85
85
|
* At a minimum, the slider's [container](https://developers.arcgis.com/javascript/latest/references/core/widgets/HistogramRangeSlider/#container) or parent container must have a `width` set in css for it to render.
|
|
86
86
|
*
|
|
87
|
-
* @deprecated since version 5.0. Use the [arcgis-slider-histogram-range](
|
|
87
|
+
* @deprecated since version 5.0. Use the [arcgis-slider-histogram-range](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-histogram-range/) component instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
|
|
88
88
|
* @since 4.12
|
|
89
89
|
* @see [Histogram](https://developers.arcgis.com/javascript/latest/references/core/widgets/Histogram/)
|
|
90
90
|
* @see [Slider](https://developers.arcgis.com/javascript/latest/references/core/widgets/Slider/)
|