@arcgis/core 5.1.0-next.134 → 5.1.0-next.136
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/WebScene.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/073ee52705ea326fecfb.js +1 -0
- package/assets/esri/core/workers/chunks/{282930645ce525d5bc92.js → 0e81b6aa64d5491870b2.js} +1 -1
- package/assets/esri/core/workers/chunks/11d1af758e2140095b10.js +1 -0
- package/assets/esri/core/workers/chunks/{81cd819c236066dc1654.js → 2ed81f1e490cb7e73405.js} +1 -1
- package/assets/esri/core/workers/chunks/2ef80e003b4f0393ac2e.js +1 -0
- package/assets/esri/core/workers/chunks/{ef8bb03a67004dd8959a.js → 312676c9027684a08107.js} +1 -1
- package/assets/esri/core/workers/chunks/31c4128b23968575feca.js +1 -0
- package/assets/esri/core/workers/chunks/{4517630bf869205bab87.js → 38a76bc4ef5c10ab0488.js} +1 -1
- package/assets/esri/core/workers/chunks/3a526e1d18490b99332f.js +1 -0
- package/assets/esri/core/workers/chunks/3e89f487c5851c954d8b.js +1 -0
- package/assets/esri/core/workers/chunks/{268243ee64d001009f78.js → 3ebe99f512c34cc93fe9.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1851278e993b7130cd5.js → 3f454b3d6424e206755f.js} +1 -1
- package/assets/esri/core/workers/chunks/44c38c10489e11ff5d8e.js +1 -0
- package/assets/esri/core/workers/chunks/{2f5970e87e1e77f8362b.js → 45922ec95c7fb704bae1.js} +1 -1
- package/assets/esri/core/workers/chunks/5468a65698931603656d.js +1 -0
- package/assets/esri/core/workers/chunks/{8bd5abb68a546d1e0525.js → 5b83893a58529ef5f08b.js} +1 -1
- package/assets/esri/core/workers/chunks/5d710b3e50f2211a765d.js +1 -0
- package/assets/esri/core/workers/chunks/5f0bc019add4aff3130c.js +1 -0
- package/assets/esri/core/workers/chunks/6121cd0264b6841a5bac.js +1 -0
- package/assets/esri/core/workers/chunks/{dfb19701b488089874fd.js → 6649acaceab00ad30e7f.js} +1 -1
- package/assets/esri/core/workers/chunks/6849282c4a5cd733779d.js +1 -0
- package/assets/esri/core/workers/chunks/{35e9635784595b1d6635.js → 7197972041f5700c235d.js} +1 -1
- package/assets/esri/core/workers/chunks/{317bf48a4d513a9a2ff3.js → 786905f34da9cdad53f0.js} +2 -2
- package/assets/esri/core/workers/chunks/{169bfafec4d59be2beb0.js → 790462ab5f21491a4f75.js} +1 -1
- package/assets/esri/core/workers/chunks/{a8ef7acb6d3d1f45e14c.js → 87011d2fe14c54e296af.js} +1 -1
- package/assets/esri/core/workers/chunks/{851fc5290497991ba001.js → 88df19742edb0cdc3e67.js} +1 -1
- package/assets/esri/core/workers/chunks/{7361ca78a605eda41a2f.js → 897a856c00b2b828efe9.js} +2 -2
- package/assets/esri/core/workers/chunks/8a88146de5b12fd4dcd8.js +1 -0
- package/assets/esri/core/workers/chunks/{9b914d04c228b02fde2d.js → 934cd06318b69f37d72b.js} +1 -1
- package/assets/esri/core/workers/chunks/93b40245378ced43ca08.js +1 -0
- package/assets/esri/core/workers/chunks/98dfe31e8ed9b522eaff.js +1 -0
- package/assets/esri/core/workers/chunks/{35c4037b8eea067d9638.js → 98f64d9ca6f2a76cf916.js} +7 -7
- package/assets/esri/core/workers/chunks/9ad36947bb42ed7f97d3.js +1 -0
- package/assets/esri/core/workers/chunks/{530cf0964d55410ffb56.js → 9bcebaf0d0e43db0b07f.js} +2 -2
- package/assets/esri/core/workers/chunks/{91c0de3950991d81b7f2.js → 9de673a04c70bd47047e.js} +1 -1
- package/assets/esri/core/workers/chunks/9e0ea6c34940b1acf3c6.js +1 -0
- package/assets/esri/core/workers/chunks/a195f569eada3a8736be.js +1 -0
- package/assets/esri/core/workers/chunks/{ac7ecd90330090c90005.js → a40ede4d3375184f21fe.js} +1 -1
- package/assets/esri/core/workers/chunks/a533d066cac26124c5ce.js +1 -0
- package/assets/esri/core/workers/chunks/a536904fe6f3b16fdbdc.js +1 -0
- package/assets/esri/core/workers/chunks/a8167ab9fd846d699be5.js +1 -0
- package/assets/esri/core/workers/chunks/{b4eb102f35315bfd6966.js → a856ae928273f9d6792f.js} +1 -1
- package/assets/esri/core/workers/chunks/aec46ec486912dca549d.js +1 -0
- package/assets/esri/core/workers/chunks/b0e4af49fc968b0a910f.js +1 -0
- package/assets/esri/core/workers/chunks/{77d896325dffe574d248.js → b3be96d5f3f6b4342907.js} +1 -1
- package/assets/esri/core/workers/chunks/b466af9019f10420115e.js +1 -0
- package/assets/esri/core/workers/chunks/bf9eca7dd107bdb06614.js +1 -0
- package/assets/esri/core/workers/chunks/c0528b4590e083e2c1ff.js +1 -0
- package/assets/esri/core/workers/chunks/c9b212fe844ab918127f.js +1 -0
- package/assets/esri/core/workers/chunks/cbe8adc100582e746a8c.js +1 -0
- package/assets/esri/core/workers/chunks/d2387906b52624b4f7f1.js +1 -0
- package/assets/esri/core/workers/chunks/{a1509e2e7809b6754b4f.js → d523af1db620b5381c99.js} +1 -1
- package/assets/esri/core/workers/chunks/d670e134348954ce465d.js +1 -0
- package/assets/esri/core/workers/chunks/d8329c2000c0cc597adc.js +1 -0
- package/assets/esri/core/workers/chunks/dee339774131d7274137.js +1 -0
- package/assets/esri/core/workers/chunks/e006d1c26ae234f5b086.js +1 -0
- package/assets/esri/core/workers/chunks/{e5b57c43b5e0b1d5ccdd.js → f170d80c5930db1d630e.js} +2 -2
- package/assets/esri/core/workers/chunks/{2d7a4b669804d0c5029b.js → f1ff33584680d8718400.js} +1 -1
- package/assets/esri/core/workers/chunks/{c538435216d253f7702e.js → f23351a04643c464be84.js} +1 -1
- package/assets/esri/core/workers/chunks/f3d331da3c61af5c5a2f.js +1 -0
- package/assets/esri/core/workers/chunks/{68b77b36daae2b4b4237.js → f3fe865506fd7428eb6d.js} +1 -1
- package/assets/esri/core/workers/chunks/{0418b5c9d06f3585c035.js → f6987cacbc55a68ec7ef.js} +2 -2
- package/assets/esri/core/workers/chunks/{95b34718081a71bf0681.js → feacdcf0ba9ea58f1616.js} +1 -1
- package/assets/esri/core/workers/chunks/{da7f85916ae799950317.js → fee50ab6c92ef0327255.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/OITBlendEmission.glsl.js +2 -21
- package/chunks/bundle2.js +1 -1
- package/config.js +1 -1
- package/geometry/support/geometryUtils.js +1 -1
- package/geometry/support/intersects.js +1 -1
- package/geometry/support/intersectsBase.js +1 -1
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +46 -3
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +39 -0
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/DimensionLayer.d.ts +1 -0
- package/layers/FeatureLayer.js +1 -1
- package/layers/GaussianSplatLayer.d.ts +1 -2
- package/layers/IntegratedMesh3DTilesLayer.d.ts +9 -1
- package/layers/ParquetLayer.d.ts +6 -10
- package/layers/VideoLayer.js +1 -1
- package/layers/graphics/data/attributeSupport.js +1 -1
- package/layers/graphics/data/queryValidationUtils.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/raster/datasets/WCSRaster.js +1 -1
- package/layers/support/AnnotationFeatureSublayer.d.ts +5 -3
- package/layers/support/SymbolLayerDrawing.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/fetchService.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/package.json +2 -2
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/loadUtils.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/portal/support/resourceUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/SimpleMarkerSymbol.d.ts +2 -2
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/views/2d/engine/transitions/FadeTransition.js +1 -1
- package/views/2d/engine/webgl/FeatureTile.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/TileCpuState.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendEmission.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/oitBlendFragment.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/View2D.d.ts +2 -2
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +6 -6
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/support/attachmentUtils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/support/panConstraint.js +2 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Print/CustomTemplate.d.ts +7 -0
- package/widgets/Search/LayerSearchSource.d.ts +3 -0
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/assets/esri/core/workers/chunks/01ba5319cac3e0f14205.js +0 -1
- package/assets/esri/core/workers/chunks/05e1f1628a3726eca03d.js +0 -1
- package/assets/esri/core/workers/chunks/0c13591347d51d684561.js +0 -1
- package/assets/esri/core/workers/chunks/1d38b2fcd85ac9ebd7c6.js +0 -1
- package/assets/esri/core/workers/chunks/1effde6a39ef0d4af525.js +0 -1
- package/assets/esri/core/workers/chunks/1ff57bf19f021f5fd246.js +0 -1
- package/assets/esri/core/workers/chunks/2b781de7b467c61849b2.js +0 -1
- package/assets/esri/core/workers/chunks/3d4ad7c728e02aa90551.js +0 -1
- package/assets/esri/core/workers/chunks/3dc6e9494af16f7b8009.js +0 -1
- package/assets/esri/core/workers/chunks/3ecb906322a6a5c8c93b.js +0 -1
- package/assets/esri/core/workers/chunks/3f67162456a1f02190fa.js +0 -1
- package/assets/esri/core/workers/chunks/48a59c621477f9bac915.js +0 -1
- package/assets/esri/core/workers/chunks/53c8062f4573fa64c49d.js +0 -1
- package/assets/esri/core/workers/chunks/609edb4da427ec37bcf7.js +0 -1
- package/assets/esri/core/workers/chunks/6f5a82388a5eb5fcf1b7.js +0 -1
- package/assets/esri/core/workers/chunks/7c61b18e43c789aaecc6.js +0 -1
- package/assets/esri/core/workers/chunks/85505a8b8b0794656d06.js +0 -1
- package/assets/esri/core/workers/chunks/92b60ec8033eb8dc2b44.js +0 -1
- package/assets/esri/core/workers/chunks/93d08d82ceab19e314f8.js +0 -1
- package/assets/esri/core/workers/chunks/9802770413ad814dab29.js +0 -1
- package/assets/esri/core/workers/chunks/9da1a514e042eb642d35.js +0 -1
- package/assets/esri/core/workers/chunks/a0876a52a3c2ad849370.js +0 -1
- package/assets/esri/core/workers/chunks/a892b3be70f482bef0ba.js +0 -1
- package/assets/esri/core/workers/chunks/b0212df1fe8d9448f3d6.js +0 -1
- package/assets/esri/core/workers/chunks/b590402170ae289290d7.js +0 -1
- package/assets/esri/core/workers/chunks/bdb2077d25525853975f.js +0 -1
- package/assets/esri/core/workers/chunks/bf67e0f6064fb9d94ac8.js +0 -1
- package/assets/esri/core/workers/chunks/bfa6f4c08e7571bb1f37.js +0 -1
- package/assets/esri/core/workers/chunks/cf41a66fb97c1076fb34.js +0 -1
- package/assets/esri/core/workers/chunks/cf9a132c4c37e62de3d7.js +0 -1
- package/assets/esri/core/workers/chunks/e5471373f89fd7cb9844.js +0 -1
- package/assets/esri/core/workers/chunks/f23e995320674b32e142.js +0 -1
- package/assets/esri/core/workers/chunks/fa1336b60278017d2525.js +0 -1
- package/assets/esri/core/workers/chunks/fad4ce7392b89c606656.js +0 -1
- /package/assets/esri/core/workers/chunks/{317bf48a4d513a9a2ff3.js.LICENSE.txt → 786905f34da9cdad53f0.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{7361ca78a605eda41a2f.js.LICENSE.txt → 897a856c00b2b828efe9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{530cf0964d55410ffb56.js.LICENSE.txt → 9bcebaf0d0e43db0b07f.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{0418b5c9d06f3585c035.js.LICENSE.txt → f170d80c5930db1d630e.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{e5b57c43b5e0b1d5ccdd.js.LICENSE.txt → f6987cacbc55a68ec7ef.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{some as r}from"../../../core/iteratorUtils.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as n}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as a,syncAndInitial as m,on as c}from"../../../core/reactiveUtils.js";import{isScreenRect as h}from"../../../core/screenUtils.js";import{property as p,subclass as d}from"../../../core/accessorSupport/decorators.js";import u from"../../../geometry/Extent.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as f}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as y}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as j}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/Accessor.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import _ from"../tiling/TileQueue.js";import w from"../tiling/TileStrategy.js";import v from"../engine/webgl/Overlay.js";import b from"../engine/webgl/OverlayContainer.js";import{LayerView2D as E}from"./LayerView2D.js";import S from"../../layers/MediaLayerView.js";import{TaskPriority as R}from"../../support/Scheduler.js";let T=class extends(E(S)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new l,this._debugGraphicsView=null,this._interaction=null,this.elements=new t}initialize(){this.addHandles([a(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await this._updatingHandles.addPromise(import("./support/MediaLayerInteraction.js"));if(this.destroyed)return;this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},m),a(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},m),a(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},m)])}isUpdating(){return!0===this._interaction?.updating||r(this._elementReferences.values(),({overlay:e})=>!e.isReady)}attach(){this.addAttachHandles([c(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),c(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new b,this.container.addChild(this._overlayContainer),this._fetchQueue=new _({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:R.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new w({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y];for(const{elementView:{normalizedCoords:n,element:o}}of this._elementReferences.values())null!=n&&f(n.rings,s)&&i.push({type:"media",element:o,layer:this.layer,mapPoint:h(t)?null:e,sourcePoint:o.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new V(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.consumePromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(G,e,!0);const r=new u({xmin:G[0],ymin:G[1],xmax:G[2],ymax:G[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){n(this._elementReferences,t.uid,()=>{const e=new j({element:t,spatialReference:this.view.spatialReference}),r=new v(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.consumePromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const r=[],s=[];for(const e of this._tileStrategy.tiles){const n=C(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?n||s.push(e):n&&r.push(e)}for(const t of r)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new j({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const r of this._tileStrategy.tiles){C(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}}};e([p({readOnly:!0})],T.prototype,"elements",void 0),T=e([d("esri.views.2d.layers.MediaLayerView2D")],T);const G=g(),U={xmin:0,ymin:0,xmax:0,ymax:0};function C(e,t,i){return e.getTileBounds(G,t.key,!0),U.xmin=G[0],U.ymin=G[1],U.xmax=G[2],U.ymax=G[3],y(U,i)}class V{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const r of e)i.has(r)?i.delete(r):t.push(r);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const q=T;export{q as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{some as r}from"../../../core/iteratorUtils.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{isAbortError as n}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as a,syncAndInitial as m,on as c}from"../../../core/reactiveUtils.js";import{isScreenRect as p}from"../../../core/screenUtils.js";import{property as h,subclass as d}from"../../../core/accessorSupport/decorators.js";import u from"../../../geometry/Extent.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as f}from"../../../geometry/support/contains.js";import{targetIntersectsPolygon as y,extentIntersectsPolygon as j}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as _}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/Accessor.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import v from"../tiling/TileStrategy.js";import b from"../engine/webgl/Overlay.js";import S from"../engine/webgl/OverlayContainer.js";import{LayerView2D as E}from"./LayerView2D.js";import{getMapPointsFromScreen as T}from"../support/hitTestUtils.js";import R from"../../layers/MediaLayerView.js";import{TaskPriority as U}from"../../support/Scheduler.js";let G=class extends(E(R)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new l,this._debugGraphicsView=null,this._interaction=null,this.elements=new t}initialize(){this.addHandles([a(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await this._updatingHandles.addPromise(import("./support/MediaLayerInteraction.js"));if(this.destroyed)return;this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},m),a(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},m),a(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},m)])}isUpdating(){return!0===this._interaction?.updating||r(this._elementReferences.values(),({overlay:e})=>!e.isReady)}attach(){this.addAttachHandles([c(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),c(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new S,this.container.addChild(this._overlayContainer),this._fetchQueue=new w({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:U.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new v({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y],o=p(t);for(const{elementView:{normalizedCoords:n,element:l}}of this._elementReferences.values())if(o){const r=T(this.view,t).map(e=>[e.x,e.y]);null!=n&&y(r,n.rings)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:null,sourcePoint:l.toSource(e)})}else null!=n&&f(n.rings,s)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:e,sourcePoint:l.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new x(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.consumePromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},e=>{n(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(C,e,!0);const r=new u({xmin:C[0],ymin:C[1],xmax:C[2],ymax:C[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){o(this._elementReferences,t.uid,()=>{const e=new _({element:t,spatialReference:this.view.spatialReference}),r=new b(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.consumePromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const r=[],s=[];for(const e of this._tileStrategy.tiles){const o=q(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||s.push(e):o&&r.push(e)}for(const t of r)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new _({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const r of this._tileStrategy.tiles){q(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}}};e([h({readOnly:!0})],G.prototype,"elements",void 0),G=e([d("esri.views.2d.layers.MediaLayerView2D")],G);const C=g(),V={xmin:0,ymin:0,xmax:0,ymax:0};function q(e,t,i){return e.getTileBounds(C,t.key,!0),V.xmin=C[0],V.ymin=C[1],V.xmax=C[2],V.ymax=C[3],j(V,i)}class x{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const r of e)i.has(r)?i.delete(r):t.push(r);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const M=G;export{M as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{signal as s}from"../../../../core/signal.js";import{AFeatureContainer as r}from"../../engine/AFeatureContainer.js";import{effectFlag0 as i,filterFlag0 as n}from"../../engine/webgl/definitions.js";import a from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as l}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{FeatureTilePresentStrategy as o}from"./FeatureTilePresentStrategy.js";import{RenderState as d}from"./RenderState.js";import{renderHighlight as h}from"../support/util.js";import{createHittestQuery as u}from"../../support/hitTestUtils.js";class c{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class p{constructor(e){this.level=e,this.id=performance.now(),this.messages=[],this.resolver=Promise.withResolvers()}}class _{constructor(e,t){this.id=e,this.version=t}}class f extends r{constructor(e){super(e.view.featuresTilingScheme),this.referenceScale=null,this._updatingChildren=s(!1),this._hitTestsRequests=[],this._renderState=s(null),this._renderStateNext=s(null),this._store=new a,this._subscriptions=new Map,this._presentation=new o,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._supportsInstanceCleanup=!0,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){super.destroy(),this._renderState.value=e(this._renderState.value),this._renderStateNext.value=e(this._renderStateNext.value)}get batching(){return has("featurelayer-strict-draw-order")?1:has("featurelayer-force-marker-text-draw-order")?2:0}get updating(){const e=this._updatingChildren.value,t=!this._renderState.value||this._renderState.value.updating,s=!!this._renderStateNext.value,r=this.attributeView.updating;return e||t||s||r}subscriptions(){return this._subscriptions.values()}get hasLabels(){return null!==this.labelSchema}get hasHighlight(){return this._layerView.hasHighlight}get children(){return this._renderState.value?this._renderState.value.tiles().filter(e=>e.presenting):[]}get usedMemory(){let e=0;return this._renderState.value&&(e+=this._renderState.value.usedMemory),this._renderStateNext.value&&(e+=this._renderStateNext.value.usedMemory),e+=this.attributeView.usedMemory,e}get instanceStore(){return this._store}get labelingCollisionInfos(){if(!this._deconflictionInfo)throw new Error("InternalError: DeconflictionInfo not defined. Was update called?");return this._deconflictionInfo}get labelSchema(){return this._schema?.mesh.factory.labels??null}get layerOrder(){return this._layerView.view.allLayerViews.items.indexOf(this._layerView)}get tiles(){return this._renderState.value?.tiles()}get requiresRefresh(){return!!this._renderState.value?.requiresRefresh}get _instanceStore(){return this._store}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&l.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(v(t))return t;return null}update(e,t){this._schema=e,this._deconflictionInfo=t}setCoverage(e){this._presentation.updateCoverage(e)}getPresenting(){const e=new Set;for(const t of this._renderState.value?.tiles()??[])t.presenting&&e.add(t.id);return e}beforeRender(e){if(super.beforeRender(e),this._renderState.value){for(const t of this._renderState.value.tiles())t.setTransform(e.state);if(!e.decluttering){this._presentation.update(this._renderState.value.tiles());for(const e of this._renderState.value.tiles())e.upload(this._instanceStore,this.batching)}this._updatingChildren.value=!this.children.every(e=>e.ended&&e.presenting)}}renderChildren(e){switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 16:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}afterRender(e){super.afterRender(e),e.decluttering||(this._handleNextLevelUpdate(),this._finializeUpdate(),this._updateAttributeView(),this._handleSwapRenderState(),this._renderState.value?.update(this.attributeView.currentEpoch)),this._hitTestsRequests.length&&this.requestRender()}updateStart(e){return this.attributeView.lockTextureUploads(),this._supportsInstanceCleanup=!e&&"dictionary"!==this._schema?.mesh.factory.symbology.type,this.instanceStore.updateStart(this._supportsInstanceCleanup),this.instanceStore}async updateEnd(e,t,s){return this._updateResolver=new c({schema:e,deconflictionInfo:t,invalidateMesh:s}),this.requestRender(),e.mesh.factory.referenceScale&&(this.referenceScale=e.mesh.factory.referenceScale),this._updateResolver.resolver.promise}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&this.requestDeclutter()}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe){if(!this._subscriptions.has(t)){const e=new _(t,s);this._subscriptions.set(t,e);continue}this._subscriptions.get(t).version=s}for(const t of e.unsubscribe)this._subscriptions.delete(t),this.removeTile(t)}isFeatureFiltered(e){const t=this.attributeView.getFilterFlags(e),s=t&n,r=null==this._layerView.featureEffectView.featureEffect||this._layerView.featureEffectView.featureEffect.excludedLabelsVisible||t&i;return!(s&&r)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const r of t)s.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}beginLevelMeshUpdate(e){if(null!=this._pendingLevelUpdate)throw new Error("InternalError: Pending level mesh update in progress");return this._pendingLevelUpdate=new p(e),has("esri-2d-update-debug")&&console.debug(`FeatureContainer.beginLevelMeshUpdate(level=${e}, id=${this._pendingLevelUpdate.id})`),this._pendingLevelUpdate.id}applyLevelMeshUpdate(e){if(null==this._pendingLevelUpdate)throw new Error("InternalError: No level mesh update to apply");if(this._pendingLevelUpdate.id!==e)throw new Error("InternalError: Unexpected id");if(this._nextLevelUpdate)throw new Error("InternalError: Already applying pending level mesh update in progress");if(has("esri-2d-update-debug")){const{id:e,level:t}=this._pendingLevelUpdate;console.debug(`FeatureContainer.applyLevelMeshUpdate(level=${t}, id=${e})`)}return this._nextLevelUpdate=this._pendingLevelUpdate,this._pendingLevelUpdate=null,this._nextLevelUpdate.resolver.promise}_handleNextLevelUpdate(){if(this._nextLevelUpdate){if(has("esri-2d-update-debug")){const{id:e,level:t}=this._nextLevelUpdate;console.debug(`FeatureContainer._handleLevelMeshUpdate(level=${t}, id=${e})`)}const e=this._renderStateNext.value??this._renderState.value;for(const t of this._nextLevelUpdate.messages)e?.clearLevelCpuState(this._nextLevelUpdate.level),this._applyMessage(t);this._nextLevelUpdate.resolver.resolve(),this._nextLevelUpdate=null}}lockForOverrides(){this._renderState.value?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState.value?.unlockUploads(),this._shouldUnlockAttributeView&&(this.attributeView.unlockTextureUploads(),this._shouldUnlockAttributeView=!1),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState.value?.flush(this.attributeView.currentEpoch),this.requestRender()}async updateRenderState(e){if(this._renderStateNext.value)throw new Error("InternalError: renderStateNext already exists");has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext.value=new d(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this,this.tilingScheme)}async swapRenderState(){if(!this._renderStateNext.value)throw new Error("InternalError: renderStateNext not yet created");if(this._renderStateSwapResolver)throw new Error("InternalError: renderState swap already in progress");this._renderStateSwapResolver=Promise.withResolvers(),await this._renderStateSwapResolver.promise}async onMessage(e,s){if(t(s),!this._pendingLevelUpdate)return this._applyMessage(e);this._pendingLevelUpdate.messages.push(e)}removeTile(e){(this._renderState.value||this._renderStateNext.value)&&(this._renderState.value&&this._renderState.value.removeTile(e),this._renderStateNext.value&&this._renderStateNext.value.removeTile(e))}hitTest(e){const t=u(e);if(!t)return console.warn("Unexpected hittest input:",e),Promise.resolve({trueHitIds:[],candidateHitIds:[]});let s=this._hitTestsRequests.find(({query:e})=>t.hittestType===e.hittestType&&t.input===e.input);const r=Promise.withResolvers();return s?s.resolvers.push(r):(s={query:t,resolvers:[r]},this._hitTestsRequests.push(s)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach((e,t)=>s.set(t,e)),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:s}=this._layerView.layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=s&&super.doRender(e)}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=l.heatmap.getStencilReference(t)}createRenderParams(e){const t=super.createRenderParams(e);return t.referenceScale=this.referenceScale,t}_applyMessage(e){const t=e.inner;if(!this._subscriptions.has(t.id))return;const s=this._subscriptions.get(t.id);if(s.version!==t.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${t.subscriptionVesrion} != ${s.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}const r=this._renderStateNext.value??this._renderState.value;if(!r)throw new Error("InternalError: No renderState defined");r.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${r.version}, message: ${t.version}]`),r.enqueueUpdate(e),this.requestRender()}_finializeUpdate(){if(!this._updateResolver)return;const{schema:e,deconflictionInfo:t,invalidateMesh:s}=this._updateResolver.inner;this._schema=e,this._deconflictionInfo=t,this.attributeView.unlockTextureUploads(),this.instanceStore.updateEnd(this._supportsInstanceCleanup),s&&(this.restartAllAnimations(),this.swapRenderState());const r="heatmap"===e.mesh.factory.symbology.type?"target-defer":"eager";this._presentation.updateStrategy(r),this._updateResolver.resolver.resolve(),this._updateResolver=null,this.requestRender()}_handleSwapRenderState(){if(this._renderStateSwapResolver&&this._renderStateNext.value){has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.value}] FeatureContainer.update.swapRenderState`);const e=this._renderState.value,t=new Set,s=new Set;for(const r of e?.tiles()??[])r.decluttering&&t.add(r.id),r.presenting&&s.add(r.id);this._renderState.value=this._renderStateNext.value,this._renderStateNext.value=null,this._renderState.value.flush(this.attributeView.currentEpoch),e?.destroy(),this._renderStateSwapResolver.resolve(),this._renderStateSwapResolver=null;for(const r of this._renderState.value.tiles())t.has(r.id)&&(r.decluttering=!0),s.has(r.id)&&(r.presenting=!0);this.requestRender(),this.hasLabels&&this.requestDeclutter()}}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,0),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&h(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,r=t.boundFramebuffer,i=t.getViewport(),n=e.passOptions,a=e.drawPhase;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),e.drawPhase=8;const{distance:l,smallSymbolDistance:o}=e.passOptions,d=Math.max(l,o),h=e.passOptions.hittestType;for(const u of this.children)u.visible&&("rect"===h?u.containsScreenRect(e.state,e.passOptions.tlbr)&&this._renderTile(u,e,0):u.containsScreenPoint(e.state,e.passOptions.position,2*d)&&this._renderTile(u,e,0));s.draw(e),s.unbind(),t.bindFramebuffer(r),t.restoreViewport(i),e.passOptions=n,e.drawPhase=a}_renderFeatures(e,t){const s=this._getHeatmapInstance(e);null!=s?this._renderHeatmapFeatures(e,t,s):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const s of this.children)s.visible&&this._renderTile(s,e,t)}_renderHeatmapFeatures(e,t,s){for(const r of this.children)r.visible&&this._renderTile(r,e,t,19);s.techniqueRef.renderResolvePass(e,s)}_renderTile(e,t,s,r){t.selection=s,e.getDisplayList()?.render(t,r)}}function v(e){return 19===e.techniqueRef.type}export{f as FeatureContainer};
|
|
2
|
+
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{AFeatureContainer as s}from"../../engine/AFeatureContainer.js";import{effectFlag0 as i,filterFlag0 as n}from"../../engine/webgl/definitions.js";import a from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as o}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{FeatureTilePresentStrategy as l}from"./FeatureTilePresentStrategy.js";import{RenderState as d}from"./RenderState.js";import{renderHighlight as h}from"../support/util.js";import{createHittestQuery as u}from"../../support/hitTestUtils.js";class c{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class p{constructor(e){this.level=e,this.id=performance.now(),this.messages=[]}}class f{constructor(e,t){this.id=e,this.version=t}}class _ extends s{constructor(e){super(e.view.featuresTilingScheme),this.referenceScale=null,this._updatingChildren=r(!1),this._hitTestsRequests=[],this._renderState=r(null),this._renderStateNext=r(null),this._store=new a,this._subscriptions=new Map,this._presentation=new l,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._supportsInstanceCleanup=!0,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){super.destroy(),this._renderState.value=e(this._renderState.value),this._renderStateNext.value=e(this._renderStateNext.value)}get batching(){return has("featurelayer-strict-draw-order")?1:has("featurelayer-force-marker-text-draw-order")?2:0}get updating(){const e=this._updatingChildren.value,t=!this._renderState.value||this._renderState.value.updating,r=!!this._renderStateNext.value,s=this.attributeView.updating;return e||t||r||s}subscriptions(){return this._subscriptions.values()}get hasLabels(){return null!==this.labelSchema}get hasHighlight(){return this._layerView.hasHighlight}get children(){return this._renderState.value?this._renderState.value.tiles().filter(e=>e.presenting):[]}get usedMemory(){let e=0;return this._renderState.value&&(e+=this._renderState.value.usedMemory),this._renderStateNext.value&&(e+=this._renderStateNext.value.usedMemory),e+=this.attributeView.usedMemory,e}get instanceStore(){return this._store}get labelingCollisionInfos(){if(!this._deconflictionInfo)throw new Error("InternalError: DeconflictionInfo not defined. Was update called?");return this._deconflictionInfo}get labelSchema(){return this._schema?.mesh.factory.labels??null}get layerOrder(){return this._layerView.view.allLayerViews.items.indexOf(this._layerView)}get tiles(){return this._renderState.value?.tiles()}get requiresRefresh(){return!!this._renderState.value?.requiresRefresh}get _instanceStore(){return this._store}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&o.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(v(t))return t;return null}update(e,t){this._schema=e,this._deconflictionInfo=t}setCoverage(e){this._presentation.updateCoverage(e)}getPresenting(){const e=new Set;for(const t of this._renderState.value?.tiles()??[])t.presenting&&e.add(t.id);return e}beforeRender(e){if(super.beforeRender(e),this._renderState.value){for(const t of this._renderState.value.tiles())t.setTransform(e.state);if(!e.decluttering){this._presentation.update(this._renderState.value.tiles());for(const e of this._renderState.value.tiles())e.upload(this._instanceStore,this.batching)}this._updatingChildren.value=!this.children.every(e=>e.ended&&e.presenting)}}renderChildren(e){switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 16:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}afterRender(e){super.afterRender(e),e.decluttering||(this._finializeUpdate(),this._updateAttributeView(),this._handleSwapRenderState(),this._renderState.value?.update(this.attributeView.currentEpoch)),this._hitTestsRequests.length&&this.requestRender()}updateStart(e){return this.attributeView.lockTextureUploads(),this._supportsInstanceCleanup=!e&&"dictionary"!==this._schema?.mesh.factory.symbology.type,this.instanceStore.updateStart(this._supportsInstanceCleanup),this.instanceStore}async updateEnd(e,t,r){return this._updateResolver=new c({schema:e,deconflictionInfo:t,invalidateMesh:r}),this.requestRender(),e.mesh.factory.referenceScale&&(this.referenceScale=e.mesh.factory.referenceScale),this._updateResolver.resolver.promise}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&this.requestDeclutter()}updateSubscriptions(e){for(const{tileId:t,version:r}of e.subscribe){if(!this._subscriptions.has(t)){const e=new f(t,r);this._subscriptions.set(t,e);continue}this._subscriptions.get(t).version=r}for(const t of e.unsubscribe)this._subscriptions.delete(t),this.removeTile(t)}isFeatureFiltered(e){const t=this.attributeView.getFilterFlags(e),r=t&n,s=null==this._layerView.featureEffectView.featureEffect||this._layerView.featureEffectView.featureEffect.excludedLabelsVisible||t&i;return!(r&&s)}getDisplayStatistics(e,t){const r=this._statisticsByLevel.get(e);return r?r.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let r=this._statisticsByLevel.get(e);r||(r=new Map,this._statisticsByLevel.set(e,r));for(const s of t)r.set(s.fieldName,{minValue:s.minValue,maxValue:s.maxValue})}beginLevelMeshUpdate(e){if(null!=this._pendingLevelUpdate)throw new Error("InternalError: Pending level mesh update in progress");return this._pendingLevelUpdate=new p(e),has("esri-2d-update-debug")&&console.debug(`FeatureContainer.beginLevelMeshUpdate(level=${e}, id=${this._pendingLevelUpdate.id})`),this._pendingLevelUpdate.id}applyLevelMeshUpdate(e){if(null==this._pendingLevelUpdate)throw new Error("InternalError: No level mesh update to apply");if(this._pendingLevelUpdate.id!==e)throw new Error("InternalError: Unexpected id");if(has("esri-2d-update-debug")){const{id:e,level:t}=this._pendingLevelUpdate;console.debug(`FeatureContainer.applyLevelMeshUpdate(level=${t}, id=${e})`)}const{level:t,messages:r}=this._pendingLevelUpdate,s=this._renderStateNext.value??this._renderState.value;if(!s)throw new Error("InternalError: No renderState defined");s.enqueueLevelReplace(t,r),this._pendingLevelUpdate=null,this.requestRender()}lockForOverrides(){this._renderState.value?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState.value?.unlockUploads(),this._shouldUnlockAttributeView&&(this.attributeView.unlockTextureUploads(),this._shouldUnlockAttributeView=!1),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState.value?.flush(this.attributeView.currentEpoch),this.requestRender()}async updateRenderState(e){if(this._renderStateNext.value)throw new Error("InternalError: renderStateNext already exists");has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext.value=new d(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.tilingScheme)}async swapRenderState(){if(!this._renderStateNext.value)throw new Error("InternalError: renderStateNext not yet created");if(this._renderStateSwapResolver)throw new Error("InternalError: renderState swap already in progress");this._renderStateSwapResolver=Promise.withResolvers(),await this._renderStateSwapResolver.promise}async onMessage(e,r){if(t(r),!this._pendingLevelUpdate)return this._applyMessage(e);this._pendingLevelUpdate.messages.push(e)}removeTile(e){(this._renderState.value||this._renderStateNext.value)&&(this._renderState.value&&this._renderState.value.removeTile(e),this._renderStateNext.value&&this._renderStateNext.value.removeTile(e))}hitTest(e){const t=u(e);if(!t)return console.warn("Unexpected hittest input:",e),Promise.resolve({trueHitIds:[],candidateHitIds:[]});let r=this._hitTestsRequests.find(({query:e})=>t.hittestType===e.hittestType&&t.input===e.input);const s=Promise.withResolvers();return r?r.resolvers.push(s):(r={query:t,resolvers:[s]},this._hitTestsRequests.push(r)),this.requestRender(),s.promise}getSortKeys(e){const t=new Set(e),r=new Map;for(const s of this.children)if(s.getSortKeys(t).forEach((e,t)=>r.set(t,e)),r.size===t.size)break;return r}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:r}=this._layerView.layer.effectiveScaleRange,s=e.state.scale;s<=(t||1/0)&&s>=r&&super.doRender(e)}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=o.heatmap.getStencilReference(t)}createRenderParams(e){const t=super.createRenderParams(e);return t.referenceScale=this.referenceScale,t}_applyMessage(e){const t=e.inner;if(!this._subscriptions.has(t.id))return;const r=this._subscriptions.get(t.id);if(r.version!==t.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${t.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}const s=this._renderStateNext.value??this._renderState.value;if(!s)throw new Error("InternalError: No renderState defined");s.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${s.version}, message: ${t.version}]`),s.enqueueUpdate(e),this.requestRender()}_finializeUpdate(){if(!this._updateResolver)return;const{schema:e,deconflictionInfo:t,invalidateMesh:r}=this._updateResolver.inner;this._schema=e,this._deconflictionInfo=t,this.attributeView.unlockTextureUploads(),this.instanceStore.updateEnd(this._supportsInstanceCleanup),r&&(this.restartAllAnimations(),this.swapRenderState());const s="heatmap"===e.mesh.factory.symbology.type?"target-defer":"eager";this._presentation.updateStrategy(s),this._updateResolver.resolver.resolve(),this._updateResolver=null,this.requestRender()}_handleSwapRenderState(){if(this._renderStateSwapResolver&&this._renderStateNext.value){has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.value}] FeatureContainer.update.swapRenderState`);const e=this._renderState.value,t=new Set,r=new Set;for(const s of e?.tiles()??[])s.decluttering&&t.add(s.id),s.presenting&&r.add(s.id);this._renderState.value=this._renderStateNext.value,this._renderStateNext.value=null,this._renderState.value.flush(this.attributeView.currentEpoch),e?.destroy(),this._renderStateSwapResolver.resolve(),this._renderStateSwapResolver=null;for(const s of this._renderState.value.tiles())t.has(s.id)&&(s.decluttering=!0),r.has(s.id)&&(s.presenting=!0);this.requestRender(),this.hasLabels&&this.requestDeclutter()}}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,0),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&h(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,r=e.painter.effects.hittest,s=t.boundFramebuffer,i=t.getViewport(),n=e.passOptions,a=e.drawPhase;r.bind(e),e.passOptions=r.createOptions(e,this._hitTestsRequests),e.drawPhase=8;const{distance:o,smallSymbolDistance:l}=e.passOptions,d=Math.max(o,l),h=e.passOptions.hittestType;for(const u of this.children)u.visible&&("rect"===h?u.containsScreenRect(e.state,e.passOptions.tlbr)&&this._renderTile(u,e,0):u.containsScreenPoint(e.state,e.passOptions.position,2*d)&&this._renderTile(u,e,0));r.draw(e),r.unbind(),t.bindFramebuffer(s),t.restoreViewport(i),e.passOptions=n,e.drawPhase=a}_renderFeatures(e,t){const r=this._getHeatmapInstance(e);null!=r?this._renderHeatmapFeatures(e,t,r):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const r of this.children)r.visible&&this._renderTile(r,e,t)}_renderHeatmapFeatures(e,t,r){for(const s of this.children)s.visible&&this._renderTile(s,e,t,19);r.techniqueRef.renderResolvePass(e,r)}_renderTile(e,t,r,s){t.selection=r,e.getDisplayList()?.render(t,s)}}function v(e){return 19===e.techniqueRef.type}export{_ as FeatureContainer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/CircularArray.js";import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{signal as s}from"../../../../core/signal.js";import{create as r}from"../../../../geometry/support/aaBoundingRect.js";import"../../tiling/TileInfoView.js";import n from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{FeatureTile as o}from"../../engine/webgl/FeatureTile.js";const
|
|
2
|
+
import e from"../../../../core/CircularArray.js";import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{signal as s}from"../../../../core/signal.js";import{create as r}from"../../../../geometry/support/aaBoundingRect.js";import"../../tiling/TileInfoView.js";import n from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{FeatureTile as o}from"../../engine/webgl/FeatureTile.js";const a=1e3;class d{constructor(t,i,r,n){this.getStage=t,this.getSubscriptionVersion=i,this.version=r,this._tileInfoView=n,this._pendingUpdates=new e(a),this._locked=!1,this._tiles=new Map,this._updating=s(!1)}destroy(){for(const e of this.tiles())this._fader?.unregisterFeatureTile(e),e.destroy();this._pendingUpdates.clear(),this._tiles.clear()}get _fader(){return this.getStage()?.labelManager.symbolFader}tiles(){return Array.from(this._tiles.values())}size(){return this._tiles.size}get usedMemory(){let e=0;for(const t of this._tiles.values())e+=t.usedMemory;for(const t of this._pendingUpdates.entries)t&&(e+=l(t)?t.messages.reduce((e,t)=>e+u(t.inner),0):u(t.inner));return e}get requiresRefresh(){for(const e of this._tiles.values())if(e.requiresRefresh)return!0;return!1}get updating(){return this._updating.value}getTile(e){return this._tiles.get(e)}setTiles(e){this._tiles.clear();for(const t of e)this._tiles.set(t.key.id,t)}lockUploads(){this._locked=!0}unlockUploads(){this._locked=!1}enqueueUpdate(e){this._pendingUpdates.enqueue(e),this._notify()}enqueueLevelReplace(e,t){this._pendingUpdates.enqueue({type:"level-replace",level:e,messages:t}),this._notify()}update(e){if(!this._locked)for(;this._pendingUpdates.size;){const t=this._pendingUpdates.peek();if(null==t||p(t)>e)break;this._applyUpdate(t),this._pendingUpdates.dequeue()}this._notify()}flush(e){for(;this._pendingUpdates.size;){const t=this._pendingUpdates.dequeue();if(null!=t){const i=p(t);i>e&&console.warn("Tried to flush RenderState, but patch more recent than current",{patchEpoch:i,currentEpoch:e}),this._applyUpdate(t)}}this._notify()}removeTile(e){const t=this._tiles.get(e);has("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t&&(this._fader?.unregisterFeatureTile(t),t.destroy()),this._tiles.delete(e)}_clearLevelCpuState(e){for(const t of this._tiles.values())t.key.level===e&&t.clearCpuState()}_notify(){this._updating.mutate(e=>0!==this._pendingUpdates.size)}_applyUpdate(e){if(l(e)){this._clearLevelCpuState(e.level);for(const t of e.messages)this._updateTile(t)}else this._updateTile(e)}_updateTile(e){const{inner:t,objectIdMap:i}=e,s=this.getSubscriptionVersion(t.id);if(s!==t.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${t.subscriptionVesrion} != ${s}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}if(has("esri-2d-update-debug")){const e=t.debugInfo?.chunkId??"<EnsureEnd>";console.debug(`Version[${t.version}] Tile[${t.id}] Chunk[${e}] RenderState.updateTile [${t.type}]`,t)}const r=this._ensureTile(t.id);if("update"===t.type){const[e,...s]=t.modify;r.update({type:"update",modify:e,remove:t.remove,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const r of s){const e=this._tiles.get(r.tileId);e&&e.update({type:"update",modify:r,remove:t.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}return}if(null==t.append)return void r.update({type:"append",debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});const[n,...o]=t.append;r.update({type:"append",append:n,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const a of o){const e=this._tiles.get(a.tileId);e&&e.update({type:"update",modify:a,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){has("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const s=new n(e),a=this._tileInfoView.getTileBounds(r(),s),d=a[0],u=a[3],l=this._tileInfoView.getTileResolution(s.level),p=new o(s,l,d,u,this._fader);if(this._fader?.registerFeatureTile(p),p.stage=this.getStage(),!p.stage){const e=new t("featurelayerview:webgl","Cannot create tile with empty stage");i.getLogger("esri.views.2d.layers.features.RenderState").error(e)}return p}_copyPixelBufferedEntitiesInto(e){let t=7;const i=this._tileInfoView.getLODInfoAt(e.key);for(let s=-1;s<=1;s++)for(let r=-1;r<=1;r++){if(0===s&&0===r)continue;const n=e.key.getNormalizedNeighbor(r,s,i).id,o=this._tiles.get(n);if(null!=o){const i=1<<t;e.copyPixelBufferedEntitesFrom(o,i,r,s)}t--}}}function u(e){switch(e.type){case"update":return e.modify.reduce((e,t)=>e+c(t),0);case"append":return e.append?e.append.reduce((e,t)=>e+c(t),0):0}}function l(e){return"type"in e&&"level-replace"===e.type}function p(e){if(!l(e))return e.inner.attributeEpoch;let t=-1/0;for(const i of e.messages)t=Math.max(t,i.inner.attributeEpoch);return t}function c(e){return e.entities.byteLength+e.data.reduce((e,t)=>e+f(t),0)}function f(e){return e.indices.byteLength+e.vertices.byteLength+(e.metrics?.byteLength??0)}export{d as RenderState};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{getOrCreateMapValue as e}from"../../../../../core/MapUtils.js";import{GeohashCell as r}from"../../../../../geohash/GeohashCell.js";import{GeohashTree as t}from"../../../../../geohash/GeohashTree.js";import{getGeohash as o,getGeohashBounds as s}from"../../../../../geohash/geohashUtils.js";import{AAggregateSpatialIndex as i}from"./AAggregateSpatialIndex.js";import{createArcadeEvaluationOptions as n}from"../support/arcadeUtils.js";class a extends i{constructor(e,r){super(e),this._reader=r,this._tree=new t,this.insert(this._reader)}get usedMemory(){return this._tree.usedMemory}forEachInCell(e,r){throw new Error("Not supported.")}insert(e){const r=e.getCursor(),{featureFilter:t,sqlOptions:s,geohashLevel:i,spatialReference:n}=this.options.inner;for(;r.next();){const e=r;if(null!==t&&!t.check(e,s))continue;let a=0,h=0;if("esriGeometryPoint"===e.geometryType)a=e.readXWorldSpace(),h=e.readYWorldSpace();else{const r=e.readCentroidWorldSpace();if(null==r)
|
|
2
|
+
import{getOrCreateMapValue as e}from"../../../../../core/MapUtils.js";import{GeohashCell as r}from"../../../../../geohash/GeohashCell.js";import{GeohashTree as t}from"../../../../../geohash/GeohashTree.js";import{getGeohash as o,getGeohashBounds as s}from"../../../../../geohash/geohashUtils.js";import{AAggregateSpatialIndex as i}from"./AAggregateSpatialIndex.js";import{createArcadeEvaluationOptions as n}from"../support/arcadeUtils.js";class a extends i{constructor(e,r){super(e),this._reader=r,this._tree=new t,this.insert(this._reader)}get usedMemory(){return this._tree.usedMemory}forEachInCell(e,r){throw new Error("Not supported.")}insert(e){const r=e.getCursor(),{featureFilter:t,sqlOptions:s,geohashLevel:i,spatialReference:n}=this.options.inner;for(;r.next();){const e=r;if(null!==t&&!t.check(e,s))continue;let a=0,h=0;if("esriGeometryPoint"===e.geometryType)a=e.readXWorldSpace(),h=e.readYWorldSpace();else{const r=e.readCentroidWorldSpace();if(null==r)continue;[a,h]=r.coords}const d=o(a,h,i,n);d&&this._tree.insert(e,d[0],d[1],i)}}put(e,r){throw new Error("Not supported.")}putBounded(t,o,i,a){const{arcadeContextInfo:h,scale:d,geohashLevel:l,spatialReference:c,fields:p}=this.options.inner,u=n(d,h),f=s(i,a,l,c);null!=f&&this._tree.forEachInBounds(f,s=>{let i=null;for(const n of s.indices){this._reader.setIndex(n);const a=this._reader.getObjectId();o.has(a)||(i??=e(t,s.id,()=>r.create(p,s.xNode,s.yNode,s.depth)),i.insert(this._reader,l,c,u),o.add(a))}})}}export{a as GeohashSpatialIndex};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{getOrCreateMapValue as e}from"../../../../../core/MapUtils.js";import{getMetersPerUnitForSR as t,inchesPerMeter as r}from"../../../../../core/units.js";import{AAggregateSpatialIndex as i}from"./AAggregateSpatialIndex.js";import{GridCell as s}from"./GridCell.js";import{GridIndexCell as n}from"./GridIndexCell.js";import{createArcadeEvaluationOptions as o}from"../support/arcadeUtils.js";const l=96;function a(e,i){return t(e)*r*l/i}class c extends i{constructor(e,t){super(e),this._reader=t,this._cells=new Map,this._pixelsPerMapUnit=a(e.inner.spatialReference,e.inner.scale),this.insert(this._reader)}get worldUnitsPerCell(){return 1*this.options.inner.cellSize/this._pixelsPerMapUnit}insert(e){const t=e.getCursor();for(;t.next();){const e=t,{featureFilter:r,sqlOptions:i,cellSize:s}=this.options.inner;if(null!==r&&!r.check(e,i))continue;let n=0,o=0;if("esriGeometryPoint"===e.geometryType)n=e.readXWorldSpace(),o=e.readYWorldSpace();else{const t=e.readCentroidWorldSpace();if(null==t)
|
|
2
|
+
import{getOrCreateMapValue as e}from"../../../../../core/MapUtils.js";import{getMetersPerUnitForSR as t,inchesPerMeter as r}from"../../../../../core/units.js";import{AAggregateSpatialIndex as i}from"./AAggregateSpatialIndex.js";import{GridCell as s}from"./GridCell.js";import{GridIndexCell as n}from"./GridIndexCell.js";import{createArcadeEvaluationOptions as o}from"../support/arcadeUtils.js";const l=96;function a(e,i){return t(e)*r*l/i}class c extends i{constructor(e,t){super(e),this._reader=t,this._cells=new Map,this._pixelsPerMapUnit=a(e.inner.spatialReference,e.inner.scale),this.insert(this._reader)}get worldUnitsPerCell(){return 1*this.options.inner.cellSize/this._pixelsPerMapUnit}insert(e){const t=e.getCursor();for(;t.next();){const e=t,{featureFilter:r,sqlOptions:i,cellSize:s}=this.options.inner;if(null!==r&&!r.check(e,i))continue;let n=0,o=0;if("esriGeometryPoint"===e.geometryType)n=e.readXWorldSpace(),o=e.readYWorldSpace();else{const t=e.readCentroidWorldSpace();if(null==t)continue;[n,o]=t.coords}const l=n*this._pixelsPerMapUnit,a=o*this._pixelsPerMapUnit,c=Math.floor(l/s),d=Math.floor(a/s);this._getCellOrCreate(c,d).push(t.getIndex())}}get usedMemory(){return 0}forEachInCell(e,t){const r=this._cells.get(e);if(r)for(const i of r._indices)this._reader.setIndex(i),t(this._reader)}put(t,r){const{arcadeContextInfo:i,scale:n,fields:l}=this.options.inner,a=o(n,i);this._cells.forEach(i=>{let n=null;for(const o of i._indices){this._reader.setIndex(o);const c=this._reader.getObjectId();r.has(c)||(n??=e(t,i.id,()=>s.create(i.gridX,i.gridY,l,this.worldUnitsPerCell)),n.insert(this._reader,a),r.add(c))}})}putBounded(t,r,i,n){const{arcadeContextInfo:l,scale:a,cellSize:c,fields:d}=this.options.inner,h=o(a,l),p=[i.xmin,i.ymin,i.xmax,i.ymax],[f,_,u,x]=p,m=Math.floor(f*this._pixelsPerMapUnit/c),g=Math.floor(_*this._pixelsPerMapUnit/c),M=Math.ceil(u*this._pixelsPerMapUnit/c),C=Math.ceil(x*this._pixelsPerMapUnit/c);for(let o=g;o<=C;o++)for(let i=m;i<=M;i++){const n=s.createId(i,o),l=this._cells.get(n);if(!l)continue;let a=null;for(const c of l._indices){this._reader.setIndex(c);const n=this._reader.getObjectId();r.has(n)||(a??=e(t,l.id,()=>s.create(i,o,d,this.worldUnitsPerCell)),a.insert(this._reader,h),r.add(n))}}}_getCellOrCreate(e,t){const r=n.createId(e,t);let i=this._cells.get(r);return i||(i=new n(e,t),this._cells.set(r,i)),i}}export{c as GridSpatialIndex,a as pixelsPerMapUnit};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../../core/lang.js";import{sqlNotIn as t,sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{createFeatureIdInfo as i}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as n}from"./floorFilterUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{ExceedsLimitCache as
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{sqlNotIn as t,sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{createFeatureIdInfo as i}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as n}from"./floorFilterUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{ExceedsLimitCache as p}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as u,createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{getSortKey as m}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as y}from"../schema/processor/StorageSchema.js";import{getAnnotationMatcherSchema as d}from"../../support/annodime/annotationSchema.js";import{annotationRealFields as h,annotationVirtualFields as f}from"../../support/annodime/fields.js";import{getReferenceScale as g}from"../../support/annodime/utils.js";class S{constructor(e){this.layer=e,this._cache=new p}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,a=this.layer.refreshInterval>0,i=!s&&a,o=u("isSourceHosted"in r&&r.isSourceHosted,i,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);let n=[];return n=e.availableFields.concat(...h),c(r,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:n,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{meshes:s,referenceScale:a}=await this._fetchAnnotationDataElementRequest(e,{type:"annotation-data-element-request"}),{objectIdField:i}=this.layer,o=m(null,null,i);return{storage:y(null,t.filters),mesh:{properties:{sortKey:o,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:s,labels:{type:"label",classes:[]},referenceScale:a}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e,s){e=o(this.layer,e,s);const i=this.layer.sublayers.filter(e=>!e.visible).map(e=>e.subtypeCode);if(!i.length)return e;e??=new a;const n=t(this.layer.subtypeField,i.toArray());return e.where=r(e.where,n),e}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>n(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields,()=>this.layer.sublayers.map(({visible:e})=>({visible:e}))]}getRenderer(){return null}setGraphicOrigin(e){const t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=this.layer,e.origin=t?.graphicOrigin}_createServiceInfo(t){const r=this.layer,a=r.fieldsIndex.toJSON();a.fields.push(...f);const{capabilities:o,editingInfo:n,globalIdField:p,datesInUnknownTimezone:u,dateFieldsTimeZone:c,subtypeField:m}=r,y=l(r),d=r.timeInfo?.toJSON(),h=r.spatialReference.toJSON(),g=e(this.layer.parsedUrl),S=this.layer.objectIdField,b=s(g.path),F=t.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:b,orderByFields:S,outSpatialReference:F,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:c,subtypeField:m,globalIdField:p,fieldsIndex:a,geometryType:y,featureIdInfo:i(r),timeInfo:d,spatialReference:h,outSpatialReference:F,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:r.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:o.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:o.query.maxRecordCount,tileMaxRecordCount:o.query.tileMaxRecordCount,supportsCompactGeometry:o.query.supportsCompactGeometry,supportsDefaultSpatialReference:o.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:o.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:o.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:o.query.supportsDegeneratedQuantizedGeometry,lastEditDate:n?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:o.query.supportsReturnExceededLimitGeometries}}}async _fetchAnnotationDataElementRequest(e,t){const r={cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null},s=this.layer,a=await s.fetchDataElement(),i=g(a);return{type:"annotation-data-element-response",dataElement:a,meshes:await d(a,r),referenceScale:i}}}export{S as AnnotationLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{createFeatureIdInfo as r}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{ExceedsLimitCache as i}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as a,createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{getSortKey as n}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as l}from"../schema/processor/StorageSchema.js";import{getDimensionMatcherSchema as c}from"../../support/annodime/dimensionSchema.js";import{dimensionRealFields as p,dimensionVirtualFields as u}from"../../support/annodime/fields.js";import{getReferenceScale as m}from"../../support/annodime/utils.js";class d{constructor(e){this.layer=e,this._cache=new i}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,i=this.layer.refreshInterval>0,n=!s&&i,l=a("isSourceHosted"in r&&r.isSourceHosted,n,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);let c=[];return c=e.availableFields.concat(...p),o(r,l,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:c,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{meshes:s,referenceScale:i}=await this._fetchDimensionDataElementRequest(e,{type:"dimension-data-element-request"}),{objectIdField:a}=this.layer,o=n(null,null,a);return{storage:l(null,t.filters),mesh:{properties:{sortKey:o,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:s,labels:{type:"label",classes:[]},referenceScale:i}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e){return e}getUpdateHashProperties(){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields]}getRenderer(){return null}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const a=this.layer,o=a.fieldsIndex.toJSON();o.fields.push(...u);const{capabilities:n,editingInfo:l,globalIdField:c,datesInUnknownTimezone:p,dateFieldsTimeZone:m,subtypeField:d}=a,y=s(a),h=a.timeInfo?.toJSON(),f=a.spatialReference.toJSON(),g=e(this.layer.parsedUrl),S=this.layer.objectIdField,R=t(g.path),
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{createFeatureIdInfo as r}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{ExceedsLimitCache as i}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as a,createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{getSortKey as n}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as l}from"../schema/processor/StorageSchema.js";import{getDimensionMatcherSchema as c}from"../../support/annodime/dimensionSchema.js";import{dimensionRealFields as p,dimensionVirtualFields as u}from"../../support/annodime/fields.js";import{getReferenceScale as m}from"../../support/annodime/utils.js";class d{constructor(e){this.layer=e,this._cache=new i}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,i=this.layer.refreshInterval>0,n=!s&&i,l=a("isSourceHosted"in r&&r.isSourceHosted,n,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);let c=[];return c=e.availableFields.concat(...p),o(r,l,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:c,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{meshes:s,referenceScale:i}=await this._fetchDimensionDataElementRequest(e,{type:"dimension-data-element-request"}),{objectIdField:a}=this.layer,o=n(null,null,a);return{storage:l(null,t.filters),mesh:{properties:{sortKey:o,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:s,labels:{type:"label",classes:[]},referenceScale:i}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e){return e}getUpdateHashProperties(){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields]}getRenderer(){return null}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const a=this.layer,o=a.fieldsIndex.toJSON();o.fields.push(...u);const{capabilities:n,editingInfo:l,globalIdField:c,datesInUnknownTimezone:p,dateFieldsTimeZone:m,subtypeField:d}=a,y=s(a),h=a.timeInfo?.toJSON(),f=a.spatialReference.toJSON(),g=e(this.layer.parsedUrl),S=this.layer.objectIdField,R=t(g.path),F=i.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:R,orderByFields:S,outSpatialReference:F,metadata:{timeReferenceUnknownClient:p,dateFieldsTimeZone:m,subtypeField:d,globalIdField:c,fieldsIndex:o,geometryType:y,featureIdInfo:r(a),timeInfo:h,spatialReference:f,outSpatialReference:F,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:a.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:n.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:n.query.maxRecordCount,tileMaxRecordCount:n.query.tileMaxRecordCount,supportsCompactGeometry:n.query.supportsCompactGeometry,supportsDefaultSpatialReference:n.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:n.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:n.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:n.query.supportsDegeneratedQuantizedGeometry,lastEditDate:l?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:n.query.supportsReturnExceededLimitGeometries}}}async _fetchDimensionDataElementRequest(e,t){const r={cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null},s=this.layer,i=await s.fetchDataElement(),a=m(i);return{type:"dimension-data-element-response",dataElement:i,meshes:await c(i,r),referenceScale:a}}}export{d as DimensionLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{pt2px as e}from"../../../../../../core/screenUtils.js";import r from"../../../../../../layers/support/OrderByInfo.js";import{createLabelMatcherSchema as t}from"./LabelMatcherSchema.js";import{createMatcherSchema as s}from"./MatcherSchema.js";import{createStorageSchema as i,createTrackStorageSchema as n}from"./StorageSchema.js";import{createVisualVariableUniforms as a}from"./VisualVariablesSchema.js";async function l(e,r){const i=r.renderer,n=a(i);return{symbology:await s(e,i),labels:await t(e,r,n)}}async function o(e,r,t,s){const n=t.featureReduction;if(n)switch(n.type){case"binning":return f(n,e,r,t,s);case"cluster":return b(n,e,r,t,s)}if(t.trackInfo?.enabled)return y(t.trackInfo,e,r,t,s);t.symbolLayerDrawing?.enabled
|
|
2
|
+
import{pt2px as e}from"../../../../../../core/screenUtils.js";import r from"../../../../../../layers/support/OrderByInfo.js";import{createLabelMatcherSchema as t}from"./LabelMatcherSchema.js";import{createMatcherSchema as s}from"./MatcherSchema.js";import{createStorageSchema as i,createTrackStorageSchema as n}from"./StorageSchema.js";import{createVisualVariableUniforms as a}from"./VisualVariablesSchema.js";async function l(e,r){const i=r.renderer,n=a(i);return{symbology:await s(e,i),labels:await t(e,r,n)}}async function o(e,r,t,s){const n=t.featureReduction;if(n)switch(n.type){case"binning":return f(n,e,r,t,s);case"cluster":return b(n,e,r,t,s)}if(t.trackInfo?.enabled)return y(t.trackInfo,e,r,t,s);e.symbolLayerDrawing=t.symbolLayerDrawing?.enabled?t.symbolLayerDrawing:null;const a=p(t.orderBy,t.renderer,t.objectIdField),o=i(t.renderer,r.filters),c=await l(e,t),u=d(c.symbology);return{storage:o,mesh:{properties:{sortKey:a,timeZone:r.timeZone,returnMeshObjectId:u,displayRefreshVersion:s,currentUser:r.currentUser},strategy:{type:"feature"},factory:c},expressionProperties:{timeExtent:r.timeExtent?.toJSON()}}}function c(e,r){return e.fields.map(e=>({...e.toJSON(),type:u(e,r)}))}function u(e,r){const{onStatisticExpression:t,onStatisticField:s,statisticType:i}=e;switch(i){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(t){const{returnType:e}=t;return e?"string"===e?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const e=r.find(e=>e.name===s);return e?e.type:"esriFieldTypeString"}}}async function f(r,n,l,o,u){const f=c(r,o.fields),b=r.renderer,y=await s(n,b),p=i(b,[null,null]),m=a(b),g=await t(n,{geometryType:"polygon",labelingInfoSource:o.labelingInfoSource+"-binning",labelingInfo:r.labelingInfo,labelsVisible:r.labelsVisible},m),v=d(y),h="geohash"===r.binType?{type:"geohash",fixBinLevel:r.fixedBinLevel??3}:{type:"grid",size:e(r.size),fixedBinLevel:r.fixedBinLevel};return{storage:p,mesh:{properties:{sortKey:null,timeZone:l.timeZone,returnMeshObjectId:v,displayRefreshVersion:u,currentUser:l.currentUser},strategy:{type:"binning",fields:f,index:h,featureFilter:l.filters[0]},factory:{labels:g,symbology:y}},expressionProperties:{timeExtent:l.timeExtent?.toJSON()}}}async function b(r,n,l,o,u){const f=c(r,o.fields),b={type:"cluster",feature:await s(n,r.effectiveFeatureRenderer),cluster:await s(n,r.effectiveClusterRenderer)},y=a(r.effectiveFeatureRenderer),p={type:"cluster",feature:await t(n,o,y),cluster:await t(n,{geometryType:"point",labelingInfoSource:o.labelingInfoSource+"-clusters",labelingInfo:r.labelingInfo,labelsVisible:r.labelsVisible},y)},m=i(r.effectiveFeatureRenderer,[null,null]),g=d(b);return{storage:m,mesh:{properties:{sortKey:null,timeZone:l.timeZone,displayRefreshVersion:u,returnMeshObjectId:g,currentUser:l.currentUser},strategy:{type:"cluster",fields:f,featureFilter:l.filters[0],clusterRadius:e(r.clusterRadius/2)},factory:{labels:p,symbology:b}},expressionProperties:{timeExtent:l.timeExtent?.toJSON()}}}async function y(e,r,i,l,o){const u=c(e,l.fields),f={type:"track",previousObservation:await s(r,e.previousObservations.renderer),latestObservation:await s(r,e.latestObservations.renderer),trackLine:await s(r,e.trackLines.renderer)},b={type:"track",previousObservation:await t(r,{geometryType:l.geometryType,labelingInfoSource:l.labelingInfoSource+"-track-prev",labelingInfo:e.previousObservations.labelingInfo,labelsVisible:e.previousObservations.labelsVisible},a(e.previousObservations.renderer)),latestObservation:await t(r,{geometryType:l.geometryType,labelingInfoSource:l.labelingInfoSource+"-track-latest",labelingInfo:e.latestObservations.labelingInfo,labelsVisible:e.latestObservations.labelsVisible},a(e.latestObservations.renderer)),trackLine:await t(r,{geometryType:"polyline",labelingInfoSource:l.labelingInfoSource+"-track-line",labelingInfo:e.trackLines.labelingInfo,labelsVisible:e.trackLines.labelsVisible},a(e.trackLines.renderer))},y=n(e,[null,null]),p=d(f);return{storage:y,mesh:{properties:{sortKey:null,timeZone:i.timeZone,returnMeshObjectId:p,displayRefreshVersion:o,currentUser:i.currentUser},strategy:{type:"track",featureFilter:i.filters[0],fields:u,maxDisplayDuration:e.maxDisplayDuration?.toMilliseconds()??0,maxDisplayObservationsPerTrack:e.maxDisplayObservationsPerTrack,showLatestObservation:e.latestObservations.visible,showPreviousObservations:e.previousObservations.visible,showTrackLine:e.trackLines.visible,timeField:e.timeField},factory:{labels:b,symbology:f}},expressionProperties:{timeExtent:i.timeExtent?.toJSON()}}}function p(e,t,s){const i=null!=t&&"unique-value"===t.type&&t.orderByClassesEnabled;if("default"!==e||i||(e=[new r({field:s,order:"descending"})]),"default"!==e&&e?.length){e.length;const r=e[0],t="ascending"===r.order?"asc":"desc";return r.field?{field:r.field,order:t}:r.valueExpression?{expression:r.valueExpression,order:t}:null}if(i){return{byRenderer:!0,order:"asc"}}return null}function m(e){return 2===e.techniqueType}function d(e){if("simple"===e.type&&e.meshes.some(m))return!0;if("interval"===e.type){if(e.intervals.some(e=>e.meshes.some(m)||e.alternateMeshes.some(m)))return!0;if(e.backgroundFill.some(m))return!0}if("map"===e.type){if(e.map.some(e=>e.meshes.some(m)||e.alternateMeshes.some(m)))return!0;if(e.backgroundFill.some(m))return!0}return!1}export{o as createSimpleProcessorSchema,c as getAggregateFields,p as getSortKey};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../../../request.js";import t from"../../../../../../../core/Error.js";import has from"../../../../../../../core/has.js";import a from"../../../../../../../core/workers/Connection.js";import{toQuantizationTransform as r}from"../../../../../../../geometry/support/quantizationUtils.js";import{convertFromFeatureSet as
|
|
2
|
+
import e from"../../../../../../../request.js";import t from"../../../../../../../core/Error.js";import has from"../../../../../../../core/has.js";import a from"../../../../../../../core/workers/Connection.js";import{toQuantizationTransform as r}from"../../../../../../../geometry/support/quantizationUtils.js";import{equals as s}from"../../../../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatureSet as i,quantizeOptimizedFeatureSet as o}from"../../../../../../../layers/graphics/featureConversionUtils.js";import{checkProjectionSupport as n}from"../../../../../../../layers/graphics/data/projectionSupport.js";import{queryOptimizedFeatureSet as u}from"../../../../../../../layers/ogc/ogcFeatureUtils.js";import{executeQueryPBFBuffer as c,getQueryParameters as m,executeQuery as l}from"../../../../../../../rest/query/operations/query.js";import{FeatureSetReaderAnnotationJSON as p}from"../../../support/FeatureSetReaderAnnotationJSON.js";import{FeatureSetReaderDimensionJSON as d}from"../../../support/FeatureSetReaderDimensionJSON.js";import{FeatureSetReaderJSON as f}from"../../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderPBF as h}from"../../../support/FeatureSetReaderPBF.js";import{annotationVirtualFields as y,dimensionVirtualFields as _}from"../../../../support/annodime/fields.js";class w{constructor(e,t){this.service=e,this._metadata=t}destroy(){}}function q(e,t,a){switch(e.type){case"memory":return new z(e,t,a);case"ogc":return new O(e,t);case"feature-service":return e.queryMetadata.supportsFormatPBF&&has("featurelayer-pbf")?"annotation-feature"===t.layerType?new P(e,t):"dimension-feature"===t.layerType?new j(e,t):new F(e,t):"annotation-feature"===t.layerType?new x(e,t):"dimension-feature"===t.layerType?new R(e,t):new v(e,t)}}async function S(e){const t=new a;return await t.open(e,{}),t}class z extends w{constructor(e,t,a){super(e,t),this._ports=[],this._loaded=this._load(a)}destroy(){this._loaded.finally(()=>{this._client.close(),this._client=null;for(const e of this._ports)e.close()}).catch(()=>{})}async _load(e){this._ports=await e.layerView.openMemoryPorts(),this._client=await S(this._ports)}async executeQuery(e,t){await this._loaded;const a=await this._client.invoke("queryFeatures",e.toJSON(),t);let r=this._metadata;return s(e.outSpatialReference,a.spatialReference)&&(r=r.weakCloneWithResolvedSpatialReference()),f.fromFeatureSet(a,r)}}class F extends w{async executeQuery(a,r){const s=await c(this.service.source,a,r),i=!a.quantizationParameters;try{return h.fromBuffer(s,this._metadata,i)}catch(o){const s=await m(this.service.source,a,"pbf",r??{}),{data:{url:i}}=await e(s.url,{responseType:"native-request-init",...s.options});throw new t("featurelayer:query","Failed to parse response",{url:i,error:o,query:a.toJSON()})}}}class v extends w{async executeQuery(e,t){const{source:a,queryMetadata:s}=this.service,n=null;if(null!=e.quantizationParameters&&!s.supportsQuantization){const s=e.clone(),u=r(s.quantizationParameters);s.quantizationParameters=null;const c=await l(a,s,n,t),m=i(c,this._metadata.featureIdInfo);return o(u,m),f.fromOptimizedFeatureSet(m,this._metadata)}const u=await l(a,e,n,t);return"esriGeometryPoint"===this._metadata.geometryType&&(u.features=u.features?.filter(e=>{if(null!=e.geometry){const t=e.geometry;return Number.isFinite(t.x)&&Number.isFinite(t.y)}return!0})),f.fromFeatureSet(u,this._metadata)}}class x extends w{constructor(e,t){super(e,t),this._loaded=this._load()}async _load(){await n(this._metadata.spatialReference,this._metadata.outSpatialReference)}async executeQuery(e,t){await this._loaded;const{source:a}=this.service,s=e.clone(),n=r(s.quantizationParameters);s.quantizationParameters=null;const u=await l(a,s,this._metadata.spatialReference,t),c=i(u,this._metadata.featureIdInfo);return c.fields.push(...y),o(n,c),p.fromOptimizedFeatureSet(c,this._metadata)}}class P extends w{async executeQuery(a,r){const[s]=await Promise.all([c(this.service.source,a,r),n(this._metadata.spatialReference,this._metadata.outSpatialReference)]),i=!a.quantizationParameters;try{const e=h.fromBuffer(s,this._metadata,i),t=[];for(;e.next();){const a=e.readOptimizedFeatureWorldSpace();a&&t.push(a)}const a=e.getInTransform();return p.fromOptimizedFeatures(t,this._metadata,a)}catch(o){const s=await m(this.service.source,a,"pbf",r??{}),{data:{url:i}}=await e(s.url,{responseType:"native-request-init",...s.options});throw new t("featurelayer:query","Failed to parse response",{url:i,error:o,query:a.toJSON()})}}}class R extends w{constructor(e,t){super(e,t),this._loaded=this._load()}async _load(){await n(this._metadata.spatialReference,this._metadata.outSpatialReference)}async executeQuery(e,t){await this._loaded;const{source:a}=this.service,s=e.clone(),n=r(s.quantizationParameters);s.quantizationParameters=null;const u=await l(a,s,this._metadata.spatialReference,t),c=i(u,this._metadata.featureIdInfo);return c.fields.push(..._),o(n,c),d.fromOptimizedFeatureSet(c,this._metadata)}}class j extends w{async executeQuery(a,r){const[s]=await Promise.all([c(this.service.source,a,r),n(this._metadata.spatialReference,this._metadata.outSpatialReference)]),i=!a.quantizationParameters;try{const e=h.fromBuffer(s,this._metadata,i),t=[];for(;e.next();){const a=e.readOptimizedFeatureWorldSpace();a&&t.push(a)}const a=e.getInTransform();return d.fromOptimizedFeatures(t,this._metadata,a)}catch(o){const s=await m(this.service.source,a,"pbf",r??{}),{data:{url:i}}=await e(s.url,{responseType:"native-request-init",...s.options});throw new t("featurelayer:query","Failed to parse response",{url:i,error:o,query:a.toJSON()})}}}class O extends w{async executeQuery(e,t){if(e.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const a=e.clone(),s=r(a.quantizationParameters);a.quantizationParameters=null;const i=await u(this.service.source,e,t);return o(s,i),f.fromOptimizedFeatureSet(i,this._metadata)}const a=await u(this.service.source,e,t);return f.fromOptimizedFeatureSet(a,this._metadata)}}export{w as SourceAdapter,q as createQueryAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../geometry/SpatialReference.js";import t from"../../../../../layers/support/FieldsIndex.js";class i{static minimal(e,n,s=[],l=!1,o=!1){return new i({geometryType:e,hasZ:l,hasM:o,fieldsIndex:new t(s).toJSON(),featureIdInfo:{type:"object-id",fieldName:n},subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,layerType:void 0})}static createFeature(e){return new i(e)}constructor(i){let n;this._options=i,this._fieldsIndex=t.fromJSON(i.fieldsIndex),i.spatialReference&&(i.spatialReference instanceof e?this._spatialReference=i.spatialReference:this._spatialReference=e.fromJSON(i.spatialReference)),i.outSpatialReference&&(i.outSpatialReference instanceof e?this._outSpatialReference=i.outSpatialReference:this._outSpatialReference=e.fromJSON(i.outSpatialReference)),"object-id"===i.featureIdInfo.type&&(n=i.featureIdInfo.fieldName),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:n,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0,datesInUnknownTimezone:this._options.timeReferenceUnknownClient??void 0,dateFieldsTimeZone:this._options.dateFieldsTimeZone??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return"esriGeometryMultiPatch"===this._options.geometryType?"esriGeometryPolygon":this._options.geometryType}get hasZ(){return this._options.hasZ}get hasM(){return this._options.hasM}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get featureIdInfo(){return this._options.featureIdInfo}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get outSpatialReference(){return this._outSpatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}get layerType(){return this._options.layerType}weakCloneWithAdditionalFields(e){return new i({fieldsIndex:{fields:[...this._fieldsIndex.fields,...e],timeZoneByFieldName:null},geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM,globalIdField:this.globalIdField,featureIdInfo:this.featureIdInfo,spatialReference:this.spatialReference,outSpatialReference:this.outSpatialReference,subtypeField:this.subtypeField,subtypes:this._options.subtypes,timeInfo:this.timeInfo,timeReferenceUnknownClient:this.timeReferenceUnknownClient,dateFieldsTimeZone:this._options.dateFieldsTimeZone,typeIdField:this._options.typeIdField,types:this._options.types,layerType:this._options.layerType})}}class n extends i{static createGraphics(e){return new n({fieldsIndex:(new t).toJSON(),featureIdInfo:{type:"object-id",fieldName:"uid"},geometryType:null,hasZ:!1,hasM:!1,spatialReference:e,outSpatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,layerType:null})}}export{i as FeatureMetadata,n as GraphicsMetadata};
|
|
2
|
+
import e from"../../../../../geometry/SpatialReference.js";import t from"../../../../../layers/support/FieldsIndex.js";class i{static minimal(e,n,s=[],l=!1,o=!1){return new i({geometryType:e,hasZ:l,hasM:o,fieldsIndex:new t(s).toJSON(),featureIdInfo:{type:"object-id",fieldName:n},subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,layerType:void 0})}static createFeature(e){return new i(e)}constructor(i){let n;this._options=i,this._fieldsIndex=t.fromJSON(i.fieldsIndex),i.spatialReference&&(i.spatialReference instanceof e?this._spatialReference=i.spatialReference:this._spatialReference=e.fromJSON(i.spatialReference)),i.outSpatialReference&&(i.outSpatialReference instanceof e?this._outSpatialReference=i.outSpatialReference:this._outSpatialReference=e.fromJSON(i.outSpatialReference)),"object-id"===i.featureIdInfo.type&&(n=i.featureIdInfo.fieldName),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:n,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0,datesInUnknownTimezone:this._options.timeReferenceUnknownClient??void 0,dateFieldsTimeZone:this._options.dateFieldsTimeZone??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return"esriGeometryMultiPatch"===this._options.geometryType?"esriGeometryPolygon":this._options.geometryType}get hasZ(){return this._options.hasZ}get hasM(){return this._options.hasM}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get featureIdInfo(){return this._options.featureIdInfo}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get outSpatialReference(){return this._outSpatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}get layerType(){return this._options.layerType}weakCloneWithAdditionalFields(e){return new i({fieldsIndex:{fields:[...this._fieldsIndex.fields,...e],timeZoneByFieldName:null},geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM,globalIdField:this.globalIdField,featureIdInfo:this.featureIdInfo,spatialReference:this.spatialReference,outSpatialReference:this.outSpatialReference,subtypeField:this.subtypeField,subtypes:this._options.subtypes,timeInfo:this.timeInfo,timeReferenceUnknownClient:this.timeReferenceUnknownClient,dateFieldsTimeZone:this._options.dateFieldsTimeZone,typeIdField:this._options.typeIdField,types:this._options.types,layerType:this._options.layerType})}weakCloneWithResolvedSpatialReference(){return new i({fieldsIndex:{fields:this._fieldsIndex.fields,timeZoneByFieldName:null},geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM,globalIdField:this.globalIdField,featureIdInfo:this.featureIdInfo,spatialReference:this.outSpatialReference,outSpatialReference:this.outSpatialReference,subtypeField:this.subtypeField,subtypes:this._options.subtypes,timeInfo:this.timeInfo,timeReferenceUnknownClient:this.timeReferenceUnknownClient,dateFieldsTimeZone:this._options.dateFieldsTimeZone,typeIdField:this._options.typeIdField,types:this._options.types,layerType:this._options.layerType})}}class n extends i{static createGraphics(e){return new n({fieldsIndex:(new t).toJSON(),featureIdInfo:{type:"object-id",fieldName:"uid"},geometryType:null,hasZ:!1,hasM:!1,spatialReference:e,outSpatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,layerType:null})}}export{i as FeatureMetadata,n as GraphicsMetadata};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/has.js";import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import{minInt16 as t}from"../../../../../core/typedArrayUtil.js";import i from"../../../../../layers/graphics/OptimizedGeometry.js";import{getParquetObjectId as
|
|
2
|
+
import"../../../../../core/has.js";import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import{minInt16 as t}from"../../../../../core/typedArrayUtil.js";import{fromRectValues as i}from"../../../../../geometry/support/aaBoundingBox.js";import s from"../../../../../layers/graphics/OptimizedGeometry.js";import{getParquetObjectId as r}from"../../../../../layers/graphics/sources/support/parquetIdUtils.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";const o=new TextDecoder;class d extends n{constructor(i,s,r,n,o,d=new Uint32Array(r.size()),h,a){if(super(i),this._indexMap=s,this._inner=r,this._fileId=n,this._transform=o,this._displayIds=d,this._points=h,this._rowIds=a,this._index=-1,this._emptyNumberValue=0,this.usedMemory=e,this._size=this._inner.size(),this._rowIds||(this._rowIds=this._inner.readIdsUnsafe().slice()),!this._points&&"esriGeometryPoint"===this.geometryType){const e=this._inner.readPointCoordsQuantizedUnsafe()?.slice();e?(this._emptyNumberValue=t,this._points=e):(this._emptyNumberValue=NaN,this._points=this._inner.readPointCoordsUnsafe()?.slice())}i.featureIdInfo.type}destroy(){super.destroy(),this._inner.free()}get fields(){return this.metadata.fieldsIndex}get geometryType(){return this.metadata.geometryType}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}async updateFields(e,t,i,s){const r=this._inner.rowGroup(),n=new Uint32Array(this._inner.readIdsUnsafe()),o=await e.createPatch(t,r,n,i,s);this._inner.insertPatchBytes(new Uint8Array(o))}getInTransform(){return this._transform}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){const e=this._rowIds[this._index];return r(this._fileId,e)}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getBoundsXMin(){return this._inner.boundsXMin(this._index)}getBoundsYMin(){return this._inner.boundsYMin(this._index)}getBoundsXMax(){return this._inner.boundsXMax(this._index)}getBoundsYMax(){return this._inner.boundsYMax(this._index)}getBounds(e){const t=this._inner.boundsXMin(this._index);return!!Number.isFinite(t)&&(i(e,t,this._inner.boundsYMin(this._index),this._inner.boundsXMax(this._index),this._inner.boundsYMax(this._index)),!0)}setBoundsXMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsXMax(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMax(e){throw new Error("InternalError: Setting bounds is unsupported")}getIndex(){return this._index}next(){for(;++this._index<this._size&&!this._getExists(););return this._index<this._size}readGeometryArea(){return this.readGeometryForDisplay()?.area()??0}copy(){const e=new d(this.metadata,this._indexMap,this._inner,this._fileId,this._transform,this._displayIds,this._points,this._rowIds);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._index=this._index}_readGeometry(e){const t=this._inner.readCoordsUnsafe(this._index),i=this._inner.readLengthsUnsafe(this._index);return t&&i?new s(i,t,this.hasZ,this.hasM):null}_readX(){if(this._points){const e=this._points[2*this._index];return e===this._emptyNumberValue?NaN:e}return this._inner.readX(this._index)}_readY(){if(this._points){const e=this._points[2*this._index+1];return e===this._emptyNumberValue?NaN:e}return this._inner.readY(this._index)}_readServerCentroid(){return null}_readAttribute(e,t){const i=this.fields.get(e);if(!i)return;const s=this._indexMap[i.name];if(null==s)return this.getObjectId();const r=this._inner.readAttribute(this._index,s);if(null==r)return r;if("esriFieldTypeString"===i.type||"esriFieldTypeDateOnly"===i.type||"esriFieldTypeTimeOnly"===i.type||"esriFieldTypeTimestampOffset"===i.type){const e=this._inner.readAttribute(this._index,s);return o.decode(e)}const n=this.fields.isDateField(i.name);return t?null==r?r:n?new Date(r):r:r}_readAttributes(){const e={};for(const t of this.metadata.fieldsIndex.fields){if(null==this._indexMap[t.name])continue;const i=this._readAttribute(t.name,!1);void 0!==i&&(e[t.name]=i)}return e.__OBJECTID=this.getObjectId(),e}}export{d as FeatureSetReaderParquet};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import i from"../../../../../core/Error.js";import{rad2deg as t}from"../../../../../core/mathUtils.js";import{dist as e,set as n,equals as s,subtract as o}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as r,create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isPolygon as l}from"../../../../../geometry/support/jsonTypeUtils.js";import m from"../../../../../layers/support/FieldsIndex.js";import{createRendererExpression as _}from"../../../../../support/ArcadeExpression.js";import{fromCIMHorizontalAlignment as a,fromCIMVerticalAlignment as d,fromCIMFontDecoration as u}from"../../../../../symbols/cim/utils.js";import g from"../../../arcade/callExpressionWithFeature.js";import{glyphSize as P,magicLabelLineHeight as c}from"../../../engine/webgl/definitions.js";import b from"../../../engine/webgl/Rect.js";import{shapeGlyphs as x}from"../../../engine/webgl/mesh/templates/shapingUtils.js";import{queryPointOnLine as p,angleFromXAxis as f,intersectRaysByPointsAndAngles as y}from"../../features/support/FeatureSetReaderDimensionJSON.js";import{roundPtToWholePixel as D,getLineWidth as M}from"../../graphics/graphicsUtils.js";import{DimensionRealFieldName as S}from"./dimensionUtils.js";import{getAttributeValue as k}from"./utils.js";class L{static async create(i,t,e,n){const s=n(i.textSymbol),o=new L(i,s);return await o.initialize(t,e),o}constructor(i,t){if(this._dimensionStyle=i,this._mosaicItems=t,this._textString=null,this._displayExtLines=!0,this._systemLength=0,this._dimensionAngleRad=0,this._dimensionLength=0,this._extAngleRad=Math.PI/2,this._compiledExpression=null,this._fieldsIndex=null,this._beginBaselinePoint=null,this._endBaselinePoint=null,this._dimensionLinePoint=null,this._beginDimensionPoint=null,this._endDimensionPoint=null,this._beginMarkerPoint=null,this._endMarkerPoint=null,this._beginMarkerRect=null,this._endMarkerRect=null,this._textRect=null,this._textPoint=null,this._dimensionPolyline=null,this._dimensionExtensionLines=null,this._hasTextPoint=!1,this._doMarkersFit=!0,this._dimensionIsEvaluated=!1,null==i)throw new Error("dimension syle must be defined!")}async initialize(t,e){if(!this._dimensionStyle)return;const{attributes:n}=t;if("Expression"===(this._dimensionStyle.textOption??"None")){const{expression:i,expressionParserName:n}=this._dimensionStyle;i&&"arcade"===n.toLocaleLowerCase()&&(this._compiledExpression=await _(i,e),this._fieldsIndex=w(t))}const s=Number(k(S.extAngle,n));this._extAngleRad=isNaN(s)?Math.PI/2:s,this._systemLength=Number(k("__SYSTEM_LENGTH__",n));const{geometry:o}=t;if(o&&!l(o))throw new i("dimension-layer","processed geometry must be a valid 'polygon'.");const r=o?.rings[0];if(!r||r.length<3)throw new i("dimension-layer","processed geometry must have at least 3 points.");this._hasTextPoint=0!==r[3][0]&&0!==r[3][1]&&void 0!==r[3][0]&&void 0!==r[3][1],this._hasTextPoint&&(this._textPoint=r[3]);const h=this._dimensionStyle.textSymbol;n.__DIMENSION_ANGLE__+=h?.angle??0}getTextString(i){return null==this._textString&&(this._textString=this._getDimensionText(i)),this._textString}get textSymbol(){return this._dimensionStyle.textSymbol??null}get beginBaselinePoint(){return this._beginBaselinePoint}get endBaselinePoint(){return this._endBaselinePoint}get beginDimensionPoint(){return this._beginDimensionPoint}get endDimensionPoint(){return this._endDimensionPoint}get textPoint(){return this._textPoint}get dimensionLine(){return this._dimensionPolyline}get extensionLines(){return this._displayExtLines?this._dimensionExtensionLines:null}evaluateWithGeometry(i,t){this._dimensionIsEvaluated||(this._computeDimensionLineInfo(i,t),this._evaluateDefaultPlacement(t),this._updateExtensionLines(t),this._updateTextPoint(i,t),this._dimensionIsEvaluated=!0)}_updateTextPoint(i,t){if(this._hasTextPoint)return;const{textFit:e}=this._dimensionStyle;let n=!0;if(!this._doMarkersFit){if(this._hasTextPoint)return;if("None"===e||!this._beginMarkerRect||!this._endMarkerRect||!this._textRect)return void(n=!0);if((T(this._beginMarkerRect,this._textRect)||T(this._endMarkerRect,this._textRect))&&(n=!1),!n){const i=t*(this._textRect.width/2);"MoveBegin"===e?this._textPoint=p(this._beginMarkerPoint,this._endMarkerPoint,-i):"MoveEnd"===e&&(this._textPoint=p(this._endMarkerPoint,this._beginMarkerPoint,-i))}}if(n){if(!this._dimensionStyle.textSymbol)return;const i=t*(this._textRect.width/2),e=this._dimensionPolyline[0],n=this._dimensionPolyline[1],s=p(e[0],e[1],i),o=p(n[0],n[1],i);this._dimensionPolyline=[[s,e[1]],[o,n[1]]]}}_updateExtensionLines(i){if(!(this._displayExtLines&&this._beginDimensionPoint&&this._dimensionLinePoint&&this._endDimensionPoint))return;const{extensionLineOvershot:t,extensionLineOffset:n}=this._dimensionStyle;let s=this._dimensionLinePoint,o=this._endDimensionPoint;null==t||isNaN(t)||0===t||(s=p(this._dimensionLinePoint,this._beginBaselinePoint,-t*i),o=p(this._endDimensionPoint,this._endBaselinePoint,-t*i));let r=this._beginBaselinePoint,h=this._endBaselinePoint;if(null!=n&&!isNaN(n)&&0!==n){const i=e(s,this._beginBaselinePoint),t=e(o,this._endBaselinePoint);r=p(s,this._beginBaselinePoint,i-n),h=p(o,this._endBaselinePoint,t-n)}this._dimensionExtensionLines=[[s,r],[o,h]]}_computeDimensionLineInfo(o,m){if(!o||!l(o)||o.rings[0].length<3)throw new i("DimensionLayerView: bad geometry","Dimension cann't be applied to an empty geometry!");const _=o.rings[0],a=r(_[0][0],_[0][1]),d=r(_[1][0],_[1][1]),u=r(_[2][0],_[2][1]);this._beginBaselinePoint=n(h(),a[0],a[1]),this._endBaselinePoint=n(h(),d[0],d[1]),this._dimensionLinePoint=u;let g=this._extAngleRad;if(s(a,u))this._beginDimensionPoint=n(h(),a[0],a[1]),this._endDimensionPoint=n(h(),d[0],d[1]),this._displayExtLines=!1;else{const e=f([d[0]-a[0],d[1]-a[1]]),s=t(g);s>=-1&&s<=1?g+=t(1):s>=179&&s<=181&&(g-=t(1));const o=y(u,e,d,e+g);if(!o)throw new i("DimensionLayerView: bad geometry","Failed to construct dimension extension lines!");this._beginDimensionPoint=n(h(),u[0],u[1]),this._endDimensionPoint=n(h(),o[0],o[1])}this._dimensionLength=e(this._beginDimensionPoint,this._endDimensionPoint),this._hasTextPoint||(this._textPoint=p(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength/2))}_evaluateDefaultPlacement(i){const{beginMarkerSymbol:t,endMarkerSymbol:e}=this._dimensionStyle,n=this._measureMarkerSymbolSize(t,this._beginDimensionPoint,this._dimensionAngleRad,i),s=this._measureMarkerSymbolSize(e,this._endDimensionPoint,this._dimensionAngleRad+Math.PI,i),r=this._measureDimensionText(this._textString||"",this._textPoint,i);this._textRect=r;const h=i*((n?.width??0)/2),l=i*((s?.width??0)/2);this._beginMarkerPoint=p(this._beginDimensionPoint,this._endDimensionPoint,h),this._endMarkerPoint=p(this._endDimensionPoint,this._beginDimensionPoint,l);const m=[0,0];if(n&&this._beginMarkerPoint){const i=o(m,this._beginMarkerPoint,this._beginDimensionPoint);n.x+=i[0],n.y+=i[1]}if(s&&this._endMarkerPoint){const i=o(m,this._endMarkerPoint,this._endDimensionPoint);s.x+=i[0],s.y+=i[1]}if(this._beginMarkerRect=n,this._endMarkerRect=s,this._doMarkersFit=this._checkMarkerFit(n,s,r,i),this._doMarkersFit){const i=p(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength/2);this._dimensionPolyline=[[i,this._beginDimensionPoint],[i,this._endDimensionPoint]]}else this._beginMarkerPoint=p(this._beginDimensionPoint,this._endDimensionPoint,-4*h),this._endMarkerPoint=p(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+4*l),this._dimensionPolyline=[[this._beginMarkerPoint,this._beginDimensionPoint],[this._endMarkerPoint,this._endDimensionPoint]]}_checkMarkerFit(i,t,e,n){if(!i||!t)return!1;const{markerFit:s,markerOption:o,markerFitTolerance:r}=this._dimensionStyle;if("None"===s)return!0;let h=!0;if("Tolerance"===s)r*n>=this._dimensionLength&&(h=!1);else{if(this._hasTextPoint&&"Both"!==o)return!0;this._hasTextPoint&&"Both"===o?T(i,t)&&(h=!1):(T(i,t)&&(h=!1),h&&e&&(T(e,i)||T(e,t))&&(h=!1))}return h||(this._beginMarkerPoint=p(this._beginDimensionPoint,this._endDimensionPoint,-i.width/2),this._endMarkerPoint=p(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+t.width/2)),h}_measureDimensionText(i,t,e){if(null==this._textString||null==t||null==this._mosaicItems)return null;const n=[];for(const a of i)a.codePointAt(0),n.push(this._mosaicItems.glyphs[a.codePointAt(0)]);const s=this._dimensionStyle.textSymbol;if(!s)return null;const o=a(s.horizontalAlignment),r=d(s.verticalAlignment),h=u(s),l=D(s.height||10),m=!0,_=s.angle||0,g=l/P,p=M(s.lineWidth),f=c*Math.max(.25,Math.min(l||1,4)),y={...this._mosaicItems,glyphs:n.filter(i=>null!=i)},S=x(y,{scale:g,angle:_,xOffset:0,yOffset:0,horizontalAlignment:o,verticalAlignment:r,decoration:h,lineHeight:f,useCIMAngleBehavior:m,maxLineWidth:p,hasBackground:!1}),k=t;if(!k)return null;const L=e,w=[S.bounds.blX,S.bounds.trY],E=[S.bounds.trX,S.bounds.trY],T=[S.bounds.blX,S.bounds.blY],R=[S.bounds.trX,S.bounds.blY];return w[0]-=S.bounds.x,w[1]-=S.bounds.y,E[0]-=S.bounds.x,E[1]-=S.bounds.y,T[0]-=S.bounds.x,T[1]-=S.bounds.y,R[0]-=S.bounds.x,R[1]-=S.bounds.y,w[0]*=L,w[1]*=L,E[0]*=L,E[1]*=L,T[0]*=L,T[1]*=L,R[0]*=L,R[1]*=L,w[0]+=k[0],w[1]+=k[1],E[0]+=k[0],E[1]+=k[1],T[0]+=k[0],T[1]+=k[1],R[0]+=k[0],R[1]+=k[1],new b(E[0],E[1],1.1*Math.abs(w[0]-E[0]),1.1*Math.abs(R[1]-E[1]))}_measureMarkerSymbolSize(i,t,e,n){return i?new b(-16,-16,32,32):null}_getDimensionText(i){const{attributes:t}=i;let e=this._systemLength;1===Number(k(S.useCustomLength,t))&&(e=Number(k(S.customLength,t)));let n=this._getDimensionString(e,i);return"number"==typeof n&&(n=n.toString()),t.__COMPUTED_TEXT_STRING__=n,n||""}_getDimensionString(i,t){const{convertUnits:e,displayUnits:n,displayPrecision:s,prefix:o,suffix:r,textOption:h}=this._dimensionStyle;if("None"===h)return null;if("Expression"===h&&this._compiledExpression&&t)return g(this._compiledExpression,t,{},"esriGeometryPolyline",this._fieldsIndex);let l=(i=null==s||isNaN(s)?parseFloat(i.toString()):parseFloat(i.toFixed(s))).toString();return"Suffix"===h&&(o&&(l=`${o} ${l}`),r&&(l=`${l} ${r}`)),l}}function w(i){const{attributes:t}=i,e=Object.keys(S).map(i=>({name:i,alias:i,type:"string"==typeof t[i]?"esriFieldTypeString":"esriFieldTypeDouble"}));return new m(e)}function E(i){return{left:i.x,right:i.x+i.width,top:i.y+i.height,bottom:i.y}}function T(i,t){const e=E(i),n=E(t),s=e.left<=n.right&&n.left<=e.right,o=e.bottom<=n.top&&n.bottom<=e.top;return s&&o}export{L as default};
|
|
2
|
+
import i from"../../../../../core/Error.js";import{deg2rad as t,rad2deg as n}from"../../../../../core/mathUtils.js";import{dist as e,set as s,equals as o,subtract as r}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as h,create as l}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isPolygon as m}from"../../../../../geometry/support/jsonTypeUtils.js";import _ from"../../../../../layers/support/FieldsIndex.js";import{createRendererExpression as a}from"../../../../../support/ArcadeExpression.js";import{fromCIMHorizontalAlignment as d,fromCIMVerticalAlignment as u,fromCIMFontDecoration as g}from"../../../../../symbols/cim/utils.js";import P from"../../../arcade/callExpressionWithFeature.js";import{glyphSize as c,magicLabelLineHeight as b}from"../../../engine/webgl/definitions.js";import x from"../../../engine/webgl/Rect.js";import{shapeGlyphs as p}from"../../../engine/webgl/mesh/templates/shapingUtils.js";import{queryPointOnLine as f,angleFromXAxis as y,intersectRaysByPointsAndAngles as D}from"../../features/support/FeatureSetReaderDimensionJSON.js";import{roundPtToWholePixel as M,getLineWidth as S}from"../../graphics/graphicsUtils.js";import{DimensionRealFieldName as k}from"./dimensionUtils.js";import{getAttributeValue as L}from"./utils.js";class w{static async create(i,t,n,e){const s=e(i.textSymbol),o=new w(i,s);return await o.initialize(t,n),o}constructor(i,t){if(this._dimensionStyle=i,this._mosaicItems=t,this._textString=null,this._displayExtLines=!0,this._systemLength=0,this._dimensionAngleRad=0,this._dimensionLength=0,this._extAngleRad=Math.PI/2,this._compiledExpression=null,this._fieldsIndex=null,this._beginBaselinePoint=null,this._endBaselinePoint=null,this._dimensionLinePoint=null,this._beginDimensionPoint=null,this._endDimensionPoint=null,this._beginMarkerPoint=null,this._endMarkerPoint=null,this._beginMarkerRect=null,this._endMarkerRect=null,this._textRect=null,this._textPoint=null,this._dimensionPolyline=null,this._dimensionExtensionLines=null,this._hasTextPoint=!1,this._doMarkersFit=!0,this._dimensionIsEvaluated=!1,null==i)throw new Error("dimension syle must be defined!")}async initialize(t,n){if(!this._dimensionStyle)return;const{attributes:e}=t;if("Expression"===(this._dimensionStyle.textOption??"None")){const{expression:e,expressionParserName:s}=this._dimensionStyle;if(e&&s){if(s&&"arcade"!==s.toLocaleLowerCase())throw new i("dimension-layer",`Unsupported expression parser (${s}) for dimension text.`);this._compiledExpression=await a(e,n),this._fieldsIndex=E(t)}}const s=Number(L(k.extAngle,e));this._extAngleRad=isNaN(s)?Math.PI/2:s,this._systemLength=Number(L("__SYSTEM_LENGTH__",e));const{geometry:o}=t;if(o&&!m(o))throw new i("dimension-layer","processed geometry must be a valid 'polygon'.");const r=o?.rings[0];if(!r||r.length<3)throw new i("dimension-layer","processed geometry must have at least 3 points.");this._hasTextPoint=0!==r[3][0]&&0!==r[3][1]&&void 0!==r[3][0]&&void 0!==r[3][1],this._hasTextPoint&&(this._textPoint=r[3]);const h=this._dimensionStyle.textSymbol;e.__DIMENSION_ANGLE__+=h?.angle??0}getTextString(i){return null==this._textString&&(this._textString=this._getDimensionText(i)),this._textString}get textSymbol(){return this._dimensionStyle.textSymbol??null}get beginBaselinePoint(){return this._beginBaselinePoint}get endBaselinePoint(){return this._endBaselinePoint}get beginDimensionPoint(){return this._beginDimensionPoint}get endDimensionPoint(){return this._endDimensionPoint}get textPoint(){return this._textPoint}get dimensionLine(){return this._dimensionPolyline}get extensionLines(){return this._displayExtLines?this._dimensionExtensionLines:null}evaluateWithGeometry(i,t){this._dimensionIsEvaluated||(this._computeDimensionLineInfo(i,t),this._evaluateDefaultPlacement(t),this._updateExtensionLines(t),this._updateTextPoint(i,t),this._dimensionIsEvaluated=!0)}_updateTextPoint(i,t){if(this._hasTextPoint)return;const{textFit:n}=this._dimensionStyle;let e=!0;if(!this._doMarkersFit){if(this._hasTextPoint)return;if("None"===n||!this._beginMarkerRect||!this._endMarkerRect||!this._textRect)return void(e=!0);if((N(this._beginMarkerRect,this._textRect)||N(this._endMarkerRect,this._textRect))&&(e=!1),!e){const i=t*(this._textRect.width/2);"MoveBegin"===n?this._textPoint=f(this._beginMarkerPoint,this._endMarkerPoint,-i):"MoveEnd"===n&&(this._textPoint=f(this._endMarkerPoint,this._beginMarkerPoint,-i))}}if(e){if(!this._dimensionStyle.textSymbol)return;const i=t*(this._textRect.width/2),n=this._dimensionPolyline[0],e=this._dimensionPolyline[1],s=f(n[0],n[1],i),o=f(e[0],e[1],i);this._dimensionPolyline=[[s,n[1]],[o,e[1]]]}}_updateExtensionLines(i){if(!(this._displayExtLines&&this._beginDimensionPoint&&this._dimensionLinePoint&&this._endDimensionPoint))return;const{extensionLineOvershot:t,extensionLineOffset:n}=this._dimensionStyle;let s=this._dimensionLinePoint,o=this._endDimensionPoint;null==t||isNaN(t)||0===t||(s=f(this._dimensionLinePoint,this._beginBaselinePoint,-t*i),o=f(this._endDimensionPoint,this._endBaselinePoint,-t*i));let r=this._beginBaselinePoint,h=this._endBaselinePoint;if(null!=n&&!isNaN(n)&&0!==n){const i=e(s,this._beginBaselinePoint),t=e(o,this._endBaselinePoint);r=f(s,this._beginBaselinePoint,i-n),h=f(o,this._endBaselinePoint,t-n)}this._dimensionExtensionLines=[[s,r],[o,h]]}_computeDimensionLineInfo(r,_){if(!r||!m(r)||r.rings[0].length<3)throw new i("DimensionLayerView: bad geometry","Dimension cann't be applied to an empty geometry!");const a=r.rings[0],d=h(a[0][0],a[0][1]),u=h(a[1][0],a[1][1]),g=h(a[2][0],a[2][1]);this._beginBaselinePoint=s(l(),d[0],d[1]),this._endBaselinePoint=s(l(),u[0],u[1]),this._dimensionLinePoint=g;let P=this._extAngleRad;if(o(d,g))this._beginDimensionPoint=s(l(),d[0],d[1]),this._endDimensionPoint=s(l(),u[0],u[1]),this._displayExtLines=!1;else{const e=y([u[0]-d[0],u[1]-d[1]]),o=n(P);o>=-1&&o<=1?P+=t(1):o>=179&&o<=181&&(P-=t(1));const r=D(g,e,u,e+P);if(!r)throw new i("DimensionLayerView: bad geometry","Failed to construct dimension extension lines!");this._beginDimensionPoint=s(l(),g[0],g[1]),this._endDimensionPoint=s(l(),r[0],r[1])}this._dimensionLength=e(this._beginDimensionPoint,this._endDimensionPoint),this._hasTextPoint||(this._textPoint=f(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength/2))}_evaluateDefaultPlacement(i){const{beginMarkerSymbol:t,endMarkerSymbol:n}=this._dimensionStyle,e=this._measureMarkerSymbolSize(t,this._beginDimensionPoint,this._dimensionAngleRad,i),s=this._measureMarkerSymbolSize(n,this._endDimensionPoint,this._dimensionAngleRad+Math.PI,i),o=this._measureDimensionText(this._textString||"",this._textPoint,i);this._textRect=o;const h=i*((e?.width??0)/2),l=i*((s?.width??0)/2);this._beginMarkerPoint=f(this._beginDimensionPoint,this._endDimensionPoint,h),this._endMarkerPoint=f(this._endDimensionPoint,this._beginDimensionPoint,l);const m=[0,0];if(e&&this._beginMarkerPoint){const i=r(m,this._beginMarkerPoint,this._beginDimensionPoint);e.x+=i[0],e.y+=i[1]}if(s&&this._endMarkerPoint){const i=r(m,this._endMarkerPoint,this._endDimensionPoint);s.x+=i[0],s.y+=i[1]}if(this._beginMarkerRect=e,this._endMarkerRect=s,this._doMarkersFit=this._checkMarkerFit(e,s,o,i),this._doMarkersFit){const i=f(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength/2);this._dimensionPolyline=[[i,this._beginDimensionPoint],[i,this._endDimensionPoint]]}else this._beginMarkerPoint=f(this._beginDimensionPoint,this._endDimensionPoint,-4*h),this._endMarkerPoint=f(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+4*l),this._dimensionPolyline=[[this._beginMarkerPoint,this._beginDimensionPoint],[this._endMarkerPoint,this._endDimensionPoint]]}_checkMarkerFit(i,t,n,e){if(!i||!t)return!1;const{markerFit:s,markerOption:o,markerFitTolerance:r}=this._dimensionStyle;if("None"===s)return!0;let h=!0;if("Tolerance"===s)r*e>=this._dimensionLength&&(h=!1);else{if(this._hasTextPoint&&"Both"!==o)return!0;this._hasTextPoint&&"Both"===o?N(i,t)&&(h=!1):(N(i,t)&&(h=!1),h&&n&&(N(n,i)||N(n,t))&&(h=!1))}return h||(this._beginMarkerPoint=f(this._beginDimensionPoint,this._endDimensionPoint,-i.width/2),this._endMarkerPoint=f(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+t.width/2)),h}_measureDimensionText(i,t,n){if(null==this._textString||null==t||null==this._mosaicItems)return null;const e=[];for(const d of i)d.codePointAt(0),e.push(this._mosaicItems.glyphs[d.codePointAt(0)]);const s=this._dimensionStyle.textSymbol;if(!s)return null;const o=d(s.horizontalAlignment),r=u(s.verticalAlignment),h=g(s),l=M(s.height||10),m=!0,_=s.angle||0,a=l/c,P=S(s.lineWidth),f=b*Math.max(.25,Math.min(l||1,4)),y={...this._mosaicItems,glyphs:e.filter(i=>null!=i)},D=p(y,{scale:a,angle:_,xOffset:0,yOffset:0,horizontalAlignment:o,verticalAlignment:r,decoration:h,lineHeight:f,useCIMAngleBehavior:m,maxLineWidth:P,hasBackground:!1}),k=t;if(!k)return null;const L=n,w=[D.bounds.blX,D.bounds.trY],E=[D.bounds.trX,D.bounds.trY],T=[D.bounds.blX,D.bounds.blY],N=[D.bounds.trX,D.bounds.blY];return w[0]-=D.bounds.x,w[1]-=D.bounds.y,E[0]-=D.bounds.x,E[1]-=D.bounds.y,T[0]-=D.bounds.x,T[1]-=D.bounds.y,N[0]-=D.bounds.x,N[1]-=D.bounds.y,w[0]*=L,w[1]*=L,E[0]*=L,E[1]*=L,T[0]*=L,T[1]*=L,N[0]*=L,N[1]*=L,w[0]+=k[0],w[1]+=k[1],E[0]+=k[0],E[1]+=k[1],T[0]+=k[0],T[1]+=k[1],N[0]+=k[0],N[1]+=k[1],new x(E[0],E[1],1.1*Math.abs(w[0]-E[0]),1.1*Math.abs(N[1]-E[1]))}_measureMarkerSymbolSize(i,t,n,e){return i?new x(-16,-16,32,32):null}_getDimensionText(i){const{attributes:t}=i;let n=null;const e=1===Number(L(k.useCustomLength,t));n=Number(L(e?k.customLength:k.dimLength,t)),(0===n||isNaN(n)||null==n)&&(n=this._systemLength);let s=this._getDimensionString(n,i);return"number"==typeof s&&(s=s.toString()),t.__COMPUTED_TEXT_STRING__=s,s||""}_getDimensionString(i,t){const{convertUnits:n,displayUnits:e,displayPrecision:s,prefix:o,suffix:r,textOption:h}=this._dimensionStyle;if("None"===h)return null;if("Expression"===h&&this._compiledExpression&&t)return P(this._compiledExpression,t,{},"esriGeometryPolyline",this._fieldsIndex);let l=(i=null==s||isNaN(s)?parseFloat(i.toString()):parseFloat(i.toFixed(s))).toString();return"Suffix"===h&&(o&&(l=`${o} ${l}`),r&&(l=`${l} ${r}`)),l}}function E(i){const{attributes:t}=i,n=Object.keys(k).map(i=>({name:i,alias:i,type:"string"==typeof t[i]?"esriFieldTypeString":"esriFieldTypeDouble"}));return new _(n)}function T(i){return{left:i.x,right:i.x+i.width,top:i.y+i.height,bottom:i.y}}function N(i,t){const n=T(i),e=T(t),s=n.left<=e.right&&e.left<=n.right,o=n.bottom<=e.top&&e.bottom<=n.top;return s&&o}export{w as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import{translate as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as r,create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as s,scale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as o,fromArray as n,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as h,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as m}from"../../../../geometry/projection/projectBuffer.js";import{create as u,fromSubBuffer as d,intersectsClippingArea as f}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as g,doubleArrayFrom as _}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as b}from"../../../../geometry/support/FloatArray.js";import{needsElevationUpdates3D as y,evaluateElevationAlignmentAtPoint as v,SampleElevationInfo as x}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as w}from"./Graphics3DObject3DGraphicLayer.js";import{pathNumRoundJoinSubdivisions as S}from"./Graphics3DPathSymbolLayerConstants.js";import{Graphics3DSymbolLayer as P,nanFallbackColor as D}from"./Graphics3DSymbolLayer.js";import{isValidSize as j}from"./graphicUtils.js";import{ConvertOptions as C,initFastSymbolUpdatesState as V,updateFastSymbolUpdatesState as A,getSizeAttributeValue as U,getAttributeValue as z}from"../support/FastSymbolUpdates.js";import{SamplePosition as E}from"../../support/ElevationProvider.js";import{Object3D as R}from"../../webgl-engine/lib/Object3D.js";import{Path as B}from"../../webgl-engine/lib/Path.js";import{PathBuilder as L}from"../../webgl-engine/lib/PathBuilder.js";import{RoundCapBuilder as k,TriangulationCapBuilder as G,NoCapBuilder as O}from"../../webgl-engine/lib/PathCapBuilder.js";import{MiterExtruder as I}from"../../webgl-engine/lib/PathExtruder.js";import{PathGeometry as F,isPathGeometry as M}from"../../webgl-engine/lib/PathGeometry.js";import{FastUpdatePathGeometry as T,StaticPathGeometry as q}from"../../webgl-engine/lib/PathGeometryData.js";import{computeMinimumRotationTangentFrame as H}from"../../webgl-engine/lib/pathGeometryUtils.js";import{quadProfiles as W,circleProfiles as N}from"../../webgl-engine/lib/PathProfile.js";import{newPathVertex as J}from"../../webgl-engine/lib/PathVertex.js";import{DefaultMaterial as Z}from"../../webgl-engine/materials/DefaultMaterial.js";import{PathMaterial as K}from"../../webgl-engine/materials/PathMaterial.js";const Q=["polyline"];class X extends P{constructor(e,t,r,i){super(e,t,r,i,re(t)),this._intrinsicSize=o(1,1),this._upVectorAlignment=1,this._stencilWidth=.1,this.ensureDrapedStatus(!1)}async doLoad(){const t=this.symbolLayer,r=null!=t.width?t.width:t.height,i=null!=t.height?t.height:r;this._vvConvertOptions=new C({supports:{size:!0,color:!0,rotation:!1,opacity:!0},modelSize:[1,1,1],symbolSize:[r,1,i],unitInMeters:this._context.renderCoordsHelper.unitInMeters,fallbackColor:this._getFallbackOpacityAndColor(D),fallbackSize:[r,1,i]});const o=this._context.renderer?.visualVariables;this._fastUpdates=o?.length?V(this._context.renderer,this._vvConvertOptions):null;const l=t.anchor||"center";this._upVectorAlignment="heading"===t.profileRotation?0:1;const c=t.profile||"circle";switch(c){default:case"circle":this._profile=N[l];break;case"quad":this._profile=W[l]}switch(t.join){case"round":this._extruder=new I(0,S);break;default:case"bevel":this._extruder=new I(0,1);break;case"miter":this._extruder=new I(.8*Math.PI,1)}switch(this._cap){case"none":this._capBuilder=new O;break;case"butt":default:this._capBuilder=new G(this._profile,1);break;case"square":this._capBuilder=new G(this._profile,2);break;case"round":{const e="quad"===c;this._capBuilder=new k(this._profile,e);break}}const p=this._materialColor,m=this._getCombinedOpacityAndColor(p),u=h(m),d=m[3],f=this.needsDrivenTransparentPass,g=t.material?.emissive,_={diffuse:u,ambient:u,emissiveStrengthFromSymbol:("color"===g?.source?g?.strength:void 0)??0,emissiveSource:1,opacity:d,drivenOpacity:f,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&(s(this._intrinsicSize,r,i),!j(this._intrinsicSize[0])||!j(this._intrinsicSize[1])))throw new e("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");let b;this._fastUpdates?.visualVariables.size||a(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters),this._fastUpdates?b=new K({..._,...this._fastUpdates.materialParameters,size:n(this._intrinsicSize),upVectorAlignment:this._upVectorAlignment,profile:this._profile,pathCapType:this._capBuilder.type,cutoffAngle:this._extruder.cutoffAngle,numJoinSubdivisions:this._extruder.numBendSubdivisions},this._context):(_.hasVertexColors=this._drivenProperties.color||this._drivenProperties.opacity,_.normalType=1,b=new Z(_,this._context)),b.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._materials[0]=b,this._updateTransparentDepedentMaterialParameters()}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Q,this.symbolLayer.type))return null;const r=this.createElevationContextForGraphic(t);return this._createAs3DShape(e,r)}layerOpacityChanged(){const e=this._materialColor,t=this._getCombinedOpacity(e),r=this._materials[0];r&&(r.setParameters({opacity:t}),this._updateTransparentDepedentMaterialParameters())}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,y)}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._materials[0]?.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;if(!A(this._fastUpdates,t,this._vvConvertOptions))return 0;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return 2}_getVertexData(e){let t=0;const r=e.paths,i=[],s=e.spatialReference,a=this._context.elevationProvider.spatialReference,o=this._context.renderCoordsHelper.spatialReference;for(const h of r)t+=h.length;const n=g(3*t);let l,c=0;for(const h of r){i.push({offset:c,numVertices:h.length});for(const t of h)n[c++]=t[0],n[c++]=t[1],n[c++]=e.hasZ?t[2]:0}return null==a||s.equals(a)||m(n,s,0,n,a,0,t)?(null==a||a.equals(o)?l=_(n):(l=g(3*t),m(n,a,0,l,o,0,t)),{pathVertexDataInfos:i,vertexDataES:n,vertexDataRS:l}):null}_createAs3DShape(e,s){const{graphic:a,renderingInfo:o}=e,n=a.geometry,h=this._getVertexData(n);if(null==h)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(0===h.pathVertexDataInfos.length)return 0!==n.paths.length&&n.paths.some(e=>e.length>0)||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)"),null;const p=new Array,m=n.spatialReference,g=u(),_=this._context.renderCoordsHelper,x=new E(h.vertexDataES),S=a.uid,P=b(h.vertexDataRS.length);for(const u of h.pathVertexDataInfos){const e=u.numVertices;if(e<2)continue;const a=u.offset;if(null!=this._context.clippingExtent&&(d(h.vertexDataES,a,e,g),!f(g,this._context.clippingExtent)))continue;const n=new Array,b=a+3*e;for(let t=a;t<b;t+=3){x.offset=t;const e=v(x,this._context.elevationProvider,s,_);c(ie,h.vertexDataRS[t],h.vertexDataRS[t+1],h.vertexDataRS[t+2]),_.setAltitude(ie,e),h.vertexDataRS[t]=ie[0],h.vertexDataRS[t+1]=ie[1],h.vertexDataRS[t+2]=ie[2],n.push(J(this._upVectorAlignment))}const y=new B(n,h.vertexDataES,h.vertexDataRS,a,P);Y(y,this._upVectorAlignment,this._context.renderCoordsHelper);const w=new L(y,this._profile,this._extruder,this._capBuilder,this._upVectorAlignment);let D=null;if(this._fastUpdates){const{size:e,color:t,opacity:r}=this._fastUpdates.visualVariables,i=U(e,o.size),s=z(t,o.color),a=z(r,o.opacity);D=new T(w,i,s,a)}else{const e=l(this._intrinsicSize);if(this._drivenProperties.size){const t=o.size?.output??["symbol-value","symbol-value","symbol-value"];e[0]*=$(t[0],"symbol-value"===t[2]?this.symbolLayer.height||0:t[2],this.symbolLayer.width||0),e[1]*=$(t[2],"symbol-value"===t[0]?this.symbolLayer.width||0:t[0],this.symbolLayer.height||0)}const t=new q(w);t.bake(e);const r=this._getDrivenColor(o);r&&t.bakeVertexColors(r),D=t}const j=D.createGeometryData(),C=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:S,layerViewUid:this._context.layerViewUid}),V=new F(this._materials[0],j,D,m,this._stencilWidth,C);V.transformation=t(i(),r,w.path.origin),p.push(V)}if(0===p.length)return null;const D=new R({geometries:p,layerViewUid:this._context.layerViewUid,graphicUid:S}),j=new w(this,D,null,(e,t,r,i,s)=>te(e,t,i,s,this._upVectorAlignment),s,null);return j.alignedSampledElevation=0,j.needsElevationUpdates=y(s.mode),j}_getDrivenColor(e){return this._hasDrivenColorOrOpacity?this._getDrivenUInt8ColorWithNaNSupport(e,this._materialColor,!1):null}get _materialColor(){return this.symbolLayer.material?.color}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}get _cap(){return this.symbolLayer.cap||"butt"}_updateTransparentDepedentMaterialParameters(){const e=this._materials[0];e&&e.setParameters({cullFace:e.transparent||"none"===this._cap?0:2})}}function Y(e,t,r){const{origin:i,positions:s}=e;let a=e.offset;switch(t){default:case 0:for(const t of e.vertices)ie[0]=s[a++]+i[0],ie[1]=s[a++]+i[1],ie[2]=s[a++]+i[2],r.worldUpAtPosition(ie,ie),t.setFrameFromUpVector(ie);break;case 1:ie[0]=s[a]+i[0],ie[1]=s[a+1]+i[1],ie[2]=s[a+2]+i[2],r.worldUpAtPosition(ie,ie),H(e,ie)}}function $(e,t,r){switch(e){case"symbol-value":return r;case"proportional":return t;default:return e}}function ee(e,t,r,i){let s=0;const{origin:a,vertices:o,positions:n,positionsES:l}=e,h=e.offset+3*o.length;for(let p=e.offset;p<h;p+=3)c(ie,l[p],l[p+1],l[p+2]),r(ie,se),s+=se.sampledElevation,ie[0]=n[p]+a[0],ie[1]=n[p+1]+a[1],ie[2]=n[p+2]+a[2],i.setAltitude(ie,se.z),n[p]=ie[0]-a[0],n[p+1]=ie[1]-a[1],n[p+2]=ie[2]-a[2];return e.updatePathVertexInformation(),s/o.length}function te(e,t,r,i,s){const a=e.stageObject,o=a.geometries;let n=0;for(const l of o){if(!M(l))continue;const e=l.path,o=e.builder.path;n+=ee(o,t,r,i),0!==s&&Y(o,s,i),e.onPathChanged(l),l.invalidateBoundingInfo(),a.geometryVertexAttributeUpdated(l,"position")}return n/o.length}function re(e){return 1===(e.material?.color?.a??0)}const ie=p(),se=new x;export{X as Graphics3DPathSymbolLayer};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import r from"../../../../core/Error.js";import{disposable as i}from"../../../../core/handleUtils.js";import{translate as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as a,create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,scale as l}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as c,fromArray as h,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as f,create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as u}from"../../../../geometry/projection/projectBuffer.js";import{create as g,fromSubBuffer as _,intersectsClippingArea as y}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as b,doubleArrayFrom as v}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as x}from"../../../../geometry/support/FloatArray.js";import{getCoordinateEquals as w}from"../../../../geometry/support/geometryUtils.js";import{needsElevationUpdates3D as S,evaluateElevationAlignmentAtPoint as P,SampleElevationInfo as D}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as j}from"./Graphics3DObject3DGraphicLayer.js";import{pathNumRoundJoinSubdivisions as C}from"./Graphics3DPathSymbolLayerConstants.js";import{Graphics3DSymbolLayer as V,nanFallbackColor as A}from"./Graphics3DSymbolLayer.js";import{isValidSize as U}from"./graphicUtils.js";import{ConvertOptions as z,initFastSymbolUpdatesState as E,updateFastSymbolUpdatesState as R,getSizeAttributeValue as B,getAttributeValue as k}from"../support/FastSymbolUpdates.js";import{SamplePosition as L}from"../../support/ElevationProvider.js";import{Object3D as G}from"../../webgl-engine/lib/Object3D.js";import{Path as O}from"../../webgl-engine/lib/Path.js";import{PathBuilder as I}from"../../webgl-engine/lib/PathBuilder.js";import{RoundCapBuilder as F,TriangulationCapBuilder as M,NoCapBuilder as T}from"../../webgl-engine/lib/PathCapBuilder.js";import{MiterExtruder as q}from"../../webgl-engine/lib/PathExtruder.js";import{PathGeometry as H,isPathGeometry as W}from"../../webgl-engine/lib/PathGeometry.js";import{FastUpdatePathGeometry as N,StaticPathGeometry as Z}from"../../webgl-engine/lib/PathGeometryData.js";import{computeMinimumRotationTangentFrame as J}from"../../webgl-engine/lib/pathGeometryUtils.js";import{quadProfiles as K,circleProfiles as Q}from"../../webgl-engine/lib/PathProfile.js";import{newPathVertex as X}from"../../webgl-engine/lib/PathVertex.js";import{DefaultMaterial as Y}from"../../webgl-engine/materials/DefaultMaterial.js";import{PathMaterial as $}from"../../webgl-engine/materials/PathMaterial.js";const ee=["polyline"];class te extends V{constructor(e,t,r,i){super(e,t,r,i,oe(t)),this._intrinsicSize=c(1,1),this._upVectorAlignment=1,this._stencilWidth=.1,this.ensureDrapedStatus(!1)}async doLoad(){const e=this.symbolLayer,t=null!=e.width?e.width:e.height,i=null!=e.height?e.height:t;this._vvConvertOptions=new z({supports:{size:!0,color:!0,rotation:!1,opacity:!0},modelSize:[1,1,1],symbolSize:[t,1,i],unitInMeters:this._context.renderCoordsHelper.unitInMeters,fallbackColor:this._getFallbackOpacityAndColor(A),fallbackSize:[t,1,i]});const s=this._context.renderer?.visualVariables;this._fastUpdates=s?.length?E(this._context.renderer,this._vvConvertOptions):null;const a=e.anchor||"center";this._upVectorAlignment="heading"===e.profileRotation?0:1;const o=e.profile||"circle";switch(o){default:case"circle":this._profile=Q[a];break;case"quad":this._profile=K[a]}switch(e.join){case"round":this._extruder=new q(0,C);break;default:case"bevel":this._extruder=new q(0,1);break;case"miter":this._extruder=new q(.8*Math.PI,1)}switch(this._cap){case"none":this._capBuilder=new T;break;case"butt":default:this._capBuilder=new M(this._profile,1);break;case"square":this._capBuilder=new M(this._profile,2);break;case"round":{const e="quad"===o;this._capBuilder=new F(this._profile,e);break}}const c=this._materialColor,p=this._getCombinedOpacityAndColor(c),m=f(p),d=p[3],u=this.needsDrivenTransparentPass,g=e.material?.emissive,_={diffuse:m,ambient:m,emissiveStrengthFromSymbol:("color"===g?.source?g?.strength:void 0)??0,emissiveSource:1,opacity:d,drivenOpacity:u,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&(n(this._intrinsicSize,t,i),!U(this._intrinsicSize[0])||!U(this._intrinsicSize[1])))throw new r("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");let y;this._fastUpdates?.visualVariables.size||l(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters),this._fastUpdates?y=new $({..._,...this._fastUpdates.materialParameters,size:h(this._intrinsicSize),upVectorAlignment:this._upVectorAlignment,profile:this._profile,pathCapType:this._capBuilder.type,cutoffAngle:this._extruder.cutoffAngle,numJoinSubdivisions:this._extruder.numBendSubdivisions},this._context):(_.hasVertexColors=this._drivenProperties.color||this._drivenProperties.opacity,_.normalType=1,y=new Y(_,this._context)),y.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._materials[0]=y,this._updateTransparentDepedentMaterialParameters()}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,ee,this.symbolLayer.type))return null;const r=this.createElevationContextForGraphic(t);return this._createAs3DShape(e,r)}layerOpacityChanged(){const e=this._materialColor,t=this._getCombinedOpacity(e),r=this._materials[0];r&&(r.setParameters({opacity:t}),this._updateTransparentDepedentMaterialParameters())}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,S)}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._materials[0]?.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;if(!R(this._fastUpdates,t,this._vvConvertOptions))return 0;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return 2}_getVertexData(r){let i=0;const s=r.paths,a=[],o=r.spatialReference,n=this._context.elevationProvider.spatialReference,l=this._context.renderCoordsHelper.spatialReference,c=w(r.hasZ),h=s.map(r=>{const i={stack:[],error:void 0,hasError:!1};try{const t=ce;e(i,he,!1);for(let e=1;e<r.length;++e)c(r[e],r[e-1])&&t.add(e);return 0===t.size?r:r.filter((e,r)=>!t.has(r))}catch(s){i.error=s,i.hasError=!0}finally{t(i)}});for(const e of h)i+=e.length;const p=b(3*i);let m,f=0;for(const e of h){a.push({offset:f,numVertices:e.length});for(const t of e)p[f++]=t[0],p[f++]=t[1],p[f++]=r.hasZ?t[2]:0}return null==n||o.equals(n)||u(p,o,0,p,n,0,i)?(null==n||n.equals(l)?m=v(p):(m=b(3*i),u(p,n,0,m,l,0,i)),{pathVertexDataInfos:a,vertexDataES:p,vertexDataRS:m}):null}_createAs3DShape(e,t){const{graphic:r,renderingInfo:i}=e,n=r.geometry,l=this._getVertexData(n);if(null==l)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(0===l.pathVertexDataInfos.length)return 0!==n.paths.length&&n.paths.some(e=>e.length>0)||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)"),null;const c=new Array,h=n.spatialReference,f=g(),d=this._context.renderCoordsHelper,u=new L(l.vertexDataES),b=r.uid,v=x(l.vertexDataRS.length);for(const g of l.pathVertexDataInfos){const e=g.numVertices;if(e<2)continue;const r=g.offset;if(null!=this._context.clippingExtent&&(_(l.vertexDataES,r,e,f),!y(f,this._context.clippingExtent)))continue;const n=new Array,x=r+3*e;for(let i=r;i<x;i+=3){u.offset=i;const e=P(u,this._context.elevationProvider,t,d);m(ne,l.vertexDataRS[i],l.vertexDataRS[i+1],l.vertexDataRS[i+2]),d.setAltitude(ne,e),l.vertexDataRS[i]=ne[0],l.vertexDataRS[i+1]=ne[1],l.vertexDataRS[i+2]=ne[2],n.push(X(this._upVectorAlignment))}const w=new O(n,l.vertexDataES,l.vertexDataRS,r,v);re(w,this._upVectorAlignment,this._context.renderCoordsHelper);const S=new I(w,this._profile,this._extruder,this._capBuilder,this._upVectorAlignment);let D=null;if(this._fastUpdates){const{size:e,color:t,opacity:r}=this._fastUpdates.visualVariables,s=B(e,i.size),a=k(t,i.color),o=k(r,i.opacity);D=new N(S,s,a,o)}else{const e=p(this._intrinsicSize);if(this._drivenProperties.size){const t=i.size?.output??["symbol-value","symbol-value","symbol-value"];e[0]*=ie(t[0],"symbol-value"===t[2]?this.symbolLayer.height||0:t[2],this.symbolLayer.width||0),e[1]*=ie(t[2],"symbol-value"===t[0]?this.symbolLayer.width||0:t[0],this.symbolLayer.height||0)}const t=new Z(S);t.bake(e);const r=this._getDrivenColor(i);r&&t.bakeVertexColors(r),D=t}const j=D.createGeometryData(),C=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:b,layerViewUid:this._context.layerViewUid}),V=new H(this._materials[0],j,D,h,this._stencilWidth,C);V.transformation=s(o(),a,S.path.origin),c.push(V)}if(0===c.length)return null;const w=new G({geometries:c,layerViewUid:this._context.layerViewUid,graphicUid:b}),D=new j(this,w,null,(e,t,r,i,s)=>ae(e,t,i,s,this._upVectorAlignment),t,null);return D.alignedSampledElevation=0,D.needsElevationUpdates=S(t.mode),D}_getDrivenColor(e){return this._hasDrivenColorOrOpacity?this._getDrivenUInt8ColorWithNaNSupport(e,this._materialColor,!1):null}get _materialColor(){return this.symbolLayer.material?.color}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}get _cap(){return this.symbolLayer.cap||"butt"}_updateTransparentDepedentMaterialParameters(){const e=this._materials[0];e&&e.setParameters({cullFace:e.transparent||"none"===this._cap?0:2})}}function re(e,t,r){const{origin:i,positions:s}=e;let a=e.offset;switch(t){default:case 0:for(const t of e.vertices)ne[0]=s[a++]+i[0],ne[1]=s[a++]+i[1],ne[2]=s[a++]+i[2],r.worldUpAtPosition(ne,ne),t.setFrameFromUpVector(ne);break;case 1:ne[0]=s[a]+i[0],ne[1]=s[a+1]+i[1],ne[2]=s[a+2]+i[2],r.worldUpAtPosition(ne,ne),J(e,ne)}}function ie(e,t,r){switch(e){case"symbol-value":return r;case"proportional":return t;default:return e}}function se(e,t,r,i){let s=0;const{origin:a,vertices:o,positions:n,positionsES:l}=e,c=e.offset+3*o.length;for(let h=e.offset;h<c;h+=3)m(ne,l[h],l[h+1],l[h+2]),r(ne,le),s+=le.sampledElevation,ne[0]=n[h]+a[0],ne[1]=n[h+1]+a[1],ne[2]=n[h+2]+a[2],i.setAltitude(ne,le.z),n[h]=ne[0]-a[0],n[h+1]=ne[1]-a[1],n[h+2]=ne[2]-a[2];return e.updatePathVertexInformation(),s/o.length}function ae(e,t,r,i,s){const a=e.stageObject,o=a.geometries;let n=0;for(const l of o){if(!W(l))continue;const e=l.path,o=e.builder.path;n+=se(o,t,r,i),0!==s&&re(o,s,i),e.onPathChanged(l),l.invalidateBoundingInfo(),a.geometryVertexAttributeUpdated(l,"position")}return n/o.length}function oe(e){return 1===(e.material?.color?.a??0)}const ne=d(),le=new D,ce=new Set,he=i({remove:()=>ce.clear()});export{te as Graphics3DPathSymbolLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import"../../../../core/Logger.js";import{trackAccess as
|
|
2
|
+
import"../../../../core/has.js";import"../../../../core/Logger.js";import{trackAccess as e}from"../../../../core/accessorSupport/tracking.js";import{SimpleObservable as n}from"../../../../core/accessorSupport/tracking/SimpleObservable.js";import{e as t}from"../../../../chunks/earcut.js";import{loadLibtessF64 as o,isLibtessF64Loaded as i,triangulateIndexedF64 as s}from"../../../../geometry/libtess.js";import{isClockwise as u}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as r,doubleSubArray as l,concatDoubleArrays as c}from"../../../../geometry/support/DoubleArray.js";import{compactMeshIndices as d,newIndexArray as g,concatIndexArrays as h}from"../../../../geometry/support/Indices.js";import{leastSignificantAxis as f}from"../../../../geometry/support/polygonUtils.js";const p=1e-5,a={method:"auto",projectionAxis:void 0,outlines:void 0};function m(e,n){const{hasZ:t,ccwRingsAsHoles:o,spatialReference:i}=n,s=n.axis??x(e,t,i),u=e.length,c=[],d=[],g=[],h=[],f=e.reduce((e,n)=>e+n.length,0);let p=0;const a=r(3*f);let m=0;const L=o&&e[0]&&v(e[0],t,s);for(let r=u-1;r>=0;r--){const n=e[r],i=D(n,t);if(i<3){i>1&&h.push(n);continue}const u=!!o&&v(n,t,s);if(L?!u:u)c[p++]=n;else{let e=n.length;for(let n=0;n<p;++n)e+=c[n].length;const o={index:m,pathLengths:new Array(p+1),count:e,holeIndices:new Array(p)};o.pathLengths[0]=n.length,n.length>0&&g.push({index:m,count:n.length}),m=S(n,a,m,n.length,t,L);for(let n=0;n<p;++n){const e=c[n];o.holeIndices[n]=m,o.pathLengths[n+1]=e.length,e.length>0&&g.push({index:m,count:e.length}),m=S(e,a,m,e.length,t,L)}p=0,o.count>0&&d.push(o)}}const y=m;for(const r of h)g.push({index:m,count:r.length}),m=S(r,a,m,r.length,t,L);return{positions:3*m===a.length?a:l(a,0,3*m),polygonVertexCount:y,polygons:d,outlines:g}}function x(e,n,t){if(!n)return 2;const o=e.map(e=>{const o=D(e,n);return o<3?2:f(e,o,t)}),i=o[0];return o.every(e=>e===i)?i:2}function v(e,n,t){if(!n)return!u(e);if(e.length<3)return!1;switch(t){case 0:return!u(e,1,2);case 1:return!u(e,0,2);case 2:return!u(e,0,1)}}const L=new n;function y(n,t){const o=R(n,t);if(o.succeeded)return o;return"libtess-not-loaded"===o.message?(e(L),I()):o}async function I(){try{await o(),L.notify()}catch(e){throw e}}function R(e,n){const t={method:n?.method??a.method,projectionAxis:n?.projectionAxis??a.projectionAxis,outlines:n?.outlines??a.outlines},{projectionAxis:o}=t,i=null!=o&&2!==o;i&&O(e.positions,o,2);const s=B(e,t);if(i){const n=s.succeeded?s.positions:null;null!=n&&n!==e.positions&&O(n,2,o),O(e.positions,2,o)}return s}function B(e,n){const t=Array();let o=0;for(const i of e.polygons){if("libtess"===n.method){const o=b(e,i,null!=n.outlines);if(!o.succeeded)return o;t.push(o);continue}const s=j(e,i,null!=n.outlines);if(o=Math.max(o,s.deviation),"auto"===n.method&&s.deviation>p){const o=b(e,i,null!=n.outlines);if(!o.succeeded)return o;t.push(o)}else t.push(s)}return A(t,e,n.method,n.outlines,o)}function A(e,n,t,o,i){const s=null!=o;if(0===e.length){const e=r(0),i=g(0),s=C(n,o,e,i,i),u={succeeded:!0,positions:s.positions,indices:i,outlineIndexBuffer:s.outlineIndexBuffer,outlineRingLengths:s.mergedOutlineRingLengths,vertexCount:s.positions.length/3};return"libtess"===t?{...u,method:"libtess"}:{...u,method:"earcut",deviation:0}}if(e.every(e=>"earcut"===e.method)){const t=Array();for(const n of e)for(let e=0;e<n.indices.length;e++)t.push(n.indices[e]+n.polygon.index);const{outlineIndexBuffer:u,outlineRingLengths:r}=s?U(o,n.positions):{outlineIndexBuffer:void 0,outlineRingLengths:void 0};return{succeeded:!0,positions:n.positions,indices:d(t),outlineIndexBuffer:u,outlineRingLengths:r,vertexCount:n.positions.length/3,method:"earcut",deviation:i}}if(1===e.length&&"libtess"===e[0].method){const t=e[0],i=C(n,o,t.positions,t.outlineIndexBuffer,t.outlineRingLengths);return{succeeded:!0,positions:i.positions,indices:t.indices,outlineIndexBuffer:i.outlineIndexBuffer,outlineRingLengths:i.mergedOutlineRingLengths,vertexCount:i.positions.length/3,method:"libtess"}}const u=e.reduce((e,n)=>e+n.vertexCount,0),l=e.reduce((e,n)=>e+n.indices.length,0),c=s?e.reduce((e,n)=>e+(n.outlineIndexBuffer?.length??0),0):0,h=s?e.reduce((e,n)=>e+(n.outlineRingLengths?.length??0),0):0,f=new Float64Array(3*u),p=new Uint32Array(l),a=s?new Uint32Array(c):void 0,m=s?new Uint32Array(h):void 0;let x=0,v=0,L=0,y=0;for(const r of e){f.set(r.positions,3*x);for(let e=0;e<r.indices.length;e++)p[v+e]=r.indices[e]+x;if(s&&null!=a&&null!=m){const e=r.outlineIndexBuffer,n=r.outlineRingLengths;if(null!=e&&null!=n){for(let n=0;n<e.length;n++)a[L+n]=e[n]+x;m.set(n,y),L+=e.length,y+=n.length}}x+=r.vertexCount,v+=r.indices.length}const I=C(n,o,f,a,m),R={succeeded:!0,positions:I.positions,indices:p,outlineIndexBuffer:I.outlineIndexBuffer,outlineRingLengths:I.mergedOutlineRingLengths,vertexCount:I.positions.length/3};return e.every(e=>"libtess"===e.method)?{...R,method:"libtess"}:{...R,method:"mixed",deviation:i}}function j(e,n,o){const i=k(e.positions,n),s=n.holeIndices.map(e=>e-n.index),u=s.length>0?s:null,r=d(t(i,u,3)),l=t.deviation(i,s,3,r),c=o?w(n):void 0,g=null!=c?U(c,i):{outlineIndexBuffer:void 0,outlineRingLengths:void 0};return{succeeded:!0,method:"earcut",polygon:n,positions:i,indices:r,outlineIndexBuffer:g.outlineIndexBuffer,outlineRingLengths:g.outlineRingLengths,vertexCount:n.count,deviation:l}}function b(e,n,t){if(!i())return F("libtess-not-loaded");const o=k(e.positions,n),u=n.pathLengths,r=s(o,u,3,t);return r.vertices.length%3!=0?F("positions-not-multiple-of-3"):{succeeded:!0,method:"libtess",polygon:n,positions:r.vertices,indices:r.indices,outlineIndexBuffer:r.outlineIndices,outlineRingLengths:r.outlineRingLengths,vertexCount:r.vertices.length/3}}function w(e){const n=new Array(e.pathLengths.length);let t=0;for(let o=0;o<e.pathLengths.length;o++){const i=e.pathLengths[o];n[o]={index:t,count:i},t+=i}return n}function C(e,n,t,o,i){if(null==n)return{positions:t,outlineIndexBuffer:void 0,mergedOutlineRingLengths:void 0};const s=o??g(0),u=i??g(0),r=e.polygonVertexCount,d=n.filter(e=>e.index>=r);if(0===d.length)return{positions:t,outlineIndexBuffer:s,mergedOutlineRingLengths:u};const f=3*r,p=l(e.positions,f,e.positions.length-f),a=c(t,p),m=t.length/3,x=d.map(e=>({index:m+e.index-r,count:e.count})),{outlineIndexBuffer:v,outlineRingLengths:L}=U(x,a);return{positions:a,outlineIndexBuffer:h(s,v,a.length/3),mergedOutlineRingLengths:h(u,L,u.length+L.length)}}function O(e,n,t){for(let o=0;o<e.length;o+=3){const i=e[o+n];e[o+n]=e[o+t],e[o+t]=i}}function U(e,n){const t=g(e.length);let o=0;for(let u=0;u<e.length;u++){const i=e[u],s=i.count;if(s<=0){t[u]=0;continue}const r=3*i.index,l=3*(i.index+s-1),c=s>1&&n[r]===n[l]&&n[r+1]===n[l+1]&&n[r+2]===n[l+2]?s-1:s,d=c>0?c+1:0;t[u]=d,o+=d}const i=g(o,n.length/3);let s=0;for(let u=0;u<e.length;u++){const n=t[u];if(0===n)continue;const o=e[u].index,r=n-1;for(let e=0;e<r;e++)i[s++]=o+e;i[s++]=o}return{outlineIndexBuffer:i,outlineRingLengths:t}}function k(e,{index:n,count:t}){return l(e,3*n,3*t)}function S(e,n,t,o,i,s){let u=s?e.length-1:0;const r=s?-1:1;t*=3;for(let l=0;l<o;++l){const o=e[u];n[t++]=o[0],n[t++]=o[1],n[t++]=i&&null!=o[2]?o[2]:0,u+=r}return t/3}function V(e,n){const t=e.length;if(t<2)return!1;const o=e[0],i=e[t-1];return o[0]===i[0]&&o[1]===i[1]&&(!n||o[2]===i[2])}function D(e,n){return V(e,n)?e.length-1:e.length}function F(e){return{succeeded:!1,message:e}}export{x as axisFromRings,v as isCounterClockwise,I as load,m as ringsToOutlinedTessellationInfo,R as tessellate,y as tessellateOrLoad};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o,cast as l,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as d}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeVisualizerNode as h,getAttachmentName as a}from"./RenderNodeVisualizerNode.js";import c from"../../../../../widgets/Widget.js";import{tsx as p}from"../../../../../widgets/support/widget.js";let u=class extends c{constructor(){super(...arguments),this.clearColor=d,this.previewSize=
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o,cast as l,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as d}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeVisualizerNode as h,getAttachmentName as a}from"./RenderNodeVisualizerNode.js";import c from"../../../../../widgets/Widget.js";import{tsx as p}from"../../../../../widgets/support/widget.js";let u=class extends c{constructor(){super(...arguments),this.clearColor=d,this.previewSize=w,this.filter=["color"],this.node=null,this.active=!0,this._previews=new Map,this._allPreviews=new Set,this._dirty=!0}castPreviewSize(e){return Math.max(e,w)}get _namedFilters(){const e=this.filter?.filter(e=>"color"!==e&&"depth"!==e);return e&&e.length>0?e:null}initialize(){this.node||(this.node=new h({view:this.view,destroyedCB:()=>{this.node=null,this.destroy()},clearColor:this.clearColor}));const e=this.node;this._updateInterval=setInterval(()=>this._updatePreviews()),this.addHandles([r(()=>this.active,i=>{this.view.stage.renderer.fboCache.debugCallback=i?(i,r)=>{if(null==i||null==r||!this.view.stage.renderView.renderingContext)return this._previews.forEach(([e])=>e.release()),void this._previews.clear();if("fbo visualizer"===i||!this._matchesFilter(i)||r&&0===r.colorAttachments.length&&null==r.depthStencilTexture)return;const{width:s,height:o}=r,l=o>this.previewSize?Math.round(s*this.previewSize/o):s,n=o>this.previewSize?this.previewSize:o;if(l/n>4)return void t.getLogger(this).warnOnce(`Skipping preview of wide ${i} FBO (${l}x${n}px)`);r.level&&(i+=` ${r.level}`);const d=e.getDownscaledFBO(r,i,l,n,this._focusedAttachment,this._focusedAttachmentType),h=null!=r.depthStencilTexture,c=this.filter?.includes("color")||!this.filter?.includes("depth"),p=this.filter?.includes("depth")||!this.filter?.includes("color");d.fbo?.colorAttachments.forEach((e,t)=>{const l=d.getAttachment(e);if(l){const n=h&&t===r.colorAttachments.length;if(n&&!p||!n&&!c)return;l.retain();const d=a(i,r,e,n),u=this._previews.get(d);u?.[0]?.release(),this._previews.set(d,[l,s,o]),this._allPreviews.add(d)}}),d.detachAllColors(),d.release(),this._dirty=!0}:null},s)])}destroy(){this.removeHandles(),this.view.stage?.renderer&&(this.view.stage.renderer.fboCache.debugCallback=null),this._removeUpdate(),this.node&&(this.node.destroyedCB=()=>{},this.node=i(this.node)),this._previews.forEach(([e])=>e.release()),this._previews.clear()}_matchesFilter(e){return this._namedFilters?.some(t=>e.includes(t))??!0}_updatePreviews(){if(!this._dirty)return;this._dirty=!1,this.renderNow();const e=this._focusedAttachment&&Array.from(this._previews.keys()).includes(this._focusedAttachment);this._focusedAttachment&&!e&&this._deselectFocusFBO(),this._allPreviews.forEach((e,t)=>{const i=this._getElement(t);if(!i)return;i.getContext("2d").clearRect(0,0,i.width,i.height)}),this._previews.forEach(([e,t,i],r)=>{const s=this._getElement(r);if(!s)return;const o=i>this.previewSize?Math.round(t*this.previewSize/i):t,l=i>this.previewSize?this.previewSize:i;s.style.width=`${o}px`,s.style.height=`${l}px`;const n=s.width,d=s.height,h=this._getElement(`label-${r}`);h&&(h.innerText=`${r} (${t}x${i})`);const a=this.node?.getPreviewContent(n,d,e,r),c=s.getContext("2d");c.clearRect(0,0,n,d),a&&c.putImageData(a,0,0)})}_getElement(e){return document.querySelector("arcgis-scene")?.shadowRoot?.getElementById(e)??document.getElementById(e)}_fboPreviewStyle(e){return{width:"1px",height:"1px",background:e?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",transform:"rotateX(180deg)"}}_removeUpdate(){null!=this._updateInterval&&(clearInterval(this._updateInterval),this._updateInterval=null)}_selectFocusFBO(e,t){this._focusedAttachment=e,this._focusedAttachmentType=0===t?null:9,this.view.stage.renderView.requestRender()}_deselectFocusFBO(){this._focusedAttachment=null,this.node?.clearFocusedFBO(),this.view.stage.renderView.requestRender()}_renderFBOPreviews(){const e=this._allPreviews.size>0?Array.from(this._allPreviews.keys()).sort().map(e=>this._renderFBOPreview(e)):p("div",null);return p("div",{styles:{display:"flex",flexFlow:"row wrap",justifyContent:"flex-end",gap:"2px"}},e)}_renderFBOPreview(e){const t=this._previews.has(e);return p("div",{key:e,styles:{display:"flex",flexFlow:"column nowrap",alignItems:"center"},onmousedown:t=>this._selectFocusFBO(e,t.button)},p("canvas",{id:e,styles:this._fboPreviewStyle(t)}),p("div",{id:e,styles:{display:"flex",justifyContent:"center"}},p("p",{id:`label-${e}`,styles:{fontSize:"12px",color:"white",margin:"1px",textShadow:"-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000"}})))}render(){return p("div",{class:"esri-widget debug-widget",styles:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-end",background:"rgba(255, 255, 255, 0)"}},this._renderFBOPreviews(),p("button",{type:"button",onclick:()=>this._deselectFocusFBO()},"Reset focus"))}};e([o({constructOnly:!0})],u.prototype,"view",void 0),e([o({constructOnly:!0})],u.prototype,"clearColor",void 0),e([o()],u.prototype,"previewSize",void 0),e([l("previewSize")],u.prototype,"castPreviewSize",null),e([o()],u.prototype,"filter",void 0),e([o()],u.prototype,"_namedFilters",null),e([o()],u.prototype,"node",void 0),e([o()],u.prototype,"active",void 0),u=e([n("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizer")],u);const w=140;export{u as RenderNodeVisualizer,w as minimumPreviewSize};
|