@arcgis/core 6.0.0-next.42 → 6.0.0-next.43
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/Basemap.js +1 -1
- package/Graphic.js +1 -1
- package/Ground.js +1 -1
- package/WebDocument2D.js +1 -1
- package/WebScene.js +1 -1
- package/analysis/ElevationProfile/ElevationProfileLineScene.d.ts +1 -0
- package/analysis/ElevationProfileAnalysis.d.ts +15 -0
- package/analysis/LineOfSightAnalysis.d.ts +6 -1
- package/analysis/ShadowCastAnalysis.d.ts +18 -22
- package/analysis/ShadowCastAnalysis.js +1 -1
- package/analysis/ViewshedAnalysis.d.ts +6 -1
- package/applications/Components/analysisUtils.d.ts +6 -0
- package/applications/Components/analysisUtils.js +1 -1
- package/arcade/ArcadeModuleResolver.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/functions/maths.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{2f54e4feb554c1a7b9c4.js → 02debe67e6fef9d88bdd.js} +1 -1
- package/assets/esri/core/workers/chunks/{bd046399e05e759e0bc2.js → 035204000954973b0ebc.js} +1 -1
- package/assets/esri/core/workers/chunks/05225506fdba0c827407.js +1 -0
- package/assets/esri/core/workers/chunks/{4c73c493dabe949c2512.js → 077b755688346e0dc8d3.js} +1 -1
- package/assets/esri/core/workers/chunks/0c1d8e0c2eae21f97fc0.js +1 -0
- package/assets/esri/core/workers/chunks/105865a4d8cb4ddf8a8a.js +1 -0
- package/assets/esri/core/workers/chunks/{afe3e89737fb45189a99.js → 14ed0c34b910eba3434e.js} +1 -1
- package/assets/esri/core/workers/chunks/{f67b37253d6d05d1e339.js → 14ef986665b4a1f6ccdc.js} +1 -1
- package/assets/esri/core/workers/chunks/158cbf4075d3eca83a6a.js +1 -0
- package/assets/esri/core/workers/chunks/{a03f15f2cbc3fed291c2.js → 15f2b27b8edc0d53e399.js} +1 -1
- package/assets/esri/core/workers/chunks/181d24ced5ef6b1f959b.js +1 -0
- package/assets/esri/core/workers/chunks/18dbee576b7b9dbe69fb.js +1 -0
- package/assets/esri/core/workers/chunks/1aebb8fe0692058bf2fb.js +1 -0
- package/assets/esri/core/workers/chunks/1cdb55d9a5ab1a5e3f08.js +1 -0
- package/assets/esri/core/workers/chunks/{cf2e5f827cea7d7319ce.js → 1e5c5029b0653047a769.js} +1 -1
- package/assets/esri/core/workers/chunks/20db6e844708d3e71437.js +1 -0
- package/assets/esri/core/workers/chunks/21a4c3d8265aca775616.js +1 -0
- package/assets/esri/core/workers/chunks/23fff0505e02fd364909.js +1 -0
- package/assets/esri/core/workers/chunks/286e3e050b29e6158e6f.js +1 -0
- package/assets/esri/core/workers/chunks/29ef9d357e30082d267a.js +1 -0
- package/assets/esri/core/workers/chunks/29feef121b0916fb90bf.js +1 -0
- package/assets/esri/core/workers/chunks/2ef91e8da260454f46d8.js +1 -0
- package/assets/esri/core/workers/chunks/32b9bedd4bb0504f0b1d.js +1 -0
- package/assets/esri/core/workers/chunks/{279089a6a3f08022c678.js → 361d620b3f91868b1490.js} +1 -1
- package/assets/esri/core/workers/chunks/37c16e20f022ca27cdae.js +1 -0
- package/assets/esri/core/workers/chunks/380aefa522dfeccb8c65.js +1 -0
- package/assets/esri/core/workers/chunks/394ae3199c78a94c6a2a.js +1 -0
- package/assets/esri/core/workers/chunks/{fdd2b35388f9fe42b623.js → 3a90b6eafa92f1a68ac5.js} +1 -1
- package/assets/esri/core/workers/chunks/{6a65fc1a2931230fe994.js → 3bb1e06861cd0563ed9f.js} +1 -1
- package/assets/esri/core/workers/chunks/3f92afa58c895bf87e62.js +1 -0
- package/assets/esri/core/workers/chunks/422784ceae0d511868a0.js +1 -0
- package/assets/esri/core/workers/chunks/44782e8318dc47cb08a0.js +1 -0
- package/assets/esri/core/workers/chunks/{5882f349f3771868e67f.js → 4521f72ab0ea872e5d7c.js} +1 -1
- package/assets/esri/core/workers/chunks/45b5a61c4e9fbd9ca0b3.js +1 -0
- package/assets/esri/core/workers/chunks/47af220003adfca2167e.js +1 -0
- package/assets/esri/core/workers/chunks/487500443a6037d3599f.js +1 -0
- package/assets/esri/core/workers/chunks/4a4fab74442c3d914505.js +1 -0
- package/assets/esri/core/workers/chunks/4a8903fb1a5d30a68df9.js +1 -0
- package/assets/esri/core/workers/chunks/4d818b231e6d1fa73cc5.js +1 -0
- package/assets/esri/core/workers/chunks/{e0cf6e1e21d0ee739009.js → 4e03aa5518d46a36661c.js} +1 -1
- package/assets/esri/core/workers/chunks/{1a614bac5db42c6263f8.js → 4fe10650ba3cd30aa9a2.js} +1 -1
- package/assets/esri/core/workers/chunks/50b8b1cce0a5f77c8372.js +1 -0
- package/assets/esri/core/workers/chunks/5470a29a69010c8361c4.js +1 -0
- package/assets/esri/core/workers/chunks/564d7f2e58fbc16853c0.js +1 -0
- package/assets/esri/core/workers/chunks/5c2e79f2ca401741bf3e.js +1 -0
- package/assets/esri/core/workers/chunks/5c9ab86bec07264dc9f2.js +1 -0
- package/assets/esri/core/workers/chunks/{04d55ed51e8b2683c4b4.js → 5d908a823b324bafda1e.js} +1 -1
- package/assets/esri/core/workers/chunks/5e6d6676a5c47c0e132a.js +1 -0
- package/assets/esri/core/workers/chunks/5fd4d3cb3c9350131a59.js +1 -0
- package/assets/esri/core/workers/chunks/60637f38159e9bf68d4e.js +1 -0
- package/assets/esri/core/workers/chunks/69b73251257088ce7099.js +1 -0
- package/assets/esri/core/workers/chunks/6cd17c3a254a0b5c2476.js +1 -0
- package/assets/esri/core/workers/chunks/{06102715e9a8f218e07c.js → 6f3732e7ba2d031ba789.js} +1 -1
- package/assets/esri/core/workers/chunks/7191ab31fa040a7c561e.js +1 -0
- package/assets/esri/core/workers/chunks/71ba848c3352ea3ff96f.js +1 -0
- package/assets/esri/core/workers/chunks/76dc8e3264a456f33e61.js +1 -0
- package/assets/esri/core/workers/chunks/77d80b6d65d761214a7c.js +1 -0
- package/assets/esri/core/workers/chunks/{e2430bc3a1edeb5c3266.js → 78a69594c82d37aecbfb.js} +1 -1
- package/assets/esri/core/workers/chunks/{787c1a8bda7d745633f2.js → 81b9894e81cce3490984.js} +1 -1
- package/assets/esri/core/workers/chunks/85cd525705eec6803dd3.js +1 -0
- package/assets/esri/core/workers/chunks/863f04cacdc843d3f208.js +1 -0
- package/assets/esri/core/workers/chunks/8766832c7253557da8fe.js +1 -0
- package/assets/esri/core/workers/chunks/87992070008812f8ae6f.js +1 -0
- package/assets/esri/core/workers/chunks/892fd2c3533ce46a9258.js +1 -0
- package/assets/esri/core/workers/chunks/89b9d716d96135d4f057.js +1 -0
- package/assets/esri/core/workers/chunks/{4b2d392ad8e381bfd6b3.js → 89e9ebc8d5c1022cb265.js} +1 -1
- package/assets/esri/core/workers/chunks/8b38798ac6d774185238.js +1 -0
- package/assets/esri/core/workers/chunks/8b53369cace136ed1329.js +1 -0
- package/assets/esri/core/workers/chunks/8ba4f5e1912edf397947.js +1 -0
- package/assets/esri/core/workers/chunks/{987424121cf30b0f3c50.js → 8d3e92a3367a3ddc02bd.js} +1 -1
- package/assets/esri/core/workers/chunks/8e7a3b1b088c160f4db7.js +1 -0
- package/assets/esri/core/workers/chunks/8f4fba4d2339c91c8b3f.js +1 -0
- package/assets/esri/core/workers/chunks/{45aaefbdffe5e15dfb24.js → 919a6aedf38e9631ee09.js} +1 -1
- package/assets/esri/core/workers/chunks/{487c46d5245cfb35c4bb.js → 921917e53bac82693ec8.js} +1 -1
- package/assets/esri/core/workers/chunks/92809b209b68abcb97ee.js +1 -0
- package/assets/esri/core/workers/chunks/{beccbfff549902733c4e.js → 9869c696e6321c8db0a9.js} +1 -1
- package/assets/esri/core/workers/chunks/98957dba728c93506e50.js +1 -0
- package/assets/esri/core/workers/chunks/99ffb839407cb3c26ad8.js +1 -0
- package/assets/esri/core/workers/chunks/9b517c8d26a86dedb921.js +1 -0
- package/assets/esri/core/workers/chunks/{cb2329d1ea72ce5cc057.js → 9c3f56f22e9baa80a387.js} +1 -1
- package/assets/esri/core/workers/chunks/{1860104c2b33f68785dd.js → 9d0976f5979c4f9154dc.js} +1 -1
- package/assets/esri/core/workers/chunks/9fe1812aad6e566aea31.js +1 -0
- package/assets/esri/core/workers/chunks/a1602995ef96beb7df29.js +1 -0
- package/assets/esri/core/workers/chunks/{dff845574c0037a1dca6.js → a332e31165b65a6fb92e.js} +1 -1
- package/assets/esri/core/workers/chunks/a553478664a688f32488.js +1 -0
- package/assets/esri/core/workers/chunks/a7937b06f4b0860c7671.js +1 -0
- package/assets/esri/core/workers/chunks/{1980fd7ae1617ef4d19d.js → a95186214f1206efd8ed.js} +1 -1
- package/assets/esri/core/workers/chunks/{853563c66ecf58d53d36.js → ab60e8fbe0f92340616a.js} +1 -1
- package/assets/esri/core/workers/chunks/acea0946049136578354.js +1 -0
- package/assets/esri/core/workers/chunks/{342a97974a78007b25e0.js → ad94f54b4c88b3a047bc.js} +1 -1
- package/assets/esri/core/workers/chunks/ae29fec228e70a93ced1.js +1 -0
- package/assets/esri/core/workers/chunks/ae6dc159be974ca0e8da.js +1 -0
- package/assets/esri/core/workers/chunks/ae70972bf88d586fd453.js +1 -0
- package/assets/esri/core/workers/chunks/b021fa4654ede1d04279.js +1 -0
- package/assets/esri/core/workers/chunks/b03f32f02858244c6cd0.js +1 -0
- package/assets/esri/core/workers/chunks/b2d922ecc2c4899dbee1.js +1 -0
- package/assets/esri/core/workers/chunks/b42e50ec6b819f669400.js +1 -0
- package/assets/esri/core/workers/chunks/b6a82775b83d20599635.js +1 -0
- package/assets/esri/core/workers/chunks/b6d365b9198b74b05338.js +1 -0
- package/assets/esri/core/workers/chunks/{48c6230b8a6d3a8a7906.js → bc21241bc9acb83d1b1c.js} +1 -1
- package/assets/esri/core/workers/chunks/bd02d927b0b4991b61c5.js +1 -0
- package/assets/esri/core/workers/chunks/bdf1c4c038d556527483.js +1 -0
- package/assets/esri/core/workers/chunks/c1273f14a5ef3d81de0d.js +1 -0
- package/assets/esri/core/workers/chunks/c752f1e732bb019f657d.js +1 -0
- package/assets/esri/core/workers/chunks/{3f74c61359b4bd6dcf00.js → c7f49493bd548d5dc1e0.js} +1 -1
- package/assets/esri/core/workers/chunks/{36bafcc29ac133a05558.js → c86d3af148b28ded5875.js} +10 -10
- package/assets/esri/core/workers/chunks/{692f0093c444fcc752b5.js → cadd60fa4370284c7ae3.js} +1 -1
- package/assets/esri/core/workers/chunks/{d5e251cddd41d643510c.js → cb62326b6526cde429c1.js} +1 -1
- package/assets/esri/core/workers/chunks/cd8304b1db83d48c57db.js +1 -0
- package/assets/esri/core/workers/chunks/cdf0c7706d3e1221f49b.js +1 -0
- package/assets/esri/core/workers/chunks/d00dd961a5b79f563123.js +1 -0
- package/assets/esri/core/workers/chunks/d893c3bb093104d3db95.js +1 -0
- package/assets/esri/core/workers/chunks/d8fb1d9da16492574a11.js +1 -0
- package/assets/esri/core/workers/chunks/{520f499d79fa71f262c7.js → dd7e4c94a88452425750.js} +1 -1
- package/assets/esri/core/workers/chunks/ddb4689624d091922471.js +1 -0
- package/assets/esri/core/workers/chunks/df32a3fe81d60f0d7462.js +1 -0
- package/assets/esri/core/workers/chunks/dfc6b33f51dc81f3a7be.js +1 -0
- package/assets/esri/core/workers/chunks/e55934eb4a17a5b24c94.js +1 -0
- package/assets/esri/core/workers/chunks/{5473409fee59db80f87d.js → e5bdfef7c2cc5354be52.js} +1 -1
- package/assets/esri/core/workers/chunks/e8cdec961e9cff1cb73b.js +1 -0
- package/assets/esri/core/workers/chunks/{446d172834f8675f1202.js → eaf720dfdf6ceca31249.js} +1 -1
- package/assets/esri/core/workers/chunks/ef274db3fa260eadf371.js +1 -0
- package/assets/esri/core/workers/chunks/efca82a4dc494f57380b.js +1 -0
- package/assets/esri/core/workers/chunks/f05990e6fb378e2e1a3b.js +1 -0
- package/assets/esri/core/workers/chunks/f0fc89cdf50a40913c02.js +1 -0
- package/assets/esri/core/workers/chunks/{8b5dcc4282772bf6b675.js → f11eaab5354cc6aa9569.js} +1 -1
- package/assets/esri/core/workers/chunks/f1c2f7c7ce4bd4096eb0.js +1 -0
- package/assets/esri/core/workers/chunks/f4e63c5f82b8c2bbfacb.js +1 -0
- package/assets/esri/core/workers/chunks/f86ff791a10c802879ec.js +1 -0
- package/assets/esri/core/workers/chunks/{7452b5ae971a9ff2e6e9.js → fdffefd7de540272a8a6.js} +1 -1
- package/assets/esri/core/workers/chunks/fe0248af95d3f37e099e.js +1 -0
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/core/Accessor.js +1 -1
- package/core/Collection.js +1 -1
- package/core/LRUCache.js +1 -1
- package/core/MapUtils.js +1 -1
- package/core/Version.js +1 -1
- package/core/asyncUtils.js +1 -1
- package/core/fontUtils.js +1 -1
- package/core/has.js +1 -1
- package/core/sql/SqlInterval.js +1 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/sql/writeUtils.js +1 -1
- package/core/sql.js +1 -1
- package/core/urlUtils.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
- package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
- package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
- package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
- package/geometry/Point.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/geometry/support/webMercatorUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.d.ts +5 -1
- package/layers/GeospatialPDFLayer.js +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LineOfSightLayer.d.ts +6 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/TileLayer.js +1 -1
- package/layers/VectorTileLayer.d.ts +53 -0
- package/layers/VectorTileLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/ViewshedLayer.d.ts +6 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/effects/jsonUtils.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/graphics/sources/support/uploads.js +1 -1
- package/layers/knowledgeGraph/cypherUtils.js +1 -1
- package/layers/mixins/refresh.js +1 -1
- package/layers/ogc/ogcFeatureUtils.js +1 -1
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/parquet.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/datasets/wcsCoverageParser.js +1 -1
- package/layers/raster/formats/Lerc.js +1 -1
- package/layers/support/ClientSideConnection.js +1 -1
- package/layers/support/ElevationSampler.js +1 -1
- package/layers/support/MultidimensionalSubset.js +1 -1
- package/layers/support/SpriteSource.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/infoFor3D.js +1 -1
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/layers/support/wmsUtils.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/libs/lyr3d/Lyr3DModule.js +1 -1
- package/linkChart/utils.js +1 -1
- package/networks/support/Circuit.js +1 -1
- package/networks/support/CircuitSection.js +1 -1
- package/package.json +2 -2
- package/portal/Portal.js +1 -1
- package/portal/PortalItemResource.js +1 -1
- package/portal/PortalQueryParams.js +1 -1
- package/renderers/HeatmapRenderer.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
- package/rest/query/operations/queryAttachments.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/symbols/cim/types.d.ts +15 -11
- package/symbols/support/previewSymbol3D.js +1 -1
- package/tables/support/templateUtils.js +1 -1
- package/views/2d/engine/vectorTiles/SourceLayerData.js +1 -1
- package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/vectorTiles/TileManager.js +1 -1
- package/views/2d/engine/vectorTiles/TileParser.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileSourceData.js +2 -0
- package/views/2d/engine/vectorTiles/WorkerTile.js +1 -1
- package/views/2d/engine/vectorTiles/WorkerTileHandler.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
- package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
- package/views/2d/engine/vectorTiles/style/Filter.js +1 -1
- package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSourceWorker.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleProperty.js +1 -1
- package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +4 -4
- package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/support/TileStore.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/tiling/TileKey.js +1 -1
- package/views/2d/tiling/TileStrategy.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionComputation.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/images/generateTextures.js +1 -1
- package/views/3d/environment/EnvironmentView.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/MeshFastUpdateProcessor.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/I3SAsyncElevationUpdater.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/TextureCollection.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/CutFill.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +2 -2
- package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
- package/views/draw/DrawAction.js +1 -1
- package/views/draw/support/PluginContext.js +1 -1
- package/views/interactive/sketch/normalizedPoint.js +1 -1
- package/views/interactive/tooltip/fields/TooltipFieldElevation.js +1 -1
- package/views/interactive/tooltip/fields/TooltipFieldOrientation.js +1 -1
- package/views/interactive/tooltip/fields/TooltipFieldSize.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Attribution/AttributionViewModel.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass/CompassViewModel.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLine.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
- package/widgets/Expand/ExpandViewModel.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/Fullscreen/FullscreenViewModel.js +1 -1
- package/widgets/Histogram/HistogramViewModel.js +1 -1
- package/widgets/Histogram.js +1 -1
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
- package/widgets/Home/HomeViewModel.js +1 -1
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Locate/LocateViewModel.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
- package/widgets/OrientedImageryViewer/support/urlUtils.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/DiscreteOptions.js +1 -1
- package/widgets/ShadowCast/DurationOptions.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/ShadowCast/ThresholdOptions.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/TableList/TableListViewModel.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom/ZoomViewModel.js +1 -1
- package/widgets/support/AnalysisViewModelMixin.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/dateUtils.js +1 -1
- package/assets/esri/core/workers/chunks/00d43f02119167531d1b.js +0 -1
- package/assets/esri/core/workers/chunks/0696fa44a04b99738d7b.js +0 -1
- package/assets/esri/core/workers/chunks/091ec4fe83038f3558f4.js +0 -1
- package/assets/esri/core/workers/chunks/098ac10877d92fde1006.js +0 -1
- package/assets/esri/core/workers/chunks/0a29d87b6e58a3c6df8f.js +0 -1
- package/assets/esri/core/workers/chunks/0d04353843ccb7440342.js +0 -1
- package/assets/esri/core/workers/chunks/0d87cb6417672de95d53.js +0 -1
- package/assets/esri/core/workers/chunks/1132e28aaa5825b10b6e.js +0 -1
- package/assets/esri/core/workers/chunks/1380cec385426673f294.js +0 -1
- package/assets/esri/core/workers/chunks/1b24a40c0fa197014873.js +0 -1
- package/assets/esri/core/workers/chunks/1c7096eb48a3a7f27d4f.js +0 -1
- package/assets/esri/core/workers/chunks/1cc03067f8405285057c.js +0 -1
- package/assets/esri/core/workers/chunks/1f76f6dcdae9f55389cb.js +0 -1
- package/assets/esri/core/workers/chunks/21e1d423ee33f916547e.js +0 -1
- package/assets/esri/core/workers/chunks/247617c0dbae2386ab3b.js +0 -1
- package/assets/esri/core/workers/chunks/25657f70c5f04a4ed978.js +0 -1
- package/assets/esri/core/workers/chunks/2690d5fcd9d5ca92ebf6.js +0 -1
- package/assets/esri/core/workers/chunks/2853606099602f73d379.js +0 -1
- package/assets/esri/core/workers/chunks/28ed020d9995b6577be5.js +0 -1
- package/assets/esri/core/workers/chunks/2b27d3bc492e000bbe58.js +0 -1
- package/assets/esri/core/workers/chunks/2d64a13c2303e9cae613.js +0 -1
- package/assets/esri/core/workers/chunks/36e5f070009b29b7ac3d.js +0 -1
- package/assets/esri/core/workers/chunks/3b5e9e0b180dc10491ec.js +0 -1
- package/assets/esri/core/workers/chunks/46edd6c9ed6701e6b975.js +0 -1
- package/assets/esri/core/workers/chunks/4e17665dd9048c300d87.js +0 -1
- package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +0 -1
- package/assets/esri/core/workers/chunks/4e8e322b469657ac22e2.js +0 -1
- package/assets/esri/core/workers/chunks/5396b6e99a0546a25d19.js +0 -1
- package/assets/esri/core/workers/chunks/553a8bf5bc5c56d1bcaf.js +0 -1
- package/assets/esri/core/workers/chunks/55c0c074e4afe05f5d4d.js +0 -1
- package/assets/esri/core/workers/chunks/5bfb962ca192f90a2724.js +0 -1
- package/assets/esri/core/workers/chunks/60c8eedd06080edab3e3.js +0 -1
- package/assets/esri/core/workers/chunks/61d36730564c5ac5edab.js +0 -1
- package/assets/esri/core/workers/chunks/6588725275c75fae0d9c.js +0 -1
- package/assets/esri/core/workers/chunks/661c6324529dd17b297e.js +0 -1
- package/assets/esri/core/workers/chunks/6699fac01ccd842851ba.js +0 -1
- package/assets/esri/core/workers/chunks/672a5390182b20d632be.js +0 -1
- package/assets/esri/core/workers/chunks/67caef2ecf0dc5f2eed3.js +0 -1
- package/assets/esri/core/workers/chunks/68dd1fd2025c7125ead1.js +0 -1
- package/assets/esri/core/workers/chunks/68fd7b314377d27aaa54.js +0 -1
- package/assets/esri/core/workers/chunks/69627b2634da64dd885f.js +0 -1
- package/assets/esri/core/workers/chunks/6f2e7e663229b223b4df.js +0 -1
- package/assets/esri/core/workers/chunks/7390af96250e89194332.js +0 -1
- package/assets/esri/core/workers/chunks/7b45ac83e279fe9516a5.js +0 -1
- package/assets/esri/core/workers/chunks/7e0ed6e8f7b77e43f628.js +0 -1
- package/assets/esri/core/workers/chunks/832c887fdc5af4c08cf2.js +0 -1
- package/assets/esri/core/workers/chunks/84fb27e3425515cd0e3f.js +0 -1
- package/assets/esri/core/workers/chunks/8502274806ea52308822.js +0 -1
- package/assets/esri/core/workers/chunks/867502158997cb2d6406.js +0 -1
- package/assets/esri/core/workers/chunks/8ceb6697e8adbeffe019.js +0 -1
- package/assets/esri/core/workers/chunks/8e391b5b82429f39791e.js +0 -1
- package/assets/esri/core/workers/chunks/8e6276ddd8d094c61f08.js +0 -1
- package/assets/esri/core/workers/chunks/8fe22c2370219f25c15b.js +0 -1
- package/assets/esri/core/workers/chunks/90d797ab82d4a68ba32f.js +0 -1
- package/assets/esri/core/workers/chunks/91586bf29492735e692d.js +0 -1
- package/assets/esri/core/workers/chunks/96f87c8efd4b11b37686.js +0 -1
- package/assets/esri/core/workers/chunks/9826baa3c15ea2062669.js +0 -1
- package/assets/esri/core/workers/chunks/9c3de54513bf8619271c.js +0 -1
- package/assets/esri/core/workers/chunks/a125650edbed802e419a.js +0 -1
- package/assets/esri/core/workers/chunks/a18c3cbe505a19d29569.js +0 -1
- package/assets/esri/core/workers/chunks/a422a801e55fa125546e.js +0 -1
- package/assets/esri/core/workers/chunks/a5f17e9a025ac2b6e1bf.js +0 -1
- package/assets/esri/core/workers/chunks/a6e846361bf5dd3a11c7.js +0 -1
- package/assets/esri/core/workers/chunks/a91dc05a6a609d04ed04.js +0 -1
- package/assets/esri/core/workers/chunks/a99c50b4e1c7568210e1.js +0 -1
- package/assets/esri/core/workers/chunks/ab48faea5432e2dbd45c.js +0 -1
- package/assets/esri/core/workers/chunks/ac107079342251a984dd.js +0 -1
- package/assets/esri/core/workers/chunks/acf4737ba509cbd73cce.js +0 -1
- package/assets/esri/core/workers/chunks/b7205620ca248f4efc88.js +0 -1
- package/assets/esri/core/workers/chunks/bbddeb1c893ff8bbae5d.js +0 -1
- package/assets/esri/core/workers/chunks/bc2e2bdf1194e6e9eb5e.js +0 -1
- package/assets/esri/core/workers/chunks/c0eb27263f608dc3684b.js +0 -1
- package/assets/esri/core/workers/chunks/c3ba1a3247e14f6b7b3a.js +0 -1
- package/assets/esri/core/workers/chunks/c5d0a034ff31d5954571.js +0 -1
- package/assets/esri/core/workers/chunks/c8057b47c7c6c02a0bda.js +0 -1
- package/assets/esri/core/workers/chunks/ca21786e519c914fc9e1.js +0 -1
- package/assets/esri/core/workers/chunks/cd46d9b4a8de644e7332.js +0 -1
- package/assets/esri/core/workers/chunks/d4c8673ca65df874a7ce.js +0 -1
- package/assets/esri/core/workers/chunks/da1e6962ba0c85c37953.js +0 -1
- package/assets/esri/core/workers/chunks/dcdf837a452dc0cac582.js +0 -1
- package/assets/esri/core/workers/chunks/e0864ca82ffa3c9a0776.js +0 -1
- package/assets/esri/core/workers/chunks/e69cd62f824ce7a22fa0.js +0 -1
- package/assets/esri/core/workers/chunks/e9457a67befc61e11095.js +0 -1
- package/assets/esri/core/workers/chunks/f190a3124d6d03417d73.js +0 -1
- package/assets/esri/core/workers/chunks/f4135779bfdaf349352a.js +0 -1
- package/assets/esri/core/workers/chunks/f6bd7b52745b82ba73dc.js +0 -1
- package/assets/esri/core/workers/chunks/fbe3a3b9d6c8c0b52f65.js +0 -1
- package/assets/esri/core/workers/chunks/fc77eb7683e708774168.js +0 -1
- package/assets/esri/core/workers/chunks/fe7184993ef5713d13fb.js +0 -1
- package/assets/esri/core/workers/chunks/fecaf0bc28aeea4d15db.js +0 -1
- package/views/2d/engine/vectorTiles/style/VectorTilePbfWriter.js +0 -2
- package/views/2d/engine/vectorTiles/style/encodeVectorTileFeatures.js +0 -2
- package/views/2d/layers/features/support/FeatureSetReaderVectorTileFeatureCursor.js +0 -2
- /package/views/2d/engine/vectorTiles/{Feature.js → PbfFeature.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../Color.js";import{toLCH as t,toRGB as n,toLAB as r}from"../../../../../core/colorUtils.js";import{unitBezier as i}from"../../../unitBezier.js";import{interpolate as a}from"../GeometryUtils.js";import{booleanType as o,numberType as s,arrayType as c,colorType as l,stringType as u,valueType as d,typeToString as f,objectType as p,getType as m,valueToString as h,matchType as ee}from"./types.js";class te{constructor(e){this._parent=e,this._vars={}}add(e,t){this._vars[e]=t}get(e){return this._vars[e]?this._vars[e]:this._parent?this._parent.get(e):null}}function ne(e){if(!Array.isArray(e)||e.length===0)return!1;let t=e[0];if(t===`literal`)return!1;if(t===`accumulated`||t===`feature-state`||t===`geometry-type`||t===`id`||t===`line-progress`||t===`properties`||t===`has-id`||(t===`get`||t===`has`)&&e.length===2)return!0;for(let t=1;t<e.length;t++)if(ne(e[t]))return!0;return!1}class g{constructor(){this.type=d}static parse(e){if(e.length>1)throw Error(`"id" does not expect arguments`);return new g}evaluate(e,t){return e?.id}}class _{constructor(){this.type=u}static parse(e){if(e.length>1)throw Error(`"geometry-type" does not expect arguments`);return new _}evaluate(e,t){if(!e)return null;switch(e.type){case 1:return`Point`;case 2:return`LineString`;case 3:return`Polygon`;default:return null}}}class v{constructor(){this.type=p}static parse(e){if(e.length>1)throw Error(`"properties" does not expect arguments`);return new v}evaluate(e,t){return e?.values}}class y{constructor(){this.type=s}static parse(e){if(e.length>1)throw Error(`"zoom" does not expect arguments`);return new y}evaluate(e,t){return t}}class b{constructor(e,t,n){this._lhs=e,this._rhs=t,this._compare=n,this.type=o}static parse(e,t,n){if(e.length!==3&&e.length!==4)throw Error(`"${e[0]}" expects 2 or 3 arguments`);if(e.length===4)throw Error(`"${e[0]}" collator not supported`);return new b($(e[1],t),$(e[2],t),n)}evaluate(e,t){return this._compare(this._lhs.evaluate(e,t),this._rhs.evaluate(e,t))}}class re extends b{static parse(e,t){return b.parse(e,t,(e,t)=>e===t)}}class ie extends b{static parse(e,t){return b.parse(e,t,(e,t)=>e!==t)}}class ae extends b{static parse(e,t){return b.parse(e,t,(e,t)=>e<t)}}class x extends b{static parse(e,t){return b.parse(e,t,(e,t)=>e<=t)}}class oe extends b{static parse(e,t){return b.parse(e,t,(e,t)=>e>t)}}class se extends b{static parse(e,t){return b.parse(e,t,(e,t)=>e>=t)}}class S{constructor(e){this._arg=e,this.type=o}static parse(e,t){if(e.length!==2)throw Error(`"!" expects 1 argument`);return new S($(e[1],t))}evaluate(e,t){return!this._arg.evaluate(e,t)}}class C{constructor(e){this._args=e,this.type=o}static parse(e,t){let n=[];for(let r=1;r<e.length;r++)n.push($(e[r],t));return new C(n)}evaluate(e,t){for(let n of this._args)if(!n.evaluate(e,t))return!1;return!0}}class w{constructor(e){this._args=e,this.type=o}static parse(e,t){let n=[];for(let r=1;r<e.length;r++)n.push($(e[r],t));return new w(n)}evaluate(e,t){for(let n of this._args)if(n.evaluate(e,t))return!0;return!1}}class T{constructor(e){this._args=e,this.type=o}static parse(e,t){let n=[];for(let r=1;r<e.length;r++)n.push($(e[r],t));return new T(n)}evaluate(e,t){for(let n of this._args)if(n.evaluate(e,t))return!1;return!0}}class E{constructor(e,t,n){this.type=e,this._args=t,this._fallback=n}static parse(e,t,n){if(e.length<4)throw Error(`"case" expects at least 3 arguments`);if(e.length%2==1)throw Error(`"case" expects an odd number of arguments`);let r,i=[];for(let a=1;a<e.length-1;a+=2){let o=$(e[a],t),s=$(e[a+1],t,n);r||=s.type,i.push({condition:o,output:s})}let a=$(e[e.length-1],t,n);return r||=a.type,new E(r,i,a)}evaluate(e,t){for(let n of this._args)if(n.condition.evaluate(e,t))return n.output.evaluate(e,t);return this._fallback.evaluate(e,t)}}class D{constructor(e,t){this.type=e,this._args=t}static parse(e,t){if(e.length<2)throw Error(`"coalesce" expects at least 1 argument`);let n,r=[];for(let i=1;i<e.length;i++){let a=$(e[i],t);n||=a.type,r.push(a)}return new D(n,r)}evaluate(e,t){for(let n of this._args){let r=n.evaluate(e,t);if(r!==null)return r}return null}}class O{constructor(e,t,n,r,i){this.type=e,this._input=t,this._labels=n,this._outputs=r,this._fallback=i}static parse(e,t){if(e.length<3)throw Error(`"match" expects at least 3 arguments`);if(e.length%2==0)throw Error(`"case" expects an even number of arguments`);let n,r=$(e[1],t),i=[],a={},o;for(let r=2;r<e.length-1;r+=2){let s=e[r];Array.isArray(s)||(s=[s]);for(let e of s){let t=typeof e;if(t!==`string`&&t!==`number`)throw Error(`"match" requires string or number literal as labels`);if(!o)o=t;else if(t!==o)throw Error(`"match" requires labels to have the same type`);a[e]=i.length}let c=$(e[r+1],t);n||=c.type,i.push(c)}return new O(n,r,a,i,$(e[e.length-1],t))}evaluate(e,t){let n=this._input.evaluate(e,t);return(this._outputs[this._labels[n]]||this._fallback).evaluate(e,t)}}class k{constructor(e,t,n,r,i){this._operator=e,this.type=t,this.interpolation=n,this.input=r,this._stops=i}static parse(e,t,n){let r=e[0];if(e.length<5)throw Error(`"${r}" expects at least 4 arguments`);let i=e[1];if(!Array.isArray(i)||i.length===0)throw Error(`"${i}" is not a valid interpolation`);switch(i[0]){case`linear`:if(i.length!==1)throw Error(`Linear interpolation cannot have parameters`);break;case`exponential`:if(i.length!==2||typeof i[1]!=`number`)throw Error(`Exponential interpolation requires one numeric argument`);break;case`cubic-bezier`:if(i.length!==5)throw Error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1`);for(let e=1;e<5;e++){let t=i[e];if(typeof t!=`number`||t<0||t>1)throw Error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1`)}break;default:throw Error(`"${e[0]}" unknown interpolation type "${i[0]}"`)}if(e.length%2!=1)throw Error(`"${r}" expects an even number of arguments`);let a=$(e[2],t,s),o;r===`interpolate-hcl`||r===`interpolate-lab`?o=l:n&&n.kind!==`value`&&(o=n);let c=[];for(let n=3;n<e.length;n+=2){let i=e[n];if(typeof i!=`number`)throw Error(`"${r}" requires stop inputs as literal numbers`);if(c.length&&c[c.length-1][0]>=i)throw Error(`"${r}" requires strictly ascending stop inputs`);let a=$(e[n+1],t,o);o||=a.type,c.push([i,a])}if(o&&o!==l&&o!==s&&(o.kind!==`array`||o.itemType!==s))throw Error(`"${r}" cannot interpolate type ${f(o)}`);return new k(r,o,i,a,c)}evaluate(i,o){let s=this._stops;if(s.length===1)return s[0][1].evaluate(i,o);let c=this.input.evaluate(i,o);if(c<=s[0][0])return s[0][1].evaluate(i,o);if(c>=s[s.length-1][0])return s[s.length-1][1].evaluate(i,o);let l=0;for(;++l<s.length&&!(c<s[l][0]););let u=s[l-1][0],d=s[l][0],p=k.interpolationRatio(this.interpolation,c,u,d),m=s[l-1][1].evaluate(i,o),h=s[l][1].evaluate(i,o);if(this._operator===`interpolate`){if(this.type.kind===`array`&&Array.isArray(m)&&Array.isArray(h))return m.map((e,t)=>a(e,h[t],p));if(this.type.kind===`color`&&m instanceof e&&h instanceof e){let t=new e(m),n=new e(h);return new e([a(t.r,n.r,p),a(t.g,n.g,p),a(t.b,n.b,p),a(t.a,n.a,p)])}if(this.type.kind===`number`&&typeof m==`number`&&typeof h==`number`)return a(m,h,p);throw Error(`"${this._operator}" cannot interpolate type ${f(this.type)}`)}if(this._operator===`interpolate-hcl`){let r=t(m),i=t(h),o=i.h-r.h,s=n({h:r.h+p*(o>180||o<-180?o-360*Math.round(o/360):o),c:a(r.c,i.c,p),l:a(r.l,i.l,p)});return new e({a:a(m.a,h.a,p),...s})}if(this._operator===`interpolate-lab`){let t=r(m),i=r(h),o=n({l:a(t.l,i.l,p),a:a(t.a,i.a,p),b:a(t.b,i.b,p)});return new e({a:a(m.a,h.a,p),...o})}throw Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(e,t){let n=this._stops;if(n.length===1||e>=n[n.length-1][0])return 0;let r=0;for(;++r<n.length&&!(e<n[r][0]););let i=n[r-1][0],a=n[r][0];return k.interpolationRatio(this.interpolation,t,i,a)}getInterpolationRange(e){let t=this._stops;if(t.length===1){let e=t[0][0];return[e,e]}let n=t[t.length-1][0];if(e>=n)return[n,n];let r=0;for(;++r<t.length&&!(e<t[r][0]););return[t[r-1][0],t[r][0]]}static interpolationRatio(e,t,n,r){let a=0;return e[0]===`linear`?a=k._exponentialInterpolationRatio(t,1,n,r):e[0]===`exponential`?a=k._exponentialInterpolationRatio(t,e[1],n,r):e[0]===`cubic-bezier`&&(a=i(e[1],e[2],e[3],e[4])(k._exponentialInterpolationRatio(t,1,n,r),1e-5)),a<0?a=0:a>1&&(a=1),a}static _exponentialInterpolationRatio(e,t,n,r){let i=r-n;if(i===0)return 0;let a=e-n;return t===1?a/i:(t**a-1)/(t**i-1)}}class A{constructor(e,t,n){this.type=e,this._input=t,this._stops=n}static parse(e,t){if(e.length<5)throw Error(`"step" expects at least 4 arguments`);if(e.length%2!=1)throw Error(`"step" expects an even number of arguments`);let n=$(e[1],t,s),r,i=[];i.push([-1/0,$(e[2],t)]);for(let n=3;n<e.length;n+=2){let a=e[n];if(typeof a!=`number`)throw Error(`"step" requires stop inputs as literal numbers`);if(i.length&&i[i.length-1][0]>=a)throw Error(`"step" requires strictly ascending stop inputs`);let o=$(e[n+1],t);r||=o.type,i.push([a,o])}return new A(r,n,i)}evaluate(e,t){let n=this._stops;if(n.length===1)return n[0][1].evaluate(e,t);let r=this._input.evaluate(e,t),i=0;for(;++i<n.length&&!(r<n[i][0]););return this._stops[i-1][1].evaluate(e,t)}}class j{constructor(e,t){this.type=e,this._output=t}static parse(e,t,n){if(e.length<4)throw Error(`"let" expects at least 3 arguments`);if(e.length%2==1)throw Error(`"let" expects an odd number of arguments`);let r=new te(t);for(let n=1;n<e.length-1;n+=2){let i=e[n];if(typeof i!=`string`)throw Error(`"let" requires a string to define variable names - found ${i}`);r.add(i,$(e[n+1],t))}let i=$(e[e.length-1],r,n);return new j(i.type,i)}evaluate(e,t){return this._output.evaluate(e,t)}}class M{constructor(e,t){this.type=e,this.output=t}static parse(e,t,n){if(e.length!==2||typeof e[1]!=`string`)throw Error(`"var" requires just one literal string argument`);let r=t.get(e[1]);if(!r)throw Error(`${e[1]} must be defined before being used in a "var" expression`);return new M(n||d,r)}evaluate(e,t){return this.output.evaluate(e,t)}}class N{constructor(e,t,n){this.type=e,this._index=t,this._array=n}static parse(e,t){if(e.length!==3)throw Error(`"at" expects 2 arguments`);let n=$(e[1],t,s),r=$(e[2],t);return new N(r.type.itemType,n,r)}evaluate(e,t){let n=this._index.evaluate(e,t),r=this._array.evaluate(e,t);if(n<0||n>=r.length)throw Error(`"at" index out of bounds`);if(n!==Math.floor(n))throw Error(`"at" index must be an integer`);return r[n]}}class P{constructor(e){this._args=e,this.type=d}static parse(e,t){let n=e.slice(1).map(e=>Array.isArray(e)?$(e,t):e);return new P(n)}evaluate(e,t){let n=(e,t)=>Array.from({length:e.length/2},(n,r)=>t(e[2*r],e[2*r+1])),r=(e,t)=>e,i;return this._args&&(i=this._args.map(n=>n&&n.evaluate?n.evaluate(e,t):n)),!i||i.length<2&&i.length%2==1?``:n(i,r).join()}}class F{constructor(e,t){this._key=e,this._obj=t,this.type=d}static parse(e,t){let n,r;switch(e.length){case 2:return n=$(e[1],t),new F(n);case 3:return n=$(e[1],t),r=$(e[2],t),new F(n,r);default:throw Error(`"get" expects 1 or 2 arguments`)}}evaluate(e,t){let n=this._key.evaluate(e,t);return this._obj?this._obj.evaluate(e,t)[n]:e?.values[n]}}class I{constructor(e,t){this._key=e,this._obj=t,this.type=o}static parse(e,t){let n,r;switch(e.length){case 2:return n=$(e[1],t),new I(n);case 3:return n=$(e[1],t),r=$(e[2],t),new I(n,r);default:throw Error(`"has" expects 1 or 2 arguments`)}}evaluate(e,t){let n=this._key.evaluate(e,t);return this._obj?n in this._obj.evaluate(e,t):!!e?.values[n]}}class L{constructor(e,t){this._key=e,this._vals=t,this.type=o}static parse(e,t){if(e.length!==3)throw Error(`"in" expects 2 arguments`);return new L($(e[1],t),$(e[2],t))}evaluate(e,t){let n=this._key.evaluate(e,t);return this._vals.evaluate(e,t).includes(n)}}class R{constructor(e,t,n){this._item=e,this._array=t,this._from=n,this.type=s}static parse(e,t){if(e.length<3||e.length>4)throw Error(`"index-of" expects 3 or 4 arguments`);let n=$(e[1],t),r=$(e[2],t);if(e.length===4){let i=$(e[3],t,s);return new R(n,r,i)}return new R(n,r)}evaluate(e,t){let n=this._item.evaluate(e,t),r=this._array.evaluate(e,t);if(this._from){let i=this._from.evaluate(e,t);if(i!==Math.floor(i))throw Error(`"index-of" index must be an integer`);return r.indexOf(n,i)}return r.indexOf(n)}}class z{constructor(e){this._arg=e,this.type=s}static parse(e,t){if(e.length!==2)throw Error(`"length" expects 2 arguments`);let n=$(e[1],t);return new z(n)}evaluate(e,t){let n=this._arg.evaluate(e,t);if(typeof n==`string`||Array.isArray(n))return n.length;throw Error(`"length" expects string or array`)}}class B{constructor(e,t,n,r){this.type=e,this._array=t,this._from=n,this._to=r}static parse(e,t){if(e.length<3||e.length>4)throw Error(`"slice" expects 2 or 3 arguments`);let n=$(e[1],t),r=$(e[2],t,s);if(r.type!==s)throw Error(`"slice" index must return a number`);if(e.length===4){let i=$(e[3],t,s);if(i.type!==s)throw Error(`"slice" index must return a number`);return new B(n.type,n,r,i)}return new B(n.type,n,r)}evaluate(e,t){let n=this._array.evaluate(e,t);if(!Array.isArray(n)&&typeof n!=`string`)throw Error(`"slice" input must be an array or a string`);let r=this._from.evaluate(e,t);if(r<0||r>=n.length)throw Error(`"slice" index out of bounds`);if(r!==Math.floor(r))throw Error(`"slice" index must be an integer`);if(this._to){let i=this._to.evaluate(e,t);if(i<0||i>=n.length)throw Error(`"slice" index out of bounds`);if(i!==Math.floor(i))throw Error(`"slice" index must be an integer`);return n.slice(r,i)}return n.slice(r)}}class V{constructor(){this.type=o}static parse(e){if(e.length!==1)throw Error(`"has-id" expects no arguments`);return new V}evaluate(e,t){return e?.id!==void 0}}class H{constructor(e,t){this._args=e,this._calculate=t,this.type=s}static parse(e,t,n){let r=e.slice(1).map(e=>$(e,t));return new H(r,n)}evaluate(e,t){let n;return this._args&&(n=this._args.map(n=>n.evaluate(e,t))),this._calculate(n)}}class ce extends H{static parse(e,t){switch(e.length){case 2:return H.parse(e,t,e=>-e[0]);case 3:return H.parse(e,t,e=>e[0]-e[1]);default:throw Error(`"-" expects 1 or 2 arguments`)}}}class le extends H{static parse(e,t){return H.parse(e,t,e=>{let t=1;for(let n of e)t*=n;return t})}}class ue extends H{static parse(e,t){if(e.length===3)return H.parse(e,t,e=>e[0]/e[1]);throw Error(`"/" expects 2 arguments`)}}class de extends H{static parse(e,t){if(e.length===3)return H.parse(e,t,e=>e[0]%e[1]);throw Error(`"%" expects 2 arguments`)}}class fe extends H{static parse(e,t){if(e.length===3)return H.parse(e,t,e=>e[0]**e[1]);throw Error(`"^" expects 1 or 2 arguments`)}}class pe extends H{static parse(e,t){return H.parse(e,t,e=>{let t=0;for(let n of e)t+=n;return t})}}class U{constructor(e,t){this._args=e,this._calculate=t,this.type=s}static{this.ops={abs:e=>Math.abs(e[0]),acos:e=>Math.acos(e[0]),asin:e=>Math.asin(e[0]),atan:e=>Math.atan(e[0]),ceil:e=>Math.ceil(e[0]),cos:e=>Math.cos(e[0]),e:()=>Math.E,floor:e=>Math.floor(e[0]),ln:e=>Math.log(e[0]),ln2:()=>Math.LN2,log10:e=>Math.log(e[0])/Math.LN10,log2:e=>Math.log(e[0])/Math.LN2,max:e=>Math.max(...e),min:e=>Math.min(...e),pi:()=>Math.PI,round:e=>Math.round(e[0]),sin:e=>Math.sin(e[0]),sqrt:e=>Math.sqrt(e[0]),tan:e=>Math.tan(e[0])}}static parse(e,t){let n=e.slice(1).map(e=>$(e,t));return new U(n,U.ops[e[0]])}evaluate(e,t){let n;return this._args&&(n=this._args.map(n=>n.evaluate(e,t))),this._calculate(n)}}class W{constructor(e){this._args=e,this.type=u}static parse(e,t){return new W(e.slice(1).map(e=>$(e,t)))}evaluate(e,t){return this._args.map(n=>n.evaluate(e,t)).join(``)}}class G{constructor(e,t){this._arg=e,this._calculate=t,this.type=u}static{this.ops={downcase:e=>e.toLowerCase(),upcase:e=>e.toUpperCase()}}static parse(e,t){if(e.length!==2)throw Error(`${e[0]} expects 1 argument`);let n=$(e[1],t);return new G(n,G.ops[e[0]])}evaluate(e,t){return this._calculate(this._arg.evaluate(e,t))}}class K{constructor(e){this._args=e,this.type=l}static parse(e,t){if(e.length!==4)throw Error(`"rgb" expects 3 arguments`);let n=e.slice(1).map(e=>$(e,t));return new K(n)}evaluate(t,n){let r=this._validate(this._args[0].evaluate(t,n)),i=this._validate(this._args[1].evaluate(t,n)),a=this._validate(this._args[2].evaluate(t,n));return new e({r,g:i,b:a})}_validate(e){if(typeof e!=`number`||e<0||e>255)throw Error(`${e}: invalid color component`);return Math.round(e)}}class q{constructor(e){this._args=e,this.type=l}static parse(e,t){if(e.length!==5)throw Error(`"rgba" expects 4 arguments`);let n=e.slice(1).map(e=>$(e,t));return new q(n)}evaluate(t,n){let r=this._validate(this._args[0].evaluate(t,n)),i=this._validate(this._args[1].evaluate(t,n)),a=this._validate(this._args[2].evaluate(t,n)),o=this._validateAlpha(this._args[3].evaluate(t,n));return new e({r,g:i,b:a,a:o})}_validate(e){if(typeof e!=`number`||e<0||e>255)throw Error(`${e}: invalid color component`);return Math.round(e)}_validateAlpha(e){if(typeof e!=`number`||e<0||e>1)throw Error(`${e}: invalid alpha color component`);return e}}class J{constructor(e){this._color=e,this.type=c(s,4)}static parse(e,t){if(e.length!==2)throw Error(`"to-rgba" expects 1 argument`);let n=$(e[1],t);return new J(n)}evaluate(t,n){return new e(this._color.evaluate(t,n)).toRgba()}}class Y{constructor(e,t){this.type=e,this._args=t}static parse(e,t){let n=e[0];if(e.length<2)throw Error(`${n} expects at least one argument`);let r=1,i;if(n===`array`){if(e.length>2){switch(e[1]){case`string`:i=u;break;case`number`:i=s;break;case`boolean`:i=o;break;default:throw Error(`"array" type argument must be string, number or boolean`)}r++}else i=d;let t;if(e.length>3){if(t=e[2],t!==null&&(typeof t!=`number`||t<0||t!==Math.floor(t)))throw Error(`"array" length argument must be a positive integer literal`);r++}i=c(i,t)}else switch(n){case`string`:i=u;break;case`number`:i=s;break;case`boolean`:i=o;break;case`object`:i=p}let a=[];for(;r<e.length;r++){let n=$(e[r],t);a.push(n)}return new Y(i,a)}evaluate(e,t){let n;for(let r of this._args){let i=r.evaluate(e,t);if(n=m(i),ee(n,this.type))return i}throw Error(`Expected ${f(this.type)} but got ${f(n)}`)}}class X{static{this.types={"to-boolean":o,"to-color":l,"to-number":s,"to-string":u}}constructor(e,t){this.type=e,this._args=t}static parse(e,t){let n=e[0],r=X.types[n];if(r===o||r===u){if(e.length!==2)throw Error(`${n} expects one argument`)}else if(e.length<2)throw Error(`${n} expects at least one argument`);let i=[];for(let n=1;n<e.length;n++){let r=$(e[n],t);i.push(r)}return new X(r,i)}evaluate(t,n){if(this.type===o)return!!this._args[0].evaluate(t,n);if(this.type===u)return h(this._args[0].evaluate(t,n));if(this.type===s){for(let e of this._args){let r=Number(e.evaluate(t,n));if(!isNaN(r))return r}return null}if(this.type===l){for(let r of this._args)try{let i=X.toColor(r.evaluate(t,n));if(i instanceof e)return i}catch{}return null}}static toBoolean(e){return!!e}static toString(e){return h(e)}static toNumber(e){let t=Number(e);if(isNaN(t))throw Error(`"${e}" is not a number`);return t}static toColor(t){if(t instanceof e)return t;if(typeof t==`string`){let n=e.fromString(t);if(n)return n;throw Error(`"${t}" is not a color`)}if(Array.isArray(t))return e.fromArray(t);throw Error(`"${t}" is not a color`)}}class Z{constructor(e){this._val=e,this.type=m(e)}static parse(e){if(e.length!==2)throw Error(`"literal" expects 1 argument`);return new Z(e[1])}evaluate(e,t){return this._val}}class Q{constructor(e){this._arg=e,this.type=u}static parse(e,t){if(e.length!==2)throw Error(`"typeof" expects 1 argument`);return new Q($(e[1],t))}evaluate(e,t){return f(m(this._arg.evaluate(e,t)))}}function $(e,t,n){let r=typeof e;if(r===`string`||r===`boolean`||r===`number`||e===null){if(n)switch(n.kind){case`string`:r!==`string`&&(e=X.toString(e));break;case`number`:r!==`number`&&(e=X.toNumber(e));break;case`color`:e=X.toColor(e)}e=[`literal`,e]}if(!Array.isArray(e)||e.length===0)throw Error(`Expression must be a non empty array`);let i=e[0];if(typeof i!=`string`)throw Error(`First element of expression must be a string`);let a=me[i];if(a===void 0)throw Error(`Invalid expression operator "${i}"`);if(!a)throw Error(`Unimplemented expression operator "${i}"`);return a.parse(e,t,n)}const me={array:Y,boolean:Y,collator:null,format:P,image:null,literal:Z,number:Y,"number-format":null,object:Y,string:Y,"to-boolean":X,"to-color":X,"to-number":X,"to-string":X,typeof:Q,accumulated:null,"feature-state":null,"geometry-type":_,id:g,"line-progress":null,properties:v,at:N,get:F,has:I,in:L,"index-of":R,length:z,slice:B,"!":S,"!=":ie,"<":ae,"<=":x,"==":re,">":oe,">=":se,all:C,any:w,case:E,coalesce:D,match:O,within:null,interpolate:k,"interpolate-hcl":k,"interpolate-lab":k,step:A,let:j,var:M,concat:W,downcase:G,"is-supported-script":null,"resolved-locale":null,upcase:G,rgb:K,rgba:q,"to-rgba":J,"-":ce,"*":le,"/":ue,"%":de,"^":fe,"+":pe,abs:U,acos:U,asin:U,atan:U,ceil:U,cos:U,e:U,floor:U,ln:U,ln2:U,log10:U,log2:U,max:U,min:U,pi:U,round:U,sin:U,sqrt:U,tan:U,zoom:y,"heatmap-density":null,"has-id":V,none:T};export{C as ALL,w as ANY,pe as Add,Y as Assert,N as At,U as Calculate,E as Case,D as Coalesce,X as Coerce,W as Concat,ue as Div,re as EQ,P as Format,se as GE,oe as GT,_ as GeomType,F as Get,I as Has,V as HasID,g as ID,L as In,R as IndexOf,k as Interpolate,x as LE,ae as LT,z as Length,j as Let,Z as Literal,O as Match,de as Mod,le as Mul,ie as NE,T as NONE,S as NOT,fe as Pow,v as Properties,K as Rgb,q as Rgba,B as Slice,A as Step,G as String,ce as Sub,J as ToRgba,Q as TypeOf,M as Var,y as Zoom,$ as createExpression,ne as isFeatureDependentExpression,me as ops};
|
|
2
|
+
import e from"../../../../../Color.js";import{toLCH as t,toRGB as n,toLAB as r}from"../../../../../core/colorUtils.js";import{unitBezier as i}from"../../../unitBezier.js";import{interpolate as a}from"../GeometryUtils.js";import{booleanType as o,numberType as s,arrayType as c,colorType as l,stringType as u,valueType as d,typeToString as f,objectType as p,getType as m,valueToString as h,matchType as ee}from"./types.js";class te{constructor(e){this._parent=e,this._vars={}}add(e,t){this._vars[e]=t}get(e){return this._vars[e]?this._vars[e]:this._parent?this._parent.get(e):null}}function ne(e){if(!Array.isArray(e)||e.length===0)return!1;let t=e[0];if(t===`literal`)return!1;if(t===`accumulated`||t===`feature-state`||t===`geometry-type`||t===`id`||t===`line-progress`||t===`properties`||t===`has-id`||(t===`get`||t===`has`)&&e.length===2)return!0;for(let t=1;t<e.length;t++)if(ne(e[t]))return!0;return!1}class g{constructor(){this.type=d}static parse(e){if(e.length>1)throw Error(`"id" does not expect arguments`);return new g}evaluate(e,t){return e?.id}}class _{constructor(){this.type=u}static parse(e){if(e.length>1)throw Error(`"geometry-type" does not expect arguments`);return new _}evaluate(e,t){if(!e)return null;switch(e.type){case 1:return`Point`;case 2:return`LineString`;case 3:return`Polygon`;default:return null}}}class v{constructor(){this.type=p}static parse(e){if(e.length>1)throw Error(`"properties" does not expect arguments`);return new v}evaluate(e,t){return e?.values}}class y{constructor(){this.type=s}static parse(e){if(e.length>1)throw Error(`"zoom" does not expect arguments`);return new y}evaluate(e,t){return t}}class b{constructor(e,t,n){this._lhs=e,this._rhs=t,this._compare=n,this.type=o}static parse(e,t,n){if(e.length!==3&&e.length!==4)throw Error(`"${e[0]}" expects 2 or 3 arguments`);if(e.length===4)throw Error(`"${e[0]}" collator not supported`);return new b($(e[1],t),$(e[2],t),n)}evaluate(e,t){return this._compare(this._lhs.evaluate(e,t),this._rhs.evaluate(e,t))}}class re extends b{static parse(e,t){return b.parse(e,t,(e,t)=>e===t)}}class ie extends b{static parse(e,t){return b.parse(e,t,(e,t)=>e!==t)}}class ae extends b{static parse(e,t){return b.parse(e,t,(e,t)=>e<t)}}class x extends b{static parse(e,t){return b.parse(e,t,(e,t)=>e<=t)}}class oe extends b{static parse(e,t){return b.parse(e,t,(e,t)=>e>t)}}class se extends b{static parse(e,t){return b.parse(e,t,(e,t)=>e>=t)}}class S{constructor(e){this._arg=e,this.type=o}static parse(e,t){if(e.length!==2)throw Error(`"!" expects 1 argument`);return new S($(e[1],t))}evaluate(e,t){return!this._arg.evaluate(e,t)}}class C{constructor(e){this._args=e,this.type=o}static parse(e,t){let n=[];for(let r=1;r<e.length;r++)n.push($(e[r],t));return new C(n)}evaluate(e,t){for(let n of this._args)if(!n.evaluate(e,t))return!1;return!0}}class w{constructor(e){this._args=e,this.type=o}static parse(e,t){let n=[];for(let r=1;r<e.length;r++)n.push($(e[r],t));return new w(n)}evaluate(e,t){for(let n of this._args)if(n.evaluate(e,t))return!0;return!1}}class T{constructor(e){this._args=e,this.type=o}static parse(e,t){let n=[];for(let r=1;r<e.length;r++)n.push($(e[r],t));return new T(n)}evaluate(e,t){for(let n of this._args)if(n.evaluate(e,t))return!1;return!0}}class E{constructor(e,t,n){this.type=e,this._args=t,this._fallback=n}static parse(e,t,n){if(e.length<4)throw Error(`"case" expects at least 3 arguments`);if(e.length%2==1)throw Error(`"case" expects an odd number of arguments`);let r,i=[];for(let a=1;a<e.length-1;a+=2){let o=$(e[a],t),s=$(e[a+1],t,n);r||=s.type,i.push({condition:o,output:s})}let a=$(e[e.length-1],t,n);return r||=a.type,new E(r,i,a)}evaluate(e,t){for(let n of this._args)if(n.condition.evaluate(e,t))return n.output.evaluate(e,t);return this._fallback.evaluate(e,t)}}class D{constructor(e,t){this.type=e,this._args=t}static parse(e,t){if(e.length<2)throw Error(`"coalesce" expects at least 1 argument`);let n,r=[];for(let i=1;i<e.length;i++){let a=$(e[i],t);n||=a.type,r.push(a)}return new D(n,r)}evaluate(e,t){for(let n of this._args){let r=n.evaluate(e,t);if(r!==null)return r}return null}}class O{constructor(e,t,n,r,i){this.type=e,this._input=t,this._labels=n,this._outputs=r,this._fallback=i}static parse(e,t){if(e.length<3)throw Error(`"match" expects at least 3 arguments`);if(e.length%2==0)throw Error(`"case" expects an even number of arguments`);let n,r=$(e[1],t),i=[],a={},o;for(let r=2;r<e.length-1;r+=2){let s=e[r];Array.isArray(s)||(s=[s]);for(let e of s){let t=typeof e;if(t!==`string`&&t!==`number`)throw Error(`"match" requires string or number literal as labels`);if(!o)o=t;else if(t!==o)throw Error(`"match" requires labels to have the same type`);a[e]=i.length}let c=$(e[r+1],t);n||=c.type,i.push(c)}return new O(n,r,a,i,$(e[e.length-1],t))}evaluate(e,t){let n=this._input.evaluate(e,t);return(this._outputs[this._labels[n]]||this._fallback).evaluate(e,t)}}class k{constructor(e,t,n,r,i){this._operator=e,this.type=t,this.interpolation=n,this.input=r,this._stops=i}static parse(e,t,n){let r=e[0];if(e.length<5)throw Error(`"${r}" expects at least 4 arguments`);let i=e[1];if(!Array.isArray(i)||i.length===0)throw Error(`"${i}" is not a valid interpolation`);switch(i[0]){case`linear`:if(i.length!==1)throw Error(`Linear interpolation cannot have parameters`);break;case`exponential`:if(i.length!==2||typeof i[1]!=`number`)throw Error(`Exponential interpolation requires one numeric argument`);break;case`cubic-bezier`:if(i.length!==5)throw Error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1`);for(let e=1;e<5;e++){let t=i[e];if(typeof t!=`number`||t<0||t>1)throw Error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1`)}break;default:throw Error(`"${e[0]}" unknown interpolation type "${i[0]}"`)}if(e.length%2!=1)throw Error(`"${r}" expects an even number of arguments`);let a=$(e[2],t,s),o;r===`interpolate-hcl`||r===`interpolate-lab`?o=l:n&&n.kind!==`value`&&(o=n);let c=[];for(let n=3;n<e.length;n+=2){let i=e[n];if(typeof i!=`number`)throw Error(`"${r}" requires stop inputs as literal numbers`);if(c.length&&c[c.length-1][0]>=i)throw Error(`"${r}" requires strictly ascending stop inputs`);let a=$(e[n+1],t,o);o||=a.type,c.push([i,a])}if(o&&o!==l&&o!==s&&(o.kind!==`array`||o.itemType!==s))throw Error(`"${r}" cannot interpolate type ${f(o)}`);return new k(r,o,i,a,c)}evaluate(i,o){let s=this._stops;if(s.length===1)return s[0][1].evaluate(i,o);let c=this.input.evaluate(i,o);if(typeof c!=`number`)throw Error(`"${this._operator}" input must be a number`);if(c<=s[0][0])return s[0][1].evaluate(i,o);if(c>=s[s.length-1][0])return s[s.length-1][1].evaluate(i,o);let l=0;for(;++l<s.length&&!(c<s[l][0]););let u=s[l-1][0],d=s[l][0],p=k.interpolationRatio(this.interpolation,c,u,d),m=s[l-1][1].evaluate(i,o),h=s[l][1].evaluate(i,o);if(this._operator===`interpolate`){if(this.type.kind===`array`&&Array.isArray(m)&&Array.isArray(h))return m.map((e,t)=>a(e,h[t],p));if(this.type.kind===`color`&&m instanceof e&&h instanceof e){let t=new e(m),n=new e(h);return new e([a(t.r,n.r,p),a(t.g,n.g,p),a(t.b,n.b,p),a(t.a,n.a,p)])}if(this.type.kind===`number`&&typeof m==`number`&&typeof h==`number`)return a(m,h,p);throw Error(`"${this._operator}" cannot interpolate type ${f(this.type)}`)}if(this._operator===`interpolate-hcl`){let r=t(m),i=t(h),o=i.h-r.h,s=n({h:r.h+p*(o>180||o<-180?o-360*Math.round(o/360):o),c:a(r.c,i.c,p),l:a(r.l,i.l,p)});return new e({a:a(m.a,h.a,p),...s})}if(this._operator===`interpolate-lab`){let t=r(m),i=r(h),o=n({l:a(t.l,i.l,p),a:a(t.a,i.a,p),b:a(t.b,i.b,p)});return new e({a:a(m.a,h.a,p),...o})}throw Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(e,t){let n=this._stops;if(n.length===1||e>=n[n.length-1][0])return 0;let r=0;for(;++r<n.length&&!(e<n[r][0]););let i=n[r-1][0],a=n[r][0];return k.interpolationRatio(this.interpolation,t,i,a)}getInterpolationRange(e){let t=this._stops;if(t.length===1){let e=t[0][0];return[e,e]}let n=t[t.length-1][0];if(e>=n)return[n,n];let r=0;for(;++r<t.length&&!(e<t[r][0]););return[t[r-1][0],t[r][0]]}static interpolationRatio(e,t,n,r){let a=0;return e[0]===`linear`?a=k._exponentialInterpolationRatio(t,1,n,r):e[0]===`exponential`?a=k._exponentialInterpolationRatio(t,e[1],n,r):e[0]===`cubic-bezier`&&(a=i(e[1],e[2],e[3],e[4])(k._exponentialInterpolationRatio(t,1,n,r),1e-5)),a<0?a=0:a>1&&(a=1),a}static _exponentialInterpolationRatio(e,t,n,r){let i=r-n;if(i===0)return 0;let a=e-n;return t===1?a/i:(t**a-1)/(t**i-1)}}class A{constructor(e,t,n){this.type=e,this._input=t,this._stops=n}static parse(e,t){if(e.length<5)throw Error(`"step" expects at least 4 arguments`);if(e.length%2!=1)throw Error(`"step" expects an even number of arguments`);let n=$(e[1],t,s),r,i=[];i.push([-1/0,$(e[2],t)]);for(let n=3;n<e.length;n+=2){let a=e[n];if(typeof a!=`number`)throw Error(`"step" requires stop inputs as literal numbers`);if(i.length&&i[i.length-1][0]>=a)throw Error(`"step" requires strictly ascending stop inputs`);let o=$(e[n+1],t);r||=o.type,i.push([a,o])}return new A(r,n,i)}evaluate(e,t){let n=this._stops;if(n.length===1)return n[0][1].evaluate(e,t);let r=this._input.evaluate(e,t),i=0;for(;++i<n.length&&!(r<n[i][0]););return this._stops[i-1][1].evaluate(e,t)}}class j{constructor(e,t){this.type=e,this._output=t}static parse(e,t,n){if(e.length<4)throw Error(`"let" expects at least 3 arguments`);if(e.length%2==1)throw Error(`"let" expects an odd number of arguments`);let r=new te(t);for(let n=1;n<e.length-1;n+=2){let i=e[n];if(typeof i!=`string`)throw Error(`"let" requires a string to define variable names - found ${i}`);r.add(i,$(e[n+1],t))}let i=$(e[e.length-1],r,n);return new j(i.type,i)}evaluate(e,t){return this._output.evaluate(e,t)}}class M{constructor(e,t){this.type=e,this.output=t}static parse(e,t,n){if(e.length!==2||typeof e[1]!=`string`)throw Error(`"var" requires just one literal string argument`);let r=t.get(e[1]);if(!r)throw Error(`${e[1]} must be defined before being used in a "var" expression`);return new M(n||d,r)}evaluate(e,t){return this.output.evaluate(e,t)}}class N{constructor(e,t,n){this.type=e,this._index=t,this._array=n}static parse(e,t){if(e.length!==3)throw Error(`"at" expects 2 arguments`);let n=$(e[1],t,s),r=$(e[2],t);return new N(r.type.itemType,n,r)}evaluate(e,t){let n=this._index.evaluate(e,t),r=this._array.evaluate(e,t);if(n<0||n>=r.length)throw Error(`"at" index out of bounds`);if(n!==Math.floor(n))throw Error(`"at" index must be an integer`);return r[n]}}class P{constructor(e){this._args=e,this.type=d}static parse(e,t){let n=e.slice(1).map(e=>Array.isArray(e)?$(e,t):e);return new P(n)}evaluate(e,t){let n=(e,t)=>Array.from({length:e.length/2},(n,r)=>t(e[2*r],e[2*r+1])),r=(e,t)=>e,i;return this._args&&(i=this._args.map(n=>n&&n.evaluate?n.evaluate(e,t):n)),!i||i.length<2&&i.length%2==1?``:n(i,r).join()}}class F{constructor(e,t){this._key=e,this._obj=t,this.type=d}static parse(e,t){let n,r;switch(e.length){case 2:return n=$(e[1],t),new F(n);case 3:return n=$(e[1],t),r=new Y(p,[$(e[2],t)]),new F(n,r);default:throw Error(`"get" expects 1 or 2 arguments`)}}evaluate(e,t){let n=this._key.evaluate(e,t);return this._obj?this._obj.evaluate(e,t)[n]??null:e?.values[n]??null}}class I{constructor(e,t){this._key=e,this._obj=t,this.type=o}static parse(e,t){let n,r;switch(e.length){case 2:return n=$(e[1],t),new I(n);case 3:return n=$(e[1],t),r=new Y(p,[$(e[2],t)]),new I(n,r);default:throw Error(`"has" expects 1 or 2 arguments`)}}evaluate(e,t){let n=this._key.evaluate(e,t);if(this._obj)return n in this._obj.evaluate(e,t);let r=e?.values;return r!=null&&n in r}}class L{constructor(e,t){this._key=e,this._vals=t,this.type=o}static parse(e,t){if(e.length!==3)throw Error(`"in" expects 2 arguments`);return new L($(e[1],t),$(e[2],t))}evaluate(e,t){let n=this._key.evaluate(e,t);return this._vals.evaluate(e,t).includes(n)}}class R{constructor(e,t,n){this._item=e,this._array=t,this._from=n,this.type=s}static parse(e,t){if(e.length<3||e.length>4)throw Error(`"index-of" expects 3 or 4 arguments`);let n=$(e[1],t),r=$(e[2],t);if(e.length===4){let i=$(e[3],t,s);return new R(n,r,i)}return new R(n,r)}evaluate(e,t){let n=this._item.evaluate(e,t),r=this._array.evaluate(e,t);if(this._from){let i=this._from.evaluate(e,t);if(i!==Math.floor(i))throw Error(`"index-of" index must be an integer`);return r.indexOf(n,i)}return r.indexOf(n)}}class z{constructor(e){this._arg=e,this.type=s}static parse(e,t){if(e.length!==2)throw Error(`"length" expects 2 arguments`);let n=$(e[1],t);return new z(n)}evaluate(e,t){let n=this._arg.evaluate(e,t);if(typeof n==`string`||Array.isArray(n))return n.length;throw Error(`"length" expects string or array`)}}class B{constructor(e,t,n,r){this.type=e,this._array=t,this._from=n,this._to=r}static parse(e,t){if(e.length<3||e.length>4)throw Error(`"slice" expects 2 or 3 arguments`);let n=$(e[1],t),r=$(e[2],t,s);if(r.type!==s)throw Error(`"slice" index must return a number`);if(e.length===4){let i=$(e[3],t,s);if(i.type!==s)throw Error(`"slice" index must return a number`);return new B(n.type,n,r,i)}return new B(n.type,n,r)}evaluate(e,t){let n=this._array.evaluate(e,t);if(!Array.isArray(n)&&typeof n!=`string`)throw Error(`"slice" input must be an array or a string`);let r=this._from.evaluate(e,t);if(r<0||r>=n.length)throw Error(`"slice" index out of bounds`);if(r!==Math.floor(r))throw Error(`"slice" index must be an integer`);if(this._to){let i=this._to.evaluate(e,t);if(i<0||i>=n.length)throw Error(`"slice" index out of bounds`);if(i!==Math.floor(i))throw Error(`"slice" index must be an integer`);return n.slice(r,i)}return n.slice(r)}}class V{constructor(){this.type=o}static parse(e){if(e.length!==1)throw Error(`"has-id" expects no arguments`);return new V}evaluate(e,t){return e?.id!==void 0}}class H{constructor(e,t){this._args=e,this._calculate=t,this.type=s}static parse(e,t,n){let r=e.slice(1).map(e=>$(e,t));return new H(r,n)}evaluate(e,t){let n;return this._args&&(n=this._args.map(n=>n.evaluate(e,t))),this._calculate(n)}}class ce extends H{static parse(e,t){switch(e.length){case 2:return H.parse(e,t,e=>-e[0]);case 3:return H.parse(e,t,e=>e[0]-e[1]);default:throw Error(`"-" expects 1 or 2 arguments`)}}}class le extends H{static parse(e,t){return H.parse(e,t,e=>{let t=1;for(let n of e)t*=n;return t})}}class ue extends H{static parse(e,t){if(e.length===3)return H.parse(e,t,e=>e[0]/e[1]);throw Error(`"/" expects 2 arguments`)}}class de extends H{static parse(e,t){if(e.length===3)return H.parse(e,t,e=>e[0]%e[1]);throw Error(`"%" expects 2 arguments`)}}class fe extends H{static parse(e,t){if(e.length===3)return H.parse(e,t,e=>e[0]**e[1]);throw Error(`"^" expects 1 or 2 arguments`)}}class pe extends H{static parse(e,t){return H.parse(e,t,e=>{let t=0;for(let n of e)t+=n;return t})}}class U{constructor(e,t){this._args=e,this._calculate=t,this.type=s}static{this.ops={abs:e=>Math.abs(e[0]),acos:e=>Math.acos(e[0]),asin:e=>Math.asin(e[0]),atan:e=>Math.atan(e[0]),ceil:e=>Math.ceil(e[0]),cos:e=>Math.cos(e[0]),e:()=>Math.E,floor:e=>Math.floor(e[0]),ln:e=>Math.log(e[0]),ln2:()=>Math.LN2,log10:e=>Math.log(e[0])/Math.LN10,log2:e=>Math.log(e[0])/Math.LN2,max:e=>Math.max(...e),min:e=>Math.min(...e),pi:()=>Math.PI,round:e=>Math.round(e[0]),sin:e=>Math.sin(e[0]),sqrt:e=>Math.sqrt(e[0]),tan:e=>Math.tan(e[0])}}static parse(e,t){let n=e.slice(1).map(e=>$(e,t));return new U(n,U.ops[e[0]])}evaluate(e,t){let n;return this._args&&(n=this._args.map(n=>n.evaluate(e,t))),this._calculate(n)}}class W{constructor(e){this._args=e,this.type=u}static parse(e,t){return new W(e.slice(1).map(e=>$(e,t)))}evaluate(e,t){return this._args.map(n=>n.evaluate(e,t)).join(``)}}class G{constructor(e,t){this._arg=e,this._calculate=t,this.type=u}static{this.ops={downcase:e=>e.toLowerCase(),upcase:e=>e.toUpperCase()}}static parse(e,t){if(e.length!==2)throw Error(`${e[0]} expects 1 argument`);let n=$(e[1],t);return new G(n,G.ops[e[0]])}evaluate(e,t){return this._calculate(this._arg.evaluate(e,t))}}class K{constructor(e){this._args=e,this.type=l}static parse(e,t){if(e.length!==4)throw Error(`"rgb" expects 3 arguments`);let n=e.slice(1).map(e=>$(e,t));return new K(n)}evaluate(t,n){let r=this._validate(this._args[0].evaluate(t,n)),i=this._validate(this._args[1].evaluate(t,n)),a=this._validate(this._args[2].evaluate(t,n));return new e({r,g:i,b:a})}_validate(e){if(typeof e!=`number`||e<0||e>255)throw Error(`${e}: invalid color component`);return Math.round(e)}}class q{constructor(e){this._args=e,this.type=l}static parse(e,t){if(e.length!==5)throw Error(`"rgba" expects 4 arguments`);let n=e.slice(1).map(e=>$(e,t));return new q(n)}evaluate(t,n){let r=this._validate(this._args[0].evaluate(t,n)),i=this._validate(this._args[1].evaluate(t,n)),a=this._validate(this._args[2].evaluate(t,n)),o=this._validateAlpha(this._args[3].evaluate(t,n));return new e({r,g:i,b:a,a:o})}_validate(e){if(typeof e!=`number`||e<0||e>255)throw Error(`${e}: invalid color component`);return Math.round(e)}_validateAlpha(e){if(typeof e!=`number`||e<0||e>1)throw Error(`${e}: invalid alpha color component`);return e}}class J{constructor(e){this._color=e,this.type=c(s,4)}static parse(e,t){if(e.length!==2)throw Error(`"to-rgba" expects 1 argument`);let n=$(e[1],t);return new J(n)}evaluate(t,n){return new e(this._color.evaluate(t,n)).toRgba()}}class Y{constructor(e,t){this.type=e,this._args=t}static parse(e,t){let n=e[0];if(e.length<2)throw Error(`${n} expects at least one argument`);let r=1,i;if(n===`array`){if(e.length>2){switch(e[1]){case`string`:i=u;break;case`number`:i=s;break;case`boolean`:i=o;break;default:throw Error(`"array" type argument must be string, number or boolean`)}r++}else i=d;let t;if(e.length>3){if(t=e[2],t!==null&&(typeof t!=`number`||t<0||t!==Math.floor(t)))throw Error(`"array" length argument must be a positive integer literal`);r++}i=c(i,t)}else switch(n){case`string`:i=u;break;case`number`:i=s;break;case`boolean`:i=o;break;case`object`:i=p}let a=[];for(;r<e.length;r++){let n=$(e[r],t);a.push(n)}return new Y(i,a)}evaluate(e,t){let n;for(let r of this._args){let i=r.evaluate(e,t);if(n=m(i),ee(n,this.type))return i}throw Error(`Expected ${f(this.type)} but got ${f(n)}`)}}class X{static{this.types={"to-boolean":o,"to-color":l,"to-number":s,"to-string":u}}constructor(e,t){this.type=e,this._args=t}static parse(e,t){let n=e[0],r=X.types[n];if(r===o||r===u){if(e.length!==2)throw Error(`${n} expects one argument`)}else if(e.length<2)throw Error(`${n} expects at least one argument`);let i=[];for(let n=1;n<e.length;n++){let r=$(e[n],t);i.push(r)}return new X(r,i)}evaluate(t,n){if(this.type===o)return!!this._args[0].evaluate(t,n);if(this.type===u)return h(this._args[0].evaluate(t,n));if(this.type===s){for(let e of this._args){let r=Number(e.evaluate(t,n));if(!isNaN(r))return r}return null}if(this.type===l){for(let r of this._args)try{let i=X.toColor(r.evaluate(t,n));if(i instanceof e)return i}catch{}return null}}static toBoolean(e){return!!e}static toString(e){return h(e)}static toNumber(e){let t=Number(e);if(isNaN(t))throw Error(`"${e}" is not a number`);return t}static toColor(t){if(t instanceof e)return t;if(typeof t==`string`){let n=e.fromString(t);if(n)return n;throw Error(`"${t}" is not a color`)}if(Array.isArray(t))return e.fromArray(t);throw Error(`"${t}" is not a color`)}}class Z{constructor(e){this._val=e,this.type=m(e)}static parse(e){if(e.length!==2)throw Error(`"literal" expects 1 argument`);return new Z(e[1])}evaluate(e,t){return this._val}}class Q{constructor(e){this._arg=e,this.type=u}static parse(e,t){if(e.length!==2)throw Error(`"typeof" expects 1 argument`);return new Q($(e[1],t))}evaluate(e,t){return f(m(this._arg.evaluate(e,t)))}}function $(e,t,n){let r=typeof e;if(r===`string`||r===`boolean`||r===`number`||e===null){if(n)switch(n.kind){case`string`:r!==`string`&&(e=X.toString(e));break;case`number`:r!==`number`&&(e=X.toNumber(e));break;case`color`:e=X.toColor(e)}e=[`literal`,e]}if(!Array.isArray(e)||e.length===0)throw Error(`Expression must be a non empty array`);let i=e[0];if(typeof i!=`string`)throw Error(`First element of expression must be a string`);let a=me[i];if(a===void 0)throw Error(`Invalid expression operator "${i}"`);if(!a)throw Error(`Unimplemented expression operator "${i}"`);return a.parse(e,t,n)}const me={array:Y,boolean:Y,collator:null,format:P,image:null,literal:Z,number:Y,"number-format":null,object:Y,string:Y,"to-boolean":X,"to-color":X,"to-number":X,"to-string":X,typeof:Q,accumulated:null,"feature-state":null,"geometry-type":_,id:g,"line-progress":null,properties:v,at:N,get:F,has:I,in:L,"index-of":R,length:z,slice:B,"!":S,"!=":ie,"<":ae,"<=":x,"==":re,">":oe,">=":se,all:C,any:w,case:E,coalesce:D,match:O,within:null,interpolate:k,"interpolate-hcl":k,"interpolate-lab":k,step:A,let:j,var:M,concat:W,downcase:G,"is-supported-script":null,"resolved-locale":null,upcase:G,rgb:K,rgba:q,"to-rgba":J,"-":ce,"*":le,"/":ue,"%":de,"^":fe,"+":pe,abs:U,acos:U,asin:U,atan:U,ceil:U,cos:U,e:U,floor:U,ln:U,ln2:U,log10:U,log2:U,max:U,min:U,pi:U,round:U,sin:U,sqrt:U,tan:U,zoom:y,"heatmap-density":null,"has-id":V,none:T};export{C as ALL,w as ANY,pe as Add,Y as Assert,N as At,U as Calculate,E as Case,D as Coalesce,X as Coerce,W as Concat,ue as Div,re as EQ,P as Format,se as GE,oe as GT,_ as GeomType,F as Get,I as Has,V as HasID,g as ID,L as In,R as IndexOf,k as Interpolate,x as LE,ae as LT,z as Length,j as Let,Z as Literal,O as Match,de as Mod,le as Mul,ie as NE,T as NONE,S as NOT,fe as Pow,v as Properties,K as Rgb,q as Rgba,B as Slice,A as Step,G as String,ce as Sub,J as ToRgba,Q as TypeOf,M as Var,y as Zoom,$ as createExpression,ne as isFeatureDependentExpression,me as ops};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{createExpression as e}from"../expression/expression.js";import{booleanType as t}from"../expression/types.js";class n{constructor(e){this._expression=e}filter(e,t){if(!this._expression)return!0;try{return this._expression.evaluate(e,t)}catch(e){return console.log(e.message),!
|
|
2
|
+
import{createExpression as e}from"../expression/expression.js";import{booleanType as t}from"../expression/types.js";class n{constructor(e){this._expression=e}filter(e,t){if(!this._expression)return!0;try{return this._expression.evaluate(e,t)}catch(e){return console.log(e.message),!1}}static createFilter(r){if(!r)return null;this.isLegacyFilter(r)&&(r=this.convertLegacyFilter(r));try{let i=e(r,null,t);return new n(i)}catch(e){return console.log(e.message),null}}static isLegacyFilter(e){if(!Array.isArray(e)||e.length===0)return!0;switch(e[0]){case`==`:case`!=`:case`>`:case`<`:case`>=`:case`<=`:return e.length===3&&typeof e[1]==`string`&&!Array.isArray(e[2]);case`in`:return e.length>=3&&typeof e[1]==`string`&&!Array.isArray(e[2]);case`!in`:return!0;case`any`:case`all`:for(let t=1;t<e.length;t++)if(this.isLegacyFilter(e[t]))return!0;return!1;case`none`:return!0;case`has`:return e.length===2&&(e[1]===`$id`||e[1]===`$type`);case`!has`:return!0;default:return!1}}static convertLegacyFilter(e){if(!Array.isArray(e)||e.length===0)return!0;let t=e[0];if(e.length===1)return t!==`any`;switch(t){case`==`:return n.convertComparison(`==`,e[1],e[2]);case`!=`:return n.negate(n.convertComparison(`==`,e[1],e[2]));case`>`:case`<`:case`>=`:case`<=`:return n.convertComparison(t,e[1],e[2]);case`in`:return n.convertIn(e[1],e.slice(2));case`!in`:return n.negate(n.convertIn(e[1],e.slice(2)));case`any`:case`all`:case`none`:return n.convertCombining(t,e.slice(1));case`has`:return n.convertHas(e[1]);case`!has`:return n.negate(n.convertHas(e[1]));default:throw Error(`Unexpected legacy filter.`)}}static convertComparison(e,t,n){switch(t){case`$type`:return[e,[`geometry-type`],n];case`$id`:return[e,[`id`],n];default:return[e,[`get`,t],n]}}static convertIn(e,t){switch(e){case`$type`:return[`in`,[`geometry-type`],[`literal`,t]];case`$id`:return[`in`,[`id`],[`literal`,t]];default:return[`in`,[`get`,e],[`literal`,t]]}}static convertHas(e){switch(e){case`$type`:return!0;case`$id`:return[`has-id`];default:return[`has`,e]}}static convertCombining(e,t){return[e].concat(t.map(this.convertLegacyFilter))}static negate(e){return[`!`,e]}}export{n as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../request.js";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{fromValues as n}from"../../../../../geometry/support/aaBoundingRect.js";import{isWebMercator as r,getInfo as i,webMercator as a,wgs84 as o}from"../../../../../geometry/support/spatialReferenceUtils.js";import{TileClipper as s}from"../../../../../geometry/support/TileClipper.js";import{convertFromGeometry as c,convertToGeometry as l,generalizeOptimizedGeometry as u,quantizeOptimizedGeometry as d}from"../../../../../layers/graphics/featureConversionUtils.js";import f from"../../../../../layers/graphics/OptimizedGeometry.js";import p from"../../../../../layers/graphics/data/FeatureStore.js";import{project as m}from"../../../../../layers/graphics/data/projectionSupport.js";import{validateGeoJSON as h,createOptimizedFeatures as g
|
|
2
|
+
import e from"../../../../../request.js";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{fromValues as n}from"../../../../../geometry/support/aaBoundingRect.js";import{isWebMercator as r,getInfo as i,webMercator as a,wgs84 as o}from"../../../../../geometry/support/spatialReferenceUtils.js";import{TileClipper as s}from"../../../../../geometry/support/TileClipper.js";import{convertFromGeometry as c,convertToGeometry as l,generalizeOptimizedGeometry as u,quantizeOptimizedGeometry as d}from"../../../../../layers/graphics/featureConversionUtils.js";import f from"../../../../../layers/graphics/OptimizedGeometry.js";import p from"../../../../../layers/graphics/data/FeatureStore.js";import{project as m}from"../../../../../layers/graphics/data/projectionSupport.js";import{validateGeoJSON as h,createOptimizedFeatures as g}from"../../../../../layers/graphics/sources/geojson/geojson.js";const _=4096,v=[{geometryType:`esriGeometryPolygon`,vectorTileGeometryType:3},{geometryType:`esriGeometryPolyline`,vectorTileGeometryType:2},{geometryType:`esriGeometryPoint`,vectorTileGeometryType:1},{geometryType:`esriGeometryMultipoint`,vectorTileGeometryType:1}];class y{constructor(){this._buffer=128,this._featureIds=new Map,this._name=``,this._stores=[],this._webMercatorStores=null,this._tolerance=.375}destroy(){for(let{store:e}of this._stores)e.clear();for(let{store:e}of this._webMercatorStores??[])e.clear();this._webMercatorStores=null,this._featureIds.clear(),this._stores.length=0}async initialize({definition:n,name:r,requestOptions:i},a={}){if(n.data==null)throw Error(`GeoJSON source '${r}' must define a data property.`);if(n.lineMetrics===!0)throw Error(`GeoJSON lineMetrics are not supported.`);if(n.promoteId&&n.generateId)throw Error(`GeoJSON promoteId and generateId cannot be used together.`);let o=typeof n.data==`string`?(await e(n.data,{...i,responseType:`json`,signal:a.signal})).data:n.data;t(a),h(o),this.destroy(),this._buffer=n.buffer??128,this._name=r,this._tolerance=n.tolerance??.375;let s=0;for(let{geometryType:e,vectorTileGeometryType:t}of v){let r=g(o,{geometryType:e,hasZ:!1,getObjectId:(e,t)=>{let r=n.promoteId?e.properties?.[n.promoteId]:n.generateId===!0?t:e.id;return typeof r==`number`||typeof r==`string`?r:null}});if(r.length===0)continue;let i=new p({geometryType:e,hasM:!1,hasZ:!1}),a=[];for(let e of r){if(!e.geometry)continue;let t=e.objectId;e.objectId=s++,this._featureIds.set(e.objectId,t??null),a.push(e)}a.length>0&&(i.addMany(a),this._stores.push({geometryType:e,store:i,vectorTileGeometryType:t}))}return t(a),{geometryTypes:[`polygon`,`line`,`point`].filter(e=>this._stores.some(({vectorTileGeometryType:t})=>t===C(e)))}}requestTile(e,n={}){t(n);let r=this._getTileFeatures(e);return t(n),{result:{layers:[{name:this._name,extent:_,features:r}]},transferList:[]}}_getStores(e){return r(e)?(this._webMercatorStores||=this._stores.map(({geometryType:e,store:t,vectorTileGeometryType:n})=>{let r=new p({geometryType:e,hasM:!1,hasZ:!1});return t.forEach(t=>{let n=b(t.geometry,e);if(n){let e=t.weakClone();e.geometry=n,r.add(e)}}),{geometryType:e,store:r,vectorTileGeometryType:n}}),this._webMercatorStores):this._stores}_getTileFeatures({col:e,row:t,origin:r,tileSpan:a,spatialReference:o}){let s=r.x+e*a,c=r.y-t*a,{valid:l}=i(o),u=l[1]-l[0],d=this._getStores(o),f=a/_,p=this._buffer*f,m=this._tolerance*f,h=[];for(let e of[-u,0,u]){let t=n(s-p-e,c-a-p,s+a+p-e,c+p),r={scale:[f,-f,1,1],translate:[s-e,c,0,0]};for(let{geometryType:e,store:n,vectorTileGeometryType:i}of d)n.forEachInBounds(t,t=>{let n=x(t,e,i,r,m,this._buffer);n&&h.push({attributes:t.attributes,geometry:n,id:this._featureIds.get(t.objectId),type:i})})}return h}}function b(e,t){return e?c(m(l(e,t,!1,!1),o,a))??null:null}function x(e,t,n,r,i,a){if(!e.geometry)return null;let o=i>0?u(e.geometry,t,i,!1,!1):e.geometry;return S(d(o,t,r,!1,!1,!0),n,a)}function S(e,t,n){if(!e)return null;let r=new s(0,0,0,8,n/8);if(r.setExtent(_),r.reset(t),t===1)for(let t=0;t<e.size;t++){let n=t*e.stride;r.moveTo(e.coords[n],e.coords[n+1])}else{let n=0;for(let i of e.lengths){r.moveTo(e.coords[n],e.coords[n+1]);for(let t=1;t<i;t++){let i=n+t*e.stride;r.lineTo(e.coords[i],e.coords[i+1])}t===3&&r.close(),n+=i*e.stride}}let i=r.result();if(!i)return null;let a=t===1?[i.length]:i.map(e=>e.length),o=[];for(let e of i)for(let t of e)o.push(t.x,t.y);return new f(a,o)}function C(e){switch(e){case`polygon`:return 3;case`line`:return 2;case`point`:return 1}}export{y as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../Color.js";import{parseToUnitRgba as t}from"../../../../../colorUtils.js";import{interpolate as n}from"../GeometryUtils.js";import{ops as r,createExpression as i,isFeatureDependentExpression as a,Interpolate as o,Zoom as s}from"../expression/expression.js";import{arrayType as c,stringType as l,booleanType as u,colorType as d,numberType as f,valueType as p,valueToString as m}from"../expression/types.js";class h{constructor(e,t){this.isDataDriven=!1,this.interpolator=null;let n;switch(e.type){case`number`:n=!0;break;case`color`:n=!0;break;case`array`:n=e.value===`number`;break;default:n=!1}if((t==null||t===``&&e.type===`color`)&&(t=e.default),Array.isArray(t)&&t.length>0&&r[t[0]]){let n={number:f,color:d,string:l,boolean:u,enum:l};try{let r=e.type===`array`?c(n[e.value]||p,e.length):n[e.type],l=i(t,null,r);this.getValue=this._buildExpression(l,e),this.isDataDriven=a(t),this.isDataDriven&&l instanceof o&&l.input instanceof s&&(this.interpolator=l)}catch(t){console.log(t.message),this.getValue=this._buildSimple(e.default)}return}n&&t.type===`interval`&&(n=!1);let m=t?.stops&&t.stops.length>0;if(m)for(let n of t.stops)n[1]=this._validate(n[1],e);if(this.isDataDriven=t?!!t.property:!1,this.isDataDriven){if(t.default!==void 0&&(t.default=this._validate(t.default,e)),m)switch(t.type){case`identity`:this.getValue=this._buildIdentity(t,e);break;case`categorical`:this.getValue=this._buildCategorical(t,e);break;default:this.getValue=n?this._buildInterpolate(t,e):this._buildInterval(t,e)}else this.getValue=this._buildIdentity(t,e)}else m?this.getValue=n?this._buildZoomInterpolate(t):this._buildZoomInterval(t):(t=this._validate(t,e),this.getValue=this._buildSimple(t))}_validate(e,t){if(t.type===`number`){if(t.minimum!=null&&e<t.minimum)return t.minimum;if(t.maximum!=null&&e>t.maximum)return t.maximum}else t.type===`color`?e=h._parseColor(e):t.type===`enum`?typeof e==`string`&&(e=t.values.indexOf(e)):t.type===`array`&&t.value===`enum`?e=e.map(e=>typeof e==`string`?t.values.indexOf(e):e):t.type===`string`&&(e=m(e));return e}_buildSimple(e){return()=>e}_buildExpression(e,t){return(n,r)=>{try{let i=e.evaluate(r,n);return i
|
|
2
|
+
import e from"../../../../../Color.js";import{parseToUnitRgba as t}from"../../../../../colorUtils.js";import{interpolate as n}from"../GeometryUtils.js";import{ops as r,createExpression as i,isFeatureDependentExpression as a,Interpolate as o,Zoom as s}from"../expression/expression.js";import{arrayType as c,stringType as l,booleanType as u,colorType as d,numberType as f,valueType as p,valueToString as m}from"../expression/types.js";class h{constructor(e,t){this.isDataDriven=!1,this.interpolator=null;let n;switch(e.type){case`number`:n=!0;break;case`color`:n=!0;break;case`array`:n=e.value===`number`;break;default:n=!1}if((t==null||t===``&&e.type===`color`)&&(t=e.default),Array.isArray(t)&&t.length>0&&r[t[0]]){let n={number:f,color:d,string:l,boolean:u,enum:l};try{let r=e.type===`array`?c(n[e.value]||p,e.length):n[e.type],l=i(t,null,r);this.getValue=this._buildExpression(l,e),this.isDataDriven=a(t),this.isDataDriven&&l instanceof o&&l.input instanceof s&&(this.interpolator=l)}catch(t){console.log(t.message),this.getValue=this._buildSimple(e.default)}return}n&&t.type===`interval`&&(n=!1);let m=t?.stops&&t.stops.length>0;if(m)for(let n of t.stops)n[1]=this._validate(n[1],e);if(this.isDataDriven=t?!!t.property:!1,this.isDataDriven){if(t.default!==void 0&&(t.default=this._validate(t.default,e)),m)switch(t.type){case`identity`:this.getValue=this._buildIdentity(t,e);break;case`categorical`:this.getValue=this._buildCategorical(t,e);break;default:this.getValue=n?this._buildInterpolate(t,e):this._buildInterval(t,e)}else this.getValue=this._buildIdentity(t,e)}else m?this.getValue=n?this._buildZoomInterpolate(t):this._buildZoomInterval(t):(t=this._validate(t,e),this.getValue=this._buildSimple(t))}_validate(e,t){if(t.type===`number`){if(t.minimum!=null&&e<t.minimum)return t.minimum;if(t.maximum!=null&&e>t.maximum)return t.maximum}else t.type===`color`?e=h._parseColor(e):t.type===`enum`?typeof e==`string`&&(e=t.values.indexOf(e)):t.type===`array`&&t.value===`enum`?e=e.map(e=>typeof e==`string`?t.values.indexOf(e):e):t.type===`string`&&(e=m(e));return e}_buildSimple(e){return()=>e}_buildExpression(e,t){return(n,r)=>{try{let i=e.evaluate(r,n);return i==null?t.default:this._validate(i,t)}catch(e){return console.log(e.message),t.default}}}_buildIdentity(e,t){return(n,r)=>{let i;return r&&(i=r.values[e.property]),i!==void 0&&(i=this._validate(i,t)),i??(e.default===void 0?t.default:e.default)}}_buildCategorical(e,t){return(n,r)=>{let i;return r&&(i=r.values[e.property]),i=this._categorical(i,e.stops),i===void 0?e.default===void 0?t.default:e.default:i}}_buildInterval(e,t){return(n,r)=>{let i;return r&&(i=r.values[e.property]),typeof i==`number`?this._interval(i,e.stops):e.default===void 0?t.default:e.default}}_buildInterpolate(e,t){return(n,r)=>{let i;return r&&(i=r.values[e.property]),typeof i==`number`?this._interpolate(i,e.stops,e.base||1):e.default===void 0?t.default:e.default}}_buildZoomInterpolate(e){return t=>this._interpolate(t,e.stops,e.base||1)}_buildZoomInterval(e){return t=>this._interval(t,e.stops)}_categorical(e,t){let n=t.length;for(let r=0;r<n;r++)if(t[r][0]===e)return t[r][1]}_interval(e,t){let n=t.length,r=0;for(let i=0;i<n&&t[i][0]<=e;i++)r=i;return t[r][1]}_interpolate(e,t,r){let i,a,o=t.length;for(let n=0;n<o;n++){let r=t[n];if(r[0]<=e)i=r;else{a=r;break}}if(i&&a){let t=a[0]-i[0],o=e-i[0],s=r===1?o/t:(r**o-1)/(r**t-1);if(Array.isArray(i[1])){let e=i[1],t=a[1],r=[];for(let i=0;i<e.length;i++)r.push(n(e[i],t[i],s));return r}return n(i[1],a[1],s)}if(i)return i[1];if(a)return a[1]}static _isEmpty(e){for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}static _parseColor(n){if(Array.isArray(n))return n;if(typeof n==`string`)return t(n)??void 0;if(n instanceof e&&!this._isEmpty(n))return n.toUnitRGBA()}}export{h as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../DisplayEntity.js";import t from"../DisplayRecord.js";import{noTextureKey as n}from"../materialKeyUtils.js";import{VertexDataWriter as r}from"./VertexDataWriter.js";import i from"../util/Writer.js";class a{constructor(t,r=0){this._id=t,this._sizeHint=r,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._didEntityStart=!1,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._pendingMetrics=[],this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:n,metricBoxLenPointer:0},this._requiresRefresh=!1,this._entities=new i(Uint32Array,this._sizeHint*e.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){let e=[],t=[],n=this._entities.buffer();for(let n of this._instanceIdToVertexData.values())t.push(n.serialize(e));return{message:{data:t,entities:n},transferList:e}}get requiresRefresh(){return this._requiresRefresh}set requiresRefresh(e){this._requiresRefresh=e}vertexStart(){return this._current.vertexStart??0}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(e){this._current.writer.vertexEnsureSize(e)}indexEnsureSize(e){this._current.writer.indexEnsureSize(e)}vertexWrite(e){this._current.writer.writeVertex(e)}vertexWriteRegion(e){this._current.writer.writeVertexRegion(e)}vertexWriteF32(e){this._current.writer.writeVertexF32(e)}recordBounds(e,t,n,r){}indexWrite(e){this._current.writer.writeIndex(e)}metricStart(e){this._current.metric=e,this._current.metric.recordStart=this.recordCount()}metricEnd(){let e=this._current.writer;this._current.metric&&(this._current.metric.recordCount=this.recordCount()-this._current.metric.recordStart),!this._current.metric?.bounds.length||!this._current.metric?.recordCount||this._pendingMetrics.push({metric:this._current.metric,writer:e}),this._current.metric=null}metricBoxWrite(e){this._current.metric.bounds.push(e)}entityStart(e,t=e){this._entityIdIndex=this._entities.push(e),this._entitySortKeyIndex=this._entities.writeF32(t),this._entityRecordCountOffset=this._entities.push(0),this._didEntityStart=!0}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){if(this._didEntityStart){for(let{metric:e,writer:t}of this._pendingMetrics)t.writeMetric(e);this._pendingMetrics.length=0,this.entityRecordCount()===0?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset),this._didEntityStart=!1}}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(e,t,r=n){this._current.writer=this._getVertexWriter(e,t),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=e,this._current.layoutHash=t.hash,this._current.textureKey=r}withRecord(e,t,n,r){return this.recordStart(e,t,n??void 0),r(),this.recordEnd()}writeWithoutBuffering(e){e()}recordEnd(e=0){let n=this._current.vertexStart,r=this._current.writer.vertexCount-n;if(!r)return!1;let i=this._current.indexStart,a=this._current.writer.indexCount-i;return this._recordIndexStart=i,this._recordIndexCount=a,this._recordVertexStart=n,this._recordVertexCount=r,this.
|
|
2
|
+
import e from"../DisplayEntity.js";import t from"../DisplayRecord.js";import{noTextureKey as n}from"../materialKeyUtils.js";import{VertexDataWriter as r}from"./VertexDataWriter.js";import i from"../util/Writer.js";class a{constructor(t,r=0){this._id=t,this._sizeHint=r,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._didEntityStart=!1,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._deferredRecords=null,this._pendingMetrics=[],this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:n,metricBoxLenPointer:0},this._requiresRefresh=!1,this._entities=new i(Uint32Array,this._sizeHint*e.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){let e=[],t=[],n=this._entities.buffer();for(let n of this._instanceIdToVertexData.values())t.push(n.serialize(e));return{message:{data:t,entities:n},transferList:e}}get requiresRefresh(){return this._requiresRefresh}set requiresRefresh(e){this._requiresRefresh=e}vertexStart(){return this._current.vertexStart??0}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(e){this._current.writer.vertexEnsureSize(e)}indexEnsureSize(e){this._current.writer.indexEnsureSize(e)}vertexWrite(e){this._current.writer.writeVertex(e)}vertexWriteRegion(e){this._current.writer.writeVertexRegion(e)}vertexWriteF32(e){this._current.writer.writeVertexF32(e)}recordBounds(e,t,n,r){}indexWrite(e){this._current.writer.writeIndex(e)}metricStart(e){this._current.metric=e,this._current.metric.recordStart=this.recordCount()}metricEnd(){let e=this._current.writer;this._current.metric&&(this._current.metric.recordCount=this.recordCount()-this._current.metric.recordStart),!this._current.metric?.bounds.length||!this._current.metric?.recordCount||this._pendingMetrics.push({metric:this._current.metric,writer:e}),this._current.metric=null}metricBoxWrite(e){this._current.metric.bounds.push(e)}entityStart(e,t=e){this._entityIdIndex=this._entities.push(e),this._entitySortKeyIndex=this._entities.writeF32(t),this._entityRecordCountOffset=this._entities.push(0),this._didEntityStart=!0}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){if(this._didEntityStart){for(let{metric:e,writer:t}of this._pendingMetrics)t.writeMetric(e);this._pendingMetrics.length=0,this.entityRecordCount()===0?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset),this._didEntityStart=!1}}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(e,t,r=n){this._current.writer=this._getVertexWriter(e,t),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=e,this._current.layoutHash=t.hash,this._current.textureKey=r}withRecord(e,t,n,r){return this.recordStart(e,t,n??void 0),r(),this.recordEnd()}writeWithoutBuffering(e){e()}deferRecords(e){if(this._deferredRecords)throw Error(`InternalError: display-record deferral cannot be nested`);let t=[],n=this._entityIdIndex;this._deferredRecords=t;try{e()}finally{this._deferredRecords=null}return()=>{if(!this._didEntityStart||this._entityIdIndex!==n)throw Error(`InternalError: deferred display records must be committed to their originating entity`);for(let e of t)this._appendRecord(e)}}recordEnd(e=0){let n=this._current.vertexStart,r=this._current.writer.vertexCount-n;if(!r)return!1;let i=this._current.indexStart,a=this._current.writer.indexCount-i;return this._recordIndexStart=i,this._recordIndexCount=a,this._recordVertexStart=n,this._recordVertexCount=r,this._appendRecord(new t(this._current.instanceId,this._current.textureKey,i,a,n,r,e)),!0}copyLast(e,n){let r=this._recordVertexStart+this._recordVertexCount;this._appendRecord(new t(this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,r,this._recordVertexCount,0));let i=this._current.writer.indexWriter,a=this._current.writer.vertexWriter,o=this._recordIndexStart+this._recordIndexCount,s=this._recordVertexCount;for(let e=this._recordIndexStart;e!==o;e++){let t=i.getValue(e);i.push(t+s)}let c=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,l=this._recordVertexStart*c,u=(this._recordVertexStart+this._recordVertexCount)*c;for(let e=l;e!==u;e++){let t=a.getValue(e);a.push(t)}let d=this._current.writer.layout.position,f=d.packPrecisionFactor??1,p=d.offset/Uint32Array.BYTES_PER_ELEMENT,m=e*f,h=n*f;for(let e=r*c;e<=a.length;e+=c)a.i1616Add(e+p,m,h)}copyLastFrom(e,t,n){let r=e._entities.getValue(e._entityIdIndex),i=this._entities.getValue(this._entityIdIndex);if(!this._didEntityStart||r!==i){let t=e._entities.getValueF32(e._entitySortKeyIndex);this.entityStart(r,t)}this.recordStart(e._current.instanceId,e._current.writer.layout,e._current.textureKey);let a=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,o=this._current.vertexStart,s=e._current.vertexStart-o,c=this._current.writer.indexWriter,l=this._current.writer.vertexWriter,u=e._current.writer.indexWriter,d=e._current.writer.vertexWriter;for(let t=e._current.indexStart;t!==u.length;t++){let e=u.getValue(t);c.push(e-s)}for(let t=e._current.vertexStart*a;t!==d.length;t++){let e=d.getValue(t);l.push(e)}let f=this._current.writer.layout.position,p=f.packPrecisionFactor??1,m=f.offset/Uint32Array.BYTES_PER_ELEMENT,h=t*p,g=n*p;for(let e=o*a;e<=l.length;e+=a)l.i1616Add(e+m,h,g);this.recordEnd()}_appendRecord(e){this._deferredRecords?this._deferredRecords.push(e):(this._entities.incr(this._entityRecordCountOffset),e.serialize(this._entities))}_getVertexWriter(e,t){let n=this._instanceIdToVertexData;return n.has(e)||n.set(e,new r(e,t,this._sizeHint)),n.get(e)}}export{a as MeshData};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
class e{constructor(e){this._context=e,this._coordinators=(e.coordinatorFactories??[]).map(t=>t({out:e.out,scaleFactor:e.scaleFactor}))}coordinateAndWrite(e,t={}){let n=[...e.writers],r=new Set;for(;n.length>0;){let
|
|
2
|
+
class e{constructor(e){this._context=e,this._coordinators=(e.coordinatorFactories??[]).map(t=>t({out:e.out,scaleFactor:e.scaleFactor}))}coordinateAndWrite(e,t={}){let n=[...e.writers],r=new Set,i=t.deferCalloutProviderRecords?e.exports.get(`callout-body`):void 0,a;for(;n.length>0;){let o=this._getNextWriter(e,n,r,t.externalReferences);if(!o)throw Error(`InternalError: mesh writer dependency graph contains a cycle`);let[s]=n.splice(o.index,1),c=o.references;if(s.setReferences(c.bindings.size?c.bindings:null),s===i){let e=this._context.out.deferRecords;if(!e)throw Error(`InternalError: callout provider paint ordering requires deferred display records`);a=e.call(this._context.out,()=>this._coordinateWrite(s,c,t.matcher))}else this._coordinateWrite(s,c,t.matcher);r.add(s)}a?.()}_getNextWriter(e,t,n,r){for(let i=0;i<t.length;i++){let a=t[i],o=this._getReferences(e,a,r);if(o.internal.every(e=>n.has(e)))return{index:i,references:o}}return null}_write(e,t,n){let{out:r,proxy:i,feature:a,options:o,level:s,viewExtent:c,scaleFactor:l}=this._context;e.write(r,i,a,o,s,c,l,t,n)}_coordinateWrite(e,t,n){let r=this._coordinators.filter(e=>e.handles(t)),{feature:i,options:a,level:o,viewExtent:s,scaleFactor:c}=this._context,l={target:i,options:a,level:o,viewExtent:s,scaleFactor:c,matcher:n},u=(i,a)=>{let o=r[i];o?o.coordinateWrite(e,t,l,e=>u(i+1,{...a,...e})):this._write(e,n,a)};u(0)}_getReferences(e,t,n){let r=new Map,i=[],a=null;for(let o of e.dependencies.get(t)??[]){if(o.external){let e=n?.get(o.type);if(!e)continue;r.set(o.type,e);continue}let e=o.writer;i.push(e),r.set(o.type,e),o.type===`callout-body`&&(a=e)}return{bindings:r,internal:i,calloutReference:a}}}export{e as MeshWriterGroupCoordinator};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{getUniformBlockName as e}from"../uniformBufferUtils.js";import{cloneShaderNode as t}from"./ShaderGraphNode.js";class n{constructor(e,t,n,r=[],i=null){this.variableName=e,this.variableInputType=t,this.node=n,this.qualifiers=r,this.uniformBlockShaderModulePath=i,this.type=`shader-input`,this.isUsed=!1}clone(){return new n(this.variableName,this.variableInputType,t(this.node),[...this.qualifiers],this.uniformBlockShaderModulePath)}}class r{constructor(e,t,n,r=[]){this.outVariableName=e,this.outVariableType=t,this.node=n,this.qualifiers=r,this.type=`shader-output`}clone(){let e=new r(this.outVariableName,this.outVariableType,t(this.node),[...this.qualifiers]);return e.variableName=this.variableName,e}}class i{static createVertex(e,t,a,s,c,l,u){let d=[];for(let t in e){let r=e[t],i=a.get(t);i?d.push(new n(i,`builtin`,r)):d.push(new n(`a_`+t,`in`,r))}for(let e of s)for(let t of e.members)d.push(new n(t.uniformName,`uniform-block`,t.uniformHydrated,[],e.shaderModulePath));for(let e of c){let t=e.textureHydrated;d.push(new n(e.textureName,`uniform`,t))}let f=[];for(let e in t){let n=t[e];if(e===`glPosition`)f.push(new r(`gl_Position`,`builtin`,n));else if(e===`glPointSize`)f.push(new r(`gl_PointSize`,`builtin`,n));else{let t=o(n),i=[];t&&i.push(t),f.push(new r(`v_`+e,`out`,n,i))}}return new i(d,f,s,l,u)}static createFragment(e,t,a,o,s,c,l){let u=[],d=Array.from(c.rootOutputNodes());for(let t in e){let r=e[t],i=a.get(t);if(i){u.push(new n(i,`builtin`,r));continue}let o=d.find(e=>e.node===r);o&&u.push(new n(o.outVariableName,`in`,r,o.qualifiers))}for(let e of o)for(let t of e.members)u.push(new n(t.uniformName,`uniform-block`,t.uniformHydrated,[],e.shaderModulePath));for(let e of s){let t=e.textureHydrated;u.push(new n(e.textureName,`uniform`,t))}let f=[];for(let e in t){let n=t[e],i=a.get(e);switch(e){case`discard`:f.push(new r(null,`discard`,n));break;case`fragData0`:f.push(new r(`fragData0`,`fragData0`,n));break;case`fragData1`:f.push(new r(`fragData1`,`fragData1`,n));break;case`fragData2`:f.push(new r(`fragData2`,`fragData2`,n));break;case`fragData3`:f.push(new r(`fragData3`,`fragData3`,n));break;default:i?f.push(new r(i,`builtin`,n)):f.push(new r(e,`out`,n))}}return new i(u,f,o,l)}constructor(e,t,n,r,i){this.type=`shader-graph-context`,this.indent=0,this.body=``,this.varCount=0,this._arrayReadVersions=new Map,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(let t of e)this._inputShaderTypesByNodeUid.set(t.node.uid,t);this._outputShaderTypes=t,this._uniformBlockBindings=n,this._transformFeedbackBindings=r,this._transformFeedbackNames=new Set(r.map(e=>`v_`+e.propertyKey)),this._usedInFragmentShader=i}shouldPruneOutputNode(e){return!this._usedInFragmentShader||e.outVariableType===`builtin`||this._transformFeedbackNames.has(e.outVariableName)?!1:!this._usedInFragmentShader.has(e.node.uid)}setEmit(e,t){this._nodeEmitMap.set(e.uid,t)}getEmit(e){return this._nodeEmitMap.get(e.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}usedUniformBlockShaderModulePaths(){let e=new Set;for(let t of this.inputs())t.isUsed&&t.variableInputType===`uniform-block`&&t.uniformBlockShaderModulePath!=null&&e.add(t.uniformBlockShaderModulePath);return e}get arrayReadVersions(){return this._arrayReadVersions}createArrayReadVersions(){let e=[],t=[],n=new Set;this._arrayReadVersions.clear();for(let e of this.rootOutputNodes())this.shouldPruneOutputNode(e)||(t.push(e.node),n.add(e.node.uid));for(let r=0;r<t.length;r++){let i=t[r];i.shaderType===`array-read-node`&&e.push(i);for(let e of i.children)e&&typeof e!=`number`&&typeof e!=`boolean`&&!n.has(e.uid)&&(n.add(e.uid),t.push(e))}for(let t of e){let e=this._arrayReadVersions.get(t.version.uid);e||(e=[],this._arrayReadVersions.set(t.version.uid,e)),e.push(t)}}getInput(e){return this._inputShaderTypesByNodeUid.get(e.uid)}*rootOutputNodes(){for(let e of this._outputShaderTypes)yield e}*nodes(){let e=
|
|
3
|
-
|
|
4
|
-
`));for(let t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add(`}`)}insertFragmentShader(e){this._insertInputs(e,`fragment`),e.fragment.code.add(``),e.fragment.code.add(`// OUTPUTS: `),e.fragment.code.add(`// --------------------------------------------------------- `);let t=0;for(let n of this.rootOutputNodes())n.outVariableType===`builtin`?e.fragment.code.add(`// ${n.outVariableType.padEnd(7)} ${n.node.type.padEnd(9)} ${n.outVariableName};`):n.outVariableType===`discard`||e.outputs.add(n.outVariableName,n.node.type,t++);e.fragment.code.add(``),e.fragment.code.add(`void main() {`),e.fragment.code.add(` `+this.body.
|
|
5
|
-
|
|
2
|
+
import{getUniformBlockName as e}from"../uniformBufferUtils.js";import{cloneShaderNode as t}from"./ShaderGraphNode.js";class n{constructor(e,t,n,r=[],i=null){this.variableName=e,this.variableInputType=t,this.node=n,this.qualifiers=r,this.uniformBlockShaderModulePath=i,this.type=`shader-input`,this.isUsed=!1}clone(){return new n(this.variableName,this.variableInputType,t(this.node),[...this.qualifiers],this.uniformBlockShaderModulePath)}}class r{constructor(e,t,n,r=[]){this.outVariableName=e,this.outVariableType=t,this.node=n,this.qualifiers=r,this.type=`shader-output`}clone(){let e=new r(this.outVariableName,this.outVariableType,t(this.node),[...this.qualifiers]);return e.variableName=this.variableName,e}}class i{static createVertex(e,t,a,s,c,l,u){let d=[];for(let t in e){let r=e[t],i=a.get(t);i?d.push(new n(i,`builtin`,r)):d.push(new n(`a_`+t,`in`,r))}for(let e of s)for(let t of e.members)d.push(new n(t.uniformName,`uniform-block`,t.uniformHydrated,[],e.shaderModulePath));for(let e of c){let t=e.textureHydrated;d.push(new n(e.textureName,`uniform`,t))}let f=[];for(let e in t){let n=t[e];if(e===`glPosition`)f.push(new r(`gl_Position`,`builtin`,n));else if(e===`glPointSize`)f.push(new r(`gl_PointSize`,`builtin`,n));else{let t=o(n),i=[];t&&i.push(t),f.push(new r(`v_`+e,`out`,n,i))}}return new i(d,f,s,l,u)}static createFragment(e,t,a,o,s,c,l){let u=[],d=Array.from(c.rootOutputNodes());for(let t in e){let r=e[t],i=a.get(t);if(i){u.push(new n(i,`builtin`,r));continue}let o=d.find(e=>e.node===r);o&&u.push(new n(o.outVariableName,`in`,r,o.qualifiers))}for(let e of o)for(let t of e.members)u.push(new n(t.uniformName,`uniform-block`,t.uniformHydrated,[],e.shaderModulePath));for(let e of s){let t=e.textureHydrated;u.push(new n(e.textureName,`uniform`,t))}let f=[];for(let e in t){let n=t[e],i=a.get(e);switch(e){case`discard`:f.push(new r(null,`discard`,n));break;case`fragData0`:f.push(new r(`fragData0`,`fragData0`,n));break;case`fragData1`:f.push(new r(`fragData1`,`fragData1`,n));break;case`fragData2`:f.push(new r(`fragData2`,`fragData2`,n));break;case`fragData3`:f.push(new r(`fragData3`,`fragData3`,n));break;default:i?f.push(new r(i,`builtin`,n)):f.push(new r(e,`out`,n))}}return new i(u,f,o,l)}constructor(e,t,n,r,i){this.type=`shader-graph-context`,this.indent=0,this.body=``,this.varCount=0,this._arrayReadVersions=new Map,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(let t of e)this._inputShaderTypesByNodeUid.set(t.node.uid,t);this._outputShaderTypes=t,this._uniformBlockBindings=n,this._transformFeedbackBindings=r,this._transformFeedbackNames=new Set(r.map(e=>`v_`+e.propertyKey)),this._usedInFragmentShader=i}shouldPruneOutputNode(e){return!this._usedInFragmentShader||e.outVariableType===`builtin`||this._transformFeedbackNames.has(e.outVariableName)?!1:!this._usedInFragmentShader.has(e.node.uid)}setEmit(e,t){this._nodeEmitMap.set(e.uid,t)}getEmit(e){return this._nodeEmitMap.get(e.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}usedUniformBlockShaderModulePaths(){let e=new Set;for(let t of this.inputs())t.isUsed&&t.variableInputType===`uniform-block`&&t.uniformBlockShaderModulePath!=null&&e.add(t.uniformBlockShaderModulePath);return e}get arrayReadVersions(){return this._arrayReadVersions}createArrayReadVersions(){let e=[],t=[],n=new Set;this._arrayReadVersions.clear();for(let e of this.rootOutputNodes())this.shouldPruneOutputNode(e)||(t.push(e.node),n.add(e.node.uid));for(let r=0;r<t.length;r++){let i=t[r];i.shaderType===`array-read-node`&&e.push(i);for(let e of i.children)e&&typeof e!=`number`&&typeof e!=`boolean`&&!n.has(e.uid)&&(n.add(e.uid),t.push(e))}for(let t of e){let e=this._arrayReadVersions.get(t.version.uid);e||(e=[],this._arrayReadVersions.set(t.version.uid,e)),e.push(t)}}getInput(e){return this._inputShaderTypesByNodeUid.get(e.uid)}*rootOutputNodes(){for(let e of this._outputShaderTypes)yield e}*nodes(){let e=Array.from(this._outputShaderTypes.values(),e=>e.node);for(;e.length;){let t=e.pop();typeof t!=`number`&&typeof t!=`boolean`&&e.push(...t.children.filter(Boolean)),yield t}}*nodesOfTypeOrFunction(){for(let e of this.nodes())typeof e!=`number`&&typeof e!=`boolean`&&(yield e)}createSubgraphContext(){let e=this.clone();return e.body=``,e.indent=this.indent+2,e._nodeEmitMap=new Map(this._nodeEmitMap),e}clone(){let e=new i([],this._outputShaderTypes,this._uniformBlockBindings,this._transformFeedbackBindings,this._usedInFragmentShader);return e._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,e.indent=this.indent,e.body=this.body,e.varCount=this.varCount,e._arrayReadVersions=this._arrayReadVersions,e._nodeEmitMap=this._nodeEmitMap,e}insertVertexShader(e){e.vertex.code.add(``),this._insertInputs(e,`vertex`),e.vertex.code.add(``),e.vertex.code.add(`// OUTPUTS: `),e.vertex.code.add(`// --------------------------------------------------------- `);for(let t of this.rootOutputNodes()){let n=t.outVariableType===`builtin`;if(!this.shouldPruneOutputNode(t)){if(n)e.vertex.code.add(`// ${t.outVariableType.padEnd(7)} ${t.node.type.padEnd(9)} ${t.outVariableName};`);else if(t.node.type===`array`){let n=[...t.qualifiers,t.outVariableType].join(` `);e.vertex.code.add(`${n.padEnd(10)} ${t.node.elementType.type.padEnd(9)} ${t.outVariableName}[${t.node.size}];`)}else{let n=[...t.qualifiers,t.outVariableType].join(` `);e.vertex.code.add(`${n.padEnd(10)} ${t.node.type.padEnd(9)} ${t.outVariableName};`)}}}e.vertex.code.add(``),e.vertex.code.add(`void main() {`),e.vertex.code.add(` `+this.body.replaceAll(`
|
|
3
|
+
`,`
|
|
4
|
+
`));for(let t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add(`}`)}insertFragmentShader(e){this._insertInputs(e,`fragment`),e.fragment.code.add(``),e.fragment.code.add(`// OUTPUTS: `),e.fragment.code.add(`// --------------------------------------------------------- `);let t=0;for(let n of this.rootOutputNodes())n.outVariableType===`builtin`?e.fragment.code.add(`// ${n.outVariableType.padEnd(7)} ${n.node.type.padEnd(9)} ${n.outVariableName};`):n.outVariableType===`discard`||e.outputs.add(n.outVariableName,n.node.type,t++);e.fragment.code.add(``),e.fragment.code.add(`void main() {`),e.fragment.code.add(` `+this.body.replaceAll(`
|
|
5
|
+
`,`
|
|
6
6
|
`));let n=Array.from(this.rootOutputNodes()),r=n.find(e=>e.outVariableType===`discard`),i=n.filter(e=>e.outVariableType!==`discard`);r&&(e.fragment.code.add(` if (${r.variableName}) {`),e.fragment.code.add(` discard;`),e.fragment.code.add(` }`),e.fragment.code.add(` `));for(let t of i)e.fragment.code.add(` ${t.outVariableName} = ${t.variableName};`);e.fragment.code.add(`}`)}_insertInputs(t,n){t[n].code.add(`// INPUTS: `),t[n].code.add(`// --------------------------------------------------------- `);let r=this.usedUniformBlockShaderModulePaths();for(let i of this._uniformBlockBindings){if(!r.has(i.shaderModulePath))continue;let o=e(i.shaderModulePath);t[n].code.add(`layout(std140) uniform ${o} {`);for(let e of i.members)t[n].code.add(` ${a(e)}`);t[n].code.add(`};`)}for(let e of this.inputs())if(e.isUsed&&e.variableInputType!==`builtin`&&e.variableInputType!==`uniform-block`){if(e.node.type===`array`)t[n].code.add(` ${e.variableInputType.padEnd(10)} ${e.node.elementType.type.padEnd(9)} ${e.variableName}[${e.node.size}];`);else if(e.node.type===`array-2d`)t[n].code.add(` ${e.variableInputType.padEnd(10)} ${e.node.elementType.type.padEnd(9)} ${e.variableName}[${e.node.size}]; // Emulated 2D Array. Not supported by ES3.0`);else{let r=[...e.qualifiers,e.variableInputType].join(` `);t[n].code.add(` ${r.padEnd(10)} ${e.node.type.padEnd(9)} ${e.variableName};`)}}}}function a(e){let{uniformHydrated:t,uniformName:n}=e;return t.type===`array`?`${t.elementType.type.padEnd(9)} ${n}[${t.size}];`:t.type===`array-2d`?`${t.elementType.type.padEnd(9)} ${n}[${t.size}]; // Emulated 2D Array. Not supported by ES3.0`:`${t.type.padEnd(9)} ${n};`}function o(e){switch(e.type){case`float`:case`vec2`:case`vec3`:case`vec4`:case`array`:return null;case`int`:case`ivec2`:case`ivec3`:case`ivec4`:case`uint`:case`uvec2`:case`uvec3`:case`uvec4`:case`bool`:case`bvec2`:case`bvec3`:case`bvec4`:return`flat`;case`mat2`:case`mat3`:case`mat4`:case`sampler2D`:case`array-2d`:throw Error(`InternalError: ${e.type} is not a valid output type`)}}export{i as ShaderGraphContext,n as ShaderInput,r as ShaderOutput};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../Graphic.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import c from"../../../../../geometry/Multipoint.js";import l from"../../../../../geometry/Point.js";import{SegmentLabels2D as u}from"../../SegmentLabels2D.js";import{SnappingVisualizer2D as d}from"../../SnappingVisualizer2D.js";import{activeVertex as f,regularVertices as p,outline as m}from"./symbols.js";import{DrawGraphicTool as h,geometryTypeToDrawOperationGeometryType as g}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as _}from"../../../../draw/DrawOperation.js";import{MapDrawSurface as v}from"../../../../draw/drawSurfaces.js";let y=class extends h{constructor(e){super(
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../Graphic.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import c from"../../../../../geometry/Multipoint.js";import l from"../../../../../geometry/Point.js";import{SegmentLabels2D as u}from"../../SegmentLabels2D.js";import{SnappingVisualizer2D as d}from"../../SnappingVisualizer2D.js";import{activeVertex as f,regularVertices as p,outline as m}from"./symbols.js";import{DrawGraphicTool as h,geometryTypeToDrawOperationGeometryType as g}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as _}from"../../../../draw/DrawOperation.js";import{MapDrawSurface as v}from"../../../../draw/drawSurfaces.js";let y=class extends h{constructor(e){let{activeFillSymbol:t,activeVertexSymbol:n,regularVerticesSymbol:r,activeLineSymbol:o,...s}=e;super(s),this._visualElementGraphics={regularVertices:null,activeVertex:null,activeEdge:null},this.activeFillSymbol=null,this.type=`draw-2d`,this._visualElementSymbols={outline:o??m,regularVertices:r??p,activeVertex:n??f,fill:t},n||this.addHandles(i(()=>this.view?.effectiveTheme?.accentColor,e=>{if(!e)return;let t=this._visualElementSymbols.activeVertex.clone().set({color:e});this._visualElementGraphics.activeVertex?.set(`symbol`,t),this._visualElementSymbols={...this._visualElementSymbols,activeVertex:t}},a))}initializeGraphic(e){return this._visualElementSymbols.fill!=null&&(e.symbol=this._visualElementSymbols.fill),this.internalGraphicsLayer.graphics.sort(b),n()}makeDrawOperation(){let{defaultZ:e,geometryType:t,hasZ:n,view:r}=this;this._createOrUpdateGraphic(null);let i=t!==`circle`&&t!==`rectangle`;return new _({view:r,manipulators:this.manipulators,geometryType:g(this.geometryType),drawingMode:this.mode,hasZ:n,defaultZ:e,snapToSceneEnabled:this.snapToScene,drawSurface:new v(r,n,e),hasM:!1,snappingManager:this.snappingManager,snappingVisualizer:new d(this.internalGraphicsLayer),segmentLabels:i?new u:null,labelOptions:this.toolOptions.labels,graphic:this.graphic,cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){if(this.geometryType===`point`)return n();let[i,a]=e,o=new l({x:i,y:a,spatialReference:this.view.spatialReference});return this._visualElementGraphics.activeVertex==null?(this._visualElementGraphics.activeVertex=new t({geometry:o,symbol:this._visualElementSymbols.activeVertex,attributes:{displayOrder:2}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex),this.internalGraphicsLayer.graphics.sort(b),n(()=>{this._visualElementGraphics.activeVertex!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeVertex),this._visualElementGraphics.activeVertex=r(this._visualElementGraphics.activeVertex))})):(this._visualElementGraphics.activeVertex.geometry=o,n())}onCursorEdgeChanged(e){return this._visualElementGraphics.activeEdge==null?(this._visualElementGraphics.activeEdge=new t({geometry:e,symbol:this._visualElementSymbols.outline,attributes:{displayOrder:0}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeEdge),this.internalGraphicsLayer.graphics.sort(b),n(()=>{this._visualElementGraphics.activeEdge!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeEdge),this._visualElementGraphics.activeEdge=r(this._visualElementGraphics.activeEdge))})):(this._visualElementGraphics.activeEdge.geometry=e,n())}onRegularVerticesChanged(e){let i=new c({points:e,spatialReference:this.view.spatialReference});return this._visualElementGraphics.regularVertices==null?(this._visualElementGraphics.regularVertices=new t({geometry:i,symbol:this._visualElementSymbols.regularVertices,attributes:{displayOrder:1}}),this.internalGraphicsLayer.add(this._visualElementGraphics.regularVertices),this.internalGraphicsLayer.graphics.sort(b),n(()=>{this._visualElementGraphics.regularVertices!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.regularVertices),this._visualElementGraphics.regularVertices=r(this._visualElementGraphics.regularVertices))})):(this._visualElementGraphics.regularVertices.geometry=i,n())}};e([o()],y.prototype,`activeFillSymbol`,void 0),e([o({readOnly:!0})],y.prototype,`type`,void 0),e([o({constructOnly:!0,nonNullable:!0})],y.prototype,`view`,void 0),y=e([s(`esri.views.2d.interactive.editingTools.draw.DrawGraphicTool2D`)],y);function b(e,t){return(e.attributes?.displayOrder??-1/0)-(t.attributes?.displayOrder??-1/0)}export{y as DrawGraphicTool2D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import has from"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{createScreenPoint as o,isScreenPoint as s,isScreenRect as c,isScreenPolygon as l,pt2px as u}from"../../../core/screenUtils.js";import{property as d,subclass as f}from"../../../core/accessorSupport/decorators.js";import{diff as p,hasDiff as m}from"../../../core/accessorSupport/diffUtils.js";import h from"../../../geometry/Point.js";import{fromValues as g,create as _}from"../../../geometry/support/aaBoundingRect.js";import{isVectorTileGraphicOrigin as v}from"../../../graphic/isVectorTileGraphicOrigin.js";import y from"../../../graphic/VectorTileGraphicOrigin.js";import{tileSizeInTileUnits as b,tileSizeInPixels as x}from"../engine/vectorTiles/constants.js";import{TileHandler as S}from"../engine/vectorTiles/TileHandler.js";import{TileManager as C}from"../engine/vectorTiles/TileManager.js";import{VectorTile as w}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as T}from"../engine/vectorTiles/VectorTileContainer.js";import E from"../engine/vectorTiles/VectorTileFeatureIndex.js";import{isSearchCircleOverlappingSymbol as D,isSearchPolygonOverlappingSymbol as O}from"../engine/vectorTiles/decluttering/util.js";import{createTileInfoView as k,supportsSpatialReference as A}from"../engine/vectorTiles/style/geoJSONVectorTileUtils.js";import j from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2D as M}from"./LayerView2D.js";import{getBbox as N,getMapPointsFromScreen as P}from"../support/hitTestUtils.js";import F from"../tiling/TileQueue.js";import I from"../../layers/VectorTileLayerView.js";import{TaskPriority as L}from"../../support/Scheduler.js";let R=class extends M(I){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._styeChanged=!1,this._spriteSourceChanged=!1}get fading(){return(this._vectorTileContainer?.fading||this._tileManager?.isFading())??!1}get hasVisibleFeatures(){let e=this._vectorTileContainer.children;for(let t of e)if(t.hasFeatures())return!0;return!1}get spriteSourceChanged(){return this._spriteSourceChanged}get styleChanged(){return this._styeChanged}async hitTest(e,t){let n=this._tileHandlerPromise,r=this._vectorTileContainer?.symbolFader;if(!n||!this._isTileHandlerReady||!r)return;await n;let i=[],a,d=c(t),f=l(t);if(d){let e=t;i=[o(e.x,e.y+e.height),o(e.x+e.width,e.y+e.height),o(e.x+e.width,e.y),o(e.x,e.y)],a=`rect`}else f?(i=t.map(e=>e),a=`polygon`):(i=[t],a=`point`);let p=has(`esri-vtl-search-tolerance`)??0,m=p>0?p:2.5,h=this.view.state,{rotation:_,pixelRatio:v}=this.view.state,y=u(m)*v,b=null,x=this._vectorTileContainer?.symbolRepository;x&&(b=x.querySymbols());let S=[];if(b)for(let e of b){let{styleLayerUID:t,vtlSymbol:n,tileKey:o}=e;a===`point`&&D(n,i[0],y,r.decluttererOffset)&&S.push({vtlSymbol:n,styleLayerUID:t,tileKey:o}),O(n,i,r.decluttererOffset)&&S.push({vtlSymbol:n,styleLayerUID:t,tileKey:o})}let C;if(s(t)){let e=[0,0],n=[0,0];h.toMap(e,t.x-y,t.y+y),h.toMap(n,t.x+y,t.y-y),C=g(Math.min(e[0],n[0]),Math.min(e[1],n[1]),Math.max(e[0],n[0]),Math.max(e[1],n[1]))}else{let e=i.map(({x:e,y:t})=>{let n=[0,0];return h.toMap(n,e,t),n});C=N([e])}let w=this._tileManager.getIntersectingTiles(C,S);if(S=S?.filter(e=>this._styleRepository.getStyleLayerVisibility(e.styleLayerUID)),(!w||w.length===0)&&S?.length===0)return null;let T=P(this.view,i),E=[],k=[];for(let e of w)E.push(this._queryTile(k,T,y,_,e,S?.filter(t=>t.tileKey.id===e.id),d?`rect`:f?`polygon`:`point`));return await Promise.all(E),k}update(e){this._tileHandlerPromise&&this._isTileHandlerReady&&(e.pixelRatio===this._tileHandler.devicePixelRatio?this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._resumeQueues()):(this._tileHandler.devicePixelRatio=e.pixelRatio,this._loadStyle()))}attach(){let{style:e}=this.layer.currentStyleInfo;this._styleRepository=new j(e),this._tileInfoView=k(this.layer,this.view.spatialReference),this._vectorTileContainer=new T(this._tileInfoView),this._tileHandler=new S(this.layer,this._styleRepository,window.devicePixelRatio||1,this._tileInfoView.tileInfo.lods.length-1,this.view.glyphMosaic(),()=>this._tileInfoView.tileInfo),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on(`paint-change`,e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:0,data:e}),this.requestUpdate();else{let t=this._styleRepository,n=t.getLayerById(e.layer);if(!n)return;let r=n.type===3;t.setPaintProperties(e.layer,e.paint),r&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on(`layout-change`,e=>{let t=this._styleRepository,n=t.getLayerById(e.layer);if(!n)return;this._styeChanged=!0;let r=p(n.layout,e.layout);r!=null&&(m(r,`visibility`)&&z(r)===1?(t.setLayoutProperties(e.layer,e.layout),n.type===3&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()):(this._styleChanges.push({type:1,data:e}),this.requestUpdate()))}),this.layer.on(`style-layer-visibility-change`,e=>{let t=this._styleRepository,n=t.getLayerById(e.layer);n&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),n.type===3&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on(`style-layer-change`,e=>{this._styleChanges.push({type:2,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on(`delete-style-layer`,e=>{this._styleChanges.push({type:3,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on(`load-style`,()=>this._loadStyle()),this.layer.on(`spriteSource-change`,e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:4,data:e});let t=this._styleRepository.layers;for(let e of t)switch(e.type){case 3:e.getLayoutProperty(`icon-image`)&&this._styleChanges.push({type:1,data:{layer:e.id,layout:e.layout}});break;case 2:e.getPaintProperty(`line-pattern`)&&this._styleChanges.push({type:0,data:{layer:e.id,paint:e.paint,isDataDriven:e.isPainterDataDriven()}});break;case 1:e.getLayoutProperty(`fill-pattern`)&&this._styleChanges.push({type:0,data:{layer:e.id,paint:e.paint,isDataDriven:e.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=i(this._vectorTileContainer),this._tileHandler=i(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return A(this.layer,e)}canResume(){let e=super.canResume(),{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){let n=this.view.scale,{minScale:r,maxScale:i}=t.layerDefinition;t?.layerDefinition&&(r&&r<n&&(e=!1),i&&i>n&&(e=!1))}return e}isUpdating(){return this.fading||!this._isTileHandlerReady}acquireTile(e){let t=this._createVectorTile(e);return this._updatingHandles.consumePromise(this._fetchQueue.push(t.key).then(e=>this._parseQueue.push({key:t.key,data:e})).then(e=>{t.once(`attach`,()=>this.requestUpdate()),t.setData(e),this.requestUpdate()}).catch(e=>{a(e)||r.getLogger(this).error(e)})),t}releaseTile(e){let t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended){this._tileManager.clear(),this.requestUpdate();return}this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();let e=this._vectorTileContainer.children,t=[];try{for(let n of e){let e=this._updatingHandles.addPromise(this._fetchQueue.push(n.key).then(e=>this._parseQueue.push({key:n.key,data:e})).then(e=>n.setData(e)).finally(()=>n.featureIndex=null));t.push(e)}await Promise.all(t)}catch(e){r.getLogger(this).error(`error refreshing vector-tiles layer-view`,e),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new C({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;let e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new F({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15,scheduler:this.scheduler,priority:L.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new F({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8,scheduler:this.scheduler,priority:L.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;let e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=i(this._fetchQueue),this._parseQueue=i(this._parseQueue),this._tileManager=i(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){return this._tileHandler.fetchTileData(e,t)}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();let e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(e){r.getLogger(this).error(`error applying vector-tiles style update`,e.message),this._resumeQueues(),this._isTileHandlerReady=!0}let t=this._styleRepository,n=new Set,i=new Set;for(let r of e){if(r.type!==3&&r.type!==2)continue;let e=r.type===2?r.data.layer.id:r.data.layer,a=t.getLayerById(e);a&&(n.add(a.uid),a.type===3&&i.add(a.uid))}let a=this._vectorTileContainer.children,o=this._vectorTileContainer?.symbolFader?.symbolRepository;o&&i.size>0&&o.deleteStyleLayers(Array.from(i));let s=new Set;if(e.forEach(e=>{let n;switch(e.type){case 0:t.setPaintProperties(e.data.layer,e.data.paint),n=e.data.layer;break;case 1:t.setLayoutProperties(e.data.layer,e.data.layout),n=e.data.layer;break;case 3:t.deleteStyleLayer(e.data.layer);return;case 2:t.setStyleLayer(e.data.layer,e.data.index),n=e.data.layer.id;break;case 4:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(e.data.spriteSource))}if(n){let e=t.getLayerById(n);e&&s.add(e.uid)}}),n.size>0){let e=Array.from(n);this._vectorTileContainer.deleteStyleLayers(e);for(let t of a)t.deleteLayerData(e)}if(this._resumeQueues(),s.size>0){let e=Array.from(s),t=[];for(let n of a){let r=this._updatingHandles.addPromise(this._fetchQueue.push(n.key).then(t=>this._parseQueue.push({key:n.key,data:t,styleLayerUIDs:e})).then(e=>n.setData(e)).finally(()=>n.featureIndex=null));t.push(r)}await Promise.all(t)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){let{style:e}=this.layer.currentStyleInfo,t=n(e);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new j(t),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;let{signal:r}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,t,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(e){if(!a(e))throw e}if(r.aborted){this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,this.requestUpdate();return}let i=await this._tileHandler.spriteMosaic,o=this._vectorTileContainer;this._tileInfoView=k(this.layer,this.view.spatialReference),o.setStyleResources(i,this.view.glyphMosaic(),this._styleRepository,this._tileInfoView),this._tileManager=new C({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(e){let t=this._tileInfoView.getTileBounds(_(),e),n=this._tileInfoView.getTileResolution(e.level);return new w(e,n,t[0],t[3],512,512,this._styleRepository)}async _queryTile(e,n,r,i,a,o,s){if(a.layerData.size===0)return;let c=this._ensureTileIndex(a),l=this._tileInfoView.getTileBounds(_(),a.key,!0),u=n.map(e=>{let[t,n,r,i]=l;return[b*((e.x-t)/(r-t)),b*(1-(e.y-n)/(i-n))]}),d=this.view.featuresTilingScheme.tileInfo.scaleToZoom(this.view.state.scale)-a.key.level,f=d>0?2**d:1,p=r/f*(b/x),m=await c.queryAttributes(u,p,s);for(let r of m){let{layer:a,feature:o}=r;this._styleRepository.getStyleLayerVisibility(a.uid)&&a.isIntersectingFeature(u,p,o,c.tileKey.level,i,f,r,s)&&e.push({type:`graphic`,layer:this.layer,graphic:new t({attributes:o.values,origin:new y(this.layer,r.layer.id,r.layer.uid)}),mapPoint:s===`point`?n[0].clone():null})}(await c.getSymbolHitResults([],o)).map(t=>{t.graphic.geometry=this._tileToMapPoint(t.tilePoint,a.transforms.tileUnitsToPixels),e.push({type:`graphic`,layer:this.layer,graphic:t.graphic,mapPoint:s===`point`?n[0].clone():null})}),e.sort((e,t)=>(v(t.graphic.origin)?t.graphic.origin.layerIndex:0)-(v(e.graphic.origin)?e.graphic.origin.layerIndex:0))}_tileToMapPoint(e,t){if(!e)return null;let n=e[0]*t[0]+e[1]*t[3]+t[6],r=e[0]*t[1]+e[1]*t[4]+t[7],i=this.view.state,a=[0,0];return i.toMap(a,[n,r]),new h({x:a[0],y:a[1],spatialReference:i.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=E.create(e.key,e.layerData,this._styleRepository,this._tileHandler,this.layer),e.featureIndex=t),t}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};e([d()],R.prototype,`_isTileHandlerReady`,void 0),R=e([f(`esri.views.2d.layers.VectorTileLayerView2D`)],R);function z(e){if(e==null)return 0;switch(e.type){case`partial`:return Object.keys(e.diff).length;case`complete`:return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case`collection`:return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}const B=R;export{B as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import has from"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{createScreenPoint as o,isScreenPoint as s,isScreenRect as c,isScreenPolygon as l,pt2px as u}from"../../../core/screenUtils.js";import{property as d,subclass as f}from"../../../core/accessorSupport/decorators.js";import{diff as p,hasDiff as m}from"../../../core/accessorSupport/diffUtils.js";import h from"../../../geometry/Point.js";import{fromValues as g,create as _}from"../../../geometry/support/aaBoundingRect.js";import{isVectorTileGraphicOrigin as v}from"../../../graphic/isVectorTileGraphicOrigin.js";import y from"../../../graphic/VectorTileGraphicOrigin.js";import{tileSizeInTileUnits as b,tileSizeInPixels as x}from"../engine/vectorTiles/constants.js";import{TileHandler as S}from"../engine/vectorTiles/TileHandler.js";import{TileManager as C}from"../engine/vectorTiles/TileManager.js";import{VectorTile as w}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as T}from"../engine/vectorTiles/VectorTileContainer.js";import E from"../engine/vectorTiles/VectorTileFeatureIndex.js";import{isSearchCircleOverlappingSymbol as D,isSearchPolygonOverlappingSymbol as O}from"../engine/vectorTiles/decluttering/util.js";import{createTileInfoView as k,supportsSpatialReference as A}from"../engine/vectorTiles/style/geoJSONVectorTileUtils.js";import j from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2D as M}from"./LayerView2D.js";import{getBbox as N,getMapPointsFromScreen as P}from"../support/hitTestUtils.js";import F from"../tiling/TileQueue.js";import I from"../../layers/VectorTileLayerView.js";import{TaskPriority as L}from"../../support/Scheduler.js";let R=class extends M(I){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._styeChanged=!1,this._spriteSourceChanged=!1}get fading(){return(this._vectorTileContainer?.fading||this._tileManager?.isFading())??!1}get hasVisibleFeatures(){let e=this._vectorTileContainer.children;for(let t of e)if(t.hasFeatures())return!0;return!1}get spriteSourceChanged(){return this._spriteSourceChanged}get styleChanged(){return this._styeChanged}async hitTest(e,t){let n=this._tileHandlerPromise,r=this._vectorTileContainer?.symbolFader;if(!n||!this._isTileHandlerReady||!r)return;await n;let i=[],a,d=c(t),f=l(t);if(d){let e=t;i=[o(e.x,e.y+e.height),o(e.x+e.width,e.y+e.height),o(e.x+e.width,e.y),o(e.x,e.y)],a=`rect`}else f?(i=t.map(e=>e),a=`polygon`):(i=[t],a=`point`);let p=has(`esri-vtl-search-tolerance`)??0,m=p>0?p:2.5,h=this.view.state,{rotation:_,pixelRatio:v}=this.view.state,y=u(m)*v,b=null,x=this._vectorTileContainer?.symbolRepository;x&&(b=x.querySymbols());let S=[];if(b)for(let e of b){let{styleLayerUID:t,vtlSymbol:n,tileKey:o}=e;a===`point`&&D(n,i[0],y,r.decluttererOffset)&&S.push({vtlSymbol:n,styleLayerUID:t,tileKey:o}),O(n,i,r.decluttererOffset)&&S.push({vtlSymbol:n,styleLayerUID:t,tileKey:o})}let C;if(s(t)){let e=[0,0],n=[0,0];h.toMap(e,t.x-y,t.y+y),h.toMap(n,t.x+y,t.y-y),C=g(Math.min(e[0],n[0]),Math.min(e[1],n[1]),Math.max(e[0],n[0]),Math.max(e[1],n[1]))}else{let e=i.map(({x:e,y:t})=>{let n=[0,0];return h.toMap(n,e,t),n});C=N([e])}let w=this._tileManager.getIntersectingTiles(C,S);if(S=S?.filter(e=>this._styleRepository.getStyleLayerVisibility(e.styleLayerUID)),(!w||w.length===0)&&S?.length===0)return null;let T=P(this.view,i),E=[],k=[];for(let e of w)E.push(this._queryTile(k,T,y,_,e,S?.filter(t=>t.tileKey.id===e.id),d?`rect`:f?`polygon`:`point`));return await Promise.all(E),k}update(e){this._tileHandlerPromise&&this._isTileHandlerReady&&(e.pixelRatio===this._tileHandler.devicePixelRatio?this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._resumeQueues()):(this._tileHandler.devicePixelRatio=e.pixelRatio,this._loadStyle()))}attach(){let{style:e}=this.layer.currentStyleInfo;this._styleRepository=new j(e),this._tileInfoView=k(this.layer,this.view.spatialReference),this._vectorTileContainer=new T(this._tileInfoView),this._tileHandler=new S(this.layer,this._styleRepository,window.devicePixelRatio||1,this._tileInfoView.tileInfo.lods.length-1,this.view.glyphMosaic(),()=>this._tileInfoView.tileInfo),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on(`paint-change`,e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:0,data:e}),this.requestUpdate();else{let t=this._styleRepository,n=t.getLayerById(e.layer);if(!n)return;let r=n.type===3;t.setPaintProperties(e.layer,e.paint),r&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on(`layout-change`,e=>{let t=this._styleRepository,n=t.getLayerById(e.layer);if(!n)return;this._styeChanged=!0;let r=p(n.layout,e.layout);r!=null&&(m(r,`visibility`)&&z(r)===1?(t.setLayoutProperties(e.layer,e.layout),n.type===3&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()):(this._styleChanges.push({type:1,data:e}),this.requestUpdate()))}),this.layer.on(`style-layer-visibility-change`,e=>{let t=this._styleRepository,n=t.getLayerById(e.layer);n&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),n.type===3&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on(`style-layer-change`,e=>{this._styleChanges.push({type:2,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on(`delete-style-layer`,e=>{this._styleChanges.push({type:3,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on(`load-style`,()=>this._loadStyle()),this.layer.on(`sprite-add`,({name:e})=>{this._styleChanges.push({type:5,data:{name:e}}),this.requestUpdate()}),this.layer.on(`spriteSource-change`,e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:4,data:e},...this._tileHandler.getSpriteStyleChanges()),this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=i(this._vectorTileContainer),this._tileHandler=i(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return A(this.layer,e)}canResume(){let e=super.canResume(),{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){let n=this.view.scale,{minScale:r,maxScale:i}=t.layerDefinition;t?.layerDefinition&&(r&&r<n&&(e=!1),i&&i>n&&(e=!1))}return e}isUpdating(){return this.fading||!this._isTileHandlerReady}acquireTile(e){let t=this._createVectorTile(e);return this._updatingHandles.consumePromise(this._fetchQueue.push(t.key).then(e=>this._parseQueue.push({key:t.key,data:e})).then(e=>{t.once(`attach`,()=>this.requestUpdate()),t.setData(e),this.requestUpdate()}).catch(e=>{a(e)||r.getLogger(this).error(e)})),t}releaseTile(e){let t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended){this._tileManager.clear(),this.requestUpdate();return}this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();let e=this._vectorTileContainer.children,t=[];try{for(let n of e){let e=this._updatingHandles.addPromise(this._fetchQueue.push(n.key).then(e=>this._parseQueue.push({key:n.key,data:e})).then(e=>n.setData(e)).finally(()=>n.featureIndex=null));t.push(e)}await Promise.all(t)}catch(e){r.getLogger(this).error(`error refreshing vector-tiles layer-view`,e),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new C({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;let e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new F({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15,scheduler:this.scheduler,priority:L.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new F({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8,scheduler:this.scheduler,priority:L.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;let e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=i(this._fetchQueue),this._parseQueue=i(this._parseQueue),this._tileManager=i(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){return this._tileHandler.fetchTileData(e,t)}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1;let e=this._styleChanges;this._styleChanges=[],e.some(e=>e.type===5)&&e.push(...this._tileHandler.getSpriteStyleChanges()),this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();try{await this._tileHandler.updateStyle(e)}catch(e){r.getLogger(this).error(`error applying vector-tiles style update`,e.message),this._resumeQueues(),this._isTileHandlerReady=!0}let t=this._styleRepository,n=new Set,i=new Set;for(let r of e){if(r.type!==3&&r.type!==2)continue;let e=r.type===2?r.data.layer.id:r.data.layer,a=t.getLayerById(e);a&&(n.add(a.uid),a.type===3&&i.add(a.uid))}let a=Array.from(this._tileManager.tiles),o=this._vectorTileContainer?.symbolFader?.symbolRepository;o&&i.size>0&&o.deleteStyleLayers(Array.from(i));let s=new Set;if(e.forEach(e=>{let n;switch(e.type){case 0:t.setPaintProperties(e.data.layer,e.data.paint),n=e.data.layer;break;case 1:t.setLayoutProperties(e.data.layer,e.data.layout),n=e.data.layer;break;case 3:t.deleteStyleLayer(e.data.layer);return;case 2:t.setStyleLayer(e.data.layer,e.data.index),n=e.data.layer.id;break;case 4:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(e.data.spriteSource))}if(n){let e=t.getLayerById(n);e&&s.add(e.uid)}}),n.size>0){let e=Array.from(n);this._vectorTileContainer.deleteStyleLayers(e);for(let t of a)t.deleteLayerData(e)}if(this._resumeQueues(),s.size>0){let e=Array.from(s),t=[];for(let n of a){let r=this._updatingHandles.addPromise(this._fetchQueue.push(n.key).then(t=>this._parseQueue.push({key:n.key,data:t,styleLayerUIDs:e})).then(e=>n.setData(e)).finally(()=>n.featureIndex=null));t.push(r)}await Promise.all(t)}this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){let{style:e}=this.layer.currentStyleInfo,t=n(e);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new j(t),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;let{signal:r}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,t,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(e){if(!a(e))throw e}if(r.aborted){this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,this.requestUpdate();return}let i=await this._tileHandler.spriteMosaic,o=this._vectorTileContainer;this._tileInfoView=k(this.layer,this.view.spatialReference),o.setStyleResources(i,this.view.glyphMosaic(),this._styleRepository,this._tileInfoView),this._tileManager=new C({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(e){let t=this._tileInfoView.getTileBounds(_(),e),n=this._tileInfoView.getTileResolution(e.level);return new w(e,n,t[0],t[3],512,512,this._styleRepository)}async _queryTile(e,n,r,i,a,o,s){if(a.layerData.size===0)return;let c=this._ensureTileIndex(a),l=this._tileInfoView.getTileBounds(_(),a.key,!0),u=n.map(e=>{let[t,n,r,i]=l;return[b*((e.x-t)/(r-t)),b*(1-(e.y-n)/(i-n))]}),d=this.view.featuresTilingScheme.tileInfo.scaleToZoom(this.view.state.scale)-a.key.level,f=d>0?2**d:1,p=r/f*(b/x),m=await c.queryAttributes(u,p,s);for(let r of m){let{layer:a,feature:o}=r;this._styleRepository.getStyleLayerVisibility(a.uid)&&a.isIntersectingFeature(u,p,o,c.tileKey.level,i,f,r,s)&&e.push({type:`graphic`,layer:this.layer,graphic:new t({attributes:o.values,origin:new y(this.layer,r.layer.id,r.layer.uid)}),mapPoint:s===`point`?n[0].clone():null})}(await c.getSymbolHitResults([],o)).map(t=>{t.graphic.geometry=this._tileToMapPoint(t.tilePoint,a.transforms.tileUnitsToPixels),e.push({type:`graphic`,layer:this.layer,graphic:t.graphic,mapPoint:s===`point`?n[0].clone():null})}),e.sort((e,t)=>(v(t.graphic.origin)?t.graphic.origin.layerIndex:0)-(v(e.graphic.origin)?e.graphic.origin.layerIndex:0))}_tileToMapPoint(e,t){if(!e)return null;let n=e[0]*t[0]+e[1]*t[3]+t[6],r=e[0]*t[1]+e[1]*t[4]+t[7],i=this.view.state,a=[0,0];return i.toMap(a,[n,r]),new h({x:a[0],y:a[1],spatialReference:i.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=E.create(e.key,e.layerData,this._styleRepository,this._tileHandler,this.layer),e.featureIndex=t),t}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};e([d()],R.prototype,`_isTileHandlerReady`,void 0),R=e([f(`esri.views.2d.layers.VectorTileLayerView2D`)],R);function z(e){if(e==null)return 0;switch(e.type){case`partial`:return Object.keys(e.diff).length;case`complete`:return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case`collection`:return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}const B=R;export{B as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../config.js";import has from"../../../../core/has.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{notDeepEqual as n}from"../../../../core/object.js";import{throwIfAborted as r,after as i}from"../../../../core/promiseUtils.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as o}from"../../../../core/workers/utils.js";import{openWithPorts as s}from"../../../../core/workers/workers.js";import{normalizeTransform as c,quantizeX as l,quantizeY as u}from"../../../../geometry/support/quantizationUtils.js";import{checkProjectionSupport as d}from"../../../../layers/graphics/data/projectionSupport.js";import{MultiTileMeshData as f}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as p}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as m}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as h}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as g}from"../../engine/webgl/util/MatcherContext.js";import{createAggregateStrategy as _}from"./processor/createAggregateStrategy.js";import{AttributeStore as v}from"./support/AttributeStore.js";import{ComputedAttributeStorage as y}from"./support/ComputedAttributeStorage.js";class b{constructor(t,n){this._connection=t,this._source=n,this._version=1,this._registry=new h;let r={fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t),fetchMesh:(e,t)=>this._connection.layerView.fetchMesh(e,t)},i={fetchGlyphs:async(t,n)=>{let r=[];if(await this._loaded,this._glyphProxy){let i=`${e.fontsUrl}/{fontstack}/{range}.pbf`;for(let e of t)r.push(this._glyphProxy.rasterizeText(i,e,n))}else console.error(`Failed to fetch glyphs from worker: proxy not created`);return Promise.all(r)}};this._proxy=new m(r,i),this._attributeStore=new v({isLocal:!1,update:e=>o(this._connection.container.updateAttributeView(e))}),this._loaded=this._load(t)}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy(),this._loaded.finally(()=>{this._glyphClient?.close(),this._glyphClient=null,this._glyphPorts?.forEach(e=>e.close())})}get hasClusters(){return this._schema?.mesh.strategy.type===`cluster`}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){return this._strategy?this._strategy.getDisplayIds(e):{}}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(e){return this._strategy?.requiresInvalidation(e)??!1}async update(e,t,r,i,o){let s=e.processor,c=n(this._schema?.storage,s.storage),l=n(this._schema?.mesh.properties,s.mesh.properties),u=n(this._schema?.mesh.factory,s.mesh.factory),f=n(this._schema?.mesh.strategy,s.mesh.strategy),m=this._schema?.mesh.properties.timeZone!==s.mesh.properties.timeZone,h=this._schema?.mesh.properties.currentUser!==s.mesh.properties.currentUser,_=x(this._schema?.expressionProperties,s.expressionProperties),v=_.some(e=>this._attributeStore.hasArcadeDependency(e)),b=_.some(e=>this._factory?.hasArcadeDependency(e)??!1),C=_.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&v,w=b||C,T=b||v||C,E=l||u||f;if(!(c||E||T)&&!i)return!1;if(has(`esri-2d-update-debug`)&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a(this._schema,s),schema:s}),this._schema=s,s.mesh.factory.symbology.type===`annotation-feature`||s.mesh.factory.symbology.type===`dimension-feature`){let e=this._source.metadata.outSpatialReference,t=this._source.metadata.attributeSpatialReference??this._source.metadata.spatialReference??e;await d(t,e)}let D=new y({fields:this._source.metadata.fieldsIndex,spatialReference:this._source.metadata.outSpatialReference}),O={currentUser:s.mesh.properties.currentUser};if((c||E||v)&&(await this._attributeStore.update(s.storage,D,this._source.metadata,t,{dependencies:_,timeZoneChanged:m,currentUserChanged:h}),this._strategy?.invalidateAttributeData(S(s))),!i&&!E&&!w)return!1;(f||l||w)&&await this._updateStrategy(s.mesh.strategy,o,S(s),O),this._updateSortKey(D,`sortKey`in s.mesh.properties?s.mesh.properties.sortKey:null);let k=s.mesh.factory.symbology.type===`dictionary`?s.mesh.factory.symbology.fieldMap:null,A=new g(D,this._proxy,r,this._registry,k);return(u||s.mesh.factory.symbology.type===`dictionary`)&&(this._factory=await p.create(A,s.mesh.factory)),this._version=t,!0}async applyOverrideUpdate(e,t){if(this._strategy)try{let n=await this._strategy.applyOverrideUpdate(e);n&&await this._process(n,t)}catch{}}async updateChunks(e,t,n){await this._doUpdateChunks(e,t,n),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}invalidate(){this._strategy&&this._strategy.invalidate()}async _load(e){this._glyphPorts=await e.layerView.openGlyphPorts(),this._glyphClient=await s(this._glyphPorts,{maxNumberOfConcurrentJobs:20}),this._glyphProxy=this._glyphClient.createInvokeProxy()}async _doUpdateChunks(e,t,n){if(this._strategy){try{let r=await this._strategy.updateChunks(e,t);r&&await this._process(r,n)}catch{}has(`esri-2d-update-debug`)&&console.log(`SendUpdates`),this._attributeStore.sendUpdates(),has(`esri-2d-update-debug`)&&console.log(`SendUpdates.await`)}}async _updateStrategy(e,t,n,r){this._strategy?.destroy(),this._strategy=await _(this._connection,e,this._source,this._attributeStore,n,r);for(let e of t)this._strategy.onSubscribe(e)}async _updateSortKey(e,n){if(this._sortInfo=t(this._sortInfo?.computed),n!=null){let t=n.byRenderer?null:await e.createComputedField(n);this._sortInfo={...n,computed:t}}}async _process(e,t){switch(e.type){case`level-replace`:return this._processLevelBatch(e,t);case`append`:case`update`:return this._processStandardBatch(e,t)}}async _processLevelBatch(e,t){let n=await this._connection.container.beginLevelMeshUpdate(e.level);await this._processBatchMessages(e.messages,t),await this._connection.container.applyLevelMeshUpdate(n)}async _processStandardBatch(e,t){return this._processBatchMessages(e.messages,t)}async _processBatchMessages(e,t){for(let n of e){let e=n.subscription;if(has(`esri-2d-update-debug`)){let t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${n.end}] Processor._process`)}let i={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(n,i),r(e.signal);let a=await this._write(n,e.tile.createArcadeEvaluationOptions(S(this._schema)),i,t),o=e.tile.tileInfoView.getLODInfoAt(e.tile.key);r(e.signal);let{message:s,transferList:c}=a.serialize(o),l={objectIdMap:null,inner:n.createMessage(s,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){l.objectIdMap={};let e=n.reader?.getCursor();if(e)for(;e.next();)l.objectIdMap[e.getDisplayId()]=e.getObjectId()}if(r(e.signal),await this._connection.container.onMessage(l,{signal:e.signal,transferList:c}),this._attributeStore.sendUpdates(),has(`esri-2d-update-debug`)){let t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${n.end}] Processor._process.await`)}}}async _fetchResources(e,t){await this._loaded,await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(!e.reader)return;let t=e.subscription.tile.createArcadeEvaluationOptions(S(this._schema));return this._factory.enqueueMatcherRequests(this._proxy,e.reader,{scale:t.$view.scale,viewingMode:`2d`},e.id)}async _fetchWriterResources(e,t){if(!e.reader)return;let n=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(S(this._schema));for(;n.next();)this._factory.enqueueWriterRequests(this._proxy,n,r,t,e.id);await this._proxy.fetchEnqueuedResources()}async _write(e,t,n,a){let o=e.subscription.tile,s=e.reader?.getCursor(),c=s?.getSize()??0,l=o.tileInfoView.tileInfo.isWrappable,u=o.tileInfoView.spatialReference.isWGS84,d=this._schema?.mesh.factory.referenceScale,p=new f(o.key,l,u,c);if(!s)return p;let m=C(o.transform,a),h=o.createArcadeEvaluationOptions(S(this._schema)),g=0;for(;s.next();){++g%1e3||(await i(0),r(e.subscription));let a=this._getSortKeyValue(s,t);p.entityStart(s.getDisplayId(),a);try{this._factory.write(p,this._proxy,s,h,n,o.level,m,d)}catch{}p.entityEnd()}return p}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;let{computed:n,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):n?.read(e,t);return a==null||isNaN(a)?0:a*(r===`asc`?-1:1)}}function x(e,t){let n=[];return(e?.timeExtent?.start!==t.timeExtent?.start||e?.timeExtent?.end!==t.timeExtent?.end)&&n.push(`timeProperties`),n}function S(e){let{timeZone:t}=e?.mesh.properties??{},{timeExtent:n}=e?.expressionProperties??{};return{timeZone:t,timeExtent:n}}function C(e,t){let n=c(e),r=[];for(let e of t.rings){let t=
|
|
2
|
+
import e from"../../../../config.js";import has from"../../../../core/has.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{notDeepEqual as n}from"../../../../core/object.js";import{throwIfAborted as r,after as i}from"../../../../core/promiseUtils.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as o}from"../../../../core/workers/utils.js";import{openWithPorts as s}from"../../../../core/workers/workers.js";import{normalizeTransform as c,quantizeX as l,quantizeY as u}from"../../../../geometry/support/quantizationUtils.js";import{checkProjectionSupport as d}from"../../../../layers/graphics/data/projectionSupport.js";import{MultiTileMeshData as f}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as p}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as m}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as h}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as g}from"../../engine/webgl/util/MatcherContext.js";import{createAggregateStrategy as _}from"./processor/createAggregateStrategy.js";import{AttributeStore as v}from"./support/AttributeStore.js";import{ComputedAttributeStorage as y}from"./support/ComputedAttributeStorage.js";class b{constructor(t,n){this._connection=t,this._source=n,this._version=1,this._registry=new h;let r={fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t),fetchMesh:(e,t)=>this._connection.layerView.fetchMesh(e,t)},i={fetchGlyphs:async(t,n)=>{let r=[];if(await this._loaded,this._glyphProxy){let i=`${e.fontsUrl}/{fontstack}/{range}.pbf`;for(let e of t)r.push(this._glyphProxy.rasterizeText(i,e,n))}else console.error(`Failed to fetch glyphs from worker: proxy not created`);return Promise.all(r)}};this._proxy=new m(r,i),this._attributeStore=new v({isLocal:!1,update:e=>o(this._connection.container.updateAttributeView(e))}),this._loaded=this._load(t)}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy(),this._loaded.finally(()=>{this._glyphClient?.close(),this._glyphClient=null,this._glyphPorts?.forEach(e=>e.close())})}get hasClusters(){return this._schema?.mesh.strategy.type===`cluster`}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){return this._strategy?this._strategy.getDisplayIds(e):{}}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(e){return this._strategy?.requiresInvalidation(e)??!1}async update(e,t,r,i,o){let s=e.processor,c=n(this._schema?.storage,s.storage),l=n(this._schema?.mesh.properties,s.mesh.properties),u=n(this._schema?.mesh.factory,s.mesh.factory),f=n(this._schema?.mesh.strategy,s.mesh.strategy),m=this._schema?.mesh.properties.timeZone!==s.mesh.properties.timeZone,h=this._schema?.mesh.properties.currentUser!==s.mesh.properties.currentUser,_=x(this._schema?.expressionProperties,s.expressionProperties),v=_.some(e=>this._attributeStore.hasArcadeDependency(e)),b=_.some(e=>this._factory?.hasArcadeDependency(e)??!1),C=_.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&v,w=b||C,T=b||v||C,E=l||u||f;if(!(c||E||T)&&!i)return!1;if(has(`esri-2d-update-debug`)&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a(this._schema,s),schema:s}),this._schema=s,s.mesh.factory.symbology.type===`annotation-feature`||s.mesh.factory.symbology.type===`dimension-feature`){let e=this._source.metadata.outSpatialReference,t=this._source.metadata.attributeSpatialReference??this._source.metadata.spatialReference??e;await d(t,e)}let D=new y({fields:this._source.metadata.fieldsIndex,spatialReference:this._source.metadata.outSpatialReference}),O={currentUser:s.mesh.properties.currentUser};if((c||E||v)&&(await this._attributeStore.update(s.storage,D,this._source.metadata,t,{dependencies:_,timeZoneChanged:m,currentUserChanged:h}),this._strategy?.invalidateAttributeData(S(s))),!i&&!E&&!w)return!1;(f||l||w)&&await this._updateStrategy(s.mesh.strategy,o,S(s),O),this._updateSortKey(D,`sortKey`in s.mesh.properties?s.mesh.properties.sortKey:null);let k=s.mesh.factory.symbology.type===`dictionary`?s.mesh.factory.symbology.fieldMap:null,A=new g(D,this._proxy,r,this._registry,k);return(u||s.mesh.factory.symbology.type===`dictionary`)&&(this._factory=await p.create(A,s.mesh.factory)),this._version=t,!0}async applyOverrideUpdate(e,t){if(this._strategy)try{let n=await this._strategy.applyOverrideUpdate(e);n&&await this._process(n,t)}catch{}}async updateChunks(e,t,n){await this._doUpdateChunks(e,t,n),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}invalidate(){this._strategy&&this._strategy.invalidate()}async _load(e){this._glyphPorts=await e.layerView.openGlyphPorts(),this._glyphClient=await s(this._glyphPorts,{maxNumberOfConcurrentJobs:20}),this._glyphProxy=this._glyphClient.createInvokeProxy()}async _doUpdateChunks(e,t,n){if(this._strategy){try{let r=await this._strategy.updateChunks(e,t);r&&await this._process(r,n)}catch{}has(`esri-2d-update-debug`)&&console.log(`SendUpdates`),this._attributeStore.sendUpdates(),has(`esri-2d-update-debug`)&&console.log(`SendUpdates.await`)}}async _updateStrategy(e,t,n,r){this._strategy?.destroy(),this._strategy=await _(this._connection,e,this._source,this._attributeStore,n,r);for(let e of t)this._strategy.onSubscribe(e)}async _updateSortKey(e,n){if(this._sortInfo=t(this._sortInfo?.computed),n!=null){let t=n.byRenderer?null:await e.createComputedField(n);this._sortInfo={...n,computed:t}}}async _process(e,t){switch(e.type){case`level-replace`:return this._processLevelBatch(e,t);case`append`:case`update`:return this._processStandardBatch(e,t)}}async _processLevelBatch(e,t){let n=await this._connection.container.beginLevelMeshUpdate(e.level);await this._processBatchMessages(e.messages,t),await this._connection.container.applyLevelMeshUpdate(n)}async _processStandardBatch(e,t){return this._processBatchMessages(e.messages,t)}async _processBatchMessages(e,t){for(let n of e){let e=n.subscription;if(has(`esri-2d-update-debug`)){let t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${n.end}] Processor._process`)}let i={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(n,i),r(e.signal);let a=await this._write(n,e.tile.createArcadeEvaluationOptions(S(this._schema)),i,t),o=e.tile.tileInfoView.getLODInfoAt(e.tile.key);r(e.signal);let{message:s,transferList:c}=a.serialize(o),l={objectIdMap:null,inner:n.createMessage(s,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){l.objectIdMap={};let e=n.reader?.getCursor();if(e)for(;e.next();)l.objectIdMap[e.getDisplayId()]=e.getObjectId()}if(r(e.signal),await this._connection.container.onMessage(l,{signal:e.signal,transferList:c}),this._attributeStore.sendUpdates(),has(`esri-2d-update-debug`)){let t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${n.end}] Processor._process.await`)}}}async _fetchResources(e,t){await this._loaded,await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(!e.reader)return;let t=e.subscription.tile.createArcadeEvaluationOptions(S(this._schema));return this._factory.enqueueMatcherRequests(this._proxy,e.reader,{scale:t.$view.scale,viewingMode:`2d`},e.id)}async _fetchWriterResources(e,t){if(!e.reader)return;let n=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(S(this._schema));for(;n.next();)this._factory.enqueueWriterRequests(this._proxy,n,r,t,e.id);await this._proxy.fetchEnqueuedResources()}async _write(e,t,n,a){let o=e.subscription.tile,s=e.reader?.getCursor(),c=s?.getSize()??0,l=o.tileInfoView.tileInfo.isWrappable,u=o.tileInfoView.spatialReference.isWGS84,d=this._schema?.mesh.factory.referenceScale,p=new f(o.key,l,u,c);if(!s)return p;let m=C(o.transform,a),h=o.createArcadeEvaluationOptions(S(this._schema)),g=0;for(;s.next();){++g%1e3||(await i(0),r(e.subscription));let a=this._getSortKeyValue(s,t);p.entityStart(s.getDisplayId(),a);try{this._factory.write(p,this._proxy,s,h,n,o.level,m,d)}catch{}p.entityEnd()}return p}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;let{computed:n,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):n?.read(e,t);return a==null||isNaN(a)?0:a*(r===`asc`?-1:1)}}function x(e,t){let n=[];return(e?.timeExtent?.start!==t.timeExtent?.start||e?.timeExtent?.end!==t.timeExtent?.end)&&n.push(`timeProperties`),n}function S(e){let{timeZone:t}=e?.mesh.properties??{},{timeExtent:n}=e?.expressionProperties??{};return{timeZone:t,timeExtent:n}}function C(e,t){let n=c(e),r=[];for(let e of t.rings){let t=Array.from(e,e=>[l(n,e[0]),u(n,e[1])]);r.push(t)}return{rings:r}}export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{Evented as e}from"../../../../../core/Evented.js";import has from"../../../../../core/has.js";import{r as t}from"../../../../../chunks/rbush.js";import{width as n,height as r,create as i}from"../../../../../geometry/support/aaBoundingRect.js";import{getInfo as a}from"../../../../../geometry/support/spatialReferenceUtils.js";import{Tile as o}from"./Tile.js";import s from"../../../tiling/TileCoverage.js";import c from"../../../tiling/TileKey.js";const l={added:[],removed:[]},u=new Set,d=new c(0,0,0,0);function f(e,t){let n=a(t);if(!n)return null;let[r,o]=n.valid;return e[2]>o?[i([e[0],e[1],o,e[3]]),i([r,e[1],r+e[2]-o,e[3]])]:e[0]<r?[i([r,e[1],e[2],e[3]]),i([o-(r-e[0]),e[1],o,e[3]])]:null}class p extends e{constructor(e){super(),this._tiles=new Map,this._index=t(9,has(`esri-csp-restrictions`)?e=>({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[`.bounds[0]`,`.bounds[1]`,`.bounds[2]`,`.bounds[3]`]),this.tiles=[],this.tileScheme=e}destroy(){super.destroy(),this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}getIntersectingTiles(e){if(!e||n(e)===0||r(e)===0)return[];let t=f(e,this.tileScheme.spatialReference);return t==null?this.boundsIntersections(e):[...new Set([...this.boundsIntersections(t[0]),...this.boundsIntersections(t[1])])]}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){let t={added:[],removed:[]};for(let n of e.added)if(!this.has(n)){let e=new o(this.tileScheme,n);this._tiles.set(n,e),this._index.insert(e),t.added.push(e)}for(let n of e.removed)if(this.has(n)){let e=this.get(n);this._tiles.delete(n),this._index.remove(e),t.removed.push(e)}this.tiles.length=0,this._tiles.forEach(e=>this.tiles.push(e)),(t.added.length||t.removed.length)&&this.emit(`update`,t)}setViewState(e){let t=this.tileScheme.getTileCoverage(e,0);if(!t)return;let{spans:n,lodInfo:r}=t,{level:i}=r;
|
|
2
|
+
import{Evented as e}from"../../../../../core/Evented.js";import has from"../../../../../core/has.js";import{r as t}from"../../../../../chunks/rbush.js";import{width as n,height as r,create as i}from"../../../../../geometry/support/aaBoundingRect.js";import{getInfo as a}from"../../../../../geometry/support/spatialReferenceUtils.js";import{Tile as o}from"./Tile.js";import s from"../../../tiling/TileCoverage.js";import c from"../../../tiling/TileKey.js";const l={added:[],removed:[]},u=new Set,d=new c(0,0,0,0);function f(e,t){let n=a(t);if(!n)return null;let[r,o]=n.valid;return e[2]>o?[i([e[0],e[1],o,e[3]]),i([r,e[1],r+e[2]-o,e[3]])]:e[0]<r?[i([r,e[1],e[2],e[3]]),i([o-(r-e[0]),e[1],o,e[3]])]:null}class p extends e{constructor(e){super(),this._tiles=new Map,this._index=t(9,has(`esri-csp-restrictions`)?e=>({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[`.bounds[0]`,`.bounds[1]`,`.bounds[2]`,`.bounds[3]`]),this.tiles=[],this.tileScheme=e}destroy(){super.destroy(),this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}getIntersectingTiles(e){if(!e||n(e)===0||r(e)===0)return[];let t=f(e,this.tileScheme.spatialReference);return t==null?this.boundsIntersections(e):[...new Set([...this.boundsIntersections(t[0]),...this.boundsIntersections(t[1])])]}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){let t={added:[],removed:[]};for(let n of e.added)if(!this.has(n)){let e=new o(this.tileScheme,n);this._tiles.set(n,e),this._index.insert(e),t.added.push(e)}for(let n of e.removed)if(this.has(n)){let e=this.get(n);this._tiles.delete(n),this._index.remove(e),t.removed.push(e)}this.tiles.length=0,this._tiles.forEach(e=>this.tiles.push(e)),(t.added.length||t.removed.length)&&this.emit(`update`,t)}setViewState(e){let t=this.tileScheme.getTileCoverage(e,0);if(!t)return;let{spans:n,lodInfo:r}=t,{level:i}=r;for(let{row:e,colFrom:t,colTo:a}of n)for(let n=t;n<=a;n++){let t=d.set(i,e,r.normalizeCol(n),r.getWorldForColumn(n)).id;if(u.add(t),!this.has(t)){let e=new o(this.tileScheme,t);this._tiles.set(t,e),this._index.insert(e),this.tiles.push(e),l.added.push(e)}}for(let e=this.tiles.length-1;e>=0;e--){let t=this.tiles[e];u.has(t.id)||(this._tiles.delete(t.id),this.tiles.splice(e,1),this._index.remove(t),l.removed.push(t))}(l.added.length||l.removed.length)&&this.emit(`update`,l),s.pool.release(t),u.clear(),l.added.length=0,l.removed.length=0}}export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as r}from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as a,throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{create as u}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as d,isPolygon as f,isExtent as p,getJsonType as m}from"../../../../geometry/support/jsonTypeUtils.js";import h from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as g,CIMSymbolHelper as _}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as v}from"../../../../symbols/cim/OverrideHelper.js";import{errorPointSymbol2D as y,errorPolylineSymbol2D as b,errorPolygonSymbol2D as x}from"../../../../symbols/support/defaults.js";import{filterFlag0 as S}from"../../engine/webgl/definitions.js";import{FeatureTile as C}from"../../engine/webgl/FeatureTile.js";import{MeshData as w}from"../../engine/webgl/mesh/MeshData.js";import{createCalloutMeshWriterCoordinator as T}from"../../engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js";import{MeshWriterGroupCoordinator as E}from"../../engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js";import{ResourceProxy as D}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as O}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createMeshWriterGroup as k}from"../../engine/webgl/util/Matcher.js";import{createStorageSchema as A}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as j}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as M}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as N}from"../features/support/FeatureMetadata.js";import{GraphicsReader as P}from"../features/support/GraphicsReader.js";import F from"./GraphicStore.js";import{FeatureCommandQueue as I}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as L}from"../support/UpdateTracking2D.js";class R{static getOrCreate(e,t,n){let r=t.get(e.id);return r||(r=new R(e,n),t.set(e.id,r)),r}static fromItems(e,t,n){let r=new R(e,n);for(let e of t)r.append(e);return r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[],this.objectIdMap=null}get reader(){return this._reader||=P.from(this.addedOrModified,this.tile,this.metadata),this._reader}append(e){this.addedOrModified.push(e),e.hasAnimations&&(this.objectIdMap=this.objectIdMap||{},this.objectIdMap[e.displayId]=e.objectId)}}let z=class extends r(t){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._highlightFlagsByObjectId=new Map,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new L({debugName:`GraphicsView2D`}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new I({process:e=>{switch(e.type){case`update`:return this._update();default:throw Error(`InternalError: Unsupported command`)}}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set(`graphics`,null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new M({spatialReference:this.view.spatialReference,fields:new h}),this._attributeStore=new j({isLocal:!0,update:e=>{has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});let e=A(null,[]);this._attributeStore.update(e,this._storage,null,0,{dependencies:[],timeZoneChanged:!1,currentUserChanged:!1})}initialize(){this._initAttributeStore(),this._metadata=N.createGraphics(this.view.spatialReference),this._resourceProxy=new D({fetch:e=>Promise.all(e.map(e=>this.view.stage.textureManager.rasterizeItem(e))),fetchDictionary:e=>{throw Error(`InternalError: Graphics do not support Dictionary requests`)},fetchMesh:e=>{throw Error(`InternalError: Graphics do not support Mesh requests`)}}),this.addHandles([s(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on(`update`,this._onTileUpdate.bind(this)),this.container.on(`attach`,()=>{this.addHandles([this.graphics.on(`change`,()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new F(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking(`CommandQueue`,this._commandQueue.updateTracking);let e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return typeof this.renderer==`function`?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){return!this._attached||this._updateTracking.updating}hitTest(e,t){if(!this.view||this.view.suspended)return[];let{resolution:r,rotation:i}=this.view.state,a=this._graphicStore.hitTest(e,t,r,i),o=new Set(a),s=this.graphics.items.reduce((e,t)=>(o.has(t.uid)&&e.set(t.uid,t),e),new Map);return a.map(e=>s.get(e)).filter(n)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange(`updating`)}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlightFilters(e){this._highlightFlagsByObjectId.clear();for(let{order:t,filters:n}of e){let e=1<<t;for(let t of n)for(let n of t.objectIds??[]){let t=this._highlightFlagsByObjectId.get(n)??0;this._highlightFlagsByObjectId.set(n,t|e)}}if(this.container.setHighlightActive(this._highlightFlagsByObjectId.size>0),this._attached)for(let e of this._graphicStore.items())this._setFilterState(e);this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)&&this.pushUpdate()}pushUpdate(){this._pushUpdate()}_pushUpdate(){a(this._commandQueue.push({type:`update`}))}async _update(){try{if(has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`),this.graphics.destroyed)return;let e=await this._graphicStore.update(this.graphics,e=>this._getSymbolForGraphic(e),e=>this._ensureSymbolResource(e));for(let t of e.updated)this.container.restartAnimation(t.objectId);if(!e.hasAnyUpdate()){this._attributeStore.sendUpdates();return}e.removed.length&&(this._cleanupRequired=!0),has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);let t=this._createTileMessages(e);await this._densifyItemsForDisplay(t),await this._fetchResources(t),this._write(t);for(let t of e.added)this._setFilterState(t);for(let t of e.updated)this._setFilterState(t);has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),this._attributeStore.sendUpdates(),has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch{}this._cleanupSharedResources()}_createTileMessages(e){let t=new Map;for(let n of e.added){let e=this.view.graphicsTileStore.getIntersectingTiles(n.symbolBounds);for(let r of e)R.getOrCreate(r,t,this._metadata).append(n)}for(let n of e.updated){let e=this.view.graphicsTileStore.getIntersectingTiles(n.prevSymbolBounds),r=this.view.graphicsTileStore.getIntersectingTiles(n.symbolBounds);for(let r of e)R.getOrCreate(r,t,this._metadata).removed.push(n.displayId);for(let e of r)R.getOrCreate(e,t,this._metadata).append(n)}for(let n of e.removed){let e=this.view.graphicsTileStore.getIntersectingTiles(n.symbolBounds);for(let r of e)R.getOrCreate(r,t,this._metadata).removed.push(n.displayId)}return Array.from(t.values())}async _densifyItemsForDisplay(e){let t=new Map;for(let n of e)for(let e of n.addedOrModified)t.has(e)||t.set(e,e.densifyCurvedGeometryForDisplay(this.view.spatialReference));await Promise.all(t.values())}async _fetchResources(e){let t={timeZone:null,timeExtent:null};for(let{tile:n,reader:r}of e){has(`esri-2d-update-debug`)&&console.debug(`Id[${this.layerId}] Tile[${n.id}] GraphicsView fetchResources`,e);let i=r.getCursor();for(;i.next();)for(let e of i.getMeshWriters().writers)e.enqueueRequest(this._resourceProxy,i,n.createArcadeEvaluationOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(let t of e){has(`esri-2d-update-debug`)&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);let e=this._writeMeshes(t),n=this._tiles.get(t.tile.key);n||=this._createFeatureTile(t.tile.key),has(`esri-2d-update-debug`)&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(n,{type:`update`,modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:t.objectIdMap}),this.container.requestRender()}}_writeMeshes(e){let t={timeZone:null,timeExtent:null},n=new w(e.tile.id),r=e.reader.getCursor();for(;r.next();)n.entityStart(r.getDisplayId(),r.getZOrder()),new E({out:n,proxy:this._resourceProxy,feature:r,options:e.tile.createArcadeEvaluationOptions(t),level:e.tile.level,coordinatorFactories:[T]}).coordinateAndWrite(r.getMeshWriters()),n.entityEnd();return{...n.serialize().message,tileId:e.tile.id,requiresRefresh:!1}}_setFilterState(e){let t=e.displayId,n=this._highlightFlagsByObjectId.get(e.objectId)??0;this._attributeStore.setData(t,0,0,n|(e.visible?S:0))}_getSymbolForGraphic(e){return e.symbol==null?this._effectiveRenderer==null?this._getNullSymbol(e):this._effectiveRenderer.getSymbol(e):e.symbol}async _ensureSymbolResource(e){if(!e.symbol)return;let t=await this._getSymbolInfo(e.symbol);if(!t)return;let n=t.linearCIM.filter(e=>e.type===`text`);e.symbolResource=n.length>0?{symbolInfo:t,textInfo:await this._getTextResources(e,n)}:{symbolInfo:t}}_getSymbolInfo(e){let t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch(e=>null)),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){let n=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(n);return{hash:e,cimSymbol:n,linearCIM:r,meshWriters:await this._createMeshWriters(n,r,t.type===`text`)}}async _convertToCIMSymbol(e){let t=g(e);return t.type===`web-style`?this._convertToCIMSymbol(await t.fetchSymbol({acceptedFormats:[`cim`,`web`]})):t}async _createLinearCIM(e){return await _.normalizeSymbolAndFetchResources(e.symbol,this._cimResourceManager),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t,n){o(this._controller.signal);let r=this.container.instanceStore,i=this.view.stage.meshWriterRegistry,a=await O(e,t,r,n),s=await Promise.all(a.map(e=>i.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e,null)));return k(s,a)}_onTileUpdate(e){if(e.added&&e.added.length>0)for(let t of e.added)this._updateTracking.consumePromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(let t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){let t=this.view.featuresTilingScheme.getTileBounds(u(),e),n=this.view.featuresTilingScheme.getTileResolution(e.level),r=new C(e,n,t[0],t[3],this.container.labelStore);return r.presenting=!0,this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;let t=this._graphicStore.queryItems(e);if(!t.length)return;let n=this._createFeatureTile(e.key),r=R.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);let i=this._writeMeshes(r);n.update({type:`append`,append:i,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:r.objectIdMap})}_removeTile(e){if(!this._tiles.has(e))return;let t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){let t=e.geometry;return t?d(t)?b:f(t)||p(t)?x:this.defaultPointSymbolEnabled?y:null:this.defaultPointSymbolEnabled?y:null}async _getTextResources(e,t){let n=[],r=[];for(let i=0;i<t.length;i++){let a=t[i],{resource:o,overrides:s}=a.textRasterizationParam;if(s?.length>0){let t=v.resolveSymbolOverrides({type:`CIMSymbolReference`,primitiveOverrides:s,symbol:{type:`CIMPointSymbol`,symbolLayers:[{type:`CIMVectorMarker`,enable:!0,size:o.symbol.height,anchorPointUnits:`Relative`,frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:`CIMMarkerGraphic`,geometry:{x:0,y:0},symbol:o.symbol,textString:o.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then(e=>{let{textString:t}=e.symbolLayers[0].markerGraphics[0];r.push({type:`cim-rasterization-info`,resource:{type:`text`,textString:t||``,font:o.font}}),a.text=o.textString=t||``}),n.push(t)}else r.push({type:`cim-rasterization-info`,resource:o})}n.length>0&&await Promise.all(n);let a=r.map(e=>this.view.stage.textureManager.rasterizeItem(e)),o=await Promise.all(a);i(o);let s=new Map;for(let e=0;e<t.length;e++){let n=t[e];s.set(n.textRasterizationParam.resource.symbol,{text:n.text,glyphMosaicItems:o[e]})}return s}_cleanupSharedResources(){if(!this._cleanupRequired)return;let e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;let t=new Set;for(let e of this._graphicStore.items()){let n=e.symbolResource?.symbolInfo.hash;t.add(n)}let n=new Set(this._hashToSymbolInfo.keys());for(let e of n.values())t.has(e)||this._hashToSymbolInfo.delete(e)}};e([c()],z.prototype,`_effectiveRenderer`,null),e([c({constructOnly:!0})],z.prototype,`layerId`,void 0),e([c({constructOnly:!0})],z.prototype,`requestUpdateCallback`,void 0),e([c()],z.prototype,`container`,void 0),e([c({constructOnly:!0})],z.prototype,`graphics`,void 0),e([c()],z.prototype,`renderer`,void 0),e([c()],z.prototype,`_updateTracking`,void 0),e([c()],z.prototype,`updating`,null),e([c()],z.prototype,`view`,void 0),e([c()],z.prototype,`updateRequested`,void 0),e([c()],z.prototype,`defaultPointSymbolEnabled`,void 0),z=e([l(`esri.views.2d.layers.graphics.GraphicsView2D`)],z);const B=z;export{B as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as r}from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as a,throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{create as u}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as d,isPolygon as f,isExtent as p,getJsonType as m}from"../../../../geometry/support/jsonTypeUtils.js";import h from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as g,CIMSymbolHelper as _}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as v}from"../../../../symbols/cim/OverrideHelper.js";import{errorPointSymbol2D as y,errorPolylineSymbol2D as b,errorPolygonSymbol2D as x}from"../../../../symbols/support/defaults.js";import{filterFlag0 as S}from"../../engine/webgl/definitions.js";import{FeatureTile as C}from"../../engine/webgl/FeatureTile.js";import{MeshData as w}from"../../engine/webgl/mesh/MeshData.js";import{createCalloutMeshWriterCoordinator as T}from"../../engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js";import{MeshWriterGroupCoordinator as E}from"../../engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js";import{ResourceProxy as D}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as O}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createMeshWriterGroup as k}from"../../engine/webgl/util/Matcher.js";import{createStorageSchema as A}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as j}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as M}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as N}from"../features/support/FeatureMetadata.js";import{GraphicsReader as P}from"../features/support/GraphicsReader.js";import F from"./GraphicStore.js";import{FeatureCommandQueue as I}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as L}from"../support/UpdateTracking2D.js";class R{static getOrCreate(e,t,n){let r=t.get(e.id);return r||(r=new R(e,n),t.set(e.id,r)),r}static fromItems(e,t,n){let r=new R(e,n);for(let e of t)r.append(e);return r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[],this.objectIdMap=null}get reader(){return this._reader||=P.from(this.addedOrModified,this.tile,this.metadata),this._reader}append(e){this.addedOrModified.push(e),e.hasAnimations&&(this.objectIdMap=this.objectIdMap||{},this.objectIdMap[e.displayId]=e.objectId)}}let z=class extends r(t){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._highlightFlagsByObjectId=new Map,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new L({debugName:`GraphicsView2D`}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new I({process:e=>{switch(e.type){case`update`:return this._update();default:throw Error(`InternalError: Unsupported command`)}}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set(`graphics`,null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new M({spatialReference:this.view.spatialReference,fields:new h}),this._attributeStore=new j({isLocal:!0,update:e=>{has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});let e=A(null,[]);this._attributeStore.update(e,this._storage,null,0,{dependencies:[],timeZoneChanged:!1,currentUserChanged:!1})}initialize(){this._initAttributeStore(),this._metadata=N.createGraphics(this.view.spatialReference),this._resourceProxy=new D({fetch:e=>Promise.all(e.map(e=>this.view.stage.textureManager.rasterizeItem(e))),fetchDictionary:e=>{throw Error(`InternalError: Graphics do not support Dictionary requests`)},fetchMesh:e=>{throw Error(`InternalError: Graphics do not support Mesh requests`)}}),this.addHandles([s(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on(`update`,this._onTileUpdate.bind(this)),this.container.on(`attach`,()=>{this.addHandles([this.graphics.on(`change`,()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new F(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking(`CommandQueue`,this._commandQueue.updateTracking);let e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return typeof this.renderer==`function`?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){return!this._attached||this._updateTracking.updating}hitTest(e,t){if(!this.view||this.view.suspended)return[];let{resolution:r,rotation:i}=this.view.state,a=this._graphicStore.hitTest(e,t,r,i),o=new Set(a),s=this.graphics.items.reduce((e,t)=>(o.has(t.uid)&&e.set(t.uid,t),e),new Map);return a.map(e=>s.get(e)).filter(n)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange(`updating`)}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlightFilters(e){this._highlightFlagsByObjectId.clear();for(let{order:t,filters:n}of e){let e=1<<t;for(let t of n)for(let n of t.objectIds??[]){let t=this._highlightFlagsByObjectId.get(n)??0;this._highlightFlagsByObjectId.set(n,t|e)}}if(this.container.setHighlightActive(this._highlightFlagsByObjectId.size>0),this._attached)for(let e of this._graphicStore.items())this._setFilterState(e);this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)&&this.pushUpdate()}pushUpdate(){this._pushUpdate()}_pushUpdate(){a(this._commandQueue.push({type:`update`}))}async _update(){try{if(has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`),this.graphics.destroyed)return;let e=await this._graphicStore.update(this.graphics,e=>this._getSymbolForGraphic(e),e=>this._ensureSymbolResource(e));for(let t of e.updated)this.container.restartAnimation(t.objectId);if(!e.hasAnyUpdate()){this._attributeStore.sendUpdates();return}e.removed.length&&(this._cleanupRequired=!0),has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);let t=this._createTileMessages(e);await this._densifyItemsForDisplay(t),await this._fetchResources(t),this._write(t);for(let t of e.added)this._setFilterState(t);for(let t of e.updated)this._setFilterState(t);has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),this._attributeStore.sendUpdates(),has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch{}this._cleanupSharedResources()}_createTileMessages(e){let t=new Map;for(let n of e.added){let e=this.view.graphicsTileStore.getIntersectingTiles(n.symbolBounds);for(let r of e)R.getOrCreate(r,t,this._metadata).append(n)}for(let n of e.updated){let e=this.view.graphicsTileStore.getIntersectingTiles(n.prevSymbolBounds),r=this.view.graphicsTileStore.getIntersectingTiles(n.symbolBounds);for(let r of e)R.getOrCreate(r,t,this._metadata).removed.push(n.displayId);for(let e of r)R.getOrCreate(e,t,this._metadata).append(n)}for(let n of e.removed){let e=this.view.graphicsTileStore.getIntersectingTiles(n.symbolBounds);for(let r of e)R.getOrCreate(r,t,this._metadata).removed.push(n.displayId)}return Array.from(t.values())}async _densifyItemsForDisplay(e){let t=new Map;for(let n of e)for(let e of n.addedOrModified)t.has(e)||t.set(e,e.densifyCurvedGeometryForDisplay(this.view.spatialReference));await Promise.all(t.values())}async _fetchResources(e){let t={timeZone:null,timeExtent:null};for(let{tile:n,reader:r}of e){has(`esri-2d-update-debug`)&&console.debug(`Id[${this.layerId}] Tile[${n.id}] GraphicsView fetchResources`,e);let i=r.getCursor();for(;i.next();)for(let e of i.getMeshWriters().writers)e.enqueueRequest(this._resourceProxy,i,n.createArcadeEvaluationOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(let t of e){has(`esri-2d-update-debug`)&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);let e=this._writeMeshes(t),n=this._tiles.get(t.tile.key);n||=this._createFeatureTile(t.tile.key),has(`esri-2d-update-debug`)&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(n,{type:`update`,modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:t.objectIdMap}),this.container.requestRender()}}_writeMeshes(e){let t={timeZone:null,timeExtent:null},n=new w(e.tile.id),r=e.reader.getCursor();for(;r.next();)n.entityStart(r.getDisplayId(),r.getZOrder()),new E({out:n,proxy:this._resourceProxy,feature:r,options:e.tile.createArcadeEvaluationOptions(t),level:e.tile.level,coordinatorFactories:[T]}).coordinateAndWrite(r.getMeshWriters(),{deferCalloutProviderRecords:!0}),n.entityEnd();return{...n.serialize().message,tileId:e.tile.id,requiresRefresh:!1}}_setFilterState(e){let t=e.displayId,n=this._highlightFlagsByObjectId.get(e.objectId)??0;this._attributeStore.setData(t,0,0,n|(e.visible?S:0))}_getSymbolForGraphic(e){return e.symbol==null?this._effectiveRenderer==null?this._getNullSymbol(e):this._effectiveRenderer.getSymbol(e):e.symbol}async _ensureSymbolResource(e){if(!e.symbol)return;let t=await this._getSymbolInfo(e.symbol);if(!t)return;let n=t.linearCIM.filter(e=>e.type===`text`);e.symbolResource=n.length>0?{symbolInfo:t,textInfo:await this._getTextResources(e,n)}:{symbolInfo:t}}_getSymbolInfo(e){let t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch(e=>null)),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){let n=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(n);return{hash:e,cimSymbol:n,linearCIM:r,meshWriters:await this._createMeshWriters(n,r,t.type===`text`)}}async _convertToCIMSymbol(e){let t=g(e);return t.type===`web-style`?this._convertToCIMSymbol(await t.fetchSymbol({acceptedFormats:[`cim`,`web`]})):t}async _createLinearCIM(e){return await _.normalizeSymbolAndFetchResources(e.symbol,this._cimResourceManager),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t,n){o(this._controller.signal);let r=this.container.instanceStore,i=this.view.stage.meshWriterRegistry,a=await O(e,t,r,n),s=await Promise.all(a.map(e=>i.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e,null)));return k(s,a)}_onTileUpdate(e){if(e.added&&e.added.length>0)for(let t of e.added)this._updateTracking.consumePromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(let t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){let t=this.view.featuresTilingScheme.getTileBounds(u(),e),n=this.view.featuresTilingScheme.getTileResolution(e.level),r=new C(e,n,t[0],t[3],this.container.labelStore);return r.presenting=!0,this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;let t=this._graphicStore.queryItems(e);if(!t.length)return;let n=this._createFeatureTile(e.key),r=R.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);let i=this._writeMeshes(r);n.update({type:`append`,append:i,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:r.objectIdMap})}_removeTile(e){if(!this._tiles.has(e))return;let t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){let t=e.geometry;return t?d(t)?b:f(t)||p(t)?x:this.defaultPointSymbolEnabled?y:null:this.defaultPointSymbolEnabled?y:null}async _getTextResources(e,t){let n=[],r=[];for(let i=0;i<t.length;i++){let a=t[i],{resource:o,overrides:s}=a.textRasterizationParam;if(s?.length>0){let t=v.resolveSymbolOverrides({type:`CIMSymbolReference`,primitiveOverrides:s,symbol:{type:`CIMPointSymbol`,symbolLayers:[{type:`CIMVectorMarker`,enable:!0,size:o.symbol.height,anchorPointUnits:`Relative`,frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:`CIMMarkerGraphic`,geometry:{x:0,y:0},symbol:o.symbol,textString:o.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then(e=>{let{textString:t}=e.symbolLayers[0].markerGraphics[0];r.push({type:`cim-rasterization-info`,resource:{type:`text`,textString:t||``,font:o.font}}),a.text=o.textString=t||``}),n.push(t)}else r.push({type:`cim-rasterization-info`,resource:o})}n.length>0&&await Promise.all(n);let a=r.map(e=>this.view.stage.textureManager.rasterizeItem(e)),o=await Promise.all(a);i(o);let s=new Map;for(let e=0;e<t.length;e++){let n=t[e];s.set(n.textRasterizationParam.resource.symbol,{text:n.text,glyphMosaicItems:o[e]})}return s}_cleanupSharedResources(){if(!this._cleanupRequired)return;let e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;let t=new Set;for(let e of this._graphicStore.items()){let n=e.symbolResource?.symbolInfo.hash;t.add(n)}let n=new Set(this._hashToSymbolInfo.keys());for(let e of n.values())t.has(e)||this._hashToSymbolInfo.delete(e)}};e([c()],z.prototype,`_effectiveRenderer`,null),e([c({constructOnly:!0})],z.prototype,`layerId`,void 0),e([c({constructOnly:!0})],z.prototype,`requestUpdateCallback`,void 0),e([c()],z.prototype,`container`,void 0),e([c({constructOnly:!0})],z.prototype,`graphics`,void 0),e([c()],z.prototype,`renderer`,void 0),e([c()],z.prototype,`_updateTracking`,void 0),e([c()],z.prototype,`updating`,null),e([c()],z.prototype,`view`,void 0),e([c()],z.prototype,`updateRequested`,void 0),e([c()],z.prototype,`defaultPointSymbolEnabled`,void 0),z=e([l(`esri.views.2d.layers.graphics.GraphicsView2D`)],z);const B=z;export{B as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/ObjectPool.js";class t{static{this.pool=new e(()=>new t(``),null,null,25,50)}static getId(e,t,n,r){return typeof e==`object`?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${n}/${r}`}constructor(e,t,n,r){this.set(e,t,n,r)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){let e=this.row&4095,t=this.col&4095,n=this.level&63;return(this.world&3)<<30|t<<22|e<<8|n}acquire(e,t,n,r){this.set(e,t,n,r)}contains(e){let t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}containsChild(e){let t=e.level-this.level;return t>0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new t(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,n,r){if(e==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof e==`object`)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if(typeof e==`string`){let[t,n,r,i]=e.split(
|
|
2
|
+
import e from"../../../core/ObjectPool.js";class t{static{this.pool=new e(()=>new t(``),null,null,25,50)}static getId(e,t,n,r){return typeof e==`object`?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${n}/${r}`}constructor(e,t,n,r){this.set(e,t,n,r)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){let e=this.row&4095,t=this.col&4095,n=this.level&63;return(this.world&3)<<30|t<<22|e<<8|n}acquire(e,t,n,r){this.set(e,t,n,r)}contains(e){let t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}containsChild(e){let t=e.level-this.level;return t>0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new t(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,n,r){if(e==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof e==`object`)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if(typeof e==`string`){let[t,n,r,i]=e.split(`/`,4);this.level=parseFloat(t),this.row=parseFloat(n),this.col=parseFloat(r),this.world=parseFloat(i)}else this.level=+e,this.row=+t,this.col=+n,this.world=+r||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new t(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(e,t,n){let r=this.clone();return r.col+=e,r.row+=t,n.normalizeKey(r),r}getChildKeys(){let e=this.level+1,n=this.row<<1,r=this.col<<1,i=this.world;return[new t(e,n,r,i),new t(e,n,r+1,i),new t(e,n+1,r,i),new t(e,n+1,r+1,i)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:+(this.col>e.col)}}export{t as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{create as e,contains as t}from"../../../geometry/support/aaBoundingRect.js";import n from"./TileCache.js";import r from"./TileCoverage.js";import i from"./TileKey.js";const a=new i(0,0,0,0),o=new Map,s=[],c=[];class l{constructor(e){this._previousScale=1/0,this.cachePolicy=`keep`,this.coveragePolicy=`closest`,this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,e.resampling!=null&&(this.resampling=e.resampling),e.cachePolicy&&(this.cachePolicy=e.cachePolicy),e.coveragePolicy&&(this.coveragePolicy=e.coveragePolicy),e.buffer!=null&&(this.buffer=e.buffer),e.cacheSize&&(this._tileCache=new n(e.cacheSize,this.tileInfoView,e=>{this.releaseTile(e)}))}destroy(){this.tileIndex.clear()}update(e){let{resampling:t,tileIndex:n}=this,{scale:i,center:l,resolution:u}=e.state,{minScale:d,maxScale:f}=this.tileInfoView,p=!e.stationary&&i>this._previousScale;if(this._previousScale=i,!t&&(i>d||i<f)){this.tiles.length=0,this.clear();return}let m=this.tileInfoView.getTileCoverage(e.state,this.buffer,this.resampling,this.coveragePolicy);if(!m){this.tiles.length=0,this.clear();return}let{spans:h,lodInfo:g}=m,{level:_}=g;this.tiles.length=0,n.forEach(e=>e.visible=!0);let v=0,y=0;
|
|
2
|
+
import{create as e,contains as t}from"../../../geometry/support/aaBoundingRect.js";import n from"./TileCache.js";import r from"./TileCoverage.js";import i from"./TileKey.js";const a=new i(0,0,0,0),o=new Map,s=[],c=[];class l{constructor(e){this._previousScale=1/0,this.cachePolicy=`keep`,this.coveragePolicy=`closest`,this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,e.resampling!=null&&(this.resampling=e.resampling),e.cachePolicy&&(this.cachePolicy=e.cachePolicy),e.coveragePolicy&&(this.coveragePolicy=e.coveragePolicy),e.buffer!=null&&(this.buffer=e.buffer),e.cacheSize&&(this._tileCache=new n(e.cacheSize,this.tileInfoView,e=>{this.releaseTile(e)}))}destroy(){this.tileIndex.clear()}update(e){let{resampling:t,tileIndex:n}=this,{scale:i,center:l,resolution:u}=e.state,{minScale:d,maxScale:f}=this.tileInfoView,p=!e.stationary&&i>this._previousScale;if(this._previousScale=i,!t&&(i>d||i<f)){this.tiles.length=0,this.clear();return}let m=this.tileInfoView.getTileCoverage(e.state,this.buffer,this.resampling,this.coveragePolicy);if(!m){this.tiles.length=0,this.clear();return}let{spans:h,lodInfo:g}=m,{level:_}=g;this.tiles.length=0,n.forEach(e=>e.visible=!0);let v=0,y=0;for(let{row:e,colFrom:t,colTo:r}of h)for(let i=t;i<=r;i++){v++;let t=a.set(_,e,g.normalizeCol(i),g.getWorldForColumn(i)).id,r=n.get(t);if(r)r.isReady?(o.set(t,r),y++):p||this._addParentTile(t,o);else{if(this._tileCache?.has(t)){if(r=this._tileCache.pop(t),this.tileIndex.set(t,r),r.isReady){o.set(t,r),y++;continue}}else r=this.acquireTile(a),this.tileIndex.set(t,r);p||this._addParentTile(t,o)}}let b=y===v;for(let[e,t]of n){if(o.has(e))continue;a.set(e);let n=this.tileInfoView.intersects(m,a),r=this.cachePolicy===`purge`?a.level!==_:a.level>_;n&&(p||!b)?t.isReady?r&&this.cachePolicy===`purge`&&this._hasReadyAncestor(a,_)?s.push(t):c.push(t):r&&s.push(t):(r||!n)&&s.push(t)}for(let e of c)e.isReady&&o.set(e.key.id,e);for(let e of s)this._tileCache?this._tileCache.add(e):this.releaseTile(e),n.delete(e.key.id);for(let e of o.values())this.tiles.push(e);for(let e of n.values())o.has(e.key.id)||(e.visible=!1);this._tileCache?.prune(_,l,u),r.pool.release(m),c.length=0,s.length=0,o.clear()}clear(){let{tileIndex:e}=this;for(let t of e.values())this.releaseTile(t);e.clear()}refresh(e){for(let t of this.tileIndex.values())e(t);this._tileCache?.clear()}updateCacheSize(e){this._tileCache&&(this._tileCache.maxSize=e)}_addParentTile(e,t){let n=e,r=null;for(;n=this.tileInfoView.getTileParentId(n),n;)if(this.tileIndex.has(n)){if(r=this.tileIndex.get(n),r?.isReady){t.has(r.key.id)||t.set(r.key.id,r);break}}else if(this._tileCache?.has(n)&&(r=this._tileCache.pop(n),this.tileIndex.set(n,r),r?.isReady)){t.has(r.key.id)||t.set(r.key.id,r);break}}_hasReadyAncestor(n,r){let i=e();this.tileInfoView.getTileBounds(i,n,!0);for(let a of this.tileIndex.values())if(a.isReady&&a.key.level>=r&&a.key.level<n.level){let n=e();if(this.tileInfoView.getTileBounds(n,a.key,!0),t(n,i))return!0}return!1}}export{l as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import o from"../../../analysis/LengthDimensionResult.js";let s=class extends t{constructor(e){super(
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import o from"../../../analysis/LengthDimensionResult.js";let s=class extends t{constructor(e){let{dimension:t,...n}=e;super({result:new o({dimension:t}),...n}),this.geometry=null,this.unconstrainedGeometry=null,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null}initialize(){this.addHandles([n(()=>this.dimension.startPoint,e=>this.elevationAlignedStartPoint=this.projectAndAlignPoint(e),r),n(()=>this.dimension.endPoint,e=>this.elevationAlignedEndPoint=this.projectAndAlignPoint(e),r)])}get dimension(){return this.result.dimension}get length(){return this.result.length}};e([i({constructOnly:!0,nonNullable:!0})],s.prototype,`result`,void 0),e([i({constructOnly:!0,nonNullable:!0})],s.prototype,`projectAndAlignPoint`,void 0),e([i()],s.prototype,`dimension`,null),e([i()],s.prototype,`length`,null),e([i()],s.prototype,`geometry`,void 0),e([i()],s.prototype,`unconstrainedGeometry`,void 0),e([i()],s.prototype,`elevationAlignedStartPoint`,void 0),e([i()],s.prototype,`elevationAlignedEndPoint`,void 0),e([i()],s.prototype,`preConstraintProperties`,void 0),e([i()],s.prototype,`previousConstraint`,void 0),s=e([a(`esri.views.3d.analysis.Dimension.LengthDimensionComputation`)],s);export{s as LengthDimensionComputation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{watch as e}from"../../../../core/reactiveUtils.js";import{getObserverRGBA as t,observerConfiguration as n,targetConfiguration as r,getInteractiveTargetRGBA as i,lineOfSightTransparentRenderOrder as a}from"./LineOfSightConfiguration.js";import{Manipulator3D as o}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as s}from"../../interactive/manipulatorUtils.js";import{RenderObject as c}from"../../interactive/RenderObject.js";import{createSphereGeometry as l}from"../../webgl-engine/lib/GeometryUtil.js";const u=1024;class d extends o{constructor(r,i){let a=g(t(r.effectiveTheme)),o=l(a,1,32,32),s=[new c(o)];super({view:r,renderObjects:s,metadata:i,radius:n.radius,elevationInfo:{mode:`absolute-height`,offset:0}}),this.themeHandle=e(()=>({color:t(r.effectiveTheme)}),e=>
|
|
2
|
+
import{watch as e}from"../../../../core/reactiveUtils.js";import{getObserverRGBA as t,observerConfiguration as n,targetConfiguration as r,getInteractiveTargetRGBA as i,lineOfSightTransparentRenderOrder as a}from"./LineOfSightConfiguration.js";import{Manipulator3D as o}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as s}from"../../interactive/manipulatorUtils.js";import{RenderObject as c}from"../../interactive/RenderObject.js";import{createSphereGeometry as l}from"../../webgl-engine/lib/GeometryUtil.js";const u=1024;class d extends o{constructor(r,i){let a=g(t(r.effectiveTheme)),o=l(a,1,32,32),s=[new c(o)];super({view:r,renderObjects:s,metadata:i,radius:n.radius,elevationInfo:{mode:`absolute-height`,offset:0}}),this.themeHandle=e(()=>({color:t(r.effectiveTheme)}),e=>a.setParameters(e))}destroy(){this.themeHandle.remove(),super.destroy()}}class f extends o{constructor(t,n){let{radius:a,visibleColor:o,occludedColor:s,undefinedColor:d}=r,f=g(i(t.effectiveTheme)),p=[new c(l(f,1,32,32),u),h(o,2176),h(s,2304),h(d,2560)];super({view:t,renderObjects:p,metadata:n,radius:a,elevationInfo:{mode:`absolute-height`,offset:0}}),this.themeHandle=e(()=>({color:i(t.effectiveTheme)}),e=>{f.setParameters(e)})}destroy(){this.themeHandle.remove(),super.destroy()}}const p={visible:2176,occluded:2304,undefined:2560};function m(e){return e&-2049|u}function h(e,t){return new c(l(g(e.toUnitRGBA()),1,32,32),t)}function g(e){let t=s(e);return t.setParameters({testsTransparentRenderOrder:a.manipulator}),t}export{d as LineOfSightObserverManipulator,f as LineOfSightTargetManipulator,p as LineOfSightTargetManipulatorState,m as getInteractiveLineOfSightTargetManipulatorState};
|