@arcgis/core 6.0.0-next.14 → 6.0.0-next.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/LineOfSightAnalysis.d.ts +49 -32
- package/analysis/LineOfSightAnalysisObserver.d.ts +19 -3
- package/analysis/LineOfSightAnalysisTarget.d.ts +19 -3
- package/analysis/Viewshed.d.ts +23 -3
- package/analysis/ViewshedAnalysis.d.ts +33 -13
- package/arcade/geometry/operatorsWorkerConnection.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00d66e3fba5ab4d2aa3c.js +1 -0
- package/assets/esri/core/workers/chunks/{d994bcf0a65d1c07160f.js → 0320cbd825f9a4222042.js} +1 -1
- package/assets/esri/core/workers/chunks/08fe248e412bb170210d.js +1 -0
- package/assets/esri/core/workers/chunks/{fb444954be74c1962ced.js → 10d80e793019dfb45ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/14d5d219e7fe017f23f0.js +1 -0
- package/assets/esri/core/workers/chunks/164e74d586297946a717.js +1 -0
- package/assets/esri/core/workers/chunks/{1bca39e0e651426bdbb5.js → 1b1d3f6916d2cb751435.js} +1 -1
- package/assets/esri/core/workers/chunks/{ed6e9d7f71bfd2691717.js → 1c77de1e79860f8d2228.js} +1 -1
- package/assets/esri/core/workers/chunks/1e40a26dcce4d1dadc28.js +1 -0
- package/assets/esri/core/workers/chunks/237a1f68a0efbfe5b77c.js +1 -0
- package/assets/esri/core/workers/chunks/23c43f09c4a4749516e1.js +1 -0
- package/assets/esri/core/workers/chunks/{3418877328f4f0830300.js → 24dac4970526a4e0ae63.js} +1 -1
- package/assets/esri/core/workers/chunks/26ceb0ff8d93dbb9b84f.js +1 -0
- package/assets/esri/core/workers/chunks/2acf2952cef69e382a35.js +1 -0
- package/assets/esri/core/workers/chunks/{481589c3eddad6e026ad.js → 369780276b2755361f7d.js} +1 -1
- package/assets/esri/core/workers/chunks/{4df6cb1bee5d0720a43e.js → 36cbd614454581aaf334.js} +1 -1
- package/assets/esri/core/workers/chunks/{1e0d2715d603f48a7e0b.js → 370aad23df597db80d65.js} +1 -1
- package/assets/esri/core/workers/chunks/3baa4a9c52f41bfd6abb.js +1 -0
- package/assets/esri/core/workers/chunks/42d44c7d532df5ee70e9.js +1 -0
- package/assets/esri/core/workers/chunks/42e985a576d7aaeed0cf.js +1 -0
- package/assets/esri/core/workers/chunks/{6400446b7615b97c3521.js → 45f826554499c38968c6.js} +1 -1
- package/assets/esri/core/workers/chunks/48cc58890fddbcf69cef.js +1 -0
- package/assets/esri/core/workers/chunks/494bd434fee9032e1d02.js +1 -0
- package/assets/esri/core/workers/chunks/{33e4ff228a8c81b99022.js → 4abd3753cd9b80e4d937.js} +1 -1
- package/assets/esri/core/workers/chunks/4bbe1f28f5f16a6bef05.js +1 -0
- package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +1 -0
- package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +1 -0
- package/assets/esri/core/workers/chunks/5529831dd891382c79df.js +1 -0
- package/assets/esri/core/workers/chunks/5736feefa261589b6273.js +1 -0
- package/assets/esri/core/workers/chunks/576248e9ae2654569420.js +1 -0
- package/assets/esri/core/workers/chunks/5acb422fe3cf693d9d4f.js +1 -0
- package/assets/esri/core/workers/chunks/{aeaaff7a4b1a99540f52.js → 5cb26bbaa08114aec5ce.js} +1 -1
- package/assets/esri/core/workers/chunks/661c6324529dd17b297e.js +1 -0
- package/assets/esri/core/workers/chunks/68dd1fd2025c7125ead1.js +1 -0
- package/assets/esri/core/workers/chunks/{89e76de5ae3328d821a4.js → 69f6d5997b8ff1326e39.js} +1 -1
- package/assets/esri/core/workers/chunks/6a8dd8b18b0b825b0c1b.js +1 -0
- package/assets/esri/core/workers/chunks/{a40b6d8b5c73e06e14d4.js → 6c255c029d67423e4dac.js} +1 -1
- package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +1 -0
- package/assets/esri/core/workers/chunks/{688f2dbf784e66082308.js → 74c866e0b66e61751861.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ffda5bf0b91700dc308.js → 78643f116677950ea29a.js} +1 -1
- package/assets/esri/core/workers/chunks/{916b363c342b61ba5461.js → 787c1a8bda7d745633f2.js} +1 -1
- package/assets/esri/core/workers/chunks/7b5f3c79e0605c32b267.js +1 -0
- package/assets/esri/core/workers/chunks/7bbfe9ff352afc566367.js +1 -0
- package/assets/esri/core/workers/chunks/{ac5a6603f7fa78d3e4c8.js → 7e8611cb709f105946f5.js} +1 -1
- package/assets/esri/core/workers/chunks/{05cd33d41d91f8d09633.js → 7fb7493f483cd9878bfa.js} +1 -1
- package/assets/esri/core/workers/chunks/{acfa03c65ba3ca6c5685.js → 8715661a838361d4211a.js} +1 -1
- package/assets/esri/core/workers/chunks/{601e1d020b8115497944.js → 8a485130781b49dbf608.js} +1 -1
- package/assets/esri/core/workers/chunks/{0ccab50877b24f862d6e.js → 8ac2098ecdc40ad41055.js} +1 -1
- package/assets/esri/core/workers/chunks/{a655ebdb4bf0660615a2.js → 8b4e9fd88c0c313416d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e544de61f07ca660236.js → 8c12269d26f5a4c753cb.js} +1 -1
- package/assets/esri/core/workers/chunks/8e19629899a5becf8e19.js +1 -0
- package/assets/esri/core/workers/chunks/91dd65cf877c8f2e01a7.js +1 -0
- package/assets/esri/core/workers/chunks/{46b4fb6a7fe4877b0efc.js → 94baa354e50c03b82b25.js} +2 -2
- package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +1 -0
- package/assets/esri/core/workers/chunks/{68be3fb88ca61f82fb90.js → 95dbbddac6581b9d671f.js} +1 -1
- package/assets/esri/core/workers/chunks/98be2f621801e230aa01.js +1 -0
- package/assets/esri/core/workers/chunks/9b051745d24d1f43480b.js +1 -0
- package/assets/esri/core/workers/chunks/9d61740ef8bdcc162be1.js +1 -0
- package/assets/esri/core/workers/chunks/{eb04e1717a1002cda3ab.js → 9f06ec95bdf0d0b52b41.js} +1 -1
- package/assets/esri/core/workers/chunks/{fafb92ca2c5e4b0b2c23.js → a09d2e1e2540921e4717.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b3e519f15ed52c83f0c.js → a49fe94933b65b4b64f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{1819c45655c836b9a8d7.js → a4d3944700f1cc240176.js} +1 -1
- package/assets/esri/core/workers/chunks/{90bdf86f553e2742d67c.js → a7bd5ba4d7d97411fd33.js} +1 -1
- package/assets/esri/core/workers/chunks/{900181f68449d8f82eeb.js → aa1ac7954e4f0fefe15b.js} +1 -1
- package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +1 -0
- package/assets/esri/core/workers/chunks/{b8337492e2b753aefac4.js → ace41659a5ca0e5abfc3.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c0ed15b544df6fb0903.js → b48952e1fb4cb7360dd0.js} +1 -1
- package/assets/esri/core/workers/chunks/b5e7475cc5fbf31289d3.js +1 -0
- package/assets/esri/core/workers/chunks/{f3da30d7300b92bd8bb0.js → befa32b9e7b3fbdd431e.js} +1 -1
- package/assets/esri/core/workers/chunks/{0f617980c7dd9ad0444f.js → bf35927979fc5e7e0478.js} +1 -1
- package/assets/esri/core/workers/chunks/c4ddac23bd649d24f3f2.js +1 -0
- package/assets/esri/core/workers/chunks/{4e6f40cbdb8c508e6df1.js → c5a9e77977e867a75ff2.js} +1 -1
- package/assets/esri/core/workers/chunks/{25f19fc929f25ddd628c.js → c79934cd6883307203f8.js} +1 -1
- package/assets/esri/core/workers/chunks/cddc3e285f763ccf33c2.js +1 -0
- package/assets/esri/core/workers/chunks/d08ff41e2a9bcd58b64a.js +1 -0
- package/assets/esri/core/workers/chunks/d311ff96a5a2791d8cfc.js +1 -0
- package/assets/esri/core/workers/chunks/d62afb71f4ece4283994.js +1 -0
- package/assets/esri/core/workers/chunks/dc1761cba0454fda3cf9.js +1 -0
- package/assets/esri/core/workers/chunks/{4ac1d3e49e242e373a92.js → e0650b1408197d3ac862.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ff6d1ed3c0f1285f3e7.js → e0d9dc97985561320bd4.js} +1 -1
- package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +1 -0
- package/assets/esri/core/workers/chunks/eb2652ec48faa78de3c5.js +1 -0
- package/assets/esri/core/workers/chunks/eca44e53bcee9b08d70a.js +1 -0
- package/assets/esri/core/workers/chunks/f00458654c7c34c369ef.js +1 -0
- package/assets/esri/core/workers/chunks/f3cd610084e3f4d8656b.js +1 -0
- package/assets/esri/core/workers/chunks/f47fe4433b05fca5c3ad.js +1 -0
- package/assets/esri/core/workers/chunks/f7bfa3d33b05b250ce33.js +1 -0
- package/assets/esri/core/workers/chunks/f91bc1cb1014e05be763.js +1 -0
- package/assets/esri/core/workers/chunks/{aadfe34a99c9ec7a0e11.js → f9c5aa0bbf23e780fecc.js} +1 -1
- package/assets/esri/core/workers/chunks/f9ff27cfcf0538ac5e26.js +1 -0
- package/assets/esri/core/workers/chunks/{19676b2c5f8b0a5ee680.js → facd1ff23203fed67686.js} +1 -1
- package/assets/esri/core/workers/chunks/{40a584cb952e94326e9e.js → fcb86d24fc7e0666b564.js} +1 -1
- package/assets/esri/libs/pdfjs/wasm/openjpeg_nowasm_fallback.js +1 -0
- package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/basis_encoder.js +1 -1
- package/chunks/basis_transcoder.js +1 -1
- package/chunks/index.js +1 -1
- package/chunks/lclayout.js +1 -1
- package/config.d.ts +2 -0
- package/config.js +1 -1
- package/core/ObjectPool.js +1 -1
- package/core/PooledArray.js +1 -1
- package/core/accessorSupport/DefaultsStore.js +1 -1
- package/core/accessorSupport/MultiOriginStore.js +1 -1
- package/core/accessorSupport/Store.js +1 -1
- package/core/accessorSupport/decorators/reader.js +1 -1
- package/core/accessorSupport/decorators/writer.js +1 -1
- package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
- package/core/workers/WorkerOwner.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/core/workers/workers.js +2 -2
- package/core/workers.d.ts +9 -0
- package/form/elements/inputs/DynamicChoiceInput.d.ts +4 -2
- package/geometry/Mesh.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/buffer/BufferPool.js +1 -1
- package/geometry/support/coordsUtils.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils.d.ts +5 -6
- package/geometry/support/polygonExtentClipping.js +1 -1
- package/identity/Credential.js +1 -1
- package/interfaces.d.ts +18 -9
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +2 -2
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/CatalogLayer.d.ts +2 -2
- package/layers/CatalogLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +2 -2
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +4 -4
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeospatialPDFLayer.d.ts +154 -4
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/Layer.d.ts +2 -0
- package/layers/LineOfSightLayer.d.ts +10 -8
- package/layers/SceneLayer.js +1 -1
- package/layers/SubtypeGroupLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/ViewshedLayer.d.ts +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +9 -9
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
- package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/{FeatureLayerReload.d.ts → ReloadableLayer.d.ts} +5 -3
- package/layers/mixins/ReloadableLayer.js +2 -0
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +2 -2
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/datasets/InMemoryRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/datasets/WCSRaster.js +1 -1
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/TiffDecoder.js +1 -1
- package/layers/raster/formats/Zlib.js +1 -1
- package/layers/raster/functions/stretchUtils.js +1 -1
- package/layers/raster/functions/vectorFieldUtils.js +1 -1
- package/layers/support/FieldsIndex.js +1 -1
- package/layers/support/LabelClass.d.ts +3 -2
- package/layers/support/PortalItemData.d.ts +31 -8
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/featureReductionProperties.js +1 -1
- package/layers/support/kmlUtils.js +1 -1
- package/layers/support/types.d.ts +4 -1
- package/layers/video/VideoController.js +10 -10
- package/libs/maquette/projection.js +1 -1
- package/networks/UtilityNetworkTraceAnalysis.js +1 -1
- package/package.json +5 -5
- package/popup/FeatureModel.js +1 -1
- package/popup/FeaturesModel.js +1 -1
- package/portal/Portal.js +1 -1
- package/request/process.js +1 -1
- package/request/types.d.ts +7 -0
- package/rest/knowledgeGraph/ObjectValue.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/trace.js +1 -1
- package/rest/query/executeQuery.js +1 -1
- package/smartMapping/raster/renderers/shadedRelief.js +1 -1
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/smartMapping/support/clusterUtils.js +1 -1
- package/statistics/utils.js +1 -1
- package/symbols/cim/CIMCursor.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/support/ElevationInfo.d.ts +4 -3
- package/undoredo/support/Services.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +2 -2
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/grid/GridView2D.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeaturePagedTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureSnapshotLoadStrategy.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
- package/views/3d/analysis/LineOfSight/{LineOfSightRootPlugin.js → LineOfSightPlacementRootPlugin.js} +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/types.d.ts +14 -3
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +39 -13
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/types.d.ts +7 -0
- package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +43 -15
- package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
- package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/SpatialIndex2D.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DDebugger.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/sphereExtentUtils.js +2 -0
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccluded.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/draw/support/editingSessionUtils.js +1 -1
- package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
- package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
- package/views/interactive/options/TooltipOptions.d.ts +2 -0
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +2 -0
- package/views/interactive/sketch/constraintUtils.js +1 -1
- package/views/interactive/snapping/SnappingDragPipelineStep.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +35 -13
- package/views/layers/SketchLayerView.d.ts +1 -0
- package/views/layers/ViewshedLayerView.d.ts +36 -12
- package/views/webgl/Program.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +10 -1
- package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor.d.ts +10 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable/support/GroupColumnTemplate.js +1 -1
- package/widgets/FeatureTable/support/TableTemplate.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +2 -2
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Legend.d.ts +1 -0
- package/widgets/Print.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.d.ts +5 -2
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js +1 -1
- package/widgets/ValuePicker/ValuePickerBaseComponent.d.ts +5 -1
- package/widgets/ValuePicker/ValuePickerCollection.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerCombobox.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerLabel.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerSlider.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerSliderVisibleElements.d.ts +5 -1
- package/widgets/ValuePicker/ValuePickerVisibleElements.d.ts +5 -1
- package/widgets/ValuePicker/types.d.ts +2 -0
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/componentsUtils.js +1 -1
- package/assets/esri/core/workers/chunks/024b44c0c8876627f904.js +0 -1
- package/assets/esri/core/workers/chunks/02c5d027bdaee67869cf.js +0 -1
- package/assets/esri/core/workers/chunks/03261b9451e293a0fac8.js +0 -1
- package/assets/esri/core/workers/chunks/037a8cc19debbaaa4e10.js +0 -1
- package/assets/esri/core/workers/chunks/0c8c01097847617261b9.js +0 -1
- package/assets/esri/core/workers/chunks/0d931c7579b6409a696d.js +0 -1
- package/assets/esri/core/workers/chunks/12c154342fff876f2f1e.js +0 -1
- package/assets/esri/core/workers/chunks/1c65ab9ed611c322ce27.js +0 -1
- package/assets/esri/core/workers/chunks/1e11d2e97d17685b878a.js +0 -1
- package/assets/esri/core/workers/chunks/1f339247b68b061ab0a4.js +0 -1
- package/assets/esri/core/workers/chunks/21ddb26526bcb2b122c3.js +0 -1
- package/assets/esri/core/workers/chunks/22e8c0aad2fe75943865.js +0 -1
- package/assets/esri/core/workers/chunks/2eae542fe7f0f6576ac1.js +0 -1
- package/assets/esri/core/workers/chunks/408e81c8f1eff8a7b379.js +0 -1
- package/assets/esri/core/workers/chunks/444e5f214abce3d607cd.js +0 -1
- package/assets/esri/core/workers/chunks/46a7da93a63663878583.js +0 -1
- package/assets/esri/core/workers/chunks/4a1e23e021bac37a88ab.js +0 -1
- package/assets/esri/core/workers/chunks/4c4117e28ea358a32088.js +0 -1
- package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +0 -1
- package/assets/esri/core/workers/chunks/59b216b60464611742d4.js +0 -1
- package/assets/esri/core/workers/chunks/5bfea0c55aca826de536.js +0 -1
- package/assets/esri/core/workers/chunks/62ac588f7dd1d24d0c9d.js +0 -1
- package/assets/esri/core/workers/chunks/62c8c9ad09e0166207fd.js +0 -1
- package/assets/esri/core/workers/chunks/62d6e101e9bd9557a410.js +0 -1
- package/assets/esri/core/workers/chunks/6558488ea96620439f34.js +0 -1
- package/assets/esri/core/workers/chunks/665e31c494d2af505acc.js +0 -1
- package/assets/esri/core/workers/chunks/6f4e6022a52de0c54aab.js +0 -1
- package/assets/esri/core/workers/chunks/7267b17de212207142c9.js +0 -1
- package/assets/esri/core/workers/chunks/7ef182e24cad50815b4e.js +0 -1
- package/assets/esri/core/workers/chunks/8293600f94553afc8c38.js +0 -1
- package/assets/esri/core/workers/chunks/8431ca60ad33d594e323.js +0 -1
- package/assets/esri/core/workers/chunks/876f7633c15f1e31078d.js +0 -1
- package/assets/esri/core/workers/chunks/8ca9648eacb894283513.js +0 -1
- package/assets/esri/core/workers/chunks/91ebb2ccab1889eb7e81.js +0 -1
- package/assets/esri/core/workers/chunks/9ce91a909eccc4dfe388.js +0 -1
- package/assets/esri/core/workers/chunks/9e1a3b6a08c96dcefdde.js +0 -1
- package/assets/esri/core/workers/chunks/9e3e442a9874ed23a043.js +0 -1
- package/assets/esri/core/workers/chunks/ad76f7ab2f3e6d5a5b3c.js +0 -1
- package/assets/esri/core/workers/chunks/aff32980d91dab07dfb7.js +0 -1
- package/assets/esri/core/workers/chunks/bbf993dba74850bbf9d7.js +0 -1
- package/assets/esri/core/workers/chunks/d8f1cefcad02d7353d4b.js +0 -1
- package/assets/esri/core/workers/chunks/d938987344bce83cc660.js +0 -1
- package/assets/esri/core/workers/chunks/ddf0671976648f621269.js +0 -1
- package/assets/esri/core/workers/chunks/de02f60258e6985ef676.js +0 -1
- package/assets/esri/core/workers/chunks/e10b57aefcc89671116e.js +0 -1
- package/assets/esri/core/workers/chunks/e65dfa19f030ec298437.js +0 -1
- package/assets/esri/core/workers/chunks/f122c18af10e56f9ec2b.js +0 -1
- package/assets/esri/core/workers/chunks/f92364afaefbac7e8f77.js +0 -1
- package/assets/esri/core/workers/chunks/fd9663952d5a94f3a83f.js +0 -1
- package/assets/esri/core/workers/chunks/fe9879ecd69ac4329291.js +0 -1
- package/layers/mixins/FeatureLayerReload.js +0 -2
- /package/views/3d/analysis/LineOfSight/{lineOfSightPlacementUtils.js → placementUtils.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{abortMaybe as e,removeMaybe as t}from"../../../core/maybe.js";import{ignoreAbortErrors as n,debounce as r}from"../../../core/promiseUtils.js";import{watch as i}from"../../../core/reactiveUtils.js";import{pointEquals as a}from"../../../layers/graphics/dehydratedFeatureComparison.js";import{clonePoint as o}from"../../../layers/graphics/hydratedFeatures.js";import{absoluteHeightElevationInfo as s}from"../../../support/elevationInfoUtils.js";import{EventPipeline as c}from"../dragEventPipeline.js";import{SnappingContext as l}from"./SnappingContext.js";import{ImmediateTask as u,TaskPriority as d}from"../../support/Scheduler.js";function f({predicate:r=()=>!0,snappingManager:a,snappingContext:o,updatingHandles:l,useZ:u=!0}){let d=new c;if(a==null)return{snappingStep:[x,d],cancelSnapping:x};let f=null,S=null,C,w=null,T=()=>{f=e(f),a.doneSnapping(),S?.frameTask.remove(),S=null,C=t(C),w=null},E=p(a,u,d),D=null,O=null,k=null;return{snappingStep:[e=>{if(!r(e))return e;let{action:t}=e;if(t===`start`){let{info:t}=e;if(S=h(o,e,m(a.view)),S.context.selfSnappingZ=null,!u&&t!=null){let e=b(o.coordinateHelper,t.handle.part);e!=null&&(S.context.selfSnappingZ={value:e,elevationInfo:o.elevationInfo??s})}}if(S!=null){let{context:r,originalScenePos:o,originalPos:s}=S,{mapEnd:c,mapStart:d,scenePoints:p}=e,m=g(s,v(c,d)),h=v(d,s),b={...e,action:`update`},x=S.context,T=_(o,p),A=a.update({point:m,scenePoint:T,context:r});if(k=A,y(c,A,h,u),D=m,O=T,t!==`end`){let{frameTask:e}=S;f??=new AbortController,w=t=>{l.consumePromise(n(E({frameTask:e,event:b,context:x,point:m,scenePoint:T,delta:h,getLastState:()=>({point:D,scenePoint:O,updatePoint:t.forceUpdate?null:k})},f.signal)))},w({forceUpdate:!1}),C??=i(()=>a.options.effectiveEnabled,()=>w?.({forceUpdate:!0}))}}return t===`end`&&T(),e},d],cancelSnapping:e=>(T(),e)}}function p(e,t,n){return r(async({frameTask:r,point:i,scenePoint:o,context:s,event:c,delta:l,getLastState:u},d)=>{let f=await r.schedule(()=>e.snap({point:i,scenePoint:o,context:s,signal:d}),d);if(f.valid){let o=await r.schedule(()=>f.apply(),d),p=u();p.point!=null&&i!==p.point&&(o=e.update({point:p.point,scenePoint:p.scenePoint,context:s})),
|
|
2
|
+
import{abortMaybe as e,removeMaybe as t}from"../../../core/maybe.js";import{ignoreAbortErrors as n,debounce as r}from"../../../core/promiseUtils.js";import{watch as i}from"../../../core/reactiveUtils.js";import{pointEquals as a}from"../../../layers/graphics/dehydratedFeatureComparison.js";import{clonePoint as o}from"../../../layers/graphics/hydratedFeatures.js";import{absoluteHeightElevationInfo as s}from"../../../support/elevationInfoUtils.js";import{EventPipeline as c}from"../dragEventPipeline.js";import{SnappingContext as l}from"./SnappingContext.js";import{ImmediateTask as u,TaskPriority as d}from"../../support/Scheduler.js";function f({predicate:r=()=>!0,snappingManager:a,snappingContext:o,updatingHandles:l,useZ:u=!0}){let d=new c;if(a==null)return{snappingStep:[x,d],cancelSnapping:x};let f=null,S=null,C,w=null,T=()=>{f=e(f),a.doneSnapping(),S?.frameTask.remove(),S=null,C=t(C),w=null},E=p(a,u,d),D=null,O=null,k=null;return{snappingStep:[e=>{if(!r(e))return e;let{action:t}=e;if(t===`start`){let{info:t}=e;if(S=h(o,e,m(a.view)),S.context.selfSnappingZ=null,!u&&t!=null){let e=b(o.coordinateHelper,t.handle.part);e!=null&&(S.context.selfSnappingZ={value:e,elevationInfo:o.elevationInfo??s})}}if(S!=null){let{context:r,originalScenePos:o,originalPos:s}=S,{mapEnd:c,mapStart:d,scenePoints:p}=e,m=g(s,v(c,d)),h=v(d,s),b={...e,action:`update`},x=S.context,T=_(o,p),A=a.update({point:m,scenePoint:T,context:r});if(k=A,y(c,A,h,u),D=m,O=T,t!==`end`){let{frameTask:e}=S;f??=new AbortController,w=t=>{l.consumePromise(n(E({frameTask:e,event:b,context:x,point:m,scenePoint:T,delta:h,getLastState:()=>({point:D,scenePoint:O,updatePoint:t.forceUpdate?null:k})},f.signal)))},w({forceUpdate:!1}),C??=i(()=>a.options.effectiveEnabled,()=>w?.({forceUpdate:!0}))}}return t===`end`&&T(),e},d],cancelSnapping:e=>(T(),e)}}function p(e,t,n){return r(async({frameTask:r,point:i,scenePoint:o,context:s,event:c,delta:l,getLastState:u},d)=>{let f=await r.schedule(()=>e.snap({point:i,scenePoint:o,context:s,signal:d}),d);if(f.valid){let o=await r.schedule(()=>f.apply(),d),p=u();p.point!=null&&i!==p.point&&(o=e.update({point:p.point,scenePoint:p.scenePoint,context:s})),p.updatePoint!=null&&a(o,p.updatePoint)||(y(c.mapEnd,o,l,t),n.execute(c))}})}function m(e){return e.type===`3d`?e.resourceController.scheduler.registerTask(d.SNAPPING):u}function h(e,t,n){return{context:new l({editGeometryOperations:e.editGeometryOperations,elevationInfo:e.elevationInfo,pointer:e.pointer,vertexHandle:t.info==null?null:t.info.handle,excludeFeature:e.excludeFeature,feature:e.feature,visualizer:e.visualizer}),originalPos:t.snapOrigin==null?t.mapStart:e.coordinateHelper.vectorToDehydratedPoint(t.snapOrigin),originalScenePos:t.scenePoints==null?null:t.scenePoints.sceneStart,frameTask:n}}function g(e,[t,n,r]){let i=o(e);return i.x+=t,i.y+=n,i.hasZ&&(i.z+=r),i}function _(e,t){return e==null||t==null?null:g(e,v(t.sceneEnd,t.sceneStart))}function v(e,t){let n=e.hasZ&&t.hasZ?e.z-t.z:0;return[e.x-t.x,e.y-t.y,n]}function y(e,t,[n,r,i],a){e.x=t.x+n,e.y=t.y+r,a&&e.hasZ&&t.hasZ&&(e.z=t.z+i)}function b(e,t){if(!e.hasZ())return null;let n=t.vertices,r=null;for(let t of n){let n=e.getZ(t.pos);if(r!=null&&n!=null&&Math.abs(n-r)>1e-6)return null;r??=n}return r}function x(e){return e}export{f as createSnapDragEventPipelineStep};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{waitAnimationFrame as n}from"../../../../core/scheduling.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{tooltipKeys as a}from"../../keybindings.js";import{notAvailableString as o}from"../constants.js";import{base as s}from"../css.js";import{ElevationModeSelect as c}from"./ElevationModeSelect.js";import l from"../../../../widgets/Widget.js";import{loadCalciteComponents as u}from"../../../../widgets/support/componentsUtils.js";import{tsx as d,tsxFragment as f}from"../../../../widgets/support/widget.js";const p=`${s}-editable-field`,m={base:p,inputMode:`${p}--input`,feedbackMode:`${p}--feedback`,readOnly:`${p}--read-only`,locked:`${p}--locked`,title:`${p}__title`,value:`${p}__value`,valueContent:`${p}__value__content`,valueContentReadOnly:`${p}__value__content--read-only`,lockIcon:`${p}__lock-icon`,input:`${p}__input`,inputWrapper:`${p}__input-wrapper`,inputAction:`${p}__input-action`,inputMessage:`${p}__input-message`,inputSuffix:`${p}__input-suffix`,button:`${p}__button`},h={lock:`lock`,unlock:`unlock`};let g=class extends l{constructor(){super(...arguments),this._input=null,this._lock=null,this._onLockClick=()=>{this.field.toggleLock(this.context)},this._onLockAfterCreate=e=>{this._lock=e},this._onLockAfterRemoved=()=>{this._lock=null},this._onKeyDown=e=>{e.key===a.discard&&this.mode===`input`&&this._input&&this.context.onDiscard(this._input)},this._onInputKeyDown=e=>{let t=this._input;if(t&&e.target===t)switch(e.key){case a.commit:return this.field.onCommit(`commit-and-exit`,t,this.context);case a.next:{e.preventDefault(),e.stopPropagation();let n=e.shiftKey?`commit-and-previous`:`commit-and-next`;return this.field.onCommit(n,t,this.context)}}},this._onInput=e=>{this.field.onInput(e.currentTarget.value)},this._onInputBlur=e=>{let t=this._input;t&&e.relatedTarget!==this._lock&&this.field.onCommit(`commit-on-blur`,t,this.context)},this._selectText=()=>{let e=()=>{(this._input===document.activeElement||this._input===document.activeElement?.shadowRoot?.activeElement)&&this._input?.selectText()};e(),n().then(e)},this._onAfterCreate=e=>{this._input=e,e.addEventListener(`paste`,this._onPaste),e.addEventListener(`beforeinput`,this._onBeforeInput)},this._onAfterRemoved=e=>{e.removeEventListener(`paste`,this._onPaste),e.removeEventListener(`beforeinput`,this._onBeforeInput),this._input===e&&(this._input=null)},this._onPaste=e=>{let t=e.clipboardData?.getData(`text`);t&&this.field.parse(t,this.context)!=null&&(e.stopPropagation(),this.field.onInput(t))},this._onBeforeInput=e=>{
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{waitAnimationFrame as n}from"../../../../core/scheduling.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{tooltipKeys as a}from"../../keybindings.js";import{notAvailableString as o}from"../constants.js";import{base as s}from"../css.js";import{ElevationModeSelect as c}from"./ElevationModeSelect.js";import l from"../../../../widgets/Widget.js";import{loadCalciteComponents as u}from"../../../../widgets/support/componentsUtils.js";import{tsx as d,tsxFragment as f}from"../../../../widgets/support/widget.js";const p=`${s}-editable-field`,m={base:p,inputMode:`${p}--input`,feedbackMode:`${p}--feedback`,readOnly:`${p}--read-only`,locked:`${p}--locked`,title:`${p}__title`,value:`${p}__value`,valueContent:`${p}__value__content`,valueContentReadOnly:`${p}__value__content--read-only`,lockIcon:`${p}__lock-icon`,input:`${p}__input`,inputWrapper:`${p}__input-wrapper`,inputAction:`${p}__input-action`,inputMessage:`${p}__input-message`,inputSuffix:`${p}__input-suffix`,button:`${p}__button`},h={lock:`lock`,unlock:`unlock`};let g=class extends l{constructor(){super(...arguments),this._input=null,this._lock=null,this._onLockClick=()=>{this.field.toggleLock(this.context)},this._onLockAfterCreate=e=>{this._lock=e},this._onLockAfterRemoved=()=>{this._lock=null},this._onKeyDown=e=>{e.key===a.discard&&this.mode===`input`&&this._input&&this.context.onDiscard(this._input)},this._onInputKeyDown=e=>{let t=this._input;if(t&&e.target===t)switch(e.key){case a.commit:return this.field.onCommit(`commit-and-exit`,t,this.context);case a.next:{e.preventDefault(),e.stopPropagation();let n=e.shiftKey?`commit-and-previous`:`commit-and-next`;return this.field.onCommit(n,t,this.context)}}},this._onInput=e=>{this.field.onInput(e.currentTarget.value)},this._onInputBlur=e=>{let t=this._input;t&&e.relatedTarget!==this._lock&&this.field.onCommit(`commit-on-blur`,t,this.context)},this._selectText=()=>{let e=()=>{(this._input===document.activeElement||this._input===document.activeElement?.shadowRoot?.activeElement)&&this._input?.selectText()};e(),n().then(e)},this._onAfterCreate=e=>{this._input=e,e.addEventListener(`paste`,this._onPaste),e.addEventListener(`beforeinput`,this._onBeforeInput)},this._onAfterRemoved=e=>{e.removeEventListener(`paste`,this._onPaste),e.removeEventListener(`beforeinput`,this._onBeforeInput),this._input===e&&(this._input=null)},this._onPaste=e=>{let t=e.clipboardData?.getData(`text`);t&&this.field.parse(t,this.context)!=null&&(e.stopPropagation(),this.field.onInput(t))},this._onBeforeInput=e=>{e.inputType!==`historyUndo`&&e.inputType!==`historyRedo`||this.field.dirty||e.preventDefault()}}initialize(){this.addHandles(t(()=>this._rawDisplayValue,()=>{let{committed:e,inputValue:t}=this.field;!e&&!t&&this._input===document.activeElement&&this._selectText()}))}loadDependencies(){return u({button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),input:()=>import(`@esri/calcite-components/dist/components/calcite-input`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`)})}render(){let{field:e,mode:t}=this,n=t===`input`;return d(`div`,{class:this.classes({[m.base]:!0,[m.feedbackMode]:t===`feedback`,[m.inputMode]:t===`input`,[m.locked]:e.locked,[m.readOnly]:e.readOnly})},d(`div`,{class:m.title,key:`title`},this._title),d(`div`,{class:m.value,key:`value`,onkeydown:this._onKeyDown},n?this._renderValueInputMode():this._renderValueFeedbackMode()))}get _formattedValue(){return this.field.getFormattedValue(this.context)||o}get _rawDisplayValue(){return this.field.getRawDisplayValue(this.context)}get _suffix(){return this.field.getSuffix(this.context)}get _title(){let{title:e}=this.field;return typeof e==`string`?e:e(this.context)}get _messages(){return this.context?.messages.sketch??{}}get _elevationModeSelect(){return this.field.name===`elevation`&&this.context.elevationModeContext&&this.context.toolOptions.tooltips.visibleElements.elevationMode?d(c,{context:this.context,key:`elevation-mode`,mode:this.mode}):null}_renderValueFeedbackMode(){return d(f,null,d(`div`,{class:m.valueContent,key:`value-feedback`},this._formattedValue,this._elevationModeSelect),this.field.locked&&this.mode!==`input`?d(`calcite-icon`,{class:m.lockIcon,icon:h.lock,key:`icon`,scale:`s`}):null)}_renderValueInputMode(){return this.field.readOnly?this._renderValueReadOnly():this._renderValueWritable()}_renderValueReadOnly(){return d(`div`,{class:this.classes(m.valueContent,m.valueContentReadOnly),key:`value-read-only`},this._formattedValue,this._elevationModeSelect)}_renderValueWritable(){let{field:e}=this,t=this._messages,{name:n}=e,r=e.invalid;return d(f,null,d(`div`,{class:m.inputWrapper,key:`value-input`},d(`calcite-input`,{afterCreate:this._onAfterCreate,afterRemoved:this._onAfterRemoved,class:m.input,"data-field-id":e.id,"data-field-name":n,"data-testid":`tooltip-field-${n}`,key:`input`,scale:`s`,status:r?`invalid`:`idle`,type:`text`,value:this._rawDisplayValue??o,onblur:this._onInputBlur,onCalciteInputInput:this._onInput,onfocus:this._selectText,onkeydown:this._onInputKeyDown},this._elevationModeSelect?d(`div`,{class:m.inputAction,slot:`action`},this._elevationModeSelect):null)),d(`div`,{class:m.inputSuffix,key:`suffix`},this._suffix),this._renderedLockButton,r?d(`calcite-notice`,{appearance:`transparent`,class:m.inputMessage,key:`input-message`,kind:`danger`,open:!0,role:`alert`,scale:`s`},d(`span`,{slot:`message`},t.invalidValue)):null)}get _renderedLockButton(){let{lockDisabled:e,locked:t,lockable:n,name:r}=this.field;if(!n)return d(`div`,{key:`no-lock-button`});let i=this._messages,a=t?i.unlockConstraint:i.lockConstraint;return d(`calcite-button`,{afterCreate:this._onLockAfterCreate,afterRemoved:this._onLockAfterRemoved,alignment:`center`,appearance:`transparent`,class:m.button,"data-testid":`tooltip-field-${r}-lock`,disabled:e,iconStart:t?h.lock:h.unlock,key:`lock-button`,kind:`neutral`,label:a,scale:`s`,tabIndex:-1,title:a,onclick:this._onLockClick})}};e([r()],g.prototype,`field`,void 0),e([r()],g.prototype,`context`,void 0),e([r()],g.prototype,`mode`,void 0),e([r()],g.prototype,`_input`,void 0),e([r()],g.prototype,`_lock`,void 0),e([r()],g.prototype,`_formattedValue`,null),e([r()],g.prototype,`_rawDisplayValue`,null),e([r()],g.prototype,`_suffix`,null),e([r()],g.prototype,`_title`,null),e([r()],g.prototype,`_messages`,null),e([r()],g.prototype,`_elevationModeSelect`,null),e([r()],g.prototype,`_renderedLockButton`,null),g=e([i(`esri.views.interactive.tooltip.components.TooltipEditableField`)],g);export{g as TooltipEditableField};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{equals as t}from"../../core/arrayUtils.js";import{createTask as n}from"../../core/asyncUtils.js";import{EventedAccessor as r}from"../../core/Evented.js";import{IdentifiableMixin as i}from"../../core/Identifiable.js";import a from"../../core/Logger.js";import{destroyMaybe as o,removeMaybe as s}from"../../core/maybe.js";import{EsriPromiseMixin as c}from"../../core/Promise.js";import{throwIfAborted as l}from"../../core/promiseUtils.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{validateScaleRange as p}from"../../geometry/support/scaleUtils.js";import{getAttributionItemFromUserCopyright as m,isDynamicAttributionLayer as h,createAttributionIndex as g,getAttributionItemsFromIndex as _,getAttributionItemFromAccessInformation as v,getAttributionItemFromLayerCopyright as y}from"../support/attributionUtils.js";let b=class extends i(c(r)){get spatialReferenceSupported(){return!0}constructor(e){super(e),this._updatingHandles=new f,this._attributionIndexTask=null,this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if(e?.name!==`layerview:create-error`){let t=this.layer&&this.layer.id||`no id`,n=this.layer?.title||`no title`;a.getLogger(this).error(`#resolve()`,`Failed to resolve layer view (layer title: '${n}', id: '${t}')`,e)}})}destroy(){this._updatingHandles=o(this._updatingHandles),this._attributionIndexTask=s(this._attributionIndexTask),this._set(`parent`,null)}get attributionItems(){let e=this._get(`attributionItems`)??[];if(this.suspended||!this.layer?.attributionVisible)return e.length===0?e:[];if(!this.view.stationary)return e;let n=this.getAttributionItems();return t(e,n,(e,t)=>e.text===t.text)?e:n}get attributionUpdating(){return this._attributionIndexTask?!this._attributionIndexTask.finished:!1}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&this.layer?.legendEnabled===!0}get updating(){return!!(this._updatingHandles?.updating||this.isUpdating())}get updatingProgress(){return+!this.updating}get updateSuspended(){return this.suspended}get visible(){return this.layer?.visible===!0}set visible(e){this._overrideIfSome(`visible`,e)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){let e=this.view.timeExtent,t=this.layer?.visibilityTimeExtent;return!e||!t||!e.intersection(t).isEmpty}canResume(){let e=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&p(e)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){let e=this.parent?.suspended?this.parent.suspendInfo:{};this.view?.ready||(e.viewNotReady=!0),
|
|
2
|
+
import{__decorate as e}from"tslib";import{equals as t}from"../../core/arrayUtils.js";import{createTask as n}from"../../core/asyncUtils.js";import{EventedAccessor as r}from"../../core/Evented.js";import{IdentifiableMixin as i}from"../../core/Identifiable.js";import a from"../../core/Logger.js";import{destroyMaybe as o,removeMaybe as s}from"../../core/maybe.js";import{EsriPromiseMixin as c}from"../../core/Promise.js";import{throwIfAborted as l}from"../../core/promiseUtils.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{validateScaleRange as p}from"../../geometry/support/scaleUtils.js";import{getAttributionItemFromUserCopyright as m,isDynamicAttributionLayer as h,createAttributionIndex as g,getAttributionItemsFromIndex as _,getAttributionItemFromAccessInformation as v,getAttributionItemFromLayerCopyright as y}from"../support/attributionUtils.js";let b=class extends i(c(r)){get spatialReferenceSupported(){return!0}constructor(e){super(e),this._updatingHandles=new f,this._attributionIndexTask=null,this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if(e?.name!==`layerview:create-error`){let t=this.layer&&this.layer.id||`no id`,n=this.layer?.title||`no title`;a.getLogger(this).error(`#resolve()`,`Failed to resolve layer view (layer title: '${n}', id: '${t}')`,e)}})}destroy(){this._updatingHandles=o(this._updatingHandles),this._attributionIndexTask=s(this._attributionIndexTask),this._set(`parent`,null)}get attributionItems(){let e=this._get(`attributionItems`)??[];if(this.suspended||!this.layer?.attributionVisible)return e.length===0?e:[];if(!this.view.stationary)return e;let n=this.getAttributionItems();return t(e,n,(e,t)=>e.text===t.text)?e:n}get attributionUpdating(){return this._attributionIndexTask?!this._attributionIndexTask.finished:!1}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&this.layer?.legendEnabled===!0}get updating(){return!!(this._updatingHandles?.updating||this.isUpdating())}get updatingProgress(){return+!this.updating}get updateSuspended(){return this.suspended}get visible(){return this.layer?.visible===!0}set visible(e){this._overrideIfSome(`visible`,e)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){let e=this.view.timeExtent,t=this.layer?.visibilityTimeExtent;return!e||!t||!e.intersection(t).isEmpty}canResume(){let e=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&p(e)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){let e=this.parent?.suspended?this.parent.suspendInfo:{};this.view?.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0);let t=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return p(t)&&this.visibleAtCurrentScale||(e.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(e.outsideVisibilityTimeExtent=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}getAttributionItems(){let e=m(this.layer);if(e)return[e];if(h(this.layer)&&(this._attributionIndexTask||(this._attributionIndexTask=n(async e=>{let t=await this.layer.fetchAttributionData();return l(e),g(t)}),this._updatingHandles.consumePromise(this._attributionIndexTask.promise)),this._attributionIndexTask?.finished&&this._attributionIndexTask.value))return _(this._attributionIndexTask.value,this.layer.tileInfo,this.view.scale,this.view.extent);let t=v(this.layer);if(t)return[t];let r=y(this.layer);return r?[r]:[]}};e([u({readOnly:!0})],b.prototype,`spatialReferenceSupported`,null),e([u()],b.prototype,`view`,void 0),e([u({readOnly:!0})],b.prototype,`attributionItems`,null),e([u({readOnly:!0})],b.prototype,`attributionUpdating`,null),e([u()],b.prototype,`fullOpacity`,null),e([u()],b.prototype,`layer`,void 0),e([u()],b.prototype,`parent`,void 0),e([u({readOnly:!0})],b.prototype,`suspended`,null),e([u({readOnly:!0})],b.prototype,`suspendInfo`,null),e([u({readOnly:!0})],b.prototype,`legendEnabled`,null),e([u({type:Boolean,readOnly:!0})],b.prototype,`updating`,null),e([u({readOnly:!0})],b.prototype,`updatingProgress`,null),e([u()],b.prototype,`updateSuspended`,null),e([u()],b.prototype,`visible`,null),e([u({readOnly:!0})],b.prototype,`visibleAtCurrentScale`,null),e([u({readOnly:!0})],b.prototype,`visibleAtCurrentTimeExtent`,null),b=e([d(`esri.views.layers.LayerView`)],b);export{b as default};
|
|
@@ -28,23 +28,35 @@ export interface LineOfSightLayerViewProperties extends LayerViewProperties, Par
|
|
|
28
28
|
* const layerView = await view.whenLayerView(lineOfSightLayer);
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
|
+
* > [!WARNING]
|
|
32
|
+
* >
|
|
33
|
+
* > **Things to consider:**
|
|
34
|
+
* > * Snapping, tooltips, display units, and input units used during interactive placement and editing are inherited from
|
|
35
|
+
* [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
|
|
36
|
+
* > * Snapping is enabled by default. This can be temporarily disabled by holding the `CTRL` key.
|
|
37
|
+
* > * Layer types currently supported for snapping are: [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/), [GraphicsLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GraphicsLayer/) (except Mesh geometries),
|
|
38
|
+
* > [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/),
|
|
39
|
+
* > [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/).
|
|
40
|
+
*
|
|
31
41
|
* @see [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/)
|
|
32
42
|
* @see [LineOfSightAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/)
|
|
33
43
|
* @see [LineOfSightAnalysisTarget](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisTarget/)
|
|
34
44
|
* @see [LineOfSightAnalysisObserver](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisObserver/)
|
|
35
45
|
* @see [LineOfSightAnalysisView3D](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/)
|
|
46
|
+
* @see [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/)
|
|
36
47
|
* @see [Line Of Sight component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-line-of-sight/)
|
|
37
48
|
* @see [Async cancellation with AbortController](https://developers.arcgis.com/javascript/latest/async-cancellation-with-abortcontroller/)
|
|
38
49
|
*/
|
|
39
50
|
export default abstract class LineOfSightLayerView extends LayerView {
|
|
40
51
|
/**
|
|
41
|
-
* Enables interactivity for the [layer](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/#layer).
|
|
42
|
-
*
|
|
43
|
-
* [LineOfSightLayer.
|
|
44
|
-
*
|
|
45
|
-
*
|
|
52
|
+
* Enables interactivity for the [layer](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/#layer).
|
|
53
|
+
* When set to `true`, and the layer includes a valid [LineOfSightLayer.observer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/#observer) and any
|
|
54
|
+
* [LineOfSightLayer.targets](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/#targets), they become selectable and editable and the manipulators will be displayed.
|
|
55
|
+
*
|
|
56
|
+
* Targets can be removed by right-clicking on them or with the `Delete` key.
|
|
57
|
+
* The observer and the last target cannot be deleted interactively.
|
|
46
58
|
*
|
|
47
|
-
* This property is automatically set to `true` when the analysis is assigned to a
|
|
59
|
+
* This property is automatically set to `true` when the [LineOfSightLayer.analysis](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/#analysis) is assigned to a
|
|
48
60
|
* [Line Of Sight component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-line-of-sight/).
|
|
49
61
|
*
|
|
50
62
|
* @default false
|
|
@@ -72,20 +84,26 @@ export default abstract class LineOfSightLayerView extends LayerView {
|
|
|
72
84
|
*/
|
|
73
85
|
get results(): Collection<LineOfSightAnalysisResult | null | undefined>;
|
|
74
86
|
/**
|
|
75
|
-
* Starts the interactive placement of an observer and
|
|
87
|
+
* Starts the interactive placement of an observer and targets on the [layer](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/#layer)'s
|
|
76
88
|
* [LineOfSightLayer.analysis](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/#analysis).
|
|
77
89
|
*
|
|
78
|
-
* If the
|
|
79
|
-
* by zero or more targets. Otherwise, if it already has a valid observer, it will allow placing targets.
|
|
90
|
+
* If the layer does not have a valid [LineOfSightLayer.observer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/#observer) yet, this method will allow placing an observer,
|
|
91
|
+
* which can be followed by zero or more targets. Otherwise, if it already has a valid observer, it will allow placing targets.
|
|
92
|
+
* An observer is valid when it has a position. Placing an observer without any targets is a productive operation.
|
|
80
93
|
*
|
|
81
|
-
* The placement operation will finish when the user presses the escape key.
|
|
94
|
+
* The placement operation will finish when the user presses the escape key. Pressing escape after placing an observer
|
|
95
|
+
* or target finalizes a productive operation. Pressing escape before a valid observer is placed rejects the promise.
|
|
82
96
|
* To stop the placing programmatically, pass an abort signal as an argument when calling the method.
|
|
83
|
-
* The promise resolves when the operation is productive, i.e. an
|
|
97
|
+
* The promise resolves when the operation is productive, i.e. an observer or any targets were added.
|
|
84
98
|
* Otherwise, if nothing was added or signal was aborted, the promise is rejected.
|
|
85
99
|
*
|
|
100
|
+
* By default, the observer and targets are created at absolute height.
|
|
101
|
+
* Optionally, by specifying the options of the method,
|
|
102
|
+
* you can change the [elevation info](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/).
|
|
103
|
+
*
|
|
86
104
|
* Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/#interactive) to `true`.
|
|
87
105
|
*
|
|
88
|
-
* @param options -
|
|
106
|
+
* @param options - An object specifying additional placement options, including elevation information and an abort signal.
|
|
89
107
|
* @returns A promise
|
|
90
108
|
* which resolves when the operation is completed successfully - i.e. the user places an observer and/or target(s),
|
|
91
109
|
* leaving the analysis in a valid state. Otherwise, the promise is rejected.
|
|
@@ -94,7 +112,11 @@ export default abstract class LineOfSightLayerView extends LayerView {
|
|
|
94
112
|
* const abortController = new AbortController();
|
|
95
113
|
*
|
|
96
114
|
* try {
|
|
97
|
-
*
|
|
115
|
+
* await layerView.place({
|
|
116
|
+
* signal: abortController.signal,
|
|
117
|
+
* // optional elevation info
|
|
118
|
+
* elevationInfo: { mode: "relative-to-ground", offset: 1.5 },
|
|
119
|
+
* });
|
|
98
120
|
* } catch (error) {
|
|
99
121
|
* if (error.name === "AbortError") {
|
|
100
122
|
* console.log("Placement operation was cancelled.");
|
|
@@ -10,6 +10,7 @@ import type { LayerViewHighlightOptions } from "./types.js";
|
|
|
10
10
|
* Represents the view of a [SketchLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SketchLayer/) in a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/).
|
|
11
11
|
*
|
|
12
12
|
* @since 5.2
|
|
13
|
+
* @beta
|
|
13
14
|
* @see [SketchLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SketchLayer/)
|
|
14
15
|
*/
|
|
15
16
|
export default abstract class SketchLayerView extends LayerView {
|
|
@@ -15,7 +15,7 @@ export interface ViewshedLayerViewProperties extends LayerViewProperties, Partia
|
|
|
15
15
|
*
|
|
16
16
|
* It allows to create new viewsheds interactively using the [place()](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/#place) method,
|
|
17
17
|
* or to make existing viewsheds selectable and editable by enabling the [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/#interactive) property.
|
|
18
|
-
* To select a viewshed, hover and click on
|
|
18
|
+
* To select a viewshed, hover and click on its observer.
|
|
19
19
|
*
|
|
20
20
|
* The view for the layer can be retrieved using [SceneView.whenLayerView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenLayerView).
|
|
21
21
|
*
|
|
@@ -28,6 +28,16 @@ export interface ViewshedLayerViewProperties extends LayerViewProperties, Partia
|
|
|
28
28
|
* const layerView = await view.whenLayerView(viewshedLayer);
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
|
+
* > [!WARNING]
|
|
32
|
+
* >
|
|
33
|
+
* > **Things to consider:**
|
|
34
|
+
* > * Snapping, tooltips, display units, and input units used during interactive placement and editing are inherited from
|
|
35
|
+
* [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
|
|
36
|
+
* > * Snapping is enabled by default. This can be temporarily disabled by holding the `CTRL` key.
|
|
37
|
+
* > * Layer types currently supported for snapping are: [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/), [GraphicsLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GraphicsLayer/) (except Mesh geometries),
|
|
38
|
+
* > [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/),
|
|
39
|
+
* > [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/).
|
|
40
|
+
*
|
|
31
41
|
* @since 4.31
|
|
32
42
|
* @see [ViewshedLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/)
|
|
33
43
|
* @see [Viewshed](https://developers.arcgis.com/javascript/latest/references/core/analysis/Viewshed/)
|
|
@@ -39,8 +49,10 @@ export interface ViewshedLayerViewProperties extends LayerViewProperties, Partia
|
|
|
39
49
|
export default abstract class ViewshedLayerView extends LayerView {
|
|
40
50
|
/**
|
|
41
51
|
* Enables interactivity for the [layer](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/#layer). When set to `true` and the layer's
|
|
42
|
-
* [ViewshedLayer.source](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/#source) includes any
|
|
43
|
-
*
|
|
52
|
+
* [ViewshedLayer.source](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/#source) includes any valid [viewsheds](https://developers.arcgis.com/javascript/latest/references/core/analysis/Viewshed/),
|
|
53
|
+
* they become selectable and editable.
|
|
54
|
+
*
|
|
55
|
+
* Viewsheds can be removed with the `Delete` key.
|
|
44
56
|
*
|
|
45
57
|
* @default false
|
|
46
58
|
*/
|
|
@@ -55,19 +67,23 @@ export default abstract class ViewshedLayerView extends LayerView {
|
|
|
55
67
|
*/
|
|
56
68
|
accessor selectedViewshed: Viewshed | null | undefined;
|
|
57
69
|
/**
|
|
58
|
-
* Starts the interactive creation of new viewsheds and adds them to the
|
|
59
|
-
* [ViewshedLayer.source](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/#source).
|
|
70
|
+
* Starts the interactive creation of new viewsheds and adds them to the
|
|
71
|
+
* [ViewshedLayer.source](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/#source) of the associated [layer](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/#layer).
|
|
60
72
|
*
|
|
61
|
-
* The first click in the scene places the observer point and the second sets the viewshed's orientation.
|
|
73
|
+
* The first click in the scene places the observer point and the second sets the viewshed's orientation and distance.
|
|
62
74
|
*
|
|
63
75
|
* The creation process will finish when the user double-clicks the mouse or presses the escape key.
|
|
64
76
|
* To stop the creation programmatically, pass an abort signal as an argument when calling the method.
|
|
65
77
|
*
|
|
66
78
|
* This method is similar to the [place()](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/#place) method, but it allows to create multiple viewsheds in a row.
|
|
67
79
|
*
|
|
80
|
+
* By default, the observer is created at absolute height.
|
|
81
|
+
* Optionally, by specifying the options of the method,
|
|
82
|
+
* you can change the [elevation info](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/).
|
|
83
|
+
*
|
|
68
84
|
* Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/#interactive) to `true`.
|
|
69
85
|
*
|
|
70
|
-
* @param options -
|
|
86
|
+
* @param options - An object specifying additional placement options, including elevation information and an abort signal.
|
|
71
87
|
* @returns A promise which resolves when creation is completed successfully or rejected if it is
|
|
72
88
|
* canceled.
|
|
73
89
|
* @example
|
|
@@ -86,17 +102,21 @@ export default abstract class ViewshedLayerView extends LayerView {
|
|
|
86
102
|
*/
|
|
87
103
|
createViewsheds(options?: ViewshedPlacementOptions | null | undefined): Promise<void>;
|
|
88
104
|
/**
|
|
89
|
-
* Starts the interactive placement of a single viewshed, adding it to the
|
|
90
|
-
* [ViewshedLayer.source](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/#source).
|
|
105
|
+
* Starts the interactive placement of a single viewshed, adding it to the
|
|
106
|
+
* [ViewshedLayer.source](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/#source) of the associated [layer](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/#layer).
|
|
91
107
|
*
|
|
92
|
-
* The first click in the scene places the observer point and the second sets the viewshed's orientation.
|
|
108
|
+
* The first click in the scene places the observer point and the second sets the viewshed's orientation and distance.
|
|
93
109
|
*
|
|
94
110
|
* The placement operation will finish when the user presses the escape key.
|
|
95
111
|
* To stop the placing programmatically, pass an abort signal as an argument when calling the method.
|
|
96
112
|
*
|
|
113
|
+
* By default, the observer is created at absolute height.
|
|
114
|
+
* Optionally, by specifying the options of the method,
|
|
115
|
+
* you can change the [elevation info](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/).
|
|
116
|
+
*
|
|
97
117
|
* Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/#interactive) to `true`.
|
|
98
118
|
*
|
|
99
|
-
* @param options -
|
|
119
|
+
* @param options - An object specifying additional placement options, including elevation information and an abort signal.
|
|
100
120
|
* @returns A promise which
|
|
101
121
|
* resolves when the operation is completed successfully or rejected if it is canceled.
|
|
102
122
|
* @since 4.33
|
|
@@ -104,7 +124,11 @@ export default abstract class ViewshedLayerView extends LayerView {
|
|
|
104
124
|
* const abortController = new AbortController();
|
|
105
125
|
*
|
|
106
126
|
* try {
|
|
107
|
-
*
|
|
127
|
+
* await layerView.place({
|
|
128
|
+
* signal: abortController.signal,
|
|
129
|
+
* // optional elevation info
|
|
130
|
+
* elevationInfo: { mode: "relative-to-ground", offset: 1.5 },
|
|
131
|
+
* });
|
|
108
132
|
* } catch (error) {
|
|
109
133
|
* if (error.name === "AbortError") {
|
|
110
134
|
* console.log("Placement operation was cancelled.");
|
package/views/webgl/Program.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{numbersEquals as e}from"../../core/arrayUtils.js";import has from"../../core/has.js";import{webglValidateShadersEnabled as t,webglDebugEnabled as n}from"./checkWebGLError.js";import{ResourceType as r}from"./enums.js";import{transpileShader as i}from"./ShaderTranspiler.js";const a=!!has(`esri-tests-disable-gpu-memory-measurements`);class o{constructor(e,n,o,c,l=new Map,u=[]){this._context=e,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,e||console.error(`RenderingContext isn't initialized!`),n.length===0&&console.error(`Shaders source should not be empty!`),n=i(n,35633),o=i(o,35632),this._vShader=s(this._context,35633,n),this._fShader=s(this._context,35632,o),d.enabled&&(this._linesOfCode=n.match(/\n/g).length+o.match(/\n/g).length+2,e.instanceCounter.increment(r.LinesOfCode,this._vShader,this._linesOfCode)),
|
|
2
|
+
import{numbersEquals as e}from"../../core/arrayUtils.js";import has from"../../core/has.js";import{webglValidateShadersEnabled as t,webglDebugEnabled as n}from"./checkWebGLError.js";import{ResourceType as r}from"./enums.js";import{transpileShader as i}from"./ShaderTranspiler.js";const a=!!has(`esri-tests-disable-gpu-memory-measurements`);class o{constructor(e,n,o,c,l=new Map,u=[]){this._context=e,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,e||console.error(`RenderingContext isn't initialized!`),n.length===0&&console.error(`Shaders source should not be empty!`),n=i(n,35633),o=i(o,35632),this._vShader=s(this._context,35633,n),this._fShader=s(this._context,35632,o),d.enabled&&(this._linesOfCode=n.match(/\n/g).length+o.match(/\n/g).length+2,e.instanceCounter.increment(r.LinesOfCode,this._vShader,this._linesOfCode)),this._vShader&&this._fShader||console.error(`Error loading shaders!`),e.instanceCounter.increment(r.Shader,this),t()&&(this.vertexShader=n,this.fragmentShader=o),this.usedMemory=a?0:n.length+o.length;let f=this._context.gl,p=f.createProgram();f.attachShader(p,this._vShader),f.attachShader(p,this._fShader),c.forEach((e,t)=>f.bindAttribLocation(p,e,t)),this.hasTransformFeedbackVaryings=!!u?.length,this.hasTransformFeedbackVaryings&&f.transformFeedbackVaryings(p,u,f.SEPARATE_ATTRIBS),f.linkProgram(p),t()&&!f.getProgramParameter(p,f.LINK_STATUS)&&console.error(`Could not link shader
|
|
3
3
|
validated: ${f.getProgramParameter(p,f.VALIDATE_STATUS)}, gl error ${f.getError()}, vertex: ${f.getShaderParameter(this._vShader,f.COMPILE_STATUS)}, fragment: ${f.getShaderParameter(this._fShader,f.COMPILE_STATUS)}, info log: ${f.getProgramInfoLog(p)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`);for(let[e,t]of l){let n=f.getUniformBlockIndex(p,e);n<4294967295&&f.uniformBlockBinding(p,n,t)}this._glName=p,e.instanceCounter.increment(r.Program,this)}get glName(){return this._glName}get hasGLName(){return this._glName!=null}get compiled(){return this._compiled?!0:!this._context.capabilities.parallelShaderCompile||this.glName==null?(this._compiled=!0,!0):(this._compiled=!!this._context.gl.getProgramParameter(this.glName,37297),this._compiled)}dispose(){let e=this._context.gl,t=this._context.instanceCounter;this._nameToUniformLocation.forEach(e=>e&&t.decrement(r.Uniform,e)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(t.decrement(r.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),e.deleteShader(this._vShader),this._vShader=null,t.decrement(r.Shader,this)),this._fShader&&=(e.deleteShader(this._fShader),null),this._glName&&(e.deleteProgram(this._glName),this._glName=null,t.decrement(r.Program,this))}_getUniformLocation(e){let t=this._nameToUniformLocation.get(e);if(t!==void 0)return t;if(this.glName){let t=this._context.gl.getUniformLocation(this.glName,e);return this._nameToUniformLocation.set(e,t),t&&this._context.instanceCounter.increment(r.Uniform,t),t}return null}hasUniform(e){return this._getUniformLocation(e)!=null}setUniform1i(e,t,n){f(n,t);let r=this._nameToUniform1.get(e);(r===void 0||t!==r)&&(this._context.gl.uniform1i(this._getUniformLocation(e),t),this._nameToUniform1.set(e,t))}setUniform1iv(e,t,n){p(n,t),u(this._nameToUniform1v,e,t)&&this._context.gl.uniform1iv(this._getUniformLocation(e),t)}setUniform2iv(e,t,n){p(n,t),u(this._nameToUniform2,e,t)&&this._context.gl.uniform2iv(this._getUniformLocation(e),t)}setUniform3iv(e,t,n){p(n,t),u(this._nameToUniform3,e,t)&&this._context.gl.uniform3iv(this._getUniformLocation(e),t)}setUniform4iv(e,t,n){p(n,t),u(this._nameToUniform4,e,t)&&this._context.gl.uniform4iv(this._getUniformLocation(e),t)}setUniform1f(e,t,n){f(n,t);let r=this._nameToUniform1.get(e);(r===void 0||t!==r)&&(this._context.gl.uniform1f(this._getUniformLocation(e),t),this._nameToUniform1.set(e,t))}setUniform1fv(e,t,n){p(n,t),u(this._nameToUniform1v,e,t)&&this._context.gl.uniform1fv(this._getUniformLocation(e),t)}setUniform2f(e,t,n,r){f(r,t,n);let i=this._nameToUniform2.get(e);i===void 0?(this._context.gl.uniform2f(this._getUniformLocation(e),t,n),this._nameToUniform2.set(e,[t,n])):(t!==i[0]||n!==i[1])&&(this._context.gl.uniform2f(this._getUniformLocation(e),t,n),i[0]=t,i[1]=n)}setUniform2fv(e,t,n){p(n,t),u(this._nameToUniform2,e,t)&&this._context.gl.uniform2fv(this._getUniformLocation(e),t)}setUniform3f(e,t,n,r,i){f(i,t,n,r);let a=this._nameToUniform3.get(e);a===void 0?(this._context.gl.uniform3f(this._getUniformLocation(e),t,n,r),this._nameToUniform3.set(e,[t,n,r])):(t!==a[0]||n!==a[1]||r!==a[2])&&(this._context.gl.uniform3f(this._getUniformLocation(e),t,n,r),a[0]=t,a[1]=n,a[2]=r)}setUniform3fv(e,t,n){p(n,t);let r=this._getUniformLocation(e);r!=null&&u(this._nameToUniform3,e,t)&&this._context.gl.uniform3fv(r,t)}setUniform4f(e,t,n,r,i,a){f(a,t,n,r,i);let o=this._nameToUniform4.get(e);o===void 0?(this._context.gl.uniform4f(this._getUniformLocation(e),t,n,r,i),this._nameToUniform4.set(e,[t,n,r,i])):(o===void 0||t!==o[0]||n!==o[1]||r!==o[2]||i!==o[3])&&(this._context.gl.uniform4f(this._getUniformLocation(e),t,n,r,i),o[0]=t,o[1]=n,o[2]=r,o[3]=i)}setUniform4fv(e,t,n){p(n,t);let r=this._getUniformLocation(e);r!=null&&u(this._nameToUniform4,e,t)&&this._context.gl.uniform4fv(r,t)}setUniformMatrix3fv(e,t,n=!1,r){p(r,t);let i=this._getUniformLocation(e);i!=null&&u(this._nameToUniformMatrix3,e,t)&&this._context.gl.uniformMatrix3fv(i,n,t)}setUniformMatrix4fv(e,t,n=!1,r){p(r,t);let i=this._getUniformLocation(e);if(i!=null){let r=this._nameToUniformMatrix4,a=r.get(e),o=!1;if(!a)r.set(e,Array.from(t)),o=!0;else{let n=t.length;if(a.length!==n)r.set(e,Array.from(t)),o=!0;else for(let e=0;e<n;++e){let r=t[e];if(a[e]!==r){for(a[e]=r;e<n;++e)a[e]=t[e];o=!0;break}}}o&&this._context.gl.uniformMatrix4fv(i,n,t)}}setUniformMatrices4fv(e,t,n=!1,r){p(r,t);let i=this._getUniformLocation(e);i!=null&&u(this._nameToUniformMatrix4,e,t)&&this._context.gl.uniformMatrix4fv(i,n,t)}stop(){}}function s(e,n,r){let i=e.gl,a=i.createShader(n);return i.shaderSource(a,r),i.compileShader(a),t()&&!i.getShaderParameter(a,i.COMPILE_STATUS)&&(console.error(`Compile error in ${n===35633?`vertex`:`fragment`} shader`),console.error(i.getShaderInfoLog(a)),console.error(c(r))),a}function c(e){let t=2;return e.replaceAll(`
|
|
4
4
|
`,()=>`
|
|
5
5
|
`+l(t++)+`:`)}function l(e){return e>=1e3?e.toString():(` `+e).slice(-3)}function u(t,n,r){let i=t.get(n);return!e(i,r)&&(t.set(n,Array.from(r)),!0)}const d={enabled:!1},f=n()?(e,...t)=>p(e,t):()=>{},p=n()?(e,t)=>{if(e?.supportsNaN)return;let n=t.length;for(let e=0;e<n;++e){let n=t[e];Number.isNaN(n)&&console.error(`Got ${n} as uniform value from ${Error().stack}`)}}:()=>{};export{o as DisposableProgram,d as test};
|
package/views/webgl/Texture.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Error.js";import has from"../../core/has.js";import t from"../../core/Logger.js";import{abortMaybe as n}from"../../core/maybe.js";import{hasValue as r}from"../../core/object.js";import{throwIfAborted as i,isAbortError as a}from"../../core/promiseUtils.js";import{checkWebGLError as o}from"./checkWebGLError.js";import{ResourceType as s,CompressedTextureFormat as c}from"./enums.js";import{estimateMemory as l}from"./TextureDescriptor.js";import{isCompressedData as u,deriveInternalFormat as d,isTexImageSource as f,is3DTarget as p,validateTexture as m,isCompressedFormat as h,getDimensions as g,isSizedPixelFormat as _,calcMipmapLevels as v}from"./textureUtils.js";import{ValidatedTextureDescriptor as y}from"./ValidatedTextureDescriptor.js";const b=!!has(`esri-tests-disable-gpu-memory-measurements`),x=()=>t.getLogger(`esri/views/webgl/Texture`);class S{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,n=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,`context`in t)this._descriptor=t,r=n;else{let r=y.validate(t,n);if(!r)throw new e(`texture:invalid-descriptor`,`Texture descriptor invalid`);this._descriptor=r}this._descriptor.target===34067?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return b?0:l(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(s.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,n){let r=this._descriptor;if(r.width!==t||r.height!==n){if(this._wasImmutablyAllocated)throw new e(`texture:immutable-resize`,`Immutable textures can't be resized!`);r.width=t,r.height=n,this._descriptor.target===34067?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!u(e)&&this._descriptor.internalFormat&&r(c,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!u(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(t,n,r,i,a,o,s=0){o||x().error(`An attempt to use uninitialized data!`),this.hasWebGLTextureObject||x().error(`An attempt to update uninitialized texture!`);let c=this._descriptor;c.internalFormat=d(c);let{context:l,pixelFormat:p,dataType:m,target:h,isImmutable:g}=c;if(g&&!this._wasImmutablyAllocated)throw new e(`texture:uninitialized`,`Cannot update immutable texture before allocation!`);let _=l.bindTexture(this,S.TEXTURE_UNIT_FOR_UPDATES,!0);(n<0||r<0||n+i>c.width||r+a>c.height)&&x().error(`An attempt to update out of bounds of the texture!`),this._configurePixelStorage();let{gl:v}=l;s&&((!i||!a)&&x().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),v.pixelStorei(v.UNPACK_SKIP_ROWS,s)),f(o)?v.texSubImage2D(h,t,n,r,i,a,p,m,o):u(o)?v.compressedTexSubImage2D(h,t,n,r,i,a,c.internalFormat,o.levels[t]):v.texSubImage2D(h,t,n,r,i,a,p,m,o),s&&v.pixelStorei(v.UNPACK_SKIP_ROWS,0),l.bindTexture(_,S.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,n,r,i,a,o,s,c){c||x().error(`An attempt to use uninitialized data!`),this.hasWebGLTextureObject||x().error(`An attempt to update an uninitialized texture!`);let l=this._descriptor;l.internalFormat=d(l);let{context:f,pixelFormat:m,dataType:h,isImmutable:g,target:_}=l;if(g&&!this._wasImmutablyAllocated)throw new e(`texture:uninitialized`,`Cannot update immutable texture before allocation!`);p(_)||x().warn(`Attempting to set 3D texture data on a non-3D texture`);let v=f.bindTexture(this,S.TEXTURE_UNIT_FOR_UPDATES);f.setActiveTexture(S.TEXTURE_UNIT_FOR_UPDATES),(n<0||r<0||i<0||n+a>l.width||r+o>l.height||i+s>l.depth)&&x().error(`An attempt to update out of bounds of the texture!`),this._configurePixelStorage();let{gl:y}=f;if(u(c))c=c.levels[t],y.compressedTexSubImage3D(_,t,n,r,i,a,o,s,l.internalFormat,c);else{let e=c;y.texSubImage3D(_,t,n,r,i,a,o,s,m,h,e)}f.bindTexture(v,S.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){let t=this._descriptor;if(t.width===0||t.height===0)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new e(`texture:immutable-change`,`Cannot add mipmaps to immutable texture after allocation`);t.hasMipmap=!0,this._samplingModeDirty=!0,m(t)}t.samplingMode===9729?(this._samplingModeDirty=!0,t.samplingMode=9985):t.samplingMode===9728&&(this._samplingModeDirty=!0,t.samplingMode=9984);let n=this._descriptor.context.bindTexture(this,S.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(S.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(n,S.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){let t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new e(`texture:immutable-change`,`Cannot delete mipmaps to immutable texture after allocation`);t.hasMipmap=!1,this._samplingModeDirty=!0,m(t)}t.samplingMode===9985?(this._samplingModeDirty=!0,t.samplingMode=9729):t.samplingMode===9984&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&=(this._applySamplingMode(),!1),this._wrapModeDirty&&=(this._applyWrapMode(),!1),this._shadowFilterDirty&&=(this._applyShadowMode(),!1)}abortCompression(){this._compressionAbortController=n(this._compressionAbortController)}_setData(t,n){let r=this._descriptor,i=r.context?.gl;if(!i)return;o(i),this.hasWebGLTextureObject||(this._glName=i.createTexture(),r.context.instanceCounter.increment(s.Texture,this)),m(r);let a=r.context.bindTexture(this,S.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(S.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),o(i);let c=n??r.target,l=p(c);if(f(t))this._setDataFromTexImageSource(t,c);else{let{width:n,height:a,depth:s}=r;if(n==null||a==null)throw new e(`texture:missing-size`,`Width and height must be specified!`);if(l&&s==null)throw new e(`texture:missing-depth`,`Depth must be specified!`);if(r.internalFormat=d(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(c,r.internalFormat,r.hasMipmap,n,a,s),u(t)){if(!h(r.internalFormat))throw new e(`texture:format-mismatch`,`Attempting to use compressed data with an uncompressed format!`);this._setDataFromCompressedSource(t,r.internalFormat,c)}else this._texImage(c,0,r.internalFormat,n,a,s,t),o(i),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),o(i),r.context.bindTexture(a,S.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){let e=this._descriptor.context.gl,{unpackAlignment:t,flipped:n,preMultiplyAlpha:r}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,+!!n),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,+!!r)}_setDataFromTexImageSource(e,t){let{gl:n}=this._descriptor.context,r=this._descriptor;r.internalFormat=d(r);let i=p(t),{width:a,height:s,depth:c}=g(e);r.width&&r.height,r.width||=a,r.height||=s,i&&r.depth,i&&(r.depth=c),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,r.internalFormat,r.hasMipmap,a,s,c),this._texImage(t,0,r.internalFormat,a,s,c,e),o(n),r.hasMipmap&&(this.generateMipmap(),o(n))}_setDataFromCompressedSource(e,t,n){let r=this._descriptor,{width:i,height:a,depth:o}=r,s=e.levels,c=v(n,i,a,o),l=Math.min(c,s.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,l),this._forEachMipmapLevel((e,r,i,a)=>{let o=s[Math.min(e,s.length-1)];this._compressedTexImage(n,e,t,r,i,a,o)},l)}_texStorage(t,n,r,i,a,o){let{gl:s}=this._descriptor.context;if(!_(n)&&!h(n))throw new e(`texture:missing-format`,`Immutable textures must have a sized or compressed internal format`);if(!this._descriptor.isImmutable)return;let c=r?v(t,i,a,o):1;if(p(t)){if(o==null)throw new e(`texture:missing-depth`,`Missing depth dimension for 3D texture upload`);s.texStorage3D(t,c,n,i,a,o)}else s.texStorage2D(t,c,n,i,a);this._wasImmutablyAllocated=!0}_texImage(t,n,r,i,a,o,s){let c=this._descriptor.context.gl,l=p(t),{isImmutable:u,pixelFormat:d,dataType:f}=this._descriptor;if(u){if(s!=null){let r=s;if(l){if(o==null)throw new e(`texture:missing-depth`,`Missing depth dimension for 3D texture upload`);c.texSubImage3D(t,n,0,0,0,i,a,o,d,f,r)}else c.texSubImage2D(t,n,0,0,i,a,d,f,r)}}else{let u=s;if(l){if(o==null)throw new e(`texture:missing-depth`,`Missing depth dimension for 3D texture upload`);c.texImage3D(t,n,r,i,a,o,0,d,f,u)}else c.texImage2D(t,n,r,i,a,0,d,f,u)}}_compressedTexImage(t,n,r,i,a,o,s){let c=this._descriptor.context.gl,l=p(t);if(this._descriptor.isImmutable){if(s!=null){if(l){if(o==null)throw new e(`texture:missing-depth`,`Missing depth dimension for 3D texture upload`);c.compressedTexSubImage3D(t,n,0,0,0,i,a,o,r,s)}else c.compressedTexSubImage2D(t,n,0,0,i,a,r,s)}}else if(l){if(o==null)throw new e(`texture:missing-depth`,`Missing depth dimension for 3D texture upload`);c.compressedTexImage3D(t,n,r,i,a,o,0,s)}else c.compressedTexImage2D(t,n,r,i,a,0,s)}async _compressOnWorker(e){let{width:t,height:n,context:r,flipped:o,preMultiplyAlpha:s,hasMipmap:c,compress:l}=this._descriptor;if(!l)return;let{compressionTracker:u,compressionCallback:d,preserveSourceBitmap:f}=l,{compressedTextureETC:p,compressedTextureS3TC:m}=r.capabilities;if(!S.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!p&&!m)return;this.abortCompression();let h=new AbortController;this._compressionAbortController=h,u?.increment();let g,_=!1,v=!1;try{e instanceof ImageBitmap?f?(g=await createImageBitmap(e),i(h),v=!0):g=e:e instanceof Uint8Array?(g=e.buffer,_=this.descriptor.flipped):(g=await createImageBitmap(e,{imageOrientation:o?`flipY`:`none`}),i(h),v=!0);let r={data:g,width:t,height:n,needsFlip:_,components:this._descriptor.pixelFormat===6408?4:3,preMultiplyAlpha:s,isOpaque:this._descriptor.isOpaque,hasMipmap:c,hasETC:!!p,hasS3TC:!!m},a=await S.compressionWorkerHandle.invoke(r,h.signal,1);if(i(h),a.compressedTexture&&this.hasWebGLTextureObject){let e=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),d?.(e-this.usedMemory)}}catch(e){a(e)||x().error(`Texture compression failed!`)}finally{u?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),v&&g instanceof ImageBitmap&&g.close()}}_forEachMipmapLevel(t,n=1/0){let{width:r,height:i,depth:a,hasMipmap:o,target:s}=this._descriptor,c=s===32879;if(r==null||i==null||c&&a==null)throw new e(`texture:missing-size`,`Missing texture dimensions for mipmap calculation`);for(let e=0;t(e,r,i,a),!(!o||r===1&&i===1&&(!c||a===1)||e>=n);++e)r=Math.max(1,r>>1),i=Math.max(1,i>>1),c&&(a=Math.max(1,a>>1))}_applySamplingMode(){let e=this._descriptor,t=e.context?.gl,n=e.samplingMode,r=e.samplingMode;n===9985||n===9987?(n=9729,e.hasMipmap||(r=9729)):(n===9984||n===9986)&&(n=9728,e.hasMipmap||(r=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,n),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){let e=this._descriptor,t=e.context?.gl;typeof e.wrapMode==`number`?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){let e=this._descriptor,t=e.context?.gl,n=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,n),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),o(t)}_applyAnisotropicFilteringParameters(){let e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}export{S as default};
|
|
2
|
+
import e from"../../core/Error.js";import has from"../../core/has.js";import t from"../../core/Logger.js";import{abortMaybe as n}from"../../core/maybe.js";import{hasValue as r}from"../../core/object.js";import{throwIfAborted as i,isAbortError as a}from"../../core/promiseUtils.js";import{checkWebGLError as o}from"./checkWebGLError.js";import{ResourceType as s,CompressedTextureFormat as c}from"./enums.js";import{estimateMemory as l}from"./TextureDescriptor.js";import{isCompressedData as u,deriveInternalFormat as d,isTexImageSource as f,is3DTarget as p,validateTexture as m,isCompressedFormat as h,getDimensions as g,isSizedPixelFormat as _,calcMipmapLevels as v}from"./textureUtils.js";import{ValidatedTextureDescriptor as y}from"./ValidatedTextureDescriptor.js";const b=!!has(`esri-tests-disable-gpu-memory-measurements`),x=()=>t.getLogger(`esri/views/webgl/Texture`);class S{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,n=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,`context`in t)this._descriptor=t,r=n;else{let r=y.validate(t,n);if(!r)throw new e(`texture:invalid-descriptor`,`Texture descriptor invalid`);this._descriptor=r}this._descriptor.target===34067?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return b?0:l(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(s.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,n){let r=this._descriptor;if(r.width!==t||r.height!==n){if(this._wasImmutablyAllocated)throw new e(`texture:immutable-resize`,`Immutable textures can't be resized!`);r.width=t,r.height=n,this._descriptor.target===34067?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!u(e)&&this._descriptor.internalFormat&&r(c,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!u(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(t,n,r,i,a,o,s=0){o||x().error(`An attempt to use uninitialized data!`),this.hasWebGLTextureObject||x().error(`An attempt to update uninitialized texture!`);let c=this._descriptor;c.internalFormat=d(c);let{context:l,pixelFormat:p,dataType:m,target:h,isImmutable:g}=c;if(g&&!this._wasImmutablyAllocated)throw new e(`texture:uninitialized`,`Cannot update immutable texture before allocation!`);let _=l.bindTexture(this,S.TEXTURE_UNIT_FOR_UPDATES,!0);(n<0||r<0||n+i>c.width||r+a>c.height)&&x().error(`An attempt to update out of bounds of the texture!`),this._configurePixelStorage();let{gl:v}=l;s&&(i&&a||x().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),v.pixelStorei(v.UNPACK_SKIP_ROWS,s)),f(o)?v.texSubImage2D(h,t,n,r,i,a,p,m,o):u(o)?v.compressedTexSubImage2D(h,t,n,r,i,a,c.internalFormat,o.levels[t]):v.texSubImage2D(h,t,n,r,i,a,p,m,o),s&&v.pixelStorei(v.UNPACK_SKIP_ROWS,0),l.bindTexture(_,S.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,n,r,i,a,o,s,c){c||x().error(`An attempt to use uninitialized data!`),this.hasWebGLTextureObject||x().error(`An attempt to update an uninitialized texture!`);let l=this._descriptor;l.internalFormat=d(l);let{context:f,pixelFormat:m,dataType:h,isImmutable:g,target:_}=l;if(g&&!this._wasImmutablyAllocated)throw new e(`texture:uninitialized`,`Cannot update immutable texture before allocation!`);p(_)||x().warn(`Attempting to set 3D texture data on a non-3D texture`);let v=f.bindTexture(this,S.TEXTURE_UNIT_FOR_UPDATES);f.setActiveTexture(S.TEXTURE_UNIT_FOR_UPDATES),(n<0||r<0||i<0||n+a>l.width||r+o>l.height||i+s>l.depth)&&x().error(`An attempt to update out of bounds of the texture!`),this._configurePixelStorage();let{gl:y}=f;if(u(c))c=c.levels[t],y.compressedTexSubImage3D(_,t,n,r,i,a,o,s,l.internalFormat,c);else{let e=c;y.texSubImage3D(_,t,n,r,i,a,o,s,m,h,e)}f.bindTexture(v,S.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){let t=this._descriptor;if(t.width===0||t.height===0)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new e(`texture:immutable-change`,`Cannot add mipmaps to immutable texture after allocation`);t.hasMipmap=!0,this._samplingModeDirty=!0,m(t)}t.samplingMode===9729?(this._samplingModeDirty=!0,t.samplingMode=9985):t.samplingMode===9728&&(this._samplingModeDirty=!0,t.samplingMode=9984);let n=this._descriptor.context.bindTexture(this,S.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(S.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(n,S.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){let t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new e(`texture:immutable-change`,`Cannot delete mipmaps to immutable texture after allocation`);t.hasMipmap=!1,this._samplingModeDirty=!0,m(t)}t.samplingMode===9985?(this._samplingModeDirty=!0,t.samplingMode=9729):t.samplingMode===9984&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&=(this._applySamplingMode(),!1),this._wrapModeDirty&&=(this._applyWrapMode(),!1),this._shadowFilterDirty&&=(this._applyShadowMode(),!1)}abortCompression(){this._compressionAbortController=n(this._compressionAbortController)}_setData(t,n){let r=this._descriptor,i=r.context?.gl;if(!i)return;o(i),this.hasWebGLTextureObject||(this._glName=i.createTexture(),r.context.instanceCounter.increment(s.Texture,this)),m(r);let a=r.context.bindTexture(this,S.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(S.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),o(i);let c=n??r.target,l=p(c);if(f(t))this._setDataFromTexImageSource(t,c);else{let{width:n,height:a,depth:s}=r;if(n==null||a==null)throw new e(`texture:missing-size`,`Width and height must be specified!`);if(l&&s==null)throw new e(`texture:missing-depth`,`Depth must be specified!`);if(r.internalFormat=d(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(c,r.internalFormat,r.hasMipmap,n,a,s),u(t)){if(!h(r.internalFormat))throw new e(`texture:format-mismatch`,`Attempting to use compressed data with an uncompressed format!`);this._setDataFromCompressedSource(t,r.internalFormat,c)}else this._texImage(c,0,r.internalFormat,n,a,s,t),o(i),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),o(i),r.context.bindTexture(a,S.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){let e=this._descriptor.context.gl,{unpackAlignment:t,flipped:n,preMultiplyAlpha:r}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,+!!n),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,+!!r)}_setDataFromTexImageSource(e,t){let{gl:n}=this._descriptor.context,r=this._descriptor;r.internalFormat=d(r);let i=p(t),{width:a,height:s,depth:c}=g(e);r.width&&r.height,r.width||=a,r.height||=s,i&&r.depth,i&&(r.depth=c),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,r.internalFormat,r.hasMipmap,a,s,c),this._texImage(t,0,r.internalFormat,a,s,c,e),o(n),r.hasMipmap&&(this.generateMipmap(),o(n))}_setDataFromCompressedSource(e,t,n){let r=this._descriptor,{width:i,height:a,depth:o}=r,s=e.levels,c=v(n,i,a,o),l=Math.min(c,s.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,l),this._forEachMipmapLevel((e,r,i,a)=>{let o=s[Math.min(e,s.length-1)];this._compressedTexImage(n,e,t,r,i,a,o)},l)}_texStorage(t,n,r,i,a,o){let{gl:s}=this._descriptor.context;if(!_(n)&&!h(n))throw new e(`texture:missing-format`,`Immutable textures must have a sized or compressed internal format`);if(!this._descriptor.isImmutable)return;let c=r?v(t,i,a,o):1;if(p(t)){if(o==null)throw new e(`texture:missing-depth`,`Missing depth dimension for 3D texture upload`);s.texStorage3D(t,c,n,i,a,o)}else s.texStorage2D(t,c,n,i,a);this._wasImmutablyAllocated=!0}_texImage(t,n,r,i,a,o,s){let c=this._descriptor.context.gl,l=p(t),{isImmutable:u,pixelFormat:d,dataType:f}=this._descriptor;if(u){if(s!=null){let r=s;if(l){if(o==null)throw new e(`texture:missing-depth`,`Missing depth dimension for 3D texture upload`);c.texSubImage3D(t,n,0,0,0,i,a,o,d,f,r)}else c.texSubImage2D(t,n,0,0,i,a,d,f,r)}}else{let u=s;if(l){if(o==null)throw new e(`texture:missing-depth`,`Missing depth dimension for 3D texture upload`);c.texImage3D(t,n,r,i,a,o,0,d,f,u)}else c.texImage2D(t,n,r,i,a,0,d,f,u)}}_compressedTexImage(t,n,r,i,a,o,s){let c=this._descriptor.context.gl,l=p(t);if(this._descriptor.isImmutable){if(s!=null){if(l){if(o==null)throw new e(`texture:missing-depth`,`Missing depth dimension for 3D texture upload`);c.compressedTexSubImage3D(t,n,0,0,0,i,a,o,r,s)}else c.compressedTexSubImage2D(t,n,0,0,i,a,r,s)}}else if(l){if(o==null)throw new e(`texture:missing-depth`,`Missing depth dimension for 3D texture upload`);c.compressedTexImage3D(t,n,r,i,a,o,0,s)}else c.compressedTexImage2D(t,n,r,i,a,0,s)}async _compressOnWorker(e){let{width:t,height:n,context:r,flipped:o,preMultiplyAlpha:s,hasMipmap:c,compress:l}=this._descriptor;if(!l)return;let{compressionTracker:u,compressionCallback:d,preserveSourceBitmap:f}=l,{compressedTextureETC:p,compressedTextureS3TC:m}=r.capabilities;if(!S.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!p&&!m)return;this.abortCompression();let h=new AbortController;this._compressionAbortController=h,u?.increment();let g,_=!1,v=!1;try{e instanceof ImageBitmap?f?(g=await createImageBitmap(e),i(h),v=!0):g=e:e instanceof Uint8Array?(g=e.buffer,_=this.descriptor.flipped):(g=await createImageBitmap(e,{imageOrientation:o?`flipY`:`none`}),i(h),v=!0);let r={data:g,width:t,height:n,needsFlip:_,components:this._descriptor.pixelFormat===6408?4:3,preMultiplyAlpha:s,isOpaque:this._descriptor.isOpaque,hasMipmap:c,hasETC:!!p,hasS3TC:!!m},a=await S.compressionWorkerHandle.invoke(r,h.signal,1);if(i(h),a.compressedTexture&&this.hasWebGLTextureObject){let e=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),d?.(e-this.usedMemory)}}catch(e){a(e)||x().error(`Texture compression failed!`)}finally{u?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),v&&g instanceof ImageBitmap&&g.close()}}_forEachMipmapLevel(t,n=1/0){let{width:r,height:i,depth:a,hasMipmap:o,target:s}=this._descriptor,c=s===32879;if(r==null||i==null||c&&a==null)throw new e(`texture:missing-size`,`Missing texture dimensions for mipmap calculation`);for(let e=0;t(e,r,i,a),!(!o||r===1&&i===1&&(!c||a===1)||e>=n);++e)r=Math.max(1,r>>1),i=Math.max(1,i>>1),c&&(a=Math.max(1,a>>1))}_applySamplingMode(){let e=this._descriptor,t=e.context?.gl,n=e.samplingMode,r=e.samplingMode;n===9985||n===9987?(n=9729,e.hasMipmap||(r=9729)):(n===9984||n===9986)&&(n=9728,e.hasMipmap||(r=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,n),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){let e=this._descriptor,t=e.context?.gl;typeof e.wrapMode==`number`?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){let e=this._descriptor,t=e.context?.gl,n=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,n),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),o(t)}_applyAnisotropicFilteringParameters(){let e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}export{S as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{watch as i,initial as a,whenOnce as o}from"../../core/reactiveUtils.js";import{property as s,subclass as c}from"../../core/accessorSupport/decorators.js";import{isLoaded as l,canProjectWithoutEngine as u,load as d}from"../../geometry/projectionUtils.js";import{equals as f}from"../../geometry/support/spatialReferenceUtils.js";import{basemapEnsureType as p}from"../../support/basemapEnsureType.js";import{findSpatialReference as m,getBasemapThumbnailUrl as h}from"../../support/basemapUtils.js";let g=class extends t{constructor(e){super(e),this._loadingProjectionEngine=!1,this.view=null,e?.suppressDeprecationWarning||n(r.getLogger(this),`Basemap Toggle`,`arcgis-basemap-toggle`,{version:`5.2`}),this.nextBasemap=p(`hybrid`)}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}initialize(){i(()=>this.nextBasemap,e=>{e&&!e.loaded&&e.load().catch(()=>{})},a)}destroy(){this.view=null}get _nextBasemapSpatialReferenceTask(){return m(this.view,this.nextBasemap)}get _viewSpatialReferenceLocked(){let{view:e}=this;return e&&`spatialReferenceLocked`in e?e.spatialReferenceLocked:!0}get activeBasemap(){return p(this.view?.map?.basemap??`topo-vector`)}get nextBasemap(){return this._get(`nextBasemap`)}set nextBasemap(e){this._set(`nextBasemap`,p(e))}get state(){let{view:e}=this;if(!e?.ready||this._nextBasemapSpatialReferenceTask.updating)return`disabled`;let{spatialReference:t}=this._nextBasemapSpatialReferenceTask;return this._viewSpatialReferenceLocked&&t!=null&&!e.spatialReference.equals(t)?`incompatible-next-basemap`:this._loadingProjectionEngine?`loading`:`ready`}async toggle(){let{activeBasemap:e,nextBasemap:t,state:n,view:r}=this;if(!r||n===`disabled`||n===`incompatible-next-basemap`)return;let i=this._viewSpatialReferenceLocked;if(!i){if(await o(()=>!this._nextBasemapSpatialReferenceTask.updating),t!==this.nextBasemap||e!==this.activeBasemap)return;let{spatialReference:n}=this._nextBasemapSpatialReferenceTask;if(n
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{watch as i,initial as a,whenOnce as o}from"../../core/reactiveUtils.js";import{property as s,subclass as c}from"../../core/accessorSupport/decorators.js";import{isLoaded as l,canProjectWithoutEngine as u,load as d}from"../../geometry/projectionUtils.js";import{equals as f}from"../../geometry/support/spatialReferenceUtils.js";import{basemapEnsureType as p}from"../../support/basemapEnsureType.js";import{findSpatialReference as m,getBasemapThumbnailUrl as h}from"../../support/basemapUtils.js";let g=class extends t{constructor(e){super(e),this._loadingProjectionEngine=!1,this.view=null,e?.suppressDeprecationWarning||n(r.getLogger(this),`Basemap Toggle`,`arcgis-basemap-toggle`,{version:`5.2`}),this.nextBasemap=p(`hybrid`)}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}initialize(){i(()=>this.nextBasemap,e=>{e&&!e.loaded&&e.load().catch(()=>{})},a)}destroy(){this.view=null}get _nextBasemapSpatialReferenceTask(){return m(this.view,this.nextBasemap)}get _viewSpatialReferenceLocked(){let{view:e}=this;return e&&`spatialReferenceLocked`in e?e.spatialReferenceLocked:!0}get activeBasemap(){return p(this.view?.map?.basemap??`topo-vector`)}get nextBasemap(){return this._get(`nextBasemap`)}set nextBasemap(e){this._set(`nextBasemap`,p(e))}get state(){let{view:e}=this;if(!e?.ready||this._nextBasemapSpatialReferenceTask.updating)return`disabled`;let{spatialReference:t}=this._nextBasemapSpatialReferenceTask;return this._viewSpatialReferenceLocked&&t!=null&&!e.spatialReference.equals(t)?`incompatible-next-basemap`:this._loadingProjectionEngine?`loading`:`ready`}async toggle(){let{activeBasemap:e,nextBasemap:t,state:n,view:r}=this;if(!r||n===`disabled`||n===`incompatible-next-basemap`)return;let i=this._viewSpatialReferenceLocked;if(!i){if(await o(()=>!this._nextBasemapSpatialReferenceTask.updating),t!==this.nextBasemap||e!==this.activeBasemap)return;let{spatialReference:n}=this._nextBasemapSpatialReferenceTask;if(n==null||f(r.spatialReference,n)||l()||u(r.spatialReference,n)||(this._loadingProjectionEngine=!0,await d(),this._loadingProjectionEngine=!1),t!==this.nextBasemap||e!==this.activeBasemap)return}r.map.basemap=t,!i&&this._nextBasemapSpatialReferenceTask.spatialReference!=null&&!f(r.spatialReference,this._nextBasemapSpatialReferenceTask.spatialReference)&&(r.spatialReference=this._nextBasemapSpatialReferenceTask.spatialReference),this.nextBasemap=e}static getThumbnailUrl(e){return h(e)}};e([s()],g.prototype,`_loadingProjectionEngine`,void 0),e([s({readOnly:!0})],g.prototype,`_nextBasemapSpatialReferenceTask`,null),e([s({readOnly:!0})],g.prototype,`_viewSpatialReferenceLocked`,null),e([s({readOnly:!0})],g.prototype,`activeBasemap`,null),e([s()],g.prototype,`nextBasemap`,null),e([s({readOnly:!0})],g.prototype,`state`,null),e([s()],g.prototype,`view`,void 0),e([s()],g.prototype,`toggle`,null),g=e([c(`esri.widgets.BasemapToggle.BasemapToggleViewModel`)],g);const _=g;export{_ as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as n}from"../../../../core/asyncUtils.js";import r from"../../../../core/Logger.js";import{getOrCreateMapValue as i}from"../../../../core/MapUtils.js";import{abortMaybe as a}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as s}from"../../../../core/promiseUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{validateDomainValue as d}from"../../../../layers/support/domainUtils.js";import{castArcadeValue as f}from"../../expressions/expressionUtils.js";import{makeUseId as p}from"./inputUtils.js";import{isEmptyValue as m}from"../../../support/forms/formUtils.js";let h=class extends t{constructor(e){super(e),this.initialEvaluationInProgress=!1,this.filterValue=``,this._choices=[],this._evaluated=!1,this._choicesByCode=new Map,this._expressionTask=null,this._interactionActive=!1,this._updatingHandles=new u}initialize(){!this._codedValueDomain&&!m(this.fieldInput.value)&&(this.initialEvaluationInProgress=!0,this.evaluateChoiceExpression().finally(()=>{this.initialEvaluationInProgress=!1}))}destroy(){a(this._expressionTask),this._updatingHandles.destroy()}get arcadeContextInfo(){return this.fieldInput.expressionsManager.arcadeContext}get choices(){return this._choices}get evaluating(){return this._updatingHandles.updating}get evaluated(){return this._evaluated}get inputValue(){if(this._interactionActive)return this.filterValue;let e=this.fieldInput.value;return e==null?``:this.getLabel(e)}get features(){return this.fieldInput.features}get filteredChoices(){let e=this.choices,t=this.filterValue.trim().toLocaleLowerCase();return t?e.filter((e,n)=>this._normalizedChoiceNames[n].includes(t)):e}get input(){return this.fieldInput.input}get _codedValueDomain(){let e=this.fieldInput.domain;return e?.type===`coded-value`?e:null}get _normalizedChoiceNames(){return this._choices.map(({code:e,name:t})=>`${t}\n${this.getLabel(e)}`.toLocaleLowerCase())}beginInteraction(){this._interactionActive||(this._interactionActive=!0,this.filterValue=``,this.evaluateChoiceExpression())}getChoice(e){return this._choicesByCode.get(e)}getLabel(e){
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as n}from"../../../../core/asyncUtils.js";import r from"../../../../core/Logger.js";import{getOrCreateMapValue as i}from"../../../../core/MapUtils.js";import{abortMaybe as a}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as s}from"../../../../core/promiseUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{validateDomainValue as d}from"../../../../layers/support/domainUtils.js";import{castArcadeValue as f}from"../../expressions/expressionUtils.js";import{makeUseId as p}from"./inputUtils.js";import{isEmptyValue as m}from"../../../support/forms/formUtils.js";let h=class extends t{constructor(e){super(e),this.initialEvaluationInProgress=!1,this.filterValue=``,this._choices=[],this._evaluated=!1,this._choicesByCode=new Map,this._expressionTask=null,this._interactionActive=!1,this._previouslySelectedChoice=void 0,this._updatingHandles=new u}initialize(){!this._codedValueDomain&&!m(this.fieldInput.value)&&(this.initialEvaluationInProgress=!0,this.evaluateChoiceExpression().finally(()=>{this.initialEvaluationInProgress=!1}))}destroy(){a(this._expressionTask),this._updatingHandles.destroy()}get arcadeContextInfo(){return this.fieldInput.expressionsManager.arcadeContext}get choices(){return this._choices}get evaluating(){return this._updatingHandles.updating}get evaluated(){return this._evaluated}get inputValue(){if(this._interactionActive)return this.filterValue;let e=this.fieldInput.value;return e==null?``:this.getLabel(e)}get interactionActive(){return this._interactionActive}get features(){return this.fieldInput.features}get filteredChoices(){let e=this.choices,t=this.filterValue.trim().toLocaleLowerCase();return t?e.filter((e,n)=>this._normalizedChoiceNames[n].includes(t)):e}get input(){return this.fieldInput.input}get _codedValueDomain(){let e=this.fieldInput.domain;return e?.type===`coded-value`?e:null}get _normalizedChoiceNames(){return this._choices.map(({code:e,name:t})=>`${t}\n${this.getLabel(e)}`.toLocaleLowerCase())}beginInteraction(){this._interactionActive||(this._interactionActive=!0,this.filterValue=``,this.evaluateChoiceExpression())}getChoice(e){return this._choicesByCode.get(e)}getLabel(e){return this._codedValueDomain?.getName(e)??this.getChoice(e)?.name??(this._previouslySelectedChoice?.code===e?this._previouslySelectedChoice.name:String(e))}endInteraction(){this._interactionActive=!1,this.filterValue=``}async evaluateChoiceExpression(){this._expressionTask=a(this._expressionTask);let e=n(e=>this._evaluateChoiceExpression(e));this._expressionTask=e;try{return await o(this._updatingHandles.addPromise(e.promise))??this.choices}finally{this._expressionTask===e&&(this._expressionTask=null)}}async _evaluateChoiceExpression(e){let t=await import(`../../../../arcade/languageUtils.js`);s(e);let n=this.arcadeContextInfo,r=this.fieldInput.field,i=this.fieldInput.template;await this.requestDeferredExpressionEvaluation({features:this.features.toArray(),getExecutor:e=>i.getExpressionExecutorsForLayer(e)?.choiceExpression}),s(e),this._evaluated=!0;let a=[];for(let e of this.features){let i=this._lookupExpressionOutcome(e),o=i?.result?this._parseChoices(i.result,n,r,t):[];if(a.push(o),o.length===0)break}let o=this.fieldInput.domain,c=v(_(a)).filter(({code:e})=>d(r,e,o)===null),l=this.fieldInput.value,u=l==null?void 0:this.getChoice(l)??(this._previouslySelectedChoice?.code===l?this._previouslySelectedChoice:void 0);return this._choicesByCode=new Map(c.map(e=>[e.code,e])),this._previouslySelectedChoice=u&&!this._choicesByCode.has(u.code)?u:void 0,this._choices=c,c}_lookupExpressionOutcome(e){return this.fieldInput.expressionsManager.outcomes.get(e)?.get(p({elementId:this.fieldInput.template.elementId,executorPurpose:`choiceExpression`}))}_parseChoices(e,t,n,r){if(!y(e,r))return x(this),[];let i=b(e,`choices`),a=r.isImmutableArray(i)?i.toArray():Array.isArray(i)?i:[],o=[];for(let e of a){if(!y(e,r)){x(this);continue}let i=b(e,`name`),a=b(e,`code`);if(typeof i!=`string`||a===void 0||r.isVoid(a)||r.isFunctionParameter(a)){x(this);continue}let s=f(a,n,t.timeZone,r);s!=null&&o.push({name:i,code:s})}return o}};e([c()],h.prototype,`arcadeContextInfo`,null),e([c()],h.prototype,`choices`,null),e([c()],h.prototype,`evaluating`,null),e([c()],h.prototype,`evaluated`,null),e([c()],h.prototype,`initialEvaluationInProgress`,void 0),e([c()],h.prototype,`inputValue`,null),e([c()],h.prototype,`interactionActive`,null),e([c()],h.prototype,`features`,null),e([c({constructOnly:!0})],h.prototype,`fieldInput`,void 0),e([c()],h.prototype,`filteredChoices`,null),e([c()],h.prototype,`filterValue`,void 0),e([c()],h.prototype,`input`,null),e([c()],h.prototype,`requestDeferredExpressionEvaluation`,void 0),e([c()],h.prototype,`_choices`,void 0),e([c()],h.prototype,`_codedValueDomain`,null),e([c()],h.prototype,`_evaluated`,void 0),e([c()],h.prototype,`_choicesByCode`,void 0),e([c()],h.prototype,`_interactionActive`,void 0),e([c()],h.prototype,`_normalizedChoiceNames`,null),e([c()],h.prototype,`_previouslySelectedChoice`,void 0),h=e([l(`esri.widgets.BatchAttributeForm.inputs.support.DynamicChoiceController`)],h);const g=h;function _(e){let[t,...n]=e;if(!t||t.length===0)return[];let r=t;for(let e of n.sort((e,t)=>e.length-t.length)){if(!e.length)return[];let t=new Map;for(let{code:n,name:r}of e)i(t,n,()=>new Set).add(r);if(r=r.filter(({code:e,name:n})=>t.get(e)?.has(n)),!r.length)break}return r}function v(e){let t=new Set;return e.filter(({code:e})=>!t.has(e)&&(t.add(e),!0))}function y(e,t){return t.isDictionary(e)&&typeof e.field==`function`&&typeof e.keys==`function`}function b(e,t){let n=e.keys().find(e=>e.toLowerCase()===t);return n==null?void 0:e.field(n)}function x(e){r.getLogger(e).error(`Value returned by choice expression does not conform to specification.`)}export{g as default};
|