@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
package/Basemap.js
CHANGED
|
@@ -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"./config.js";import n from"./request.js";import r from"./core/Collection.js";import{referenceSetter as i}from"./core/collectionUtils.js";import{JSONSupportMixin as a}from"./core/JSONSupport.js";import{isClonable as o,clone as s}from"./core/lang.js";import{Loadable as c}from"./core/Loadable.js";import{loadAll as l}from"./core/loadAll.js";import u from"./core/Logger.js";import{destroyMaybe as d}from"./core/maybe.js";import{throwIfAborted as f}from"./core/promiseUtils.js";import{isProtocolRelative as p,urlToObject as m}from"./core/urlUtils.js";import{property as h,subclass as g}from"./core/accessorSupport/decorators.js";import _ from"./geometry/SpatialReference.js";import v from"./portal/Portal.js";import y from"./portal/PortalItem.js";import{getBasemapTitle as b,esriBasemapDefinitions as x}from"./support/basemapDefinitions.js";import S from"./support/BasemapStyle.js";import{BasemapSymbol as C}from"./support/userTypeGuards/isBasemap.js";import{getLayerJSON as w}from"./webdoc/support/writeUtils.js";import{writer as T}from"./core/accessorSupport/decorators/writer.js";var E,D;let O=class extends a(c){static{E=C}static{D=this}constructor(e){super(e),this[E]=!0,this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title=`Basemap`,this.type=`Basemap`,this.id=Date.now().toString(16)+`-basemap-`+D.idCounter++,this.baseLayers=new r,this.referenceLayers=new r,this.groundLayers=new r;let t=e=>{let{parent:t}=e;t&&t!==this&&`remove`in t&&t.remove?.(e),e.parent=this,(e.type===`elevation`||e.type===`integrated-mesh-3dtiles`)&&u.getLogger(this).error(`Layer '${e.title}, id:${e.id}' of type '${e.type}' is not supported as a basemap layer and will therefore be ignored.`)},n=e=>{let{parent:t}=e;t&&t!==this&&`remove`in t&&t.remove?.(e),e.parent=this},i=e=>{let t=e.item;t.parent===this?(u.getLogger(this).error(`Layer '${t.title}, id:${t.id}' of type '${t.type}' already a ground layer, second add will be ignored.`),e.preventDefault()):t.type!==`integrated-mesh-3dtiles`&&(u.getLogger(this).error(`Layer '${t.title}, id:${t.id}' of type '${t.type}' is not supported as a ground layer and will therefore be ignored.`),e.preventDefault())},a=e=>{e.parent=null},o=e=>{e.parent===this&&(e.parent=null)};this.addHandles([this.baseLayers.on(`after-add`,e=>t(e.item)),this.baseLayers.on(`after-remove`,e=>a(e.item)),this.referenceLayers.on(`after-add`,e=>t(e.item)),this.referenceLayers.on(`after-remove`,e=>a(e.item)),this.groundLayers.on(`before-add`,i),this.groundLayers.on(`after-add`,e=>n(e.item)),this.groundLayers.on(`after-remove`,e=>o(e.item))])}static{this.idCounter=0}initialize(){this.when().catch(e=>{u.getLogger(this).error(`#load()`,`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){let e=this.baseLayers.toArray();for(let t of e)t.destroyed||t.destroy();let t=this.groundLayers.toArray();for(let e of t)e.destroyed||e.destroy();let n=this.referenceLayers.toArray();for(let e of n)e.destroyed||e.destroy();this.baseLayers.destroy(),this.groundLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=d(this.portalItem)}removeChildLayer(e){for(let t of[this.baseLayers,this.referenceLayers,this.groundLayers])t.remove(e)}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"./config.js";import n from"./request.js";import r from"./core/Collection.js";import{referenceSetter as i}from"./core/collectionUtils.js";import{JSONSupportMixin as a}from"./core/JSONSupport.js";import{isClonable as o,clone as s}from"./core/lang.js";import{Loadable as c}from"./core/Loadable.js";import{loadAll as l}from"./core/loadAll.js";import u from"./core/Logger.js";import{destroyMaybe as d}from"./core/maybe.js";import{throwIfAborted as f}from"./core/promiseUtils.js";import{isProtocolRelative as p,urlToObject as m}from"./core/urlUtils.js";import{property as h,subclass as g}from"./core/accessorSupport/decorators.js";import _ from"./geometry/SpatialReference.js";import v from"./portal/Portal.js";import y from"./portal/PortalItem.js";import{getBasemapTitle as b,esriBasemapDefinitions as x}from"./support/basemapDefinitions.js";import S from"./support/BasemapStyle.js";import{BasemapSymbol as C}from"./support/userTypeGuards/isBasemap.js";import{getLayerJSON as w}from"./webdoc/support/writeUtils.js";import{writer as T}from"./core/accessorSupport/decorators/writer.js";var E,D;let O=class extends a(c){static{E=C}static{D=this}constructor(e){super(e),this[E]=!0,this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title=`Basemap`,this.type=`Basemap`,this.id=Date.now().toString(16)+`-basemap-`+D.idCounter++,this.baseLayers=new r,this.referenceLayers=new r,this.groundLayers=new r;let t=e=>{let{parent:t}=e;t&&t!==this&&`remove`in t&&t.remove?.(e),e.parent=this,(e.type===`elevation`||e.type===`integrated-mesh-3dtiles`)&&u.getLogger(this).error(`Layer '${e.title}, id:${e.id}' of type '${e.type}' is not supported as a basemap layer and will therefore be ignored.`)},n=e=>{let{parent:t}=e;t&&t!==this&&`remove`in t&&t.remove?.(e),e.parent=this},i=e=>{let t=e.item;t.parent===this?(u.getLogger(this).error(`Layer '${t.title}, id:${t.id}' of type '${t.type}' already a ground layer, second add will be ignored.`),e.preventDefault()):t.type!==`integrated-mesh-3dtiles`&&(u.getLogger(this).error(`Layer '${t.title}, id:${t.id}' of type '${t.type}' is not supported as a ground layer and will therefore be ignored.`),e.preventDefault())},a=e=>{e.parent=null},o=e=>{e.parent===this&&(e.parent=null)};this.addHandles([this.baseLayers.on(`after-add`,e=>t(e.item)),this.baseLayers.on(`after-remove`,e=>a(e.item)),this.referenceLayers.on(`after-add`,e=>t(e.item)),this.referenceLayers.on(`after-remove`,e=>a(e.item)),this.groundLayers.on(`before-add`,i),this.groundLayers.on(`after-add`,e=>n(e.item)),this.groundLayers.on(`after-remove`,e=>o(e.item))])}static{this.idCounter=0}initialize(){this.when().catch(e=>{u.getLogger(this).error(`#load()`,`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){let e=this.baseLayers.toArray();for(let t of e)t.destroyed||t.destroy();let t=this.groundLayers.toArray();for(let e of t)e.destroyed||e.destroy();let n=this.referenceLayers.toArray();for(let e of n)e.destroyed||e.destroy();this.baseLayers.destroy(),this.groundLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=d(this.portalItem)}removeChildLayer(e){for(let t of[this.baseLayers,this.referenceLayers,this.groundLayers])t.remove(e)}get baseLayers(){return this._get(`baseLayers`)}set baseLayers(e){this._set(`baseLayers`,i(e,this._get(`baseLayers`)))}_writeBaseLayers(e,t,n){let r=[];e&&(n={...n,layerContainerType:`basemap-base-layers`},this.baseLayers.forEach(e=>{let t=w(e,n.webmap?n.webmap.getLayerJSONFromResourceInfo(e):null,n);t!=null&&r.push(t)}),this.referenceLayers.forEach(e=>{let t=w(e,n.webmap?n.webmap.getLayerJSONFromResourceInfo(e):null,n);t!=null&&(e.type!==`scene`&&(t.isReference=!0),r.push(t))})),t.baseMapLayers=r}set groundLayers(e){this._set(`groundLayers`,i(e,this._get(`groundLayers`)))}_writeGroundLayers(e,t,n){let r=[];e&&(n={...n,layerContainerType:`basemap-ground-layers`},this.groundLayers.forEach(e=>{let t=w(e,n.webmap?n.webmap.getLayerJSONFromResourceInfo(e):null,n);t!=null&&r.push(t)}),r.length>0&&(t.groundLayers=r))}get loaded(){return super.loaded}get referenceLayers(){return this._get(`referenceLayers`)}set referenceLayers(e){this._set(`referenceLayers`,i(e,this._get(`referenceLayers`)))}writeTitle(e,t){t.title=e||`Basemap`}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return l(this,e=>{e(this.baseLayers,this.groundLayers,this.referenceLayers)})}clone(){let e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(e=>o(e)?e.clone():e),groundLayers:this.groundLayers.map(e=>o(e)?e.clone():e),referenceLayers:this.referenceLayers.map(e=>o(e)?e.clone():e)};return this.loaded&&(e.loadStatus=`loaded`),new D({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set(`resourceInfo`,{data:e,context:t}),super.read(e,t)}write(e,t){return e||={},t?.origin||(t={origin:`web-map`,...t}),super.write(e,t),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(e=>{let t=s(e);return t.url&&p(t.url)&&(t.url=`https:${t.url}`),t.templateUrl&&p(t.templateUrl)&&(t.templateUrl=`https:${t.templateUrl}`),t})),e}async _loadFromSource(e){let{resourceInfo:t,portalItem:n,style:r}=this;f(e);let i=[];if(t){let n=t.context?t.context.url:null;if(i.push(this._loadLayersFromJSON(t.data,n,e)),t.data.id&&!t.data.title){let e=t.data.id;i.push(b(e).then(e=>{e&&this.read({title:e},t.context)}))}}else n?i.push(this._loadFromItem(n,e)):r&&i.push(this._loadFromStylesService(r,e));await Promise.all(i)}async _loadLayersFromJSON(e,t,n){let r=this.resourceInfo?.context,i=this.portalItem?.portal||r?.portal||null,a=A[r?.origin||``]??`web-map`,{populateOperationalLayers:o}=await import(`./layers/support/layersCreator.js`),s=[];if(f(n),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){let n={context:{...r,origin:a,url:t,portal:i,layerContainerType:`basemap-base-layers`},defaultLayerType:`DefaultTileLayer`},c=e=>a===`web-scene`&&e.layerType===`ArcGISSceneServiceLayer`||e.isReference,l=o(this.baseLayers,e.baseMapLayers.filter(e=>!c(e)),n);s.push(l);let u=o(this.referenceLayers,e.baseMapLayers.filter(c),n);s.push(u)}if(e.groundLayers&&Array.isArray(e.groundLayers)){let n={context:{...r,origin:a,url:t,portal:i,layerContainerType:`basemap-ground-layers`},defaultLayerType:`IntegratedMesh3DTilesLayer`},c=o(this.groundLayers,e.groundLayers,n);s.push(c)}await Promise.allSettled(s)}async _loadFromItem(e,t){let n=await(await e.load(t)).fetchData(`json`,t),r=m(e.itemUrl??``);return this._set(`resourceInfo`,{data:n.baseMap??{},context:{origin:k[e.type||``]??`web-map`,portal:e.portal||v.getDefault(),url:r}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:n.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:`portal-item`,portal:e.portal||v.getDefault(),url:r}),this._loadLayersFromJSON(this.resourceInfo.data,r,t)}async _loadFromStylesService(e,r){let i=e.serviceUrl.endsWith(`/webmaps`)?e.serviceUrl.slice(0,-8):e.serviceUrl,a=`${i}/styles/${e.id}/self`,o=`${i}/webmaps/${e.id}`,s=e.apiKey??(t.sessions?.basemap?.enabled?void 0:t.apiKeys.basemapStyles),[c,l]=await Promise.all([(await n(a,{query:{token:s},signal:r?.signal})).data,(await n(o,{query:{language:e.languageParameter,places:e.places,worldview:e.worldview,token:s},signal:r?.signal})).data]);this.thumbnailUrl??=c.thumbnailUrl;let u=m(o);if(this._set(`resourceInfo`,{data:l.baseMap??{},context:{origin:`web-map`,url:u}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:l.spatialReference},this.resourceInfo.context),await this._loadLayersFromJSON(this.resourceInfo.data,u,r),s)for(let e of[...this.baseLayers,...this.groundLayers,...this.referenceLayers])`apiKey`in e&&(e.apiKey=s)}static fromId(e){let t=x[e];return t?t.itemId?new D({portalItem:{id:t.itemId,portal:{url:`https://www.arcgis.com`}}}):D.fromJSON(t,t.is3d?{origin:`web-scene`,portal:new v({url:`https://www.arcgis.com`})}:{origin:`web-map`}):null}};e([h({json:{read:!1,write:{ignoreOrigin:!0,target:`baseMapLayers`,writer(e,t,n,r){this._writeBaseLayers(e,t,r)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:r}},writer(e,t,n,r){this._writeBaseLayers(e,t,r)}}}}}})],O.prototype,`baseLayers`,null),e([h({json:{read:!1,write:{ignoreOrigin:!0,target:`groundLayers`,writer(e,t,n,r){this._writeGroundLayers(e,t,r)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{groundLayers:{type:r}},writer(e,t,n,r){this._writeGroundLayers(e,t,r)}}}}}})],O.prototype,`groundLayers`,null),e([h({type:String,json:{origins:{"web-scene":{write:!0}}}})],O.prototype,`id`,void 0),e([h({type:y})],O.prototype,`portalItem`,void 0),e([h()],O.prototype,`referenceLayers`,null),e([h({constructOnly:!0})],O.prototype,`resourceInfo`,void 0),e([h({type:_})],O.prototype,`spatialReference`,void 0),e([h({type:S})],O.prototype,`style`,void 0),e([h()],O.prototype,`thumbnailUrl`,void 0),e([h({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],O.prototype,`title`,void 0),e([T(`title`)],O.prototype,`writeTitle`,null),O=D=e([g(`esri.Basemap`)],O);const k={"Web Scene":`web-scene`,"Web Map":`web-map`,"Link Chart":`link-chart`},A={"web-scene":`web-scene`,"web-map":`web-map`,"link-chart":`link-chart`},j=O;export{j as default};
|
package/Graphic.js
CHANGED
|
@@ -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"./PopupTemplate.js";import{ClonableMixin as n}from"./core/Clonable.js";import{deprecatedConstructorSignature as r}from"./core/deprecate.js";import{JSONSupport as i}from"./core/JSONSupport.js";import a from"./core/Logger.js";import{when as o}from"./core/reactiveUtils.js";import{generateUID as s}from"./core/uid.js";import{property as c,subclass as l}from"./core/accessorSupport/decorators.js";import{isSerializable as u}from"./core/support/jsonUtils.js";import{fromJSON as d}from"./geometry/support/jsonUtils.js";import{geometryTypes as f}from"./geometry/support/typeUtils.js";import{getIdFieldsProvider as p}from"./graphic/getIdFieldsProvider.js";import{getPopupProvider as m}from"./graphic/getPopupProvider.js";import{createFeatureIdFromLayer as h}from"./layers/graphics/data/createFeatureId.js";import{GraphicSymbol as g}from"./support/graphicInstanceUtils.js";import{symbolTypes as _}from"./symbols/support/typeUtils.js";var v,y;const b=Symbol(`meshGeometryHandles`);function x(e){if(!e)return null;let t={};for(let n in e){let r=d(e[n]);r&&(t[n]=r)}return Object.keys(t).length===0?null:t}function S(e){if(e==null)return null;let t={};for(let n in e){let r=e[n];r&&(t[n]=r.toJSON())}return Object.keys(t).length===0?null:t}let C=class extends n(i){static{v=g}static{y=this}constructor(e){super(e),this[v]=!0,this.distance=null,this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this.statisticsAggregatedIds=void 0,this._version=0,Object.
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"./PopupTemplate.js";import{ClonableMixin as n}from"./core/Clonable.js";import{deprecatedConstructorSignature as r}from"./core/deprecate.js";import{JSONSupport as i}from"./core/JSONSupport.js";import a from"./core/Logger.js";import{when as o}from"./core/reactiveUtils.js";import{generateUID as s}from"./core/uid.js";import{property as c,subclass as l}from"./core/accessorSupport/decorators.js";import{isSerializable as u}from"./core/support/jsonUtils.js";import{fromJSON as d}from"./geometry/support/jsonUtils.js";import{geometryTypes as f}from"./geometry/support/typeUtils.js";import{getIdFieldsProvider as p}from"./graphic/getIdFieldsProvider.js";import{getPopupProvider as m}from"./graphic/getPopupProvider.js";import{createFeatureIdFromLayer as h}from"./layers/graphics/data/createFeatureId.js";import{GraphicSymbol as g}from"./support/graphicInstanceUtils.js";import{symbolTypes as _}from"./symbols/support/typeUtils.js";var v,y;const b=Symbol(`meshGeometryHandles`);function x(e){if(!e)return null;let t={};for(let n in e){let r=d(e[n]);r&&(t[n]=r)}return Object.keys(t).length===0?null:t}function S(e){if(e==null)return null;let t={};for(let n in e){let r=e[n];r&&(t[n]=r.toJSON())}return Object.keys(t).length===0?null:t}let C=class extends n(i){static{v=g}static{y=this}constructor(e){super(e),this[v]=!0,this.distance=null,this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this.statisticsAggregatedIds=void 0,this._version=0,Object.defineProperties(this,{uid:{value:s(),configurable:!0},_lastMeshTransform:{value:{},configurable:!0,writable:!0,enumerable:!1}}),arguments.length>1&&r(a.getLogger(this),`Graphic`,{version:`4.30`})}set aggregateGeometries(e){let t=this._get(`aggregateGeometries`);JSON.stringify(t)!==JSON.stringify(e)&&this._set(`aggregateGeometries`,e)}set attributes(e){let t=this._get(`attributes`);t!==e&&(this._set(`attributes`,e),this._notifyLayer(`attributes`,t,e))}set geometry(e){let t=this._get(`geometry`);t!==e&&(this._set(`geometry`,e),this._watchMeshGeometryChanges(),this._notifyLayer(`geometry`,t,e))}set popupTemplate(e){let t=this._get(`popupTemplate`);t!==e&&(this._set(`popupTemplate`,e),this._notifyLayer(`popupTemplate`,t,e))}set symbol(e){let t=this._get(`symbol`);t!==e&&(this._set(`symbol`,e),this._notifyLayer(`symbol`,t,e))}get version(){return this._version}set visible(e){let t=this._get(`visible`);t!==e&&(this._set(`visible`,e),this._notifyLayer(`visible`,t,e))}cloneShallow(){return new y({aggregateGeometries:this.aggregateGeometries,statisticsAggregatedIds:this.statisticsAggregatedIds,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;let t=m(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;let n=this.origin&&`layer`in this.origin?this.origin.layer:null;for(let t of[n,this.sourceLayer,this.layer])if(t&&typeof t==`object`){if(`popupTemplate`in t&&t.popupTemplate)return t.popupTemplate;if(e&&`defaultPopupTemplate`in t&&t.defaultPopupTemplate!=null)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(!this.attributes)this.attributes={[e]:t};else{let n=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer(`attributes`,n,t,e)}}getObjectId(){let e=p(this.origin);if(e)return h(this,e);let t=this.sourceLayer??this.layer;return t?h(this,t):null}getGlobalId(){let e=p(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);let t=this.sourceLayer??this.layer;return t&&`globalIdField`in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){let e={aggregateGeometries:S(this.aggregateGeometries),geometry:this.geometry?.toJSON()??null,symbol:this.symbol?.toJSON()??null,attributes:u(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null};return this.statisticsAggregatedIds?.length&&(e.aggregateIds=[...this.statisticsAggregatedIds]),this.distance!=null&&(e.distance=this.distance),e}notifyMeshTransformChanged(e={}){let{geometry:t}=this;if(t?.type===`mesh`){let n={origin:t.origin,transform:t.transform};this._notifyLayer(`origin-transform`,n,n,e.action)}}_notifyLayer(e,t,n,r){if(this._version++,!this.layer||!(`graphicChanged`in this.layer))return;let i={graphic:this,property:e,oldValue:t,newValue:n};e===`origin-transform`&&(i.action=r),e===`attributes`&&(i.attributeName=r),this.layer.graphicChanged(i)}_watchMeshGeometryChanges(){this.removeHandles(b);let e=this.geometry;e?.type===`mesh`&&this.addHandles([o(()=>e.vertexSpace.origin?{localMatrix:e.transform?.localMatrix,origin:e.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{(this._lastMeshTransform.localMatrix!==e||this._lastMeshTransform.origin!==t)&&(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),o(()=>({vertexAttributes:e.vertexAttributes}),()=>{e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer(`geometry`,e,e)},{equals:(e,t)=>e===t,sync:!0})],b)}};e([c({value:null,json:{read:x}})],C.prototype,`aggregateGeometries`,null),e([c({value:null})],C.prototype,`attributes`,null),e([c({value:null,types:f,json:{read:d}})],C.prototype,`geometry`,null),e([c()],C.prototype,`distance`,void 0),e([c({type:Boolean})],C.prototype,`isAggregate`,void 0),e([c({clonable:!1})],C.prototype,`layer`,void 0),e([c({clonable:`reference`})],C.prototype,`origin`,void 0),e([c({type:t,value:null})],C.prototype,`popupTemplate`,null),e([c({clonable:`reference`})],C.prototype,`sourceLayer`,void 0),e([c({json:{name:`aggregateIds`,read:e=>e?.map(e=>Array.isArray(e)?JSON.stringify(e):e)}})],C.prototype,`statisticsAggregatedIds`,void 0),e([c({value:null,types:_})],C.prototype,`symbol`,null),e([c({clonable:!1,json:{read:!1,write:!1}})],C.prototype,`_version`,void 0),e([c({type:Boolean,value:!0})],C.prototype,`visible`,null),C=y=e([l(`esri.Graphic`)],C);export{C as default};
|
package/Ground.js
CHANGED
|
@@ -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"./Color.js";import n from"./core/Collection.js";import r from"./core/CollectionFlattener.js";import{referenceSetter as i}from"./core/collectionUtils.js";import{typeCast as a}from"./core/compilerUtils.js";import has from"./core/has.js";import{JSONSupportMixin as o}from"./core/JSONSupport.js";import{clone as s}from"./core/lang.js";import{Loadable as c}from"./core/Loadable.js";import{loadAll as l}from"./core/loadAll.js";import u from"./core/Logger.js";import{destroyMaybe as d}from"./core/maybe.js";import{isAbortError as f,throwIfAborted as p}from"./core/promiseUtils.js";import{property as m,subclass as h}from"./core/accessorSupport/decorators.js";import{Integer as g}from"./core/accessorSupport/ensureType.js";import _ from"./ground/NavigationConstraint.js";import{isIntegratedMeshLayer as v}from"./layers/support/layerUtils.js";import{GroundSymbol as y}from"./support/groundInstanceUtils.js";import{transparencyToOpacity as b,opacityToTransparency as x}from"./webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as S}from"./webdoc/support/unsupportedErrors.js";import{writer as C}from"./core/accessorSupport/decorators/writer.js";var w,T;let E=T=class extends o(c){static{w=y}constructor(e){super(e),this[w]=!0,this.parent=null,this.opacity=1,this.surfaceColor=null,this.undergroundColor=new t(`white`),this.navigationConstraint=null,this.layers=new n;let i=e=>{let t=e.item;t.parent===this?(u.getLogger(this).error(`Layer '${t.title}, id:${t.id}' of type '${t.type}' already a ground layer, second add will be ignored.`),e.preventDefault()):t.type===`elevation`||t.type===`base-elevation`||has(`enable-feature:im-as-ground`)&&(t.type===`integrated-mesh`||t.type===`integrated-mesh-3dtiles`)||(u.getLogger(this).error(`Layer '${t.title}, id:${t.id}' of type '${t.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation'${has(`enable-feature:im-as-ground`)?`, 'integrated-mesh' and 'integrated-mesh-3dtiles'`:``} are supported.`),e.preventDefault())},a=e=>{let{parent:t}=e;t&&t!==this&&`remove`in t&&t.remove?.(e),e.parent=this},o=e=>{e.parent=null};this.addHandles([this.layers.on(`before-add`,i),this.layers.on(`after-add`,e=>a(e.item)),this.layers.on(`after-remove`,e=>o(e.item))]),this.allLayers=new r({getCollections:()=>[this.layers,this.parent?.basemap?.groundLayers]})}removeChildLayer(e){this.layers.remove(e)}initialize(){this.when().catch(e=>{f(e)||u.getLogger(this).error(`#load()`,`Failed to load ground`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}get allIntegratedMeshGround(){return this.allLayers.filter(e=>v(e))}destroy(){let e=this.layers.removeAll();for(let t of e)d(t);this.layers.destroy()}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"./Color.js";import n from"./core/Collection.js";import r from"./core/CollectionFlattener.js";import{referenceSetter as i}from"./core/collectionUtils.js";import{typeCast as a}from"./core/compilerUtils.js";import has from"./core/has.js";import{JSONSupportMixin as o}from"./core/JSONSupport.js";import{clone as s}from"./core/lang.js";import{Loadable as c}from"./core/Loadable.js";import{loadAll as l}from"./core/loadAll.js";import u from"./core/Logger.js";import{destroyMaybe as d}from"./core/maybe.js";import{isAbortError as f,throwIfAborted as p}from"./core/promiseUtils.js";import{property as m,subclass as h}from"./core/accessorSupport/decorators.js";import{Integer as g}from"./core/accessorSupport/ensureType.js";import _ from"./ground/NavigationConstraint.js";import{isIntegratedMeshLayer as v}from"./layers/support/layerUtils.js";import{GroundSymbol as y}from"./support/groundInstanceUtils.js";import{transparencyToOpacity as b,opacityToTransparency as x}from"./webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as S}from"./webdoc/support/unsupportedErrors.js";import{writer as C}from"./core/accessorSupport/decorators/writer.js";var w,T;let E=T=class extends o(c){static{w=y}constructor(e){super(e),this[w]=!0,this.parent=null,this.opacity=1,this.surfaceColor=null,this.undergroundColor=new t(`white`),this.navigationConstraint=null,this.layers=new n;let i=e=>{let t=e.item;t.parent===this?(u.getLogger(this).error(`Layer '${t.title}, id:${t.id}' of type '${t.type}' already a ground layer, second add will be ignored.`),e.preventDefault()):t.type===`elevation`||t.type===`base-elevation`||has(`enable-feature:im-as-ground`)&&(t.type===`integrated-mesh`||t.type===`integrated-mesh-3dtiles`)||(u.getLogger(this).error(`Layer '${t.title}, id:${t.id}' of type '${t.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation'${has(`enable-feature:im-as-ground`)?`, 'integrated-mesh' and 'integrated-mesh-3dtiles'`:``} are supported.`),e.preventDefault())},a=e=>{let{parent:t}=e;t&&t!==this&&`remove`in t&&t.remove?.(e),e.parent=this},o=e=>{e.parent=null};this.addHandles([this.layers.on(`before-add`,i),this.layers.on(`after-add`,e=>a(e.item)),this.layers.on(`after-remove`,e=>o(e.item))]),this.allLayers=new r({getCollections:()=>[this.layers,this.parent?.basemap?.groundLayers]})}removeChildLayer(e){this.layers.remove(e)}initialize(){this.when().catch(e=>{f(e)||u.getLogger(this).error(`#load()`,`Failed to load ground`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}get allIntegratedMeshGround(){return this.allLayers.filter(e=>v(e))}destroy(){let e=this.layers.removeAll();for(let t of e)d(t);this.layers.destroy()}get loaded(){return super.loaded}get layers(){return this._get(`layers`)}set layers(e){this._set(`layers`,i(e,this._get(`layers`)))}writeLayers(e,t,n,r){let i=[];e&&(r={...r,layerContainerType:`ground`},e.forEach(e=>{if(`write`in e){let t=a(e)(),n={};t.write(n,r)&&i.push(n)}else S(r,e)})),t.layers=i}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return l(this,e=>e(this.layers))}async queryElevation(e,t){await this.load({signal:t?.signal});let{queryAll:n}=await import(`./layers/support/ElevationQuery.js`);return p(t),n(this.allLayers.toArray(),e,t)}async createElevationSampler(e,t){await this.load({signal:t?.signal});let{createSampler:n}=await import(`./layers/support/ElevationQuery.js`);return p(t),n(this.allLayers.filter(D).toArray(),e,t)}clone(){let e={opacity:this.opacity,surfaceColor:s(this.surfaceColor),undergroundColor:s(this.undergroundColor),navigationConstraint:s(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus=`loaded`),new T({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set(`resourceInfo`,{data:e,context:t}),super.read(e,t)}_loadFromSource(e){let t=this.resourceInfo;return t?this._loadLayersFromJSON(t.data,t.context,e):Promise.resolve()}async _loadLayersFromJSON(e,t,n){let r=t?.origin||`web-scene`,i=t?.portal||null,a=t?.url||null,{populateOperationalLayers:o}=await import(`./layers/support/layersCreator.js`);p(n);let s=[];if(e.layers&&Array.isArray(e.layers)){let t={context:{origin:r,url:a,portal:i,layerContainerType:`ground`},defaultLayerType:`ArcGISTiledElevationServiceLayer`};s.push(o(this.layers,e.layers,t))}await Promise.allSettled(s)}};e([m()],E.prototype,`parent`,void 0),e([m()],E.prototype,`allIntegratedMeshGround`,null),e([m({json:{read:!1,write:{isRequired:!0}}})],E.prototype,`layers`,null),e([m()],E.prototype,`allLayers`,void 0),e([C(`layers`)],E.prototype,`writeLayers`,null),e([m({constructOnly:!0})],E.prototype,`resourceInfo`,void 0),e([m({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:g,read:{reader:b,source:`transparency`},write:{writer:(e,t)=>{t.transparency=x(e)},target:`transparency`}}})],E.prototype,`opacity`,void 0),e([m({type:t,json:{type:[g],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],E.prototype,`surfaceColor`,void 0),e([m({type:t})],E.prototype,`undergroundColor`,void 0),e([m({type:_,json:{write:!0}})],E.prototype,`navigationConstraint`,void 0),E=T=e([h(`esri.Ground`)],E);function D(e){return e&&`createElevationSampler`in e}const O=E;export{O as default};
|
package/WebDocument2D.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{version as t}from"./kernel.js";import n from"./Map.js";import r from"./Viewpoint.js";import{isSome as i}from"./core/arrayUtils.js";import a from"./core/Collection.js";import o from"./core/Error.js";import{LoadableMixin as s}from"./core/Loadable.js";import{loadAll as c}from"./core/loadAll.js";import l from"./core/Logger.js";import{destroyMaybe as u}from"./core/maybe.js";import{MultiOriginJSONSupportMixin as d}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as f}from"./core/Promise.js";import{debounce as p}from"./core/promiseUtils.js";import{whenOnce as m}from"./core/reactiveUtils.js";import{addQueryParameter as h,isDataProtocol as g,dataComponents as _}from"./core/urlUtils.js";import v from"./core/Version.js";import{property as y,subclass as b}from"./core/accessorSupport/decorators.js";import{readLoadable as x}from"./core/accessorSupport/read.js";import S from"./geometry/SpatialReference.js";import C from"./portal/PortalItem.js";import{typeKeyword as w}from"./portal/support/portalItemUtils.js";import T from"./support/MapFloorInfo.js";import E from"./time/TimeExtent.js";import D from"./webdoc/RangeInfo.js";import O from"./webdoc/Widgets.js";import{getNormalizedThumbnailData as k,getOptimalThumbnailSize as A}from"./webdoc/support/thumbnailUtils.js";import{loadFromSource as j}from"./webdoc/support/webdocLoadUtils.js";import{getLayerJSON as M}from"./webdoc/support/writeUtils.js";import N from"./webmap/ApplicationProperties.js";import P from"./webmap/Bookmark.js";import F from"./webmap/InitialViewProperties.js";import I from"./webmap/background/ColorBackground.js";import{writer as L}from"./core/accessorSupport/decorators/writer.js";import{reader as R}from"./core/accessorSupport/decorators/reader.js";const z=a.ofType(P),B=new Map([[`image/jpeg`,`jpeg`],[`image/jpg`,`jpg`],[`image/png`,`png`],[`image/gif`,`gif`]]),V=w.JSAPI;let H=class extends d(s(f(n))){constructor(e){super(e),this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1,this._thumbnailFilename=null,this._updateFromPromise=null,this.resourceReferences={portalItem:null,paths:[]},this.applicationProperties=null,this.bookmarks=new z,this.floorInfo=null,this.initialViewProperties=new F,this.portalItem=null,this.portalItemResourcePath=null,this.sourceVersion=null,this.widgets=null,this._debouncedSaveOperations=p(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./webdoc/support/webdocSaveUtils.js`);switch(e){case 0:return r(this.context,this,t);case 1:return i(this.context,this,n,t)}}),this.authoringApp=this.authoringAppVersion=null,this._isAuthoringAppSetByUser=this._isAuthoringAppVersionSetByUser=!1}destroy(){this.portalItem=u(this.portalItem)}initialize(){if(this.when().catch(e=>{l.getLogger(this).error(`#load()`,`Failed to load web map`,e)}),this.resourceInfo){let e;try{e=this._validateJSON(this.resourceInfo)}catch(e){this.addResolvingPromise(Promise.reject(e));return}this.read(e)}}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set(`authoringApp`,e)}writeAuthoringApp(e,t){t.authoringApp=e&&this._isAuthoringAppSetByUser?e:V}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set(`authoringAppVersion`,e)}writeAuthoringAppVersion(e,n){n.authoringAppVersion=e&&this._isAuthoringAppVersionSetByUser?e:t}readInitialViewProperties(e,t){let n=new F;t.background&&(n.background=I.fromJSON(t.background));let i=t.initialState?.timeExtent;i&&(n.timeExtent=E.fromArray(i));let a=t.initialState?.viewpoint;return a&&(a.rotation&&v.parse(t.version||``,`webmap`).lessThan(2,20)&&t.authoringApp===`ArcGIS Pro`&&(a.rotation*=-1),n.viewpoint=r.fromJSON(a)),t.mapRangeInfo&&(n.rangeInfo=D.fromJSON(t.mapRangeInfo)),t.spatialReference&&(n.spatialReference=S.fromJSON(t.spatialReference)),t.timeZone&&(n.timeZone=t.timeZone),n}writeInitialViewProperties(e,t,n,r){if(!e)return;e.background?.color&&(t.background=e.background.write({},r));let{timeExtent:i,viewpoint:a}=e;if(a||i){let e={};a&&(e.viewpoint=a.write({},r)),i&&(e.timeExtent=i.toArray()),t.initialState=e}e.rangeInfo&&(t.mapRangeInfo=e.rangeInfo.toJSON(r)),e.spatialReference&&(t.spatialReference=e.spatialReference.write({},r)),t.timeZone=e.timeZone}writeLayers(e,t,n,r){t[n]=this._writeLayers(e,r,`operational-layers`)}get loaded(){return super.loaded}readSourceVersion(e,t){let[n,r]=t.version.split(`.`);return new v(parseInt(n,10),parseInt(r,10),`webmap`)}writeSourceVersion(e,t,n){t[n]=`${this.context.currentVersion.major}.${this.context.currentVersion.minor}`}writeTables(e,t,n,r){let i=this._writeLayers(e,r,`tables`);i.length&&(t[n]=i)}get thumbnailUrl(){return this.portalItem?.thumbnailUrl||null}set thumbnailUrl(e){e?(this._override(`thumbnailUrl`,e),this._thumbnailFilename=this._generateCustomThumbnailFilename(e)):this._clearThumbnailOverride()}get updatingFromView(){return!!this._updateFromPromise}load(e){return this.addResolvingPromise(j(this.context,this)),Promise.resolve(this)}loadAll(){return c(this,e=>{e(this.ground,this.basemap,this.layers,this.tables)})}read(e,t){t={...t,origin:this.context.origin};let n=this._getAuthoringPropsState();x(this,e,t=>super.read(e,t),t),this._restoreAuthoringPropsFromState(n)}write(e,t){if(this.loadStatus!==`loaded`){let e=new o(`webmap:not-loaded`,`Web map must be loaded before it can be serialized`);throw l.getLogger(this).error(`#toJSON()`,`Web map must be loaded before it can be serialized`,this.loadError||this.loadStatus),e}return this._removeDanglingLayerRefs(),t={...t,origin:this.context.origin,restrictedWebMapWriting:!0,webmap:this},super.write(e,t)}getReferencedResourcePaths(){return[...this.resourceReferences.paths]}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}async updateFrom(e,t){let n=this._updateFromInternal(e,t);this._updateFromPromise=n,await n,n===this._updateFromPromise&&(this._updateFromPromise=null)}getLayerJSONFromResourceInfo(e){let t=this.resourceInfo;return this._collectAllLayersJSON([...t?.baseMap?.baseMapLayers||[],...t?.operationalLayers||[],...this.basemap?.resourceInfo?.data?.baseMapLayers||[]]).find(t=>t.id===e.id)}async updateItemThumbnail(e){if(this.thumbnailUrl&&this._isOverridden(`thumbnailUrl`)){let t=await k(this.thumbnailUrl,this._thumbnailFilename,e);await this.portalItem?.updateThumbnail(t),this._clearThumbnailOverride()}}getThumbnailState(){let e=this.thumbnailUrl;return e&&=this._isOverridden(`thumbnailUrl`)?e:h(e,`w`,`8192`),{thumbnailUrl:e,filename:this._thumbnailFilename}}restoreThumbnailFromState(e){this.thumbnailUrl=e.thumbnailUrl,this._thumbnailFilename=e.filename}_collectAllLayersJSON(e){return e.reduce((e,t)=>(e.push(t),t.layerType===`GroupLayer`&&(e=e.concat(this._collectAllLayersJSON(t.layers||[]))),e),[])}_writeLayers(e,t,n){return t={...t,layerContainerType:n},e.map(e=>M(e,n===`tables`?null:this.getLayerJSONFromResourceInfo(e),t)).filter(i).toArray()}_validateJSON(e){let t=v.parse(e.version||``,`webmap`);return this.context.currentVersion.validate(t),e.version=`${t.major}.${t.minor}`,e}_removeDanglingLayerRefs(){let e=this.applicationProperties,t=e?.viewing?.search,n=e=>this.allLayers.some(t=>t.id===e);if(t?.layers&&(t.layers=t.layers.filter(e=>n(e.id))),t?.tables&&(t.tables=t.tables.filter(e=>this.tables.some(t=>t.id===e.id))),e){let t=e.editing?.locationTracking;t?.info&&!n(t.info.layerId)&&(e.editing=null)}let r=(`presentation`in this?this.presentation:null)?.slides;r&&r.forEach(e=>{e.visibleLayers&&=e.visibleLayers.filter(e=>n(e.id))})}async _updateFromInternal(e,t){if(t??={},await m(()=>e.ready),this._updateInitialViewProperties(e,t),e.map===this)for(let t of e.allLayerViews)`visible`in t&&`visible`in t.layer&&t._isOverridden(`visible`)&&(t.layer.visible=t.visible),`featureEffect`in t&&`featureEffect`in t.layer&&t._isOverridden(`featureEffect`)&&(t.layer.featureEffect=t.featureEffect),`updateLayer`in t&&await t.updateLayer();await this._updateThumbnailUrl(e,t)}_updateInitialViewProperties(e,t){if(t.backgroundExcluded||(this.initialViewProperties.background=e.background?.clone()),this.initialViewProperties.spatialReference=e.spatialReference?.clone(),this.initialViewProperties.timeZone=e.timeZone,t.viewpointExcluded||(this.initialViewProperties.viewpoint=new r({rotation:e.rotation,scale:t.scalePreserved?e.scale:null,targetGeometry:this._getViewExtent(e)})),!t.widgetsExcluded)for(let t of e.registeredComponents)t.updateWebDocument(this)}_getViewExtent(e){let t=e.center.clone().normalize(),n=e.extent.clone(),r=n.width/2;return n.xmin=t.x-r,n.xmax=t.x+r,n}async _updateThumbnailUrl(e,t){if(t.thumbnailExcluded)return;let n=A(e,t.thumbnailSize),r=await e.takeScreenshot({format:`png`,width:n.width,height:n.height});this._setAutoGeneratedThumbnail(r.dataUrl)}_setAutoGeneratedThumbnail(e){this.thumbnailUrl=e,this._thumbnailFilename=null}_clearThumbnailOverride(){this._clearOverride(`thumbnailUrl`),this.clear(`thumbnailUrl`,`user`),this._thumbnailFilename=null}_generateCustomThumbnailFilename(e){if(g(e)){let t=_(e)?.mediaType,n=t&&B.get(t.toLowerCase())||null,r=`thumbnail${Date.now()}`;return n?`${r}.${n}`:r}return null}_getAuthoringPropsState(){return{authoringApp:this.authoringApp,authoringAppVersion:this.authoringAppVersion,isAuthoringAppSetByUser:this._isAuthoringAppSetByUser,isAuthoringAppVersionSetByUser:this._isAuthoringAppVersionSetByUser}}_restoreAuthoringPropsFromState(e){e.isAuthoringAppSetByUser?this.authoringApp=e.authoringApp:this._isAuthoringAppSetByUser=!1,e.isAuthoringAppVersionSetByUser?this.authoringAppVersion=e.authoringAppVersion:this._isAuthoringAppVersionSetByUser=!1}};e([y()],H.prototype,`_updateFromPromise`,void 0),e([y({type:N,json:{write:!0}})],H.prototype,`applicationProperties`,void 0),e([y({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],H.prototype,`authoringApp`,null),e([L(`authoringApp`)],H.prototype,`writeAuthoringApp`,null),e([y({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],H.prototype,`authoringAppVersion`,null),e([L(`authoringAppVersion`)],H.prototype,`writeAuthoringAppVersion`,null),e([y({type:z,json:{write:{overridePolicy(e){return{enabled:!!(e&&e.length>0),ignoreOrigin:!0}}}}})],H.prototype,`bookmarks`,void 0),e([y({type:T,json:{name:`mapFloorInfo`,write:!0}})],H.prototype,`floorInfo`,void 0),e([y({type:F,nonNullable:!0,json:{read:{source:[`background`,`initialState.timeExtent`,`initialState.viewpoint`,`mapRangeInfo`,`spatialReference`,`timeZone`]},write:{ignoreOrigin:!0,target:{background:{type:I},"initialState.timeExtent":{type:E},"initialState.viewpoint":{type:r},mapRangeInfo:{type:D},spatialReference:{type:S},"timeZone:":{type:String}}}}})],H.prototype,`initialViewProperties`,void 0),e([R(`initialViewProperties`)],H.prototype,`readInitialViewProperties`,null),e([L(`initialViewProperties`)],H.prototype,`writeInitialViewProperties`,null),e([y({json:{read:!1,write:{target:`operationalLayers`,ignoreOrigin:!0}}})],H.prototype,`layers`,void 0),e([L(`layers`)],H.prototype,`writeLayers`,null),e([y({type:C})],H.prototype,`portalItem`,void 0),e([y()],H.prototype,`portalItemResourcePath`,void 0),e([y()],H.prototype,`resourceInfo`,void 0),e([y({readOnly:!0,type:v,json:{read:{source:`version`},write:{allowNull:!0,ignoreOrigin:!0,target:`version`,isRequired:!0}}})],H.prototype,`sourceVersion`,void 0),e([R(`sourceVersion`)],H.prototype,`readSourceVersion`,null),e([L(`sourceVersion`)],H.prototype,`writeSourceVersion`,null),e([y({json:{read:!1,write:{ignoreOrigin:!0}}})],H.prototype,`tables`,void 0),e([L(`tables`)],H.prototype,`writeTables`,null),e([y()],H.prototype,`thumbnailUrl`,null),e([y()],H.prototype,`updatingFromView`,null),e([y({type:O,json:{write:!0}})],H.prototype,`widgets`,void 0),H=e([b(`esri.WebDocument2D`)],H);const U=H;export{U as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{version as t}from"./kernel.js";import n from"./Map.js";import r from"./Viewpoint.js";import{isSome as i}from"./core/arrayUtils.js";import a from"./core/Collection.js";import o from"./core/Error.js";import{LoadableMixin as s}from"./core/Loadable.js";import{loadAll as c}from"./core/loadAll.js";import l from"./core/Logger.js";import{destroyMaybe as u}from"./core/maybe.js";import{MultiOriginJSONSupportMixin as d}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as f}from"./core/Promise.js";import{debounce as p}from"./core/promiseUtils.js";import{whenOnce as m}from"./core/reactiveUtils.js";import{addQueryParameter as h,isDataProtocol as g,dataComponents as _}from"./core/urlUtils.js";import v from"./core/Version.js";import{property as y,subclass as b}from"./core/accessorSupport/decorators.js";import{readLoadable as x}from"./core/accessorSupport/read.js";import S from"./geometry/SpatialReference.js";import C from"./portal/PortalItem.js";import{typeKeyword as w}from"./portal/support/portalItemUtils.js";import T from"./support/MapFloorInfo.js";import E from"./time/TimeExtent.js";import D from"./webdoc/RangeInfo.js";import O from"./webdoc/Widgets.js";import{getNormalizedThumbnailData as k,getOptimalThumbnailSize as A}from"./webdoc/support/thumbnailUtils.js";import{loadFromSource as j}from"./webdoc/support/webdocLoadUtils.js";import{getLayerJSON as M}from"./webdoc/support/writeUtils.js";import N from"./webmap/ApplicationProperties.js";import P from"./webmap/Bookmark.js";import F from"./webmap/InitialViewProperties.js";import I from"./webmap/background/ColorBackground.js";import{writer as L}from"./core/accessorSupport/decorators/writer.js";import{reader as R}from"./core/accessorSupport/decorators/reader.js";const z=a.ofType(P),B=new Map([[`image/jpeg`,`jpeg`],[`image/jpg`,`jpg`],[`image/png`,`png`],[`image/gif`,`gif`]]),V=w.JSAPI;let H=class extends d(s(f(n))){constructor(e){super(e),this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1,this._thumbnailFilename=null,this._updateFromPromise=null,this.resourceReferences={portalItem:null,paths:[]},this.applicationProperties=null,this.bookmarks=new z,this.floorInfo=null,this.initialViewProperties=new F,this.portalItem=null,this.portalItemResourcePath=null,this.sourceVersion=null,this.widgets=null,this._debouncedSaveOperations=p(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./webdoc/support/webdocSaveUtils.js`);switch(e){case 0:return r(this.context,this,t);case 1:return i(this.context,this,n,t)}}),this.authoringApp=this.authoringAppVersion=null,this._isAuthoringAppSetByUser=this._isAuthoringAppVersionSetByUser=!1}destroy(){this.portalItem=u(this.portalItem)}initialize(){if(this.when().catch(e=>{l.getLogger(this).error(`#load()`,`Failed to load web map`,e)}),this.resourceInfo){let e;try{e=this._validateJSON(this.resourceInfo)}catch(e){this.addResolvingPromise(Promise.reject(e));return}this.read(e)}}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set(`authoringApp`,e)}writeAuthoringApp(e,t){t.authoringApp=e&&this._isAuthoringAppSetByUser?e:V}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set(`authoringAppVersion`,e)}writeAuthoringAppVersion(e,n){n.authoringAppVersion=e&&this._isAuthoringAppVersionSetByUser?e:t}readInitialViewProperties(e,t){let n=new F;t.background&&(n.background=I.fromJSON(t.background));let i=t.initialState?.timeExtent;i&&(n.timeExtent=E.fromArray(i));let a=t.initialState?.viewpoint;return a&&(a.rotation&&v.parse(t.version||``,`webmap`).lessThan(2,20)&&t.authoringApp===`ArcGIS Pro`&&(a.rotation*=-1),n.viewpoint=r.fromJSON(a)),t.mapRangeInfo&&(n.rangeInfo=D.fromJSON(t.mapRangeInfo)),t.spatialReference&&(n.spatialReference=S.fromJSON(t.spatialReference)),t.timeZone&&(n.timeZone=t.timeZone),n}writeInitialViewProperties(e,t,n,r){if(!e)return;e.background?.color&&(t.background=e.background.write({},r));let{timeExtent:i,viewpoint:a}=e;if(a||i){let e={};a&&(e.viewpoint=a.write({},r)),i&&(e.timeExtent=i.toArray()),t.initialState=e}e.rangeInfo&&(t.mapRangeInfo=e.rangeInfo.toJSON(r)),e.spatialReference&&(t.spatialReference=e.spatialReference.write({},r)),t.timeZone=e.timeZone}writeLayers(e,t,n,r){t[n]=this._writeLayers(e,r,`operational-layers`)}get loaded(){return super.loaded}readSourceVersion(e,t){let[n,r]=t.version.split(`.`,2);return new v(parseInt(n,10),parseInt(r,10),`webmap`)}writeSourceVersion(e,t,n){t[n]=`${this.context.currentVersion.major}.${this.context.currentVersion.minor}`}writeTables(e,t,n,r){let i=this._writeLayers(e,r,`tables`);i.length&&(t[n]=i)}get thumbnailUrl(){return this.portalItem?.thumbnailUrl||null}set thumbnailUrl(e){e?(this._override(`thumbnailUrl`,e),this._thumbnailFilename=this._generateCustomThumbnailFilename(e)):this._clearThumbnailOverride()}get updatingFromView(){return!!this._updateFromPromise}load(e){return this.addResolvingPromise(j(this.context,this)),Promise.resolve(this)}loadAll(){return c(this,e=>{e(this.ground,this.basemap,this.layers,this.tables)})}read(e,t){t={...t,origin:this.context.origin};let n=this._getAuthoringPropsState();x(this,e,t=>super.read(e,t),t),this._restoreAuthoringPropsFromState(n)}write(e,t){if(this.loadStatus!==`loaded`){let e=new o(`webmap:not-loaded`,`Web map must be loaded before it can be serialized`);throw l.getLogger(this).error(`#toJSON()`,`Web map must be loaded before it can be serialized`,this.loadError||this.loadStatus),e}return this._removeDanglingLayerRefs(),t={...t,origin:this.context.origin,restrictedWebMapWriting:!0,webmap:this},super.write(e,t)}getReferencedResourcePaths(){return[...this.resourceReferences.paths]}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}async updateFrom(e,t){let n=this._updateFromInternal(e,t);this._updateFromPromise=n,await n,n===this._updateFromPromise&&(this._updateFromPromise=null)}getLayerJSONFromResourceInfo(e){let t=this.resourceInfo;return this._collectAllLayersJSON([...t?.baseMap?.baseMapLayers||[],...t?.operationalLayers||[],...this.basemap?.resourceInfo?.data?.baseMapLayers||[]]).find(t=>t.id===e.id)}async updateItemThumbnail(e){if(this.thumbnailUrl&&this._isOverridden(`thumbnailUrl`)){let t=await k(this.thumbnailUrl,this._thumbnailFilename,e);await this.portalItem?.updateThumbnail(t),this._clearThumbnailOverride()}}getThumbnailState(){let e=this.thumbnailUrl;return e&&=this._isOverridden(`thumbnailUrl`)?e:h(e,`w`,`8192`),{thumbnailUrl:e,filename:this._thumbnailFilename}}restoreThumbnailFromState(e){this.thumbnailUrl=e.thumbnailUrl,this._thumbnailFilename=e.filename}_collectAllLayersJSON(e){return e.reduce((e,t)=>(e.push(t),t.layerType===`GroupLayer`&&(e=e.concat(this._collectAllLayersJSON(t.layers||[]))),e),[])}_writeLayers(e,t,n){return t={...t,layerContainerType:n},e.map(e=>M(e,n===`tables`?null:this.getLayerJSONFromResourceInfo(e),t)).filter(i).toArray()}_validateJSON(e){let t=v.parse(e.version||``,`webmap`);return this.context.currentVersion.validate(t),e.version=`${t.major}.${t.minor}`,e}_removeDanglingLayerRefs(){let e=this.applicationProperties,t=e?.viewing?.search,n=e=>this.allLayers.some(t=>t.id===e);if(t?.layers&&(t.layers=t.layers.filter(e=>n(e.id))),t?.tables&&(t.tables=t.tables.filter(e=>this.tables.some(t=>t.id===e.id))),e){let t=e.editing?.locationTracking;t?.info&&!n(t.info.layerId)&&(e.editing=null)}let r=(`presentation`in this?this.presentation:null)?.slides;r&&r.forEach(e=>{e.visibleLayers&&=e.visibleLayers.filter(e=>n(e.id))})}async _updateFromInternal(e,t){if(t??={},await m(()=>e.ready),this._updateInitialViewProperties(e,t),e.map===this)for(let t of e.allLayerViews)`visible`in t&&`visible`in t.layer&&t._isOverridden(`visible`)&&(t.layer.visible=t.visible),`featureEffect`in t&&`featureEffect`in t.layer&&t._isOverridden(`featureEffect`)&&(t.layer.featureEffect=t.featureEffect),`updateLayer`in t&&await t.updateLayer();await this._updateThumbnailUrl(e,t)}_updateInitialViewProperties(e,t){if(t.backgroundExcluded||(this.initialViewProperties.background=e.background?.clone()),this.initialViewProperties.spatialReference=e.spatialReference?.clone(),this.initialViewProperties.timeZone=e.timeZone,t.viewpointExcluded||(this.initialViewProperties.viewpoint=new r({rotation:e.rotation,scale:t.scalePreserved?e.scale:null,targetGeometry:this._getViewExtent(e)})),!t.widgetsExcluded)for(let t of e.registeredComponents)t.updateWebDocument(this)}_getViewExtent(e){let t=e.center.clone().normalize(),n=e.extent.clone(),r=n.width/2;return n.xmin=t.x-r,n.xmax=t.x+r,n}async _updateThumbnailUrl(e,t){if(t.thumbnailExcluded)return;let n=A(e,t.thumbnailSize),r=await e.takeScreenshot({format:`png`,width:n.width,height:n.height});this._setAutoGeneratedThumbnail(r.dataUrl)}_setAutoGeneratedThumbnail(e){this.thumbnailUrl=e,this._thumbnailFilename=null}_clearThumbnailOverride(){this._clearOverride(`thumbnailUrl`),this.clear(`thumbnailUrl`,`user`),this._thumbnailFilename=null}_generateCustomThumbnailFilename(e){if(g(e)){let t=_(e)?.mediaType,n=t&&B.get(t.toLowerCase())||null,r=`thumbnail${Date.now()}`;return n?`${r}.${n}`:r}return null}_getAuthoringPropsState(){return{authoringApp:this.authoringApp,authoringAppVersion:this.authoringAppVersion,isAuthoringAppSetByUser:this._isAuthoringAppSetByUser,isAuthoringAppVersionSetByUser:this._isAuthoringAppVersionSetByUser}}_restoreAuthoringPropsFromState(e){e.isAuthoringAppSetByUser?this.authoringApp=e.authoringApp:this._isAuthoringAppSetByUser=!1,e.isAuthoringAppVersionSetByUser?this.authoringAppVersion=e.authoringAppVersion:this._isAuthoringAppVersionSetByUser=!1}};e([y()],H.prototype,`_updateFromPromise`,void 0),e([y({type:N,json:{write:!0}})],H.prototype,`applicationProperties`,void 0),e([y({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],H.prototype,`authoringApp`,null),e([L(`authoringApp`)],H.prototype,`writeAuthoringApp`,null),e([y({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],H.prototype,`authoringAppVersion`,null),e([L(`authoringAppVersion`)],H.prototype,`writeAuthoringAppVersion`,null),e([y({type:z,json:{write:{overridePolicy(e){return{enabled:!!(e&&e.length>0),ignoreOrigin:!0}}}}})],H.prototype,`bookmarks`,void 0),e([y({type:T,json:{name:`mapFloorInfo`,write:!0}})],H.prototype,`floorInfo`,void 0),e([y({type:F,nonNullable:!0,json:{read:{source:[`background`,`initialState.timeExtent`,`initialState.viewpoint`,`mapRangeInfo`,`spatialReference`,`timeZone`]},write:{ignoreOrigin:!0,target:{background:{type:I},"initialState.timeExtent":{type:E},"initialState.viewpoint":{type:r},mapRangeInfo:{type:D},spatialReference:{type:S},"timeZone:":{type:String}}}}})],H.prototype,`initialViewProperties`,void 0),e([R(`initialViewProperties`)],H.prototype,`readInitialViewProperties`,null),e([L(`initialViewProperties`)],H.prototype,`writeInitialViewProperties`,null),e([y({json:{read:!1,write:{target:`operationalLayers`,ignoreOrigin:!0}}})],H.prototype,`layers`,void 0),e([L(`layers`)],H.prototype,`writeLayers`,null),e([y({type:C})],H.prototype,`portalItem`,void 0),e([y()],H.prototype,`portalItemResourcePath`,void 0),e([y()],H.prototype,`resourceInfo`,void 0),e([y({readOnly:!0,type:v,json:{read:{source:`version`},write:{allowNull:!0,ignoreOrigin:!0,target:`version`,isRequired:!0}}})],H.prototype,`sourceVersion`,void 0),e([R(`sourceVersion`)],H.prototype,`readSourceVersion`,null),e([L(`sourceVersion`)],H.prototype,`writeSourceVersion`,null),e([y({json:{read:!1,write:{ignoreOrigin:!0}}})],H.prototype,`tables`,void 0),e([L(`tables`)],H.prototype,`writeTables`,null),e([y()],H.prototype,`thumbnailUrl`,null),e([y()],H.prototype,`updatingFromView`,null),e([y({type:O,json:{write:!0}})],H.prototype,`widgets`,void 0),H=e([b(`esri.WebDocument2D`)],H);const U=H;export{U as default};
|
package/WebScene.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{version as t}from"./kernel.js";import n from"./Map.js";import r from"./core/Collection.js";import i from"./core/Error.js";import{clone as a}from"./core/lang.js";import{LoadableMixin as o}from"./core/Loadable.js";import{loadAll as s}from"./core/loadAll.js";import c from"./core/Logger.js";import{destroyMaybe as l}from"./core/maybe.js";import{MultiOriginJSONSupportMixin as u,MultiOriginJSONSupport as ee}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as d}from"./core/Promise.js";import{debounce as f}from"./core/promiseUtils.js";import{on as p,watch as m}from"./core/reactiveUtils.js";import{urlToObject as h,addQueryParameter as te}from"./core/urlUtils.js";import g from"./core/Version.js";import _ from"./core/Warning.js";import{property as v,subclass as ne}from"./core/accessorSupport/decorators.js";import{updateOrigins as y}from"./core/accessorSupport/originUtils.js";import{readLoadable as re}from"./core/accessorSupport/read.js";import{isEarth as ie}from"./geometry/ellipsoidUtils.js";import b from"./geometry/Extent.js";import x from"./geometry/HeightModelInfo.js";import{canProjectWithoutEngine as S}from"./geometry/projectionUtils.js";import C from"./geometry/SpatialReference.js";import{validateWebSceneError as ae}from"./geometry/support/heightModelInfoUtils.js";import{fromJSON as oe}from"./geometry/support/jsonUtils.js";import w from"./portal/Portal.js";import T from"./portal/PortalItem.js";import{createForItemWrite as E}from"./portal/support/jsonContext.js";import{toggleTypeKeyword as D,typeKeyword as O}from"./portal/support/portalItemUtils.js";import{hasDeveloperBasemapLayer as k}from"./support/basemapUtils.js";import{ensureType as se}from"./support/groundUtils.js";import A from"./support/MapFloorInfo.js";import{WebSceneTag as j}from"./support/tagSymbols.js";import{createSchemaValidationError as M}from"./support/webSceneUtils.js";import{isSpatialReferenceSupported as N}from"./views/support/spatialReferenceSupport.js";import P from"./webdoc/Widgets.js";import{updateItemWithResources as F,saveResources as I}from"./webdoc/support/resourceUtils.js";import{evaluateWriteErrors as L}from"./webdoc/support/saveUtils.js";import{getNormalizedThumbnailData as R,getOptimalThumbnailSize as z}from"./webdoc/support/thumbnailUtils.js";import{addLayerUnsupportedError as B}from"./webdoc/support/unsupportedErrors.js";import{isCopyAllowed as V,initializeNewItem as H}from"./webdoc/support/webdocSaveUtils.js";import U from"./webscene/ApplicationProperties.js";import W from"./webscene/Environment.js";import G from"./webscene/InitialViewProperties.js";import K from"./webscene/Presentation.js";import ce from"./webscene/TransportationNetwork.js";import{webSceneVersion as q}from"./webscene/version.js";import{alphaCutoff as le}from"./webscene/support/AlphaCutoff.js";import{getLoader as ue}from"./webscene/support/schemaValidatorLoader.js";import{supportsVisibleElevationLayersInSlides as de,versionSupportsGround as J,generateWebSceneVersions as fe}from"./webscene/support/versionUtils.js";import{writer as Y}from"./core/accessorSupport/decorators/writer.js";import{reader as X}from"./core/accessorSupport/decorators/reader.js";var Z;const Q=`Web Scene`;let $=class extends o(d(u(n))){static{Z=j}constructor(e){super(e),this[Z]=!0,this._layersIdGCTimeoutId=void 0,this._updateFromPromise=null,this._afterLoadHooks=[],this.applicationProperties=null,this.clippingArea=null,this.clippingEnabled=!1,this.floorInfo=null,this.heightModelInfo=void 0,this.sourceVersion=null,this.transportationNetworks=null,this.presentation=new K,this.initialViewProperties=new G,this.portalItem=null,this.resourceInfo=null,this.widgets=null,this._debouncedSaveOperations=f(async(e,t,n)=>{switch(e){case 0:return this._saveImpl(t);case 1:return this._saveAsImpl(n,t)}}),this._loadContext={origin:`web-scene`,initiator:this,hooks:{onAfterLoad:e=>this._afterLoadHooks.push(e)}},this._resourceReferences={portalItem:null,paths:[]},this.authoringApp=null,this.authoringAppVersion=null,this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1}initialize(){if(this.when().catch(e=>{c.getLogger(this).error(`#load()`,`Failed to load web scene`,e)}),this.resourceInfo){let e;try{e=this._validateJSON(this.resourceInfo)}catch(e){this.addResolvingPromise(Promise.reject(e));return}this.read(e),this.addResolvingPromise(this._validateSpatialReference()),this.addResolvingPromise(this._validateHeightModelInfo())}this.addHandles(p(()=>this.allLayers,`change`,()=>this._scheduleLayersIdGC()))}destroy(){this._unscheduleLayersIdGC(),this.presentation&&this.presentation.destroy(),this.portalItem=l(this.portalItem)}writeClippingArea(e,t){t.clippingArea||={},t.clippingArea.geometry=e.toJSON()}readClippingEnabled(e,t){return t.clippingArea?!!t.clippingArea.clip:!1}writeClippingEnabled(e,t){this.clippingArea&&(t.clippingArea||={},t.clippingArea.clip=e)}writeLayers(e,t,n,r){t[n]=this._layersToJSON(e,`operational-layers`,r)}get loaded(){return super.loaded}readSourceVersion(e,t){let[n,r]=t.version.split(`.`);return new g(parseInt(n,10),parseInt(r,10))}writeSourceVersion(e,t,n){t[n]=`${q.major}.${q.minor}`}writeTables(e,t,n,r){let i=this._layersToJSON(e,`tables`,r);i.length&&(t[n]=i)}get thumbnailUrl(){return this.portalItem?.thumbnailUrl??null}set thumbnailUrl(e){e?this._override(`thumbnailUrl`,e):(this._clearOverride(`thumbnailUrl`),this.clear(`thumbnailUrl`,`user`))}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set(`authoringApp`,e)}writeAuthoringApp(e,t){t.authoringApp=e&&this._isAuthoringAppSetByUser?e:`ArcGIS API for JavaScript`}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set(`authoringAppVersion`,e)}writeAuthoringAppVersion(e,n){n.authoringAppVersion=e&&this._isAuthoringAppVersionSetByUser?e:t}get ground(){return this._get(`ground`)}set ground(e){let t=se(e);t!=null&&this._set(`ground`,t)}writeGround(e,t,n,r){t[n]=e?e.write({},r):{transparency:0,layers:[]}}readInitialViewProperties(e,t,n){let{spatialReference:r,timeZone:i,viewingMode:a}=t,o=new G,s={...t.initialState};return r!==void 0&&(s.spatialReference=r),i!==void 0&&(s.timeZone=i),a!==void 0&&(s.viewingMode=a),o.read(s,n),o}get spatialReference(){return this.initialViewProperties?.spatialReference??C.WebMercator}get timeZone(){return this.initialViewProperties?.timeZone}get viewingMode(){return this.initialViewProperties?.viewingMode??`global`}load(e){let t=this.ground;return this.addResolvingPromise(this._loadFromSource().then(()=>{t&&t!==this.ground&&t.destroy(),this._validateFeatureLayerSymbolVisibility()})),Promise.resolve(this)}loadAll(){return s(this,e=>{let t=this.presentation&&this.presentation.slides;e(this.ground,this.basemap,this.layers,t&&t.map(e=>e.basemap),this.tables)})}read(e,t){t??=this._loadContext,t.origin=`web-scene`;let n=this._isAuthoringAppVersionSetByUser,r=this._isAuthoringAppSetByUser;if(re(this,e,t=>super.read(e,t),t),r||(this._isAuthoringAppSetByUser=!1),n||(this._isAuthoringAppVersionSetByUser=!1),e.baseMap&&Array.isArray(e.baseMap.elevationLayers)&&de(this.sourceVersion)){let t=e.baseMap.elevationLayers.map(e=>({id:e.id})),n=this.presentation.slides,r=t.filter(e=>!n.some(t=>t.visibleLayers.some(t=>t.id===e.id)));n.forEach(e=>e.visibleLayers.addMany(r))}}_writeBasemapElevationLayers(e){let t=e.ground?.layers;!e.baseMap&&t?.length&&(e.baseMap={title:`Basemap`,baseMapLayers:[]}),e.baseMap&&(e.baseMap.elevationLayers=a(t))}_layersToJSON(e,t,n){let r={...n,layerContainerType:t};return e.map(e=>this._verifyWritableLayer(e,n)?e.write({},r):null).filter(e=>!!e).toArray()}_verifyWritableLayer(e,t){return e.persistenceEnabled?`write`in e||(B(t,e),!1):!1}write(e,t){if(this.loadStatus!==`loaded`){let e=new i(`webscene:not-loaded`,`Web scene must be loaded before it can be serialized`);throw c.getLogger(this).error(`#toJSON()`,`Web scene must be loaded before it can be serialized`,this.loadError||this.loadStatus),e}this._runLayersIdGC();let n=!t?.messages;t={messages:[],...t,origin:`web-scene`};let r=super.write(e,t);if(n){let e=t.messages?.filter(e=>e.name===`web-document-write:property-required`)??[];if(e.length){let t=new i(`web-document:property-required`,`One or more properties that are required in the webscene JSON are missing, see details for the specific errors`,{errors:e});throw c.getLogger(this).error(`#toJSON()`,`One or more properties that are required in the webscene JSON are missing`,e),t}}return this._writeBasemapElevationLayers(r),r}async save(e){return this._debouncedSaveOperations(0,e)}async _saveImpl(e){if(!this.portalItem)throw new i(`webscene:portal-item-not-set`,`Portal item to save to has not been set on the WebScene`);if(this.portalItem?.type!==Q)throw new i(`webscene:portal-item-wrong-type`,`Portal item needs to have type "${Q}"`);let t=this._updateFromPromise;await this._ensureLoadBeforeSave();let n=this._enableVerifyItemRelativeUrls(E(this.portalItem,`web-scene`,{withResources:!0})),r=this.write({},n);return await Promise.all(n.resources.pendingOperations),await this._verifySave(r,n,0,e),this._updateTypeKeywords(this.portalItem),await F(this.portalItem,r,this._resourceReferences,n),y(n),t&&await t,await this._saveThumbnail(this.portalItem),this.portalItem}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}async _saveAsImpl(e,t){let n=T.from(e);if(!n)throw new i(`webscene:portal-item-required`,`saveAs requires a portal item to save to`);n.id&&(n=n.clone(),n.id=null);let r=n.portal||w.getDefault();await this._ensureLoadBeforeSave(),n.type=Q,n.portal=r;let a=this._enableVerifyItemRelativeUrls(E(n,`web-scene`,{withResources:!0})),o=this.write({},a);await Promise.all(a.resources.pendingOperations),await this._verifySaveAs(o,a,t);let s=this.thumbnailUrl,c=!this._isOverridden(`thumbnailUrl`);this._updateTypeKeywords(n),await r.signIn();let l=this.portalItem,u={item:l,authenticated:!!(l?.id&&l.portal.user)},{copyAllowed:d,itemReloaded:f}=await V(u,r);if(u.authenticated||=f,!d)throw new i(`${a.name}:save-as-copy-not-allowed`,`Owner of this map does not allow others to save a copy`);let p={...t,copyAllResources:!0},m=await H(n,u,o,p);return m&&(this._resourceReferences.portalItem=n),await I(this._resourceReferences,a,{ignoreResourceCopyErrors:m}),this.portalItem=n,ee.prototype.read.call(this,{version:o.version,authoringApp:o.authoringApp,authoringAppVersion:o.authoringAppVersion},{name:`web-scene`,ignoreDefaults:!0,url:n.itemUrl?h(n.itemUrl):void 0}),y(a),s&&(this.thumbnailUrl=c?te(s,`w`,`8192`):s),a.portalItem=n,await this._saveThumbnail(l),n}async _saveThumbnail(e){if(this._isOverridden(`thumbnailUrl`)){let t=await R(this.thumbnailUrl,null,e);await this.portalItem?.updateThumbnail(t),this._clearOverride(`thumbnailUrl`),this.clear(`thumbnailUrl`,`user`)}}async _verifySave(e,t,n,r){if(!ie(this.spatialReference))throw new i(`webscene:unsupported-spatial-reference`,`Webscenes using spatial reference systems from Mars or Moon can not be saved currently.`);let{ignoreUnsupported:a,requiredPropertyChecksDisabled:o,strictSchemaValidationEnabled:s}=r||{};L(t,{errorName:`webscene:save`},{ignoreUnsupported:a,supplementalUnsupportedErrors:[`scenemodification:unsupported`],requiredPropertyChecksDisabled:o});let l=ue();if(s&&l){let t=(await l()).validate(e);if(!t.length)return;let r=`webscene did not validate:\n${t.join(`
|
|
2
|
+
import{__decorate as e}from"tslib";import{version as t}from"./kernel.js";import n from"./Map.js";import r from"./core/Collection.js";import i from"./core/Error.js";import{clone as a}from"./core/lang.js";import{LoadableMixin as o}from"./core/Loadable.js";import{loadAll as s}from"./core/loadAll.js";import c from"./core/Logger.js";import{destroyMaybe as l}from"./core/maybe.js";import{MultiOriginJSONSupportMixin as u,MultiOriginJSONSupport as ee}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as d}from"./core/Promise.js";import{debounce as f}from"./core/promiseUtils.js";import{on as p,watch as m}from"./core/reactiveUtils.js";import{urlToObject as h,addQueryParameter as te}from"./core/urlUtils.js";import g from"./core/Version.js";import _ from"./core/Warning.js";import{property as v,subclass as ne}from"./core/accessorSupport/decorators.js";import{updateOrigins as y}from"./core/accessorSupport/originUtils.js";import{readLoadable as re}from"./core/accessorSupport/read.js";import{isEarth as ie}from"./geometry/ellipsoidUtils.js";import b from"./geometry/Extent.js";import x from"./geometry/HeightModelInfo.js";import{canProjectWithoutEngine as S}from"./geometry/projectionUtils.js";import C from"./geometry/SpatialReference.js";import{validateWebSceneError as ae}from"./geometry/support/heightModelInfoUtils.js";import{fromJSON as oe}from"./geometry/support/jsonUtils.js";import w from"./portal/Portal.js";import T from"./portal/PortalItem.js";import{createForItemWrite as E}from"./portal/support/jsonContext.js";import{toggleTypeKeyword as D,typeKeyword as O}from"./portal/support/portalItemUtils.js";import{hasDeveloperBasemapLayer as k}from"./support/basemapUtils.js";import{ensureType as se}from"./support/groundUtils.js";import A from"./support/MapFloorInfo.js";import{WebSceneTag as j}from"./support/tagSymbols.js";import{createSchemaValidationError as M}from"./support/webSceneUtils.js";import{isSpatialReferenceSupported as N}from"./views/support/spatialReferenceSupport.js";import P from"./webdoc/Widgets.js";import{updateItemWithResources as F,saveResources as I}from"./webdoc/support/resourceUtils.js";import{evaluateWriteErrors as L}from"./webdoc/support/saveUtils.js";import{getNormalizedThumbnailData as R,getOptimalThumbnailSize as z}from"./webdoc/support/thumbnailUtils.js";import{addLayerUnsupportedError as B}from"./webdoc/support/unsupportedErrors.js";import{isCopyAllowed as V,initializeNewItem as H}from"./webdoc/support/webdocSaveUtils.js";import U from"./webscene/ApplicationProperties.js";import W from"./webscene/Environment.js";import G from"./webscene/InitialViewProperties.js";import K from"./webscene/Presentation.js";import ce from"./webscene/TransportationNetwork.js";import{webSceneVersion as q}from"./webscene/version.js";import{alphaCutoff as le}from"./webscene/support/AlphaCutoff.js";import{getLoader as ue}from"./webscene/support/schemaValidatorLoader.js";import{supportsVisibleElevationLayersInSlides as de,versionSupportsGround as J,generateWebSceneVersions as fe}from"./webscene/support/versionUtils.js";import{writer as Y}from"./core/accessorSupport/decorators/writer.js";import{reader as X}from"./core/accessorSupport/decorators/reader.js";var Z;const Q=`Web Scene`;let $=class extends o(d(u(n))){static{Z=j}constructor(e){super(e),this[Z]=!0,this._layersIdGCTimeoutId=void 0,this._updateFromPromise=null,this._afterLoadHooks=[],this.applicationProperties=null,this.clippingArea=null,this.clippingEnabled=!1,this.floorInfo=null,this.heightModelInfo=void 0,this.sourceVersion=null,this.transportationNetworks=null,this.presentation=new K,this.initialViewProperties=new G,this.portalItem=null,this.resourceInfo=null,this.widgets=null,this._debouncedSaveOperations=f(async(e,t,n)=>{switch(e){case 0:return this._saveImpl(t);case 1:return this._saveAsImpl(n,t)}}),this._loadContext={origin:`web-scene`,initiator:this,hooks:{onAfterLoad:e=>this._afterLoadHooks.push(e)}},this._resourceReferences={portalItem:null,paths:[]},this.authoringApp=null,this.authoringAppVersion=null,this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1}initialize(){if(this.when().catch(e=>{c.getLogger(this).error(`#load()`,`Failed to load web scene`,e)}),this.resourceInfo){let e;try{e=this._validateJSON(this.resourceInfo)}catch(e){this.addResolvingPromise(Promise.reject(e));return}this.read(e),this.addResolvingPromise(this._validateSpatialReference()),this.addResolvingPromise(this._validateHeightModelInfo())}this.addHandles(p(()=>this.allLayers,`change`,()=>this._scheduleLayersIdGC()))}destroy(){this._unscheduleLayersIdGC(),this.presentation&&this.presentation.destroy(),this.portalItem=l(this.portalItem)}writeClippingArea(e,t){t.clippingArea||={},t.clippingArea.geometry=e.toJSON()}readClippingEnabled(e,t){return t.clippingArea?!!t.clippingArea.clip:!1}writeClippingEnabled(e,t){this.clippingArea&&(t.clippingArea||={},t.clippingArea.clip=e)}writeLayers(e,t,n,r){t[n]=this._layersToJSON(e,`operational-layers`,r)}get loaded(){return super.loaded}readSourceVersion(e,t){let[n,r]=t.version.split(`.`,2);return new g(parseInt(n,10),parseInt(r,10))}writeSourceVersion(e,t,n){t[n]=`${q.major}.${q.minor}`}writeTables(e,t,n,r){let i=this._layersToJSON(e,`tables`,r);i.length&&(t[n]=i)}get thumbnailUrl(){return this.portalItem?.thumbnailUrl??null}set thumbnailUrl(e){e?this._override(`thumbnailUrl`,e):(this._clearOverride(`thumbnailUrl`),this.clear(`thumbnailUrl`,`user`))}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set(`authoringApp`,e)}writeAuthoringApp(e,t){t.authoringApp=e&&this._isAuthoringAppSetByUser?e:`ArcGIS API for JavaScript`}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set(`authoringAppVersion`,e)}writeAuthoringAppVersion(e,n){n.authoringAppVersion=e&&this._isAuthoringAppVersionSetByUser?e:t}get ground(){return this._get(`ground`)}set ground(e){let t=se(e);t!=null&&this._set(`ground`,t)}writeGround(e,t,n,r){t[n]=e?e.write({},r):{transparency:0,layers:[]}}readInitialViewProperties(e,t,n){let{spatialReference:r,timeZone:i,viewingMode:a}=t,o=new G,s={...t.initialState};return r!==void 0&&(s.spatialReference=r),i!==void 0&&(s.timeZone=i),a!==void 0&&(s.viewingMode=a),o.read(s,n),o}get spatialReference(){return this.initialViewProperties?.spatialReference??C.WebMercator}get timeZone(){return this.initialViewProperties?.timeZone}get viewingMode(){return this.initialViewProperties?.viewingMode??`global`}load(e){let t=this.ground;return this.addResolvingPromise(this._loadFromSource().then(()=>{t&&t!==this.ground&&t.destroy(),this._validateFeatureLayerSymbolVisibility()})),Promise.resolve(this)}loadAll(){return s(this,e=>{let t=this.presentation&&this.presentation.slides;e(this.ground,this.basemap,this.layers,t&&t.map(e=>e.basemap),this.tables)})}read(e,t){t??=this._loadContext,t.origin=`web-scene`;let n=this._isAuthoringAppVersionSetByUser,r=this._isAuthoringAppSetByUser;if(re(this,e,t=>super.read(e,t),t),r||(this._isAuthoringAppSetByUser=!1),n||(this._isAuthoringAppVersionSetByUser=!1),e.baseMap&&Array.isArray(e.baseMap.elevationLayers)&&de(this.sourceVersion)){let t=e.baseMap.elevationLayers.map(e=>({id:e.id})),n=this.presentation.slides,r=t.filter(e=>!n.some(t=>t.visibleLayers.some(t=>t.id===e.id)));n.forEach(e=>e.visibleLayers.addMany(r))}}_writeBasemapElevationLayers(e){let t=e.ground?.layers;!e.baseMap&&t?.length&&(e.baseMap={title:`Basemap`,baseMapLayers:[]}),e.baseMap&&(e.baseMap.elevationLayers=a(t))}_layersToJSON(e,t,n){let r={...n,layerContainerType:t};return e.map(e=>this._verifyWritableLayer(e,n)?e.write({},r):null).filter(e=>!!e).toArray()}_verifyWritableLayer(e,t){return e.persistenceEnabled?`write`in e||(B(t,e),!1):!1}write(e,t){if(this.loadStatus!==`loaded`){let e=new i(`webscene:not-loaded`,`Web scene must be loaded before it can be serialized`);throw c.getLogger(this).error(`#toJSON()`,`Web scene must be loaded before it can be serialized`,this.loadError||this.loadStatus),e}this._runLayersIdGC();let n=!t?.messages;t={messages:[],...t,origin:`web-scene`};let r=super.write(e,t);if(n){let e=t.messages?.filter(e=>e.name===`web-document-write:property-required`)??[];if(e.length){let t=new i(`web-document:property-required`,`One or more properties that are required in the webscene JSON are missing, see details for the specific errors`,{errors:e});throw c.getLogger(this).error(`#toJSON()`,`One or more properties that are required in the webscene JSON are missing`,e),t}}return this._writeBasemapElevationLayers(r),r}async save(e){return this._debouncedSaveOperations(0,e)}async _saveImpl(e){if(!this.portalItem)throw new i(`webscene:portal-item-not-set`,`Portal item to save to has not been set on the WebScene`);if(this.portalItem?.type!==Q)throw new i(`webscene:portal-item-wrong-type`,`Portal item needs to have type "${Q}"`);let t=this._updateFromPromise;await this._ensureLoadBeforeSave();let n=this._enableVerifyItemRelativeUrls(E(this.portalItem,`web-scene`,{withResources:!0})),r=this.write({},n);return await Promise.all(n.resources.pendingOperations),await this._verifySave(r,n,0,e),this._updateTypeKeywords(this.portalItem),await F(this.portalItem,r,this._resourceReferences,n),y(n),t&&await t,await this._saveThumbnail(this.portalItem),this.portalItem}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}async _saveAsImpl(e,t){let n=T.from(e);if(!n)throw new i(`webscene:portal-item-required`,`saveAs requires a portal item to save to`);n.id&&(n=n.clone(),n.id=null);let r=n.portal||w.getDefault();await this._ensureLoadBeforeSave(),n.type=Q,n.portal=r;let a=this._enableVerifyItemRelativeUrls(E(n,`web-scene`,{withResources:!0})),o=this.write({},a);await Promise.all(a.resources.pendingOperations),await this._verifySaveAs(o,a,t);let s=this.thumbnailUrl,c=!this._isOverridden(`thumbnailUrl`);this._updateTypeKeywords(n),await r.signIn();let l=this.portalItem,u={item:l,authenticated:!!(l?.id&&l.portal.user)},{copyAllowed:d,itemReloaded:f}=await V(u,r);if(u.authenticated||=f,!d)throw new i(`${a.name}:save-as-copy-not-allowed`,`Owner of this map does not allow others to save a copy`);let p={...t,copyAllResources:!0},m=await H(n,u,o,p);return m&&(this._resourceReferences.portalItem=n),await I(this._resourceReferences,a,{ignoreResourceCopyErrors:m}),this.portalItem=n,ee.prototype.read.call(this,{version:o.version,authoringApp:o.authoringApp,authoringAppVersion:o.authoringAppVersion},{name:`web-scene`,ignoreDefaults:!0,url:n.itemUrl?h(n.itemUrl):void 0}),y(a),s&&(this.thumbnailUrl=c?te(s,`w`,`8192`):s),a.portalItem=n,await this._saveThumbnail(l),n}async _saveThumbnail(e){if(this._isOverridden(`thumbnailUrl`)){let t=await R(this.thumbnailUrl,null,e);await this.portalItem?.updateThumbnail(t),this._clearOverride(`thumbnailUrl`),this.clear(`thumbnailUrl`,`user`)}}async _verifySave(e,t,n,r){if(!ie(this.spatialReference))throw new i(`webscene:unsupported-spatial-reference`,`Webscenes using spatial reference systems from Mars or Moon can not be saved currently.`);let{ignoreUnsupported:a,requiredPropertyChecksDisabled:o,strictSchemaValidationEnabled:s}=r||{};L(t,{errorName:`webscene:save`},{ignoreUnsupported:a,supplementalUnsupportedErrors:[`scenemodification:unsupported`],requiredPropertyChecksDisabled:o});let l=ue();if(s&&l){let t=(await l()).validate(e);if(!t.length)return;let r=`webscene did not validate:\n${t.join(`
|
|
3
3
|
`)}`;c.getLogger(this).error(`${n===1?`saveAs`:`save`}(): ${r}`);let a=t.map(e=>new i(`webscene:schema-validation`,e));throw M(a)}}_verifySaveAs(e,t,n){return this._verifySave(e,t,1,n)}verifySaveAs(e){let t=this._enableVerifyItemRelativeUrls({origin:`web-scene`,messages:[]}),n=this.write({},t);return this._verifySaveAs(n,t,e)}canNotSaveAs(){return!1}async updateFrom(e,t={}){let n=this._updateFrom(e,t);this._updateFromPromise=n,await n,this._updateFromPromise===n&&(this._updateFromPromise=null)}async _updateFrom(e,t={}){if(await e.whenReady(),!t.environmentExcluded&&e.environment&&(this.initialViewProperties.environment=W.prototype.clone.apply(e.environment)),!t.viewpointExcluded&&e.viewpoint&&(this.initialViewProperties.viewpoint=e.viewpoint.clone()),this.initialViewProperties.spatialReference=e.spatialReference.clone(),this.initialViewProperties.viewingMode=e.viewingMode,this.initialViewProperties.timeExtent=e.timeExtent?.clone()??null,this.initialViewProperties.timeZone=e.timeZone,this.initialViewProperties.analyses.updateFrom(e),e.clippingArea==null?this.clippingEnabled=!1:e.clippingArea!==this.clippingArea&&(this.clippingArea=e.clippingArea.clone(),this.clippingEnabled=!0),e.heightModelInfo&&(this.heightModelInfo=e.heightModelInfo.clone()),e.map===this)for(let t of e.allLayerViews){let e=`visible`;e in t&&e in t.layer&&t._isOverridden(e)&&(t.layer[e]=t[e]),`updateLayer`in t&&await t.updateLayer()}if(!t.widgetsExcluded)for(let t of e.registeredComponents)t.updateWebDocument(this);(t.thumbnailExcluded===!1||t.thumbnailExcluded==null&&!t.viewpointExcluded)&&await this.updateThumbnail(e,{size:t.thumbnailSize})}async updateThumbnail(e,t){let n=z(e,t?.size),r=await e.takeScreenshot({format:`jpg`,width:n.width,height:n.height,disableDecorations:!0});this.thumbnailUrl=r.dataUrl}async _loadFromSource(){this.resourceInfo?await this._loadFromJSON(this.resourceInfo):this.portalItem?.id?await this._loadFromItem(this.portalItem):await this._loadObjectsWithLayers(),await this._afterLoad()}async _afterLoad(){for(;this._afterLoadHooks.length;){let e=this._afterLoadHooks.slice();this._afterLoadHooks.length=0,await Promise.allSettled(e.map(e=>e(this._loadContext)))}}_readAndLoadFromJSON(e){let t=this._loadContext,n=this._validateJSON(e);return this.read(n,t),this._loadFromJSON(n)}_extractOperationalLayers(e){let t=[];if(!J(this.sourceVersion)&&e.baseMap&&Array.isArray(e.baseMap.elevationLayers))for(let n of e.baseMap.elevationLayers)t.push(n);let n=[],r=e=>(e.layers&&=e.layers.filter(r),e.layerType!==`ArcGISTiledElevationServiceLayer`||(J(this.sourceVersion)||n.push(e),!1));return{operationalLayers:e.operationalLayers?e.operationalLayers.filter(r):[],operationalElevationLayers:n,basemapElevationLayers:t}}async _loadFromJSON(e){let t=new r;await this._validateSpatialReference(),await this._validateHeightModelInfo();let{populateOperationalLayers:n}=await import(`./layers/support/layersCreator.js`),{operationalLayers:i,operationalElevationLayers:a,basemapElevationLayers:o}=this._extractOperationalLayers(e),s=[],c={context:{...this._loadContext,layerContainerType:`operational-layers`}};if(this.portalItem&&(c.context.portal=this.portalItem.portal||w.getDefault()),o.length>0){let e={...c,context:{...c.context,layerContainerType:`ground`}};e.defaultLayerType=`ArcGISTiledElevationServiceLayer`,s.push(n(this.ground.layers,o,e))}if(a.length>0){let e={...c,context:{...c.context,layerContainerType:`ground`}};e.defaultLayerType=`ArcGISTiledElevationServiceLayer`,s.push(n(t,a,e))}i&&i.length>0&&s.push(n(this.layers,i,c)),e.tables?.length&&s.push(n(this.tables,e.tables,{...c,context:{...c.context,layerContainerType:`tables`},defaultLayerType:`ArcGISFeatureLayer`})),await Promise.allSettled(s),await this._loadObjectsWithLayers(),this.ground.layers.addMany(t.filter(e=>e.type===`base-elevation`||e.type===`elevation`))}async _ensureLoadBeforeSave(){await this.load(),await this._loadObjectsWithLayers();let e=[],t=[...this.allLayers.items];for(let{basemap:e}of this.presentation.slides.items)e&&(t.push(...e.baseLayers.items),t.push(...e.groundLayers.items),t.push(...e.referenceLayers.items));for(let n of t)if(`beforeSave`in n&&typeof n.beforeSave==`function`){let t=n.beforeSave();t&&e.push(t)}await Promise.allSettled(e)}async _loadObjectsWithLayers(){let e=[];this.ground&&e.push(this.ground.load()),this.basemap&&e.push(this.basemap.load()),this.presentation.slides.forEach(t=>{t.basemap&&e.push(t.basemap.load())}),await Promise.allSettled(e)}async _loadFromItem(e){if(await e.load().catch(e=>{throw new i(`webscene:load-portal-item`,`Failed to load portal item`,{error:e})}),e.type!==`Web Scene`)throw new i(`webscene:invalid-portal-item`,"Invalid portal item type '${type}', expected 'Web Scene'",{type:e.type});let t=await e.fetchData();this.resourceInfo=t;let n=this._loadContext;n.url=h(e.itemUrl),n.portal=e.portal||w.getDefault(),n.portalItem=e,n.readResourcePaths=[],await this._readAndLoadFromJSON(t),this._resourceReferences={portalItem:e,paths:n.readResourcePaths??[]}}_validateSpatialReference(){let e=this.initialViewProperties,t=this._sceneSpatialReference,n=e.viewingMode!==`local`,r;if(n){if(!N(t,1))return Promise.reject(new i(`webscene:unsupported-spatial-reference`,"Unsupported spatial reference (${spatialReference.wkid}) in global mode, only Web Mercator, WGS84 GCS or CGCS2000 are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||S(e,t)}else{if(!N(t,2))return Promise.reject(new i(`webscene:unsupported-spatial-reference`,"Unsupported spatial reference (${spatialReference.wkid}) in local mode, only projected coordinate systems are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||e.equals(t)}let a=e=>e?.camera?.position.spatialReference??e?.targetGeometry?.spatialReference,o=e.viewpoint,s=a(o);if(s&&!r(s))return Promise.reject(new i(`webscene:incompatible-camera-spatial-reference`,"Camera spatial reference (${cameraSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{cameraSpatialReference:s,sceneSpatialReference:t,viewingMode:e.viewingMode}));let c=this.presentation.slides.find(e=>!r(a(e.viewpoint)));if(c){let n=a(c.viewpoint);return Promise.reject(new i(`webscene:incompatible-slide-spatial-reference`,"Slide spatial reference (${slideSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{slideSpatialReference:n,sceneSpatialReference:t,viewingMode:e.viewingMode}))}return Promise.resolve()}_validateHeightModelInfo(){let e=this._sceneSpatialReference,t=ae(this.heightModelInfo,e);return t?Promise.reject(t):Promise.resolve()}_validateFeatureLayerSymbolVisibility(){this.sourceVersion?.greaterEqual(1,35)||this.layers.forEach(e=>{e.type===`feature`&&e.addHandles(m(()=>e.loaded,()=>{e.elevationInfo?.mode===`on-the-ground`&&e.renderer?.type===`simple`&&e.renderer.symbol?.type===`polygon-3d`&&e.renderer.symbol.symbolLayers.some(t=>t.type!==`fill`||t.material==null?!1:!t.material.color||t.material.color.a*e.opacity<le?(e.loadWarnings.push(new _(`feature-layer:invisible-draped-symbols`,`FeatureLayer has fully transparent symbols which will no longer render or highlight`,{layer:e})),!0):!1)},{once:!0,sync:!0}))})}_validateJSON(e){let t=g.parse(e.version||``,`webscene`);return q.validate(t),e.version=`${t.major}.${t.minor}`,t.major===1&&t.minor<=2&&(e.spatialReference=C.WebMercator.toJSON()),e}_updateTypeKeywords(e){D(e,O.LOCAL_SCENE,this.initialViewProperties.viewingMode===`local`),D(e,O.DEVELOPER_BASEMAP,k(this.basemap)||this.presentation.slides.some(({basemap:e})=>!!e&&k(e))),e.typeKeywords&&=e.typeKeywords.filter((e,t,n)=>n.indexOf(e)===t)}get _sceneSpatialReference(){return this.initialViewProperties.spatialReference||C.WebMercator}get _verifyItemRelativeRootPath(){return this.portalItem?.itemUrl?h(this.portalItem.itemUrl).path:null}_enableVerifyItemRelativeUrls(e){let t=this._verifyItemRelativeRootPath;return t&&(e.verifyItemRelativeUrls={rootPath:t,writtenUrls:[]}),e}_unscheduleLayersIdGC(){this._layersIdGCTimeoutId&&=(clearTimeout(this._layersIdGCTimeoutId),0)}_scheduleLayersIdGC(){this._unscheduleLayersIdGC(),this._layersIdGCTimeoutId=setTimeout(()=>{this._layersIdGCTimeoutId=0,this._runLayersIdGC()},3e3)}_runLayersIdGC(){this._unscheduleLayersIdGC();let e=this.applicationProperties?.viewing?.search,t=e=>this.allLayers.some(t=>t.id===e&&t.persistenceEnabled);e?.layers&&(e.layers=e.layers.filter(e=>t(e.id)));let n=this.presentation&&this.presentation.slides;n&&n.forEach(e=>{e.visibleLayers&&=e.visibleLayers.filter(e=>t(e.id))})}static fromJSON(e){if(!e)throw new i(`webscene:empty-resource`,`Expected a JSON resource but got nothing`);return new this({resourceInfo:e})}static{this.version=`${q.major}.${q.minor}`}};e([v({type:U,json:{write:!0}})],$.prototype,`applicationProperties`,void 0),e([v({type:b,json:{read:{source:`clippingArea.geometry`,reader:oe},write:{target:`clippingArea.geometry`}}})],$.prototype,`clippingArea`,void 0),e([Y(`clippingArea`)],$.prototype,`writeClippingArea`,null),e([v({type:Boolean,json:{write:{target:`clippingArea.clip`}}})],$.prototype,`clippingEnabled`,void 0),e([X(`clippingEnabled`,[`clippingArea`])],$.prototype,`readClippingEnabled`,null),e([Y(`clippingEnabled`)],$.prototype,`writeClippingEnabled`,null),e([v({type:A,json:{read:{source:`mapFloorInfo`},write:{target:`mapFloorInfo`}}})],$.prototype,`floorInfo`,void 0),e([v({type:x,json:{write:{overridePolicy:e=>({enabled:e?.origin!==3&&e?.origin!==4})}}})],$.prototype,`heightModelInfo`,void 0),e([v({json:{write:{target:`operationalLayers`,ignoreOrigin:!0}}})],$.prototype,`layers`,void 0),e([Y(`layers`)],$.prototype,`writeLayers`,null),e([v({readOnly:!0,type:g,json:{type:fe(q).map(e=>e.toString()),write:{ignoreOrigin:!0,target:`version`,isRequired:!0,overridePolicy:()=>({enabled:!0,allowNull:!0,ignoreOrigin:!0})}}})],$.prototype,`sourceVersion`,void 0),e([X(`sourceVersion`,[`version`])],$.prototype,`readSourceVersion`,null),e([Y(`sourceVersion`)],$.prototype,`writeSourceVersion`,null),e([v({json:{read:!1,write:{enabled:!0,ignoreOrigin:!0}}})],$.prototype,`tables`,void 0),e([Y(`tables`)],$.prototype,`writeTables`,null),e([v()],$.prototype,`thumbnailUrl`,null),e([v({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],$.prototype,`authoringApp`,null),e([Y(`authoringApp`)],$.prototype,`writeAuthoringApp`,null),e([v({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],$.prototype,`authoringAppVersion`,null),e([Y(`authoringAppVersion`)],$.prototype,`writeAuthoringAppVersion`,null),e([v({json:{write:{isRequired:!0,enabled:!0,overridePolicy:()=>({isRequired:!0,enabled:!0,allowNull:!0,ignoreOrigin:!0})}}})],$.prototype,`ground`,null),e([Y(`ground`)],$.prototype,`writeGround`,null),e([v({type:r.ofType(ce),json:{write:!0}})],$.prototype,`transportationNetworks`,void 0),e([v({type:K,nonNullable:!0,json:{write:{ignoreOrigin:!0,writer:(e,t,n,r)=>{if(e.slides&&e.slides.length>0){let n={...r,isPresentation:!0};t.presentation=e.write({},n)}}}}})],$.prototype,`presentation`,void 0),e([v({type:G,nonNullable:!0,json:{write:{target:`initialState`,isRequired:!0,ignoreOrigin:!0},default:()=>new G({viewingMode:`global`,spatialReference:C.WebMercator})}})],$.prototype,`initialViewProperties`,void 0),e([X(`initialViewProperties`,[`initialState`,`spatialReference`,`timeZone`,`viewingMode`])],$.prototype,`readInitialViewProperties`,null),e([v({type:C,json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],$.prototype,`spatialReference`,null),e([v({type:String,json:{read:!1,write:{ignoreOrigin:!0}}})],$.prototype,`timeZone`,null),e([v({type:[`local`,`global`],json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],$.prototype,`viewingMode`,null),e([v({type:T})],$.prototype,`portalItem`,void 0),e([v()],$.prototype,`resourceInfo`,void 0),e([v({type:P,json:{write:!0}})],$.prototype,`widgets`,void 0),$=e([ne(`esri.WebScene`)],$);const pe=$;export{pe as default};
|
|
@@ -34,6 +34,7 @@ export interface ElevationProfileLineSceneProperties extends ElevationProfileLin
|
|
|
34
34
|
* > **Known Limitations**
|
|
35
35
|
* >
|
|
36
36
|
* > - This profile line type is only supported in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) and not in a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/).
|
|
37
|
+
* > - The profile can change when you zoom because the level of detail (LOD) of the scene geometry changes.
|
|
37
38
|
* > - Point cloud scene layers are not supported due to performance considerations.
|
|
38
39
|
*
|
|
39
40
|
* @since 4.34
|
|
@@ -137,6 +137,21 @@ export interface ElevationProfileAnalysisProperties extends AnalysisProperties {
|
|
|
137
137
|
* For a ready-to-use UI, use the [Elevation Profile component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-elevation-profile/),
|
|
138
138
|
* which allows users to interactively place an elevation profile and view the results in a chart.
|
|
139
139
|
*
|
|
140
|
+
* > [!WARNING]
|
|
141
|
+
* >
|
|
142
|
+
* > **Things to consider:**
|
|
143
|
+
* >
|
|
144
|
+
* > - Profile sample distances are determined automatically based on the input geometry, profile configuration, and
|
|
145
|
+
* > available elevation data. No sampling distance needs to be specified.
|
|
146
|
+
* > - Results depend on the available elevation data and its resolution.
|
|
147
|
+
*
|
|
148
|
+
* > [!WARNING]
|
|
149
|
+
* >
|
|
150
|
+
* > **Known Limitations**
|
|
151
|
+
* >
|
|
152
|
+
* > - Scene profiles can change with the camera position because they use the level of detail (LOD) of the geometry
|
|
153
|
+
* > currently loaded in the view.
|
|
154
|
+
*
|
|
140
155
|
* @since 4.34
|
|
141
156
|
* @see [ElevationProfileAnalysisView2D](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/ElevationProfileAnalysisView2D/)
|
|
142
157
|
* @see [ElevationProfileAnalysisView3D](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ElevationProfileAnalysisView3D/)
|
|
@@ -103,7 +103,6 @@ export interface LineOfSightAnalysisProperties extends AnalysisProperties {
|
|
|
103
103
|
* >
|
|
104
104
|
* > **Things to consider:**
|
|
105
105
|
* > * This analysis is only supported in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
|
|
106
|
-
* > * The results of the tool vary depending on the zoom level, as changes in zoom level affect the level of detail (LOD) of the scene geometry.
|
|
107
106
|
* > * Snapping, tooltips, display units, and input units used during interactive placement and editing are inherited from
|
|
108
107
|
* [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
|
|
109
108
|
* > * Snapping is enabled by default. This can be temporarily disabled by holding the `CTRL` key.
|
|
@@ -111,6 +110,12 @@ export interface LineOfSightAnalysisProperties extends AnalysisProperties {
|
|
|
111
110
|
* > [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/), [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/),
|
|
112
111
|
* > [3D Object SceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/), and [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/BuildingSceneLayer/).
|
|
113
112
|
*
|
|
113
|
+
* > [!WARNING]
|
|
114
|
+
* >
|
|
115
|
+
* > **Known Limitations**
|
|
116
|
+
* >
|
|
117
|
+
* > * Line of sight results can change when you zoom because the level of detail (LOD) of the scene geometry changes.
|
|
118
|
+
*
|
|
114
119
|
* @since 4.23
|
|
115
120
|
* @see [LineOfSightAnalysisView3D](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/)
|
|
116
121
|
* @see [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/)
|
|
@@ -8,7 +8,6 @@ import type { DiscreteOptionsProperties } from "./ShadowCast/DiscreteOptions.js"
|
|
|
8
8
|
import type { MinDurationOptionsProperties } from "./ShadowCast/MinDurationOptions.js";
|
|
9
9
|
import type { TotalDurationOptionsProperties } from "./ShadowCast/TotalDurationOptions.js";
|
|
10
10
|
import type { ShadowCastMode } from "./ShadowCast/types.js";
|
|
11
|
-
import type { TimeZone } from "../time/types.js";
|
|
12
11
|
import type { PolygonProperties } from "../geometry/Polygon.js";
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -16,7 +15,7 @@ import type { PolygonProperties } from "../geometry/Polygon.js";
|
|
|
16
15
|
*
|
|
17
16
|
* @since 5.0
|
|
18
17
|
*/
|
|
19
|
-
export interface ShadowCastAnalysisProperties extends AnalysisProperties, Partial<Pick<ShadowCastAnalysis, "endTimeOfDay" | "mode" | "startTimeOfDay" | "
|
|
18
|
+
export interface ShadowCastAnalysisProperties extends AnalysisProperties, Partial<Pick<ShadowCastAnalysis, "endTimeOfDay" | "mode" | "startTimeOfDay" | "timeZoneMode" | "utcOffset" | "visualizeSunlight">> {
|
|
20
19
|
/**
|
|
21
20
|
* The calendar date used to calculate the shadow cast. This date excludes the time.
|
|
22
21
|
* If a date with a time is set, the time value will be set to midnight (`00:00:00`) of that date in local system time.
|
|
@@ -63,16 +62,16 @@ export interface ShadowCastAnalysisProperties extends AnalysisProperties, Partia
|
|
|
63
62
|
* it visualizes sunlight exposure instead.
|
|
64
63
|
*
|
|
65
64
|
* The [date](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#date), [startTimeOfDay](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#startTimeOfDay),
|
|
66
|
-
* [endTimeOfDay](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#endTimeOfDay)
|
|
67
|
-
* the date
|
|
65
|
+
* and [endTimeOfDay](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#endTimeOfDay) properties define
|
|
66
|
+
* the date and time range used to compute the analysis overlay. They do not change the lighting in the
|
|
68
67
|
* scene. To control scene lighting, use [SunLighting](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SunLighting/) or the
|
|
69
68
|
* [Daylight](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-daylight/)
|
|
70
69
|
* component.
|
|
71
70
|
*
|
|
72
|
-
* The [
|
|
73
|
-
* are interpreted in for the analysis.
|
|
74
|
-
*
|
|
75
|
-
*
|
|
71
|
+
* The [SceneView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone) property determines which time zone the selected date and time range
|
|
72
|
+
* are interpreted in for the analysis. Changing the time zone preserves the selected date and time range.
|
|
73
|
+
* This differs from the Daylight component, where selecting a time zone updates the displayed date and time
|
|
74
|
+
* while preserving the scene's lighting instant.
|
|
76
75
|
*
|
|
77
76
|
* When set, the [geometry](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#geometry) property limits the visualization to a polygonal project
|
|
78
77
|
* area, such as a parcel, park, or courtyard. If no geometry is provided, the analysis applies to the entire scene.
|
|
@@ -102,7 +101,7 @@ export interface ShadowCastAnalysisProperties extends AnalysisProperties, Partia
|
|
|
102
101
|
* and [endTimeOfDay](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#endTimeOfDay) properties.
|
|
103
102
|
* - Optionally set [visualizeSunlight](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#visualizeSunlight) to visualize sunlight duration instead of shadow duration.
|
|
104
103
|
* - Optionally set [geometry](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#geometry) to limit the analysis to a polygonal project area.
|
|
105
|
-
* -
|
|
104
|
+
* - Set [SceneView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone) to choose the scene time zone used for the analysis.
|
|
106
105
|
* - If using the `discrete` [mode](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#mode), optionally set custom properties with [DiscreteOptions](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCast/DiscreteOptions/).
|
|
107
106
|
* - If using the `min-duration` [mode](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#mode), optionally set custom properties with [MinDurationOptions](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCast/MinDurationOptions/).
|
|
108
107
|
* - If using the `total-duration` [mode](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#mode), optionally set custom properties with [TotalDurationOptions](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCast/TotalDurationOptions/).
|
|
@@ -135,10 +134,10 @@ export interface ShadowCastAnalysisProperties extends AnalysisProperties, Partia
|
|
|
135
134
|
* { value: 2 * 3600 * 1000, color: [255, 198, 87, 0.5] },
|
|
136
135
|
* { value: 4 * 3600 * 1000, color: [84, 176, 74, 0.85] }
|
|
137
136
|
* ]
|
|
138
|
-
* }
|
|
139
|
-
* utcOffset: -8 // Pacific Standard Time
|
|
137
|
+
* }
|
|
140
138
|
* });
|
|
141
139
|
*
|
|
140
|
+
* view.timeZone = "America/Los_Angeles";
|
|
142
141
|
* view.analyses.add(analysis);
|
|
143
142
|
* ```
|
|
144
143
|
*
|
|
@@ -159,10 +158,12 @@ export interface ShadowCastAnalysisProperties extends AnalysisProperties, Partia
|
|
|
159
158
|
* // ... do something with the duration
|
|
160
159
|
* });
|
|
161
160
|
* ```
|
|
161
|
+
*
|
|
162
162
|
* > [!WARNING]
|
|
163
163
|
* >
|
|
164
164
|
* > **Known Limitations**
|
|
165
165
|
* >
|
|
166
|
+
* > - Shadow cast results can change when you zoom because the level of detail (LOD) of the scene geometry changes.
|
|
166
167
|
* > - Terrain does not cast shadows in this analysis.
|
|
167
168
|
* > - As a result, shadow duration may be underestimated and sunlight duration may be overestimated in areas where
|
|
168
169
|
* > terrain would normally block sunlight.
|
|
@@ -170,9 +171,6 @@ export interface ShadowCastAnalysisProperties extends AnalysisProperties, Partia
|
|
|
170
171
|
* > current camera location. For example, the sun may be below the horizon during part of the range.
|
|
171
172
|
* > Set [startTimeOfDay](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#startTimeOfDay) after local sunrise and
|
|
172
173
|
* > [endTimeOfDay](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#endTimeOfDay) before local sunset to keep the time range within daylight hours.
|
|
173
|
-
* > - A numeric [utcOffset](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#utcOffset) does not adjust automatically for daylight saving time.
|
|
174
|
-
* > - The timezone is automatically detected based on the camera location. In some situations this might
|
|
175
|
-
* > not be accurate. In case of an inaccurate timezone, users can set it manually using the [utcOffset](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#utcOffset).
|
|
176
174
|
*
|
|
177
175
|
* @since 5.0
|
|
178
176
|
* @see [ShadowCastAnalysisView3D](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ShadowCastAnalysisView3D/)
|
|
@@ -256,14 +254,12 @@ export default class ShadowCastAnalysis extends Analysis {
|
|
|
256
254
|
*/
|
|
257
255
|
accessor startTimeOfDay: number;
|
|
258
256
|
/**
|
|
259
|
-
*
|
|
260
|
-
* [startTimeOfDay](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#startTimeOfDay), and [endTimeOfDay](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#endTimeOfDay) properties
|
|
261
|
-
* are interpreted when computing the shadow cast analysis. This property takes precedence over
|
|
262
|
-
* [utcOffset](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#utcOffset).
|
|
257
|
+
* Selects regional scene-time-zone calculations or legacy UTC-offset calculations.
|
|
263
258
|
*
|
|
259
|
+
* @default "region"
|
|
264
260
|
* @internal
|
|
265
261
|
*/
|
|
266
|
-
accessor
|
|
262
|
+
accessor timeZoneMode: "region" | "offset";
|
|
267
263
|
/**
|
|
268
264
|
* Options specific to the `total-duration` mode.
|
|
269
265
|
*
|
|
@@ -282,15 +278,15 @@ export default class ShadowCastAnalysis extends Analysis {
|
|
|
282
278
|
* [startTimeOfDay](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#startTimeOfDay), and [endTimeOfDay](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#endTimeOfDay) properties are interpreted when computing the
|
|
283
279
|
* shadow cast analysis.
|
|
284
280
|
*
|
|
285
|
-
*
|
|
286
|
-
* view's camera position.
|
|
281
|
+
* The analysis uses [SceneView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone) by default.
|
|
287
282
|
*
|
|
288
283
|
* > [!WARNING]
|
|
289
284
|
* >
|
|
290
285
|
* > **Known Limitations**
|
|
291
286
|
* >
|
|
292
|
-
* >
|
|
287
|
+
* > Fixed offsets do not account for daylight saving time.
|
|
293
288
|
*
|
|
289
|
+
* @deprecated since 6.0. Use [SceneView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone) instead.
|
|
294
290
|
* @since 5.0
|
|
295
291
|
*/
|
|
296
292
|
accessor utcOffset: number | null | undefined;
|
|
@@ -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"./Analysis.js";import n from"./ShadowCast/DiscreteOptions.js";import r from"./ShadowCast/MinDurationOptions.js";import i from"./ShadowCast/TotalDurationOptions.js";import{equalsMaybe as a}from"../core/maybe.js";import{convertTime as o}from"../core/timeUtils.js";import{property as s,subclass as c}from"../core/accessorSupport/decorators.js";import l from"../geometry/Polygon.js";let u=class extends t{constructor(e){super(e),this.type=`shadow-cast`,this.geometry=null,this.utcOffset=null,this.
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"./Analysis.js";import n from"./ShadowCast/DiscreteOptions.js";import r from"./ShadowCast/MinDurationOptions.js";import i from"./ShadowCast/TotalDurationOptions.js";import{equalsMaybe as a}from"../core/maybe.js";import{convertTime as o}from"../core/timeUtils.js";import{property as s,subclass as c}from"../core/accessorSupport/decorators.js";import l from"../geometry/Polygon.js";let u=class extends t{constructor(e){super(e),this.type=`shadow-cast`,this.geometry=null,this.utcOffset=null,this.timeZoneMode=`region`,this.startTimeOfDay=o(10,`hours`,`milliseconds`),this.endTimeOfDay=o(16,`hours`,`milliseconds`),this.mode=`min-duration`,this.visualizeSunlight=!1,this.discreteOptions=new n,this.totalDurationOptions=new i,this.minDurationOptions=new r,this.date??=new Date}set date(e){let t=new Date(e);t.setHours(0,0,0,0),this._set(`date`,t)}get valid(){return!0}equals(e){return this===e||super.equals(e)&&this.date.getTime()===e.date.getTime()&&this.timeZoneMode===e.timeZoneMode&&this.utcOffset===e.utcOffset&&this.startTimeOfDay===e.startTimeOfDay&&this.endTimeOfDay===e.endTimeOfDay&&a(this.geometry,e.geometry)&&this.mode===e.mode&&this.visualizeSunlight===e.visualizeSunlight&&this.discreteOptions.equals(e.discreteOptions)&&this.totalDurationOptions.equals(e.totalDurationOptions)&&this.minDurationOptions.equals(e.minDurationOptions)}clear(){throw Error(`clear() is not supported on ShadowCastAnalysis.`)}};e([s({type:[`shadow-cast`]})],u.prototype,`type`,void 0),e([s({type:Date,nonNullable:!0})],u.prototype,`date`,null),e([s({type:l})],u.prototype,`geometry`,void 0),e([s({})],u.prototype,`utcOffset`,void 0),e([s({type:[`region`,`offset`],nonNullable:!0})],u.prototype,`timeZoneMode`,void 0),e([s({type:Number,nonNullable:!0})],u.prototype,`startTimeOfDay`,void 0),e([s({type:Number,nonNullable:!0})],u.prototype,`endTimeOfDay`,void 0),e([s({type:[`discrete`,`min-duration`,`total-duration`],nonNullable:!0})],u.prototype,`mode`,void 0),e([s({type:Boolean,nonNullable:!0})],u.prototype,`visualizeSunlight`,void 0),e([s({type:n,nonNullable:!0})],u.prototype,`discreteOptions`,void 0),e([s({type:i,nonNullable:!0})],u.prototype,`totalDurationOptions`,void 0),e([s({type:r,nonNullable:!0})],u.prototype,`minDurationOptions`,void 0),e([s({readOnly:!0})],u.prototype,`valid`,null),u=e([c(`esri.analysis.ShadowCastAnalysis`)],u);const d=u;export{d as default};
|
|
@@ -84,7 +84,6 @@ export interface ViewshedAnalysisProperties extends AnalysisProperties {
|
|
|
84
84
|
* >
|
|
85
85
|
* > **Things to consider:**
|
|
86
86
|
* > * This analysis is only supported in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
|
|
87
|
-
* > * The results of the tool vary depending on the zoom level, as changes in zoom level affect the level of detail (LOD) of the scene geometry.
|
|
88
87
|
* > * Snapping, tooltips, display units, and input units used during interactive placement and editing are inherited from
|
|
89
88
|
* [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
|
|
90
89
|
* > * Snapping is enabled by default. This can be temporarily disabled by holding the `CTRL` key.
|
|
@@ -92,6 +91,12 @@ export interface ViewshedAnalysisProperties extends AnalysisProperties {
|
|
|
92
91
|
* > [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/), [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/),
|
|
93
92
|
* > [3D Object SceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/), and [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/BuildingSceneLayer/).
|
|
94
93
|
*
|
|
94
|
+
* > [!WARNING]
|
|
95
|
+
* >
|
|
96
|
+
* > **Known Limitations**
|
|
97
|
+
* >
|
|
98
|
+
* > * Viewshed results can change when you zoom because the level of detail (LOD) of the scene geometry changes.
|
|
99
|
+
*
|
|
95
100
|
* @since 4.30
|
|
96
101
|
* @see [ViewshedAnalysisView3D](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/)
|
|
97
102
|
* @see [Viewshed](https://developers.arcgis.com/javascript/latest/references/core/analysis/Viewshed/)
|
|
@@ -169,6 +169,12 @@ export interface InternalCreateChartParameters extends AbortOptions {
|
|
|
169
169
|
* @internal
|
|
170
170
|
*/
|
|
171
171
|
container: HTMLElement;
|
|
172
|
+
/**
|
|
173
|
+
* Whether the chart uses a right-to-left layout.
|
|
174
|
+
*
|
|
175
|
+
* @internal
|
|
176
|
+
*/
|
|
177
|
+
rtl: boolean;
|
|
172
178
|
/**
|
|
173
179
|
* The analysis view to associate with the chart.
|
|
174
180
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{throwIfAborted as e}from"../../core/promiseUtils.js";import{toUnit as t}from"../../core/quantity.js";import{setTestConfig as n}from"../../views/analysis/ElevationProfile/constants.js";import{geodeticDistanceThresholdMeters as r}from"../../views/support/measurementWorkerUtils.js";function i(e){return e.forceInteractive()}function a(e){return t(e,`meters`).value>r}function o(e){return e.measurementData?.measurements!=null}function s(){return n()}async function c(t){let{ElevationProfileChart:n}=await import(`../../views/analysis/ElevationProfile/ElevationProfileChart.js`);return e(t.signal),new n({analysisView:t.analysisView,container:t.container,messages:t.messages,onCursorPositionChange:t.onCursorPositionChange,onRangeChange:t.onRangeChange,uniformScaling:t.uniformScaling??!1,hideGridLines:t.hideGridLines??void 0,hideAxisLabels:t.hideAxisLabels??void 0,view:t.view})}export{c as createChart,i as forceInteractive,o as hasValidAreaResult,a as isAboveGeodesicDistanceThreshold,s as setElevationProfileTestConfig};
|
|
2
|
+
import{throwIfAborted as e}from"../../core/promiseUtils.js";import{toUnit as t}from"../../core/quantity.js";import{setTestConfig as n}from"../../views/analysis/ElevationProfile/constants.js";import{geodeticDistanceThresholdMeters as r}from"../../views/support/measurementWorkerUtils.js";function i(e){return e.forceInteractive()}function a(e){return t(e,`meters`).value>r}function o(e){return e.measurementData?.measurements!=null}function s(){return n()}async function c(t){let{ElevationProfileChart:n}=await import(`../../views/analysis/ElevationProfile/ElevationProfileChart.js`);return e(t.signal),new n({analysisView:t.analysisView,container:t.container,messages:t.messages,onCursorPositionChange:t.onCursorPositionChange,onRangeChange:t.onRangeChange,uniformScaling:t.uniformScaling??!1,hideGridLines:t.hideGridLines??void 0,hideAxisLabels:t.hideAxisLabels??void 0,rtl:t.rtl,view:t.view})}export{c as createChart,i as forceInteractive,o as hasValidAreaResult,a as isAboveGeodesicDistanceThreshold,s as setElevationProfileTestConfig};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../request.js";import{ModuleError as t}from"./executionError.js";import{parseScript as n}from"./parser.js";import r from"./featureset/support/RecentlyUsedCache.js";import i from"../portal/Portal.js";class a{constructor(e){this.portalUri=e}static{this.mocks={}}static{this.cachedModules=new r(30)}normalizeModuleUri(e){let n=/^[a-z0-9]+(@[0-9]+\.[0-9]+\.[0-9]+)?([?|/].*)?$/gi,r=/(?<portalurl>.+)\/home\/item\.html\?id=(?<itemid>.+)$/gi,o=/(?<portalurl>.+)\/sharing\/rest\/content\/users\/[a-z0-9]+\/items\/(?<itemid>.+)$/gi,s=/(?<portalurl>.+)\/sharing\/rest\/content\/items\/(?<itemid>.+)$/gi,c=/(?<itemid>.*)@(?<versionstring>[0-9]+\.[0-9]+\.[0-9]+)([?|/].*)?$/gi;if(e.startsWith(`portal+`)){let a=e.slice(7),l=``,u=a,d=!1;for(let e of[r,s,o]){let t=e.exec(a);if(t!==null){let e=t.groups;u=e.itemid,l=e.portalurl,d=!0;break}}if(d===!1){if(n.test(a))u=a,l=this.portalUri;else throw new t(`UnsupportedUriProtocol`,{uri:e})}u.includes(`/`)&&(u=u.split(
|
|
2
|
+
import e from"../request.js";import{ModuleError as t}from"./executionError.js";import{parseScript as n}from"./parser.js";import r from"./featureset/support/RecentlyUsedCache.js";import i from"../portal/Portal.js";class a{constructor(e){this.portalUri=e}static{this.mocks={}}static{this.cachedModules=new r(30)}normalizeModuleUri(e){let n=/^[a-z0-9]+(@[0-9]+\.[0-9]+\.[0-9]+)?([?|/].*)?$/gi,r=/(?<portalurl>.+)\/home\/item\.html\?id=(?<itemid>.+)$/gi,o=/(?<portalurl>.+)\/sharing\/rest\/content\/users\/[a-z0-9]+\/items\/(?<itemid>.+)$/gi,s=/(?<portalurl>.+)\/sharing\/rest\/content\/items\/(?<itemid>.+)$/gi,c=/(?<itemid>.*)@(?<versionstring>[0-9]+\.[0-9]+\.[0-9]+)([?|/].*)?$/gi;if(e.startsWith(`portal+`)){let a=e.slice(7),l=``,u=a,d=!1;for(let e of[r,s,o]){let t=e.exec(a);if(t!==null){let e=t.groups;u=e.itemid,l=e.portalurl,d=!0;break}}if(d===!1){if(n.test(a))u=a,l=this.portalUri;else throw new t(`UnsupportedUriProtocol`,{uri:e})}u.includes(`/`)&&(u=u.split(`/`,1)[0]),u.includes(`?`)&&(u=u.split(`?`,1)[0]);let f=`current`,p=c.exec(u);if(p!==null){let e=p.groups;u=e.itemid,f=e.versionstring}return a=new i({url:l}).restUrl+`/content/items/`+u+`/resources/`+f+`.arc`,{url:a,scheme:`portal`,uri:`PO:`+a}}if(e.startsWith(`mock`)){if(e===`mock`)return{url:``,scheme:`mock`,data:`
|
|
3
3
|
export var hello = 1;
|
|
4
4
|
export function helloWorld() {
|
|
5
5
|
return "Hello World " + hello;
|
package/arcade/arcadeCompiler.js
CHANGED
|
@@ -122,7 +122,7 @@ import{toSymbolId as e,neverAbortedSignal as t}from"./arcadeEnvironment.js";impo
|
|
|
122
122
|
var ${n} = ${B(e,t.arguments[0])};
|
|
123
123
|
${r}
|
|
124
124
|
return ${B(e,t.arguments[t.arguments.length-1])}
|
|
125
|
-
${e.isAsync?`})}()))`:`}()`}`}catch(e){throw e}}function K(e,t){try{return z(e,t,(e,t)=>{throw new m(`Unrecognized`,t)})}catch(e){throw e}}function at(e){let t=function(){this.textformatting=p.textFormatting()};t.prototype=Object.create(null),t.provided=new Set([`textformatting`,`infinity`,`nan`,`pi`]),t.prototype.infinity=1/0,t.prototype.nan=NaN,t.prototype.pi=Math.PI;for(let[n,r]of Object.entries(e))t.prototype[n]=new _(r),t.provided.add(n);return t}function ot(){let e=Object.create(null);pe(e,z),be(e,z),me(e,z,L),_e(e,z),he(e,z),ye(e,z),xe(e,z),e.iif=K,e.decode=K,e.when=K,e.defaultvalue=K;let t=at(e);return ge(e,z),{ScopeSync:at(e),ScopeAsync:t}}const{ScopeSync:q,ScopeAsync:J}=ot();function Y(e,t){let n={mode:t,compiled:!0,functions:Object.create(null),signatures:[],standardFunction:z,standardFunctionAsync:z,evaluateIdentifier:L};for(let t of e)t.registerFunctions(n);if(t===`sync`)for(let[e,t]of Object.entries(n.functions))q.prototype[e]=new _(t),q.provided.add(e);else for(let[e,t]of Object.entries(n.functions))J.prototype[e]=new _(t),J.provided.add(e);for(let e of n.signatures)ue(e,t)}Y([fe],`sync`),Y([fe],`async`),Y([de],`async`),Y([ve],`async`);const X=Symbol(`uninitialized`),st=`lang.uninitialized`;function Z(e){return`lang.requireInitialized(${e})`}const Q={uninitialized:X,requireInitialized(e){if(e===X)throw new m(`InvalidIdentifier`,null);return e},isNumber(e){return A(e)},isArray(e){return k(e)},isImmutableArray(e){return ae(e)},isDictionaryLike(e){return le(e)},isString(e){return j(e)},isDictionary(e){return ce(e)},isGeometry(e){return se(e)},getGeometryKeys(e){return f(e)},getGeometryMember(e,t){return d(e,t)},error(e){throw new m(e,null)},__awaiter(e,t,n,r){let i=r.apply(e,t||[]),a=i.next();for(;!a.done&&!E(a.value);)a=i.next(a.value);return a.done?a.value:new Promise((e,t)=>{function n(r){for(;!r.done;){if(E(r.value)){Promise.resolve(r.value).then(e=>{try{n(i.next(e))}catch(e){t(e)}},e=>{try{n(i.throw(e))}catch(e){t(e)}});return}try{r=i.next(r.value)}catch(e){t(e);return}}e(r.value)}n(a)})},functionDepthchecker(e,t){return function(){if(t.depthCounter.depth++,t.localStack.push({}),t.depthCounter.depth>64)throw new m(`MaximumCallDepth`,null);let n=e.apply(this,arguments);return E(n)?n.then(e=>(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,e)):(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,n)}},mustBoolean(e){if(e===!0||e===!1)return e;throw new m(`BooleanConditionRequired`,null)},castString(e){return S(e)},aCheck(e,t){if(b(e))throw t===`ArrayExpression`?new m(`NoFunctionInArray`,null):t===`ObjectExpression`?new m(`NoFunctionInDictionary`,null):new m(`NoFunctionInTemplateLiteral`,null);return e===C?null:e},Dictionary:p,Feature:g,UserDefinedCompiledFunction:R,dictionary(e){let t=Object.create(null),n=new Map;for(let r=0;r<e.length;r+=2){if(b(e[r+1]))throw new m(`NoFunctionInDictionary`,null);if(j(e[r])===!1)throw new m(`KeyMustBeString`,null);let i=e[r].toString(),a=i.toLowerCase();n.has(a)?i=n.get(a):n.set(a,i),e[r+1]===C?t[i]=null:t[i]=e[r+1]}let r=new p(t);return r.immutable=!1,r},entry(e,t){return p.containerEntry(e,t)},strCheck(e){if(j(e)===!1)throw new m(`KeyMustBeString`,null);return e},unary(e,t){if(M(e)){if(t===`!`)return!e;if(t===`-`)return-1*x(e);if(t===`+`)return 1*x(e);if(t===`~`)return~x(e);throw new m(`UnsupportUnaryOperator`,null)}if(t===`-`)return-1*x(e);if(t===`+`)return 1*x(e);if(t===`~`)return~x(e);throw new m(`UnsupportUnaryOperator`,null)},logicalCheck(e){if(M(e)===!1)throw new m(`LogicExpressionOrAnd`,null);return e},logical(e,t,n){if(M(e)&&M(t))switch(n){case`||`:return e||t;case`&&`:return e&&t;default:throw new m(`LogicExpressionOrAnd`,null)}throw new m(`LogicExpressionOrAnd`,null)},binary(e,t,n){switch(n){case`|`:case`<<`:case`>>`:case`>>>`:case`^`:case`&`:return oe(x(e),x(t),n);case`==`:return T(e,t);case`!=`:return!T(e,t);case`<`:return w(e,t,n);case`>`:return w(e,t,n);case`<=`:return w(e,t,n);case`>=`:return w(e,t,n);case`+`:return j(e)||j(t)?S(e)+S(t):x(e)+x(t);case`-`:return x(e)-x(t);case`*`:return x(e)*x(t);case`/`:return x(e)/x(t);case`%`:return x(e)%x(t);default:throw new m(`UnsupportedOperator`,null)}},assign(e,t,n){switch(t){case`=`:return e===C?null:e;case`/=`:return x(n)/x(e);case`*=`:return x(n)*x(e);case`-=`:return x(n)-x(e);case`+=`:return j(n)||j(e)?S(n)+S(e):x(n)+x(e);case`%=`:return x(n)%x(e);default:throw new m(`UnsupportedOperator`,null)}},update(e,t,n,r){let i=this.requireInitialized(e[t]),a=x(i)+(n?1:-1);return e[t]=a,r?a:i},createFeature(e,t,n){return g.createFromGraphicLikeObject(e.geometry,e.attributes,t,n.timeZone)},memberupdate(e,t,n,r){return u(e,t,n,r)},assignmember(e,t,n,r){if(k(e)){if(A(t)){if(t<0&&(t=e.length+t),t<0||t>e.length)throw new m(`OutOfBounds`,null);if(t===e.length){if(n!==`=`)throw new m(`OutOfBounds`,null);e[t]=this.assign(r,n,e[t])}else e[t]=this.assign(r,n,e[t])}else throw new m(`ArrayAccessMustBeNumber`,null)}else if(e instanceof p){if(j(t)===!1)throw new m(`KeyAccessorMustBeString`,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else if(n!==`=`)throw new m(`FieldNotFound`,null,{key:t});else e.setField(t,this.assign(r,n,null))}else if(ie(e)){if(j(t)===!1)throw new m(`KeyAccessorMustBeString`,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else if(n!==`=`)throw new m(`FieldNotFound`,null,{key:t});else e.setField(t,this.assign(r,n,null))}else if(ae(e))throw new m(`Immutable`,null);else if(e instanceof $){if(j(t)===!1)throw new m(`ModuleAccessorMustBeString`,null);if(e.hasGlobal(t))e.setGlobal(t,this.assign(r,n,e.global(t)));else throw new m(`ModuleExportNotFound`,null)}else throw new m(`InvalidIdentifier`,null)},member(e,t){return l(e,t)},tryMember(e,t){return c(e,t)},callfunc(e,t,n){if(b(e))return e.call(n,{arguments:t,preparsed:!0});throw new m(`CallNonFunction`,null)},loadModule(e,t){let n=t.moduleFactoryMap[e];if(t.moduleSingletons[n])return t.moduleSingletons[n];let r=t.moduleFactory[n]({moduleSingletons:t.moduleSingletons,depthCounter:t.depthCounter,lrucache:t.lrucache,interceptor:t.interceptor,services:t.services,console:t.console,abortSignal:t.abortSignal,timeZone:t.timeZone??null,spatialReference:t.spatialReference});return t.moduleSingletons[n]=r,r},getNestedOptionalValue(e,t){return s(e,t)}};function ct(e){console.log(e)}function lt(n,i,a=!1){let o=null;n.usesModules&&(o=new r(null,n.loadedModules));let s=Object.create(null),c=new Set(Object.keys(i?.vars||{}).map(t=>e(t))),l=new Set(Object.keys(i?.customfunctions||{}).map(t=>e(t))),u=Te(n,a?J.provided:q.provided,
|
|
125
|
+
${e.isAsync?`})}()))`:`}()`}`}catch(e){throw e}}function K(e,t){try{return z(e,t,(e,t)=>{throw new m(`Unrecognized`,t)})}catch(e){throw e}}function at(e){let t=function(){this.textformatting=p.textFormatting()};t.prototype=Object.create(null),t.provided=new Set([`textformatting`,`infinity`,`nan`,`pi`]),t.prototype.infinity=1/0,t.prototype.nan=NaN,t.prototype.pi=Math.PI;for(let[n,r]of Object.entries(e))t.prototype[n]=new _(r),t.provided.add(n);return t}function ot(){let e=Object.create(null);pe(e,z),be(e,z),me(e,z,L),_e(e,z),he(e,z),ye(e,z),xe(e,z),e.iif=K,e.decode=K,e.when=K,e.defaultvalue=K;let t=at(e);return ge(e,z),{ScopeSync:at(e),ScopeAsync:t}}const{ScopeSync:q,ScopeAsync:J}=ot();function Y(e,t){let n={mode:t,compiled:!0,functions:Object.create(null),signatures:[],standardFunction:z,standardFunctionAsync:z,evaluateIdentifier:L};for(let t of e)t.registerFunctions(n);if(t===`sync`)for(let[e,t]of Object.entries(n.functions))q.prototype[e]=new _(t),q.provided.add(e);else for(let[e,t]of Object.entries(n.functions))J.prototype[e]=new _(t),J.provided.add(e);for(let e of n.signatures)ue(e,t)}Y([fe],`sync`),Y([fe],`async`),Y([de],`async`),Y([ve],`async`);const X=Symbol(`uninitialized`),st=`lang.uninitialized`;function Z(e){return`lang.requireInitialized(${e})`}const Q={uninitialized:X,requireInitialized(e){if(e===X)throw new m(`InvalidIdentifier`,null);return e},isNumber(e){return A(e)},isArray(e){return k(e)},isImmutableArray(e){return ae(e)},isDictionaryLike(e){return le(e)},isString(e){return j(e)},isDictionary(e){return ce(e)},isGeometry(e){return se(e)},getGeometryKeys(e){return f(e)},getGeometryMember(e,t){return d(e,t)},error(e){throw new m(e,null)},__awaiter(e,t,n,r){let i=r.apply(e,t||[]),a=i.next();for(;!a.done&&!E(a.value);)a=i.next(a.value);return a.done?a.value:new Promise((e,t)=>{function n(r){for(;!r.done;){if(E(r.value)){Promise.resolve(r.value).then(e=>{try{n(i.next(e))}catch(e){t(e)}},e=>{try{n(i.throw(e))}catch(e){t(e)}});return}try{r=i.next(r.value)}catch(e){t(e);return}}e(r.value)}n(a)})},functionDepthchecker(e,t){return function(){if(t.depthCounter.depth++,t.localStack.push({}),t.depthCounter.depth>64)throw new m(`MaximumCallDepth`,null);let n=e.apply(this,arguments);return E(n)?n.then(e=>(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,e)):(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,n)}},mustBoolean(e){if(e===!0||e===!1)return e;throw new m(`BooleanConditionRequired`,null)},castString(e){return S(e)},aCheck(e,t){if(b(e))throw t===`ArrayExpression`?new m(`NoFunctionInArray`,null):t===`ObjectExpression`?new m(`NoFunctionInDictionary`,null):new m(`NoFunctionInTemplateLiteral`,null);return e===C?null:e},Dictionary:p,Feature:g,UserDefinedCompiledFunction:R,dictionary(e){let t=Object.create(null),n=new Map;for(let r=0;r<e.length;r+=2){if(b(e[r+1]))throw new m(`NoFunctionInDictionary`,null);if(j(e[r])===!1)throw new m(`KeyMustBeString`,null);let i=e[r].toString(),a=i.toLowerCase();n.has(a)?i=n.get(a):n.set(a,i),e[r+1]===C?t[i]=null:t[i]=e[r+1]}let r=new p(t);return r.immutable=!1,r},entry(e,t){return p.containerEntry(e,t)},strCheck(e){if(j(e)===!1)throw new m(`KeyMustBeString`,null);return e},unary(e,t){if(M(e)){if(t===`!`)return!e;if(t===`-`)return-1*x(e);if(t===`+`)return 1*x(e);if(t===`~`)return~x(e);throw new m(`UnsupportUnaryOperator`,null)}if(t===`-`)return-1*x(e);if(t===`+`)return 1*x(e);if(t===`~`)return~x(e);throw new m(`UnsupportUnaryOperator`,null)},logicalCheck(e){if(M(e)===!1)throw new m(`LogicExpressionOrAnd`,null);return e},logical(e,t,n){if(M(e)&&M(t))switch(n){case`||`:return e||t;case`&&`:return e&&t;default:throw new m(`LogicExpressionOrAnd`,null)}throw new m(`LogicExpressionOrAnd`,null)},binary(e,t,n){switch(n){case`|`:case`<<`:case`>>`:case`>>>`:case`^`:case`&`:return oe(x(e),x(t),n);case`==`:return T(e,t);case`!=`:return!T(e,t);case`<`:return w(e,t,n);case`>`:return w(e,t,n);case`<=`:return w(e,t,n);case`>=`:return w(e,t,n);case`+`:return j(e)||j(t)?S(e)+S(t):x(e)+x(t);case`-`:return x(e)-x(t);case`*`:return x(e)*x(t);case`/`:return x(e)/x(t);case`%`:return x(e)%x(t);default:throw new m(`UnsupportedOperator`,null)}},assign(e,t,n){switch(t){case`=`:return e===C?null:e;case`/=`:return x(n)/x(e);case`*=`:return x(n)*x(e);case`-=`:return x(n)-x(e);case`+=`:return j(n)||j(e)?S(n)+S(e):x(n)+x(e);case`%=`:return x(n)%x(e);default:throw new m(`UnsupportedOperator`,null)}},update(e,t,n,r){let i=this.requireInitialized(e[t]),a=x(i)+(n?1:-1);return e[t]=a,r?a:i},createFeature(e,t,n){return g.createFromGraphicLikeObject(e.geometry,e.attributes,t,n.timeZone)},memberupdate(e,t,n,r){return u(e,t,n,r)},assignmember(e,t,n,r){if(k(e)){if(A(t)){if(t<0&&(t=e.length+t),t<0||t>e.length)throw new m(`OutOfBounds`,null);if(t===e.length){if(n!==`=`)throw new m(`OutOfBounds`,null);e[t]=this.assign(r,n,e[t])}else e[t]=this.assign(r,n,e[t])}else throw new m(`ArrayAccessMustBeNumber`,null)}else if(e instanceof p){if(j(t)===!1)throw new m(`KeyAccessorMustBeString`,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else if(n!==`=`)throw new m(`FieldNotFound`,null,{key:t});else e.setField(t,this.assign(r,n,null))}else if(ie(e)){if(j(t)===!1)throw new m(`KeyAccessorMustBeString`,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else if(n!==`=`)throw new m(`FieldNotFound`,null,{key:t});else e.setField(t,this.assign(r,n,null))}else if(ae(e))throw new m(`Immutable`,null);else if(e instanceof $){if(j(t)===!1)throw new m(`ModuleAccessorMustBeString`,null);if(e.hasGlobal(t))e.setGlobal(t,this.assign(r,n,e.global(t)));else throw new m(`ModuleExportNotFound`,null)}else throw new m(`InvalidIdentifier`,null)},member(e,t){return l(e,t)},tryMember(e,t){return c(e,t)},callfunc(e,t,n){if(b(e))return e.call(n,{arguments:t,preparsed:!0});throw new m(`CallNonFunction`,null)},loadModule(e,t){let n=t.moduleFactoryMap[e];if(t.moduleSingletons[n])return t.moduleSingletons[n];let r=t.moduleFactory[n]({moduleSingletons:t.moduleSingletons,depthCounter:t.depthCounter,lrucache:t.lrucache,interceptor:t.interceptor,services:t.services,console:t.console,abortSignal:t.abortSignal,timeZone:t.timeZone??null,spatialReference:t.spatialReference});return t.moduleSingletons[n]=r,r},getNestedOptionalValue(e,t){return s(e,t)}};function ct(e){console.log(e)}function lt(n,i,a=!1){let o=null;n.usesModules&&(o=new r(null,n.loadedModules));let s=Object.create(null),c=new Set(Object.keys(i?.vars||{}).map(t=>e(t))),l=new Set(Object.keys(i?.customfunctions||{}).map(t=>e(t))),u=Te(n,a?J.provided:q.provided,c.union(l),a,o,s),d;d=a?[`var runtimeCtx = this.prepare(context, true);`,`var lc = this.lc;`,`var lang = this.lang;`,`var gscope = runtimeCtx.globalScope;`,`return lang.__awaiter(this, void 0, void 0, function* () {`,` function mainBody() {`,` return lang.__awaiter(this, void 0, void 0, function* () {`,` ${u.body}`,` });`,` }`,` return this.postProcess(yield mainBody());`,`});`].join(`
|
|
126
126
|
`):[`var runtimeCtx = this.prepare(context, false);`,`var lc = this.lc;`,`var lang = this.lang;`,`var gscope = runtimeCtx.globalScope;`,`function mainBody() {`,` ${u.body}`,`}`,`return this.postProcess(mainBody());`].join(`
|
|
127
127
|
`);let{symbolMetadata:f,moduleFactoryMap:p}=u,h={lc:ne,lang:Q,postProcess(e){if(re(e))return null;if(b(e))throw new m(`IllegalResult`,null);return e},prepare(e,n){let r=e.spatialReference??O.WebMercator,i=n?new J:new q;for(let t of l)i[t]=e.customfunctions==null||!(t in e.customfunctions)?X:e.customfunctions[t]??null;for(let t of c){if(e.vars==null||!(t in e.vars)){t in i||(i[t]=X);continue}let n=e.vars[t]??null;i[t]=Ce(n)?g.createFromGraphic(n,e.timeZone??null):n}return{lrucache:e.lrucache,interceptor:e.interceptor,services:e.services,console:e.console??ct,abortSignal:e.abortSignal??t,timeZone:e.timeZone??null,spatialReference:r,track:e.track,globalScope:i,localStack:[],depthCounter:{depth:1},symbolMetadata:f,moduleFactory:s,moduleFactoryMap:p,moduleSingletons:Object.create(null)}}};return Function(`context`,d).bind(h)}async function ut(){return Y([await import(`./functions/geomasync.js`)],`async`),!0}class $ extends n{constructor(e){super(),this.moduleContext=e}hasGlobal(t){let n=this.moduleContext.symbolMetadata.exports;return n.has(t)||n.has(e(t))}setGlobal(t,n){if(b(n))throw new m(`AssignModuleFunction`,null);let r=this.moduleContext.symbolMetadata.globals.get(e(t));if(r==null)throw new m(`ModuleExportNotFound`,null);this.moduleContext.globalScope[r]=n}global(t){let n=this.moduleContext.symbolMetadata.globals.get(e(t));if(n==null)throw new m(`ModuleExportNotFound`,null);let r=this.moduleContext.globalScope,i=Q.requireInitialized(r[n]);if(b(i)&&!(i instanceof v)){let e=new v;return e.fn=i,e.parameterEvaluator=z,e.context=this.moduleContext,r[n]=e,e}return i}}function dt(e,n,i){let a=new r(null,e.loadedModules),o=Te(e,i?J.provided:q.provided,new Set,i,a,n),s;s=i?[`var runtimeCtx = this.prepare(context, true);`,`var lc = this.lc;`,`var lang = this.lang;`,`var gscope = runtimeCtx.globalScope;`,`return lang.__awaiter(this, void 0, void 0, function* () {`,` function mainBody() {`,` return lang.__awaiter(this, void 0, void 0, function* () {`,` ${o.body}`,` });`,` }`,` yield mainBody();`,` return this.prepareModule(runtimeCtx);`,`});`].join(`
|
|
128
128
|
`):[`var runtimeCtx = this.prepare(context, false);`,`var lc = this.lc;`,`var lang = this.lang;`,`var gscope = runtimeCtx.globalScope;`,`function mainBody() {`,` ${o.body}`,`}`,`mainBody();`,`return this.prepareModule(runtimeCtx);`].join(`
|