@arcgis/core 4.23.0-next.20220131 → 4.23.0-next.20220205
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/Graphic.js +1 -1
- package/TimeExtent.js +1 -1
- package/assets/components/assets/calcite-date-picker/nls/pt-BR.json +31 -0
- package/assets/components/assets/calcite-date-picker/nls/pt-PT.json +3 -3
- package/assets/components/assets/calcite-icon/clipboard16.json +1 -0
- package/assets/components/assets/calcite-icon/clipboard24.json +1 -0
- package/assets/components/assets/calcite-icon/clipboard32.json +1 -0
- package/assets/components/assets/calcite-icon/folders16.json +1 -0
- package/assets/components/assets/calcite-icon/folders24.json +1 -0
- package/assets/components/assets/calcite-icon/folders32.json +1 -0
- package/assets/components/assets/calcite-icon/initiative16.json +1 -0
- package/assets/components/assets/calcite-icon/initiative24.json +1 -0
- package/assets/components/assets/calcite-icon/initiative32.json +1 -0
- package/assets/components/assets/calcite-icon/initiativeTemplate16.json +1 -0
- package/assets/components/assets/calcite-icon/initiativeTemplate24.json +1 -0
- package/assets/components/assets/calcite-icon/initiativeTemplate32.json +1 -0
- package/assets/components/assets/calcite-icon/multipleVariables16.json +1 -0
- package/assets/components/assets/calcite-icon/multipleVariables24.json +1 -0
- package/assets/components/assets/calcite-icon/multipleVariables32.json +1 -0
- package/assets/components/assets/calcite-icon/paletteCheck16.json +1 -0
- package/assets/components/assets/calcite-icon/paletteCheck24.json +1 -0
- package/assets/components/assets/calcite-icon/paletteCheck32.json +1 -0
- package/assets/components/assets/calcite-icon/pentagon16.json +1 -0
- package/assets/components/assets/calcite-icon/pentagon24.json +1 -0
- package/assets/components/assets/calcite-icon/pentagon32.json +1 -0
- package/assets/components/assets/calcite-icon/puzzlePiece16.json +1 -0
- package/assets/components/assets/calcite-icon/puzzlePiece24.json +1 -0
- package/assets/components/assets/calcite-icon/puzzlePiece32.json +1 -0
- package/assets/components/assets/calcite-icon/ribbonRosette16.json +1 -0
- package/assets/components/assets/calcite-icon/ribbonRosette24.json +1 -0
- package/assets/components/assets/calcite-icon/ribbonRosette32.json +1 -0
- package/assets/components/assets/calcite-icon/speechBubbleExclamation16.json +1 -0
- package/assets/components/assets/calcite-icon/speechBubbleExclamation24.json +1 -0
- package/assets/components/assets/calcite-icon/speechBubbleExclamation32.json +1 -0
- package/assets/components/assets/calcite-icon/survey16.json +1 -0
- package/assets/components/assets/calcite-icon/survey24.json +1 -0
- package/assets/components/assets/calcite-icon/survey32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{7a5f5acfbd4ca1a5c1f3.js → 06116433eb6e669f146b.js} +1 -1
- package/assets/esri/core/workers/chunks/0a4401a148c3cb73d6ff.js +1 -0
- package/assets/esri/core/workers/chunks/{83d00afae4406ec78bc9.js → 0c6be307709523eb8a05.js} +1 -1
- package/assets/esri/core/workers/chunks/{e0c8d61c7a85ce15499a.js → 0d9adefd00c44585be2e.js} +1 -1
- package/assets/esri/core/workers/chunks/{44f0c3663b293afbd172.js → 0e09691edb44641de5f0.js} +1 -1
- package/assets/esri/core/workers/chunks/0e215fa28a0448169132.js +1 -0
- package/assets/esri/core/workers/chunks/{391e96192d1ec4e55ce2.js → 101b4f02f0572afb666f.js} +1 -1
- package/assets/esri/core/workers/chunks/{db3c729ce0c0b2690dc9.js → 1180ffd523c6292bc04e.js} +1 -1
- package/assets/esri/core/workers/chunks/{826c983100569586b61f.js → 1571e8213feb518ff100.js} +1 -1
- package/assets/esri/core/workers/chunks/{929c9b7cdab7c4ca3d87.js → 17c51f5a13f471e6656a.js} +1 -1
- package/assets/esri/core/workers/chunks/{37c03cfc19086ce631c6.js → 18a8b9e2f6bd89827189.js} +1 -1
- package/assets/esri/core/workers/chunks/{ed0bcc66fb1e0ee75a4b.js → 1f34957ef42e5b5977d0.js} +1 -1
- package/assets/esri/core/workers/chunks/236de5f0476f6080ee62.js +1 -0
- package/assets/esri/core/workers/chunks/288ca064cd0472439276.js +1 -0
- package/assets/esri/core/workers/chunks/29aa6046534a43d7ce19.js +1 -0
- package/assets/esri/core/workers/chunks/2e1291cd831592216446.js +1 -0
- package/assets/esri/core/workers/chunks/{68a59ce98177d8513337.js → 3403cb53e4e60923c5fc.js} +1 -1
- package/assets/esri/core/workers/chunks/34bed896b68993cabaa1.js +1 -0
- package/assets/esri/core/workers/chunks/{99619fcb772807c74f3b.js → 444829a840b8ded16fd7.js} +1 -1
- package/assets/esri/core/workers/chunks/467b5faa1c90d9821609.js +1 -0
- package/assets/esri/core/workers/chunks/49353182a16218a84251.js +1 -0
- package/assets/esri/core/workers/chunks/{fc046a15466c25d081ff.js → 4a2e93b12d60e8d92491.js} +1 -1
- package/assets/esri/core/workers/chunks/4de996ebc432f5e149bc.js +1 -0
- package/assets/esri/core/workers/chunks/50976921acf7bd636123.js +1 -0
- package/assets/esri/core/workers/chunks/5144ef135e0deb48c7bf.js +1 -0
- package/assets/esri/core/workers/chunks/584bbb675ed225f68171.js +1 -0
- package/assets/esri/core/workers/chunks/5a90d121ba79613cc2aa.js +1 -0
- package/assets/esri/core/workers/chunks/5b286f3f3deea10bdd91.js +1 -0
- package/assets/esri/core/workers/chunks/{0463ba46df855a92b9c0.js → 65ccd204ec3053687a77.js} +1 -1
- package/assets/esri/core/workers/chunks/{1f8c6a179e39fd4c5e6f.js → 6a2b8d6a9bada45ab66d.js} +1 -1
- package/assets/esri/core/workers/chunks/6be326edd9829781d926.js +1 -0
- package/assets/esri/core/workers/chunks/6ea99a6e21b09674f6b3.js +1 -0
- package/assets/esri/core/workers/chunks/{5bcb3240b3c005e5fe72.js → 7215af7810d15e89aa5a.js} +1 -1
- package/assets/esri/core/workers/chunks/7509c1693ffedc0fa018.js +1 -0
- package/assets/esri/core/workers/chunks/7b0b75878370b3475fe5.js +1 -0
- package/assets/esri/core/workers/chunks/{bfedd6ebff817c9b31c0.js → 7b618c449d793aacd874.js} +1 -1
- package/assets/esri/core/workers/chunks/{2460f3b6ada6ae900dec.js → 7c0ff01f081c7e9050d2.js} +1 -1
- package/assets/esri/core/workers/chunks/806a7db0084214a53c79.js +1 -0
- package/assets/esri/core/workers/chunks/{8fa0a14165d43ffe87a5.js → 8325b577f52936f86cff.js} +1 -1
- package/assets/esri/core/workers/chunks/84d8e77d78d0d5134083.js +1 -0
- package/assets/esri/core/workers/chunks/{dd13772a5e2eccc6a2bc.js → 8598f762f15ca68d52b7.js} +1 -1
- package/assets/esri/core/workers/chunks/85b1ae51da3689bccf92.js +1 -0
- package/assets/esri/core/workers/chunks/873b0cbd343dc71755ed.js +1 -0
- package/assets/esri/core/workers/chunks/8804b8489eeab888275b.js +1 -0
- package/assets/esri/core/workers/chunks/{5ec98f4ddac707d0fbd1.js → 88815d533808aabb1fa9.js} +1 -1
- package/assets/esri/core/workers/chunks/8c8c0ecdf44fdbb56000.js +1 -0
- package/assets/esri/core/workers/chunks/{f2124f4d0f2b8a91f0ea.js → 90c5edcd8a609224ce55.js} +1 -1
- package/assets/esri/core/workers/chunks/{bac9fc90e6756e211160.js → 94d9951509c0db09547a.js} +1 -1
- package/assets/esri/core/workers/chunks/996d6ae7f2e2273f9bce.js +1 -0
- package/assets/esri/core/workers/chunks/{c1135cb02ec46c491459.js → 9ce961bc390202c87941.js} +1 -1
- package/assets/esri/core/workers/chunks/9fbc7d2e0326be41b382.js +1 -0
- package/assets/esri/core/workers/chunks/a363fb40096679b011f6.js +1 -0
- package/assets/esri/core/workers/chunks/a41522b0a853b85c8269.js +1 -0
- package/assets/esri/core/workers/chunks/a763c11d2b02b3ec36ad.js +1 -0
- package/assets/esri/core/workers/chunks/{aeaa1667c2d9f1b3366b.js → a85ed251d3d3668e474f.js} +1 -1
- package/assets/esri/core/workers/chunks/{69fd99b7c76e9992ccf3.js → b32bf9808cb4be3a6bd0.js} +1 -1
- package/assets/esri/core/workers/chunks/b33a6fbbc8de2969b1ca.js +1 -0
- package/assets/esri/core/workers/chunks/b548e6b3add4154ac4e6.js +1 -0
- package/assets/esri/core/workers/chunks/b6c55bdd8c957b062bc1.js +1 -0
- package/assets/esri/core/workers/chunks/b90509b2088fd444fc39.js +1 -0
- package/assets/esri/core/workers/chunks/{b9e9cb354822c6d995a4.js → bea473dba8e57617a71d.js} +1 -1
- package/assets/esri/core/workers/chunks/{0d02c6ad1f4688bfa374.js → bf7c44644fe7b0aa60cf.js} +1 -1
- package/assets/esri/core/workers/chunks/c1a70f025e90d97fac6d.js +1 -0
- package/assets/esri/core/workers/chunks/{d72488db62fcf39447b6.js → c23d965a55215168a1a2.js} +1 -1
- package/assets/esri/core/workers/chunks/c3192cfe115ce354ffbc.js +1 -0
- package/assets/esri/core/workers/chunks/c3d768801f2f6cb9d5d0.js +1 -0
- package/assets/esri/core/workers/chunks/d09a0b2dc3a6fc10fa41.js +1 -0
- package/assets/esri/core/workers/chunks/d21526570300597aa6ae.js +1 -0
- package/assets/esri/core/workers/chunks/d2ffb0f21363c0d3d2a9.js +1 -0
- package/assets/esri/core/workers/chunks/{ec10151a2a95e95a0bb5.js → d304fe0ac836afd46e3d.js} +1 -1
- package/assets/esri/core/workers/chunks/{37a7bd30352b1309b8f8.js → d3f05b8e4bd53eb1eb9d.js} +1 -1
- package/assets/esri/core/workers/chunks/{17de7a324dfa7f57ad5d.js → d780e946149b1c3d1246.js} +1 -1
- package/assets/esri/core/workers/chunks/dc037f1496bb4aa40d10.js +1 -0
- package/assets/esri/core/workers/chunks/{8cbb04a9065aa3756638.js → dc04a8ba6c770bdc2bd4.js} +1 -1
- package/assets/esri/core/workers/chunks/dd5a71818a989a6edb00.js +1 -0
- package/assets/esri/core/workers/chunks/{89820b200ee44e678af5.js → dd891a98105904f8a06b.js} +1 -1
- package/assets/esri/core/workers/chunks/e17edd48179d41ddf1e7.js +1 -0
- package/assets/esri/core/workers/chunks/e323086de328a164f7f0.js +1 -0
- package/assets/esri/core/workers/chunks/ea50a6a994e5ee578d97.js +1 -0
- package/assets/esri/core/workers/chunks/{655b55ac0cd533d7e9d7.js → ecf074743183c1749581.js} +1 -1
- package/assets/esri/core/workers/chunks/f067b4fc65b835437afd.js +1 -0
- package/assets/esri/core/workers/chunks/f0e5c82e9c4fbe3c9d0a.js +1 -0
- package/assets/esri/core/workers/chunks/f96b24c075771d028e20.js +1 -0
- package/assets/esri/core/workers/chunks/{5790d171072b3c7d108f.js → f9a6de00c628538f07f6.js} +1 -1
- package/assets/esri/core/workers/chunks/{2c607d30ff8ca1b61286.js → fe0c3b7c9b428d9c3f25.js} +1 -1
- package/assets/esri/core/workers/chunks/{49a1a633bb0d93764aae.js → fffea9587ec14c6d34e8.js} +1 -1
- package/assets/esri/themes/base/_mixins.scss +1 -1
- package/assets/esri/themes/base/widgets/_Directions.scss +0 -6
- package/assets/esri/themes/base/widgets/_Legend.scss +8 -7
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/dark-blue/main.css +1 -1
- package/assets/esri/themes/dark-green/main.css +1 -1
- package/assets/esri/themes/dark-purple/main.css +1 -1
- package/assets/esri/themes/dark-red/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/themes/light-blue/main.css +1 -1
- package/assets/esri/themes/light-green/main.css +1 -1
- package/assets/esri/themes/light-purple/main.css +1 -1
- package/assets/esri/themes/light-red/main.css +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_en.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_nb.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
- package/chunks/Fog.glsl.js +12 -24
- package/chunks/Heatmap.glsl.js +10 -0
- package/chunks/HeatmapDensity.glsl.js +21 -0
- package/chunks/Precipitation.glsl.js +2 -2
- package/core/maybe.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/interfaces.d.ts +2432 -231
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/graphics/data/optimizedFeatureQueryEngineAdapter.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/support/imageryRendererUtils.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
- package/package.json +2 -2
- package/rasterRenderers.js +1 -1
- package/renderers/DictionaryRenderer.js +1 -1
- package/renderers/FlowRenderer.d.ts +4 -0
- package/renderers/FlowRenderer.js +5 -0
- package/renderers/support/DictionaryLoader.js +5 -0
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/renderers/support/rendererConversion.js +1 -1
- package/rest/geoprocessor/GPOptions.js +1 -1
- package/rest/print.js +1 -1
- package/rest/support/DirectionLine.js +1 -1
- package/rest/support/DirectionPoint.js +1 -1
- package/rest/support/FeatureSet.js +1 -1
- package/rest/support/LegendLayer.js +1 -1
- package/rest/support/LinearUnit.js +1 -1
- package/rest/support/PointBarrier.js +1 -1
- package/rest/support/PolygonBarrier.js +1 -1
- package/rest/support/PolylineBarrier.js +1 -1
- package/rest/support/RasterData.js +1 -1
- package/smartMapping/raster/renderers/flow.js +5 -0
- package/smartMapping/raster/support/utils.js +1 -1
- package/support/basemapUtils.js +1 -1
- package/support/featureFlags.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/TextSymbol3DLayer.js +1 -1
- package/symbols/cim/effects/EffectArrow.js +1 -1
- package/symbols/support/Symbol3DHalo.js +1 -1
- package/symbols/support/Symbol3DTextBackground.js +5 -0
- package/symbols/support/previewSymbol2D.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/tasks/Geoprocessor.js +1 -1
- package/views/2d/FrameTask.js +1 -1
- package/views/2d/ViewState.js +1 -1
- package/views/2d/constraints/GeometryConstraint.js +1 -1
- package/views/2d/engine/BitmapTileContainer.js +1 -1
- package/views/2d/engine/DisplayObject.js +1 -1
- package/views/2d/engine/RasterTileContainer.js +1 -1
- package/views/2d/engine/RasterVFContainer.js +5 -0
- package/views/2d/engine/RasterVFDisplayObject.js +1 -1
- package/views/2d/engine/RasterVFTileContainer.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/flow/BrushFlow.js +1 -1
- package/views/2d/engine/flow/FlowDisplayData.js +1 -1
- package/views/2d/engine/flow/FlowGLResources.js +1 -1
- package/views/2d/engine/flow/FlowStyle.js +1 -1
- package/views/2d/engine/flow/FlowView2D.js +5 -0
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/flow/flowRendererUtils.js +5 -0
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/brushes/raster/BrushVectorField.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/Buffer.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLBaseTextTemplate.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/util/Matcher.js +1 -1
- package/views/2d/input/handlers/DragPan.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/WMSLayerView2D.js +1 -1
- package/views/2d/layers/WMTSLayerView2D.js +1 -1
- package/views/2d/layers/features/Pipeline.js +1 -1
- package/views/2d/layers/features/createSymbolSchema.js +5 -0
- package/views/2d/layers/features/processors/HeatmapProcessor.js +1 -1
- package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
- package/views/2d/layers/features/schemaUtils.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/ClusterStore.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
- package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryVFStrategy.js +5 -0
- package/views/2d/layers/imagery/ImageryView2D.js +1 -1
- package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
- package/views/2d/layers/imagery/VectorFieldView2D.js +5 -0
- package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
- package/views/2d/navigation/MapViewNavigation.js +1 -1
- package/views/2d/navigation/actions/Pan.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/PrecipitationTechnique.js +1 -1
- package/views/3d/environment/SceneViewEnvironment.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/weather.js +1 -1
- package/views/3d/interactive/analysisTools/lineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/IRouteLayerView3D.js +4 -0
- package/views/3d/layers/RouteLayerView3D.js +5 -0
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/labelPlacement.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +5 -0
- package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextTexture.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +5 -0
- package/views/3d/webgl-engine/shaders/Heatmap.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/HeatmapDensity.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +5 -0
- package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +5 -0
- package/views/MapView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/draw/support/HighlightHelper.js +5 -0
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/layerUtils.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/support/WatchUpdatingTracking.js +1 -1
- package/views/support/projectionUtils.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/enums.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/Directions/support/resources.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Legend/styles/Card.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
- package/widgets/support/vnodeCache.js +5 -0
- package/widgets/support/widgetUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0453fad5cb819797b4f6.js +0 -1
- package/assets/esri/core/workers/chunks/0c15d77d8e817cf45a9a.js +0 -1
- package/assets/esri/core/workers/chunks/0cd0a6eef51fc5b9ea61.js +0 -1
- package/assets/esri/core/workers/chunks/0d684f16f37d5dc385dd.js +0 -1
- package/assets/esri/core/workers/chunks/16b6d0f8378582c051c3.js +0 -1
- package/assets/esri/core/workers/chunks/1877ab1b6a115dbba1c5.js +0 -1
- package/assets/esri/core/workers/chunks/197ec52641aed20029c6.js +0 -1
- package/assets/esri/core/workers/chunks/1b2a961f776a0b57e57a.js +0 -1
- package/assets/esri/core/workers/chunks/1b3fd66577b19aa5f2b6.js +0 -1
- package/assets/esri/core/workers/chunks/1c733b7db092a2a88ef3.js +0 -1
- package/assets/esri/core/workers/chunks/2629adf79e7fd9f25f07.js +0 -1
- package/assets/esri/core/workers/chunks/27474b007988855bea9d.js +0 -1
- package/assets/esri/core/workers/chunks/2b25fc7945a187c2bb9d.js +0 -1
- package/assets/esri/core/workers/chunks/34b59d7099904dcb28b5.js +0 -1
- package/assets/esri/core/workers/chunks/422537fc3df707bb62c9.js +0 -1
- package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +0 -1
- package/assets/esri/core/workers/chunks/4ba6de8aa7e2960bad49.js +0 -1
- package/assets/esri/core/workers/chunks/4be35af7d6babbfe9d84.js +0 -1
- package/assets/esri/core/workers/chunks/5457962a70bd3c557a75.js +0 -1
- package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +0 -1
- package/assets/esri/core/workers/chunks/57b349d1dbc0bed75b79.js +0 -1
- package/assets/esri/core/workers/chunks/5d11b97b667921d67ae7.js +0 -1
- package/assets/esri/core/workers/chunks/5dbe555a5a662ff3d9ce.js +0 -1
- package/assets/esri/core/workers/chunks/64b7e8d812ea8fcf269e.js +0 -1
- package/assets/esri/core/workers/chunks/75d812955a473d0e8960.js +0 -1
- package/assets/esri/core/workers/chunks/94515fb3ef38067eeadd.js +0 -1
- package/assets/esri/core/workers/chunks/952980635afc7ec81804.js +0 -1
- package/assets/esri/core/workers/chunks/96f148a556a2418038de.js +0 -1
- package/assets/esri/core/workers/chunks/9876a1bae350795fab36.js +0 -1
- package/assets/esri/core/workers/chunks/a1930e4f035bc9aa1ae5.js +0 -1
- package/assets/esri/core/workers/chunks/a8692bffb76444c34760.js +0 -1
- package/assets/esri/core/workers/chunks/b3f5e91116112b0b612a.js +0 -1
- package/assets/esri/core/workers/chunks/ba762bcfd74af0bb8218.js +0 -1
- package/assets/esri/core/workers/chunks/be588873c16770ceb9ef.js +0 -1
- package/assets/esri/core/workers/chunks/bf6dda4a2af14c4b7716.js +0 -1
- package/assets/esri/core/workers/chunks/c2253a9f29c1aabb2b75.js +0 -1
- package/assets/esri/core/workers/chunks/c984b3040e120e502b11.js +0 -1
- package/assets/esri/core/workers/chunks/cdbc005eebec1503b99d.js +0 -1
- package/assets/esri/core/workers/chunks/d04fca5d46cca02500b7.js +0 -1
- package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +0 -1
- package/assets/esri/core/workers/chunks/d98dab12b71912fa397b.js +0 -1
- package/assets/esri/core/workers/chunks/dedc333a61081772ca7b.js +0 -1
- package/assets/esri/core/workers/chunks/e218bde41ffbcc5194f5.js +0 -1
- package/assets/esri/core/workers/chunks/e287f49184d076af17e2.js +0 -1
- package/assets/esri/core/workers/chunks/e9e5196b44b6923be1a3.js +0 -1
- package/assets/esri/core/workers/chunks/ea595b0df5050eda2a13.js +0 -1
- package/assets/esri/core/workers/chunks/eb82ff10cef2bde6e57f.js +0 -1
- package/assets/esri/core/workers/chunks/ee6e0db58dc64410e687.js +0 -1
- package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +0 -1
- package/renderers/AnimatedFlowRenderer.d.ts +0 -4
- package/renderers/AnimatedFlowRenderer.js +0 -5
- package/views/2d/engine/flow/AnimatedFlowView2D.js +0 -5
- package/views/2d/engine/flow/animatedFlowRendererUtils.js +0 -5
- package/views/2d/layers/imagery/ImageryGraphicsView2D.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as t,isSome as e}from"../../../../../core/maybe.js";import{convertFromFeatures as r,convertFromFeatureSet as s,convertToFeature as i,convertToGeometry as n,getQuantizedArea as o,unquantizeOptimizedGeometry as a}from"../../../../../layers/graphics/featureConversionUtils.js";import{hasGeometry as u}from"../../../../../layers/graphics/OptimizedFeature.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";function c({coords:t,lengths:e}){let r=0;for(const s of e){for(let e=1;e<s;e++)t[2*(r+e)]+=t[2*(r+e)-2],t[2*(r+e)+1]+=t[2*(r+e)-1];r+=s}}class d extends h{constructor(t,e,r){super(t),this._featureIndex=-1,this._dateFields=new Set,this._geometryType=r,this._features=e}static fromFeatures(t,e,s){const i=r([],t,e,!1,!1,s);for(let r=0;r<i.length;r++)i[r].displayId=t[r].displayId;return d.fromOptimizedFeatures(i,e)}static fromFeatureSet(t,e){const r=s(t,e);return d.fromOptimizedFeatureSet(r)}static fromOptimizedFeatureSet(t){const{features:e,geometryType:r}=t,s=d.fromOptimizedFeatures(e,r);s._exceededTransferLimit=t.exceededTransferLimit,s._transform=t.transform;for(const i of t.fields)"esriFieldTypeDate"===i.type&&s._dateFields.add(i.name);return s}static fromOptimizedFeatures(t,e,r){const s=h.createInstance(),i=new d(s,t,e);return i._transform=r,i}get _current(){return this._features[this._featureIndex]}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}removeIds(t){const e=new Set(t);this._features=this._features.filter((t=>!e.has(t.objectId)))}append(t){for(const e of t)this._features.push(e)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let t="";for(const e in this._current.attributes)t+=this._current.attributes[e];return t}getIndex(){return this._featureIndex}setIndex(t){this._featureIndex=t}getObjectId(){return this._current.objectId}getDisplayId(){return this._current.displayId}setDisplayId(t){this._current.displayId=t}getGroupId(){return this._current.groupId}setGroupId(t){this._current.groupId=t}copy(){const t=new d(this.instance,this._features,this.geometryType);return this.copyInto(t),t}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readLegacyFeature(){return i(this._current,this.geometryType,this.hasZ,this.hasM)}readOptimizedFeature(){return this._current}readLegacyPointGeometry(){return this.readGeometry()?{x:this.getX(),y:this.getY()}:null}readLegacyGeometry(){const t=this.readGeometry();return n(t,this.geometryType,this.hasZ,this.hasM)}readLegacyCentroid(){const e=this.readCentroid();return t(e)?null:{x:e.coords[0]*this._sx+this._tx,y:e.coords[1]*this._sy+this._ty}}readGeometryArea(){return u(this._current)?o(this._current.geometry,2):0}readUnquantizedGeometry(){const t=this.readGeometry();if("esriGeometryPoint"===this.geometryType||!t)return t;const e=t.clone();return c(e),e}readHydratedGeometry(){const r=this._current.geometry;if(t(r))return null;const s=r.clone();return e(this._transform)&&a(s,s,this.hasZ,this.hasM,this._transform),s}getXHydrated(){if(!u(this._current))return 0;const e=this._current.geometry.coords[0],r=this.getQuantizationTransform();return t(r)?e:e*r.scale[0]+r.translate[0]}getYHydrated(){if(!u(this._current))return 0;const e=this._current.geometry.coords[1],r=this.getQuantizationTransform();return t(r)?e:r.translate[1]-e*r.scale[1]}getX(){return u(this._current)?this._current.geometry.coords[0]*this._sx+this._tx:0}getY(){return u(this._current)?this._current.geometry.coords[1]*this._sy+this._ty:0}readGeometry(){if(!u(this._current))return null;const t=this._current.geometry.clone();if(t.isPoint)return t.coords[0]=t.coords[0]*this._sx+this._tx,t.coords[1]=t.coords[1]*this._sy+this._ty,t;let e=0;for(const r of t.lengths)t.coords[2*e]=t.coords[2*e]*this._sx+this._tx,t.coords[2*e+1]=t.coords[2*e+1]*this._sy+this._ty,e+=r;return t}readCentroid(){if(!u(this._current))return null;if(
|
|
5
|
+
import{isNone as t,isSome as e}from"../../../../../core/maybe.js";import{convertFromFeatures as r,convertFromFeatureSet as s,convertToFeature as i,convertToGeometry as n,getQuantizedArea as o,unquantizeOptimizedGeometry as a}from"../../../../../layers/graphics/featureConversionUtils.js";import{hasGeometry as u}from"../../../../../layers/graphics/OptimizedFeature.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";function c({coords:t,lengths:e}){let r=0;for(const s of e){for(let e=1;e<s;e++)t[2*(r+e)]+=t[2*(r+e)-2],t[2*(r+e)+1]+=t[2*(r+e)-1];r+=s}}class d extends h{constructor(t,e,r){super(t),this._featureIndex=-1,this._dateFields=new Set,this._geometryType=r,this._features=e}static fromFeatures(t,e,s){const i=r([],t,e,!1,!1,s);for(let r=0;r<i.length;r++)i[r].displayId=t[r].displayId;return d.fromOptimizedFeatures(i,e)}static fromFeatureSet(t,e){const r=s(t,e);return d.fromOptimizedFeatureSet(r)}static fromOptimizedFeatureSet(t){const{features:e,geometryType:r}=t,s=d.fromOptimizedFeatures(e,r);s._exceededTransferLimit=t.exceededTransferLimit,s._transform=t.transform;for(const i of t.fields)"esriFieldTypeDate"===i.type&&s._dateFields.add(i.name);return s}static fromOptimizedFeatures(t,e,r){const s=h.createInstance(),i=new d(s,t,e);return i._transform=r,i}get _current(){return this._features[this._featureIndex]}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}removeIds(t){const e=new Set(t);this._features=this._features.filter((t=>!e.has(t.objectId)))}append(t){for(const e of t)this._features.push(e)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let t="";for(const e in this._current.attributes)t+=this._current.attributes[e];return t}getIndex(){return this._featureIndex}setIndex(t){this._featureIndex=t}getObjectId(){return this._current.objectId}getDisplayId(){return this._current.displayId}setDisplayId(t){this._current.displayId=t}getGroupId(){return this._current.groupId}setGroupId(t){this._current.groupId=t}copy(){const t=new d(this.instance,this._features,this.geometryType);return this.copyInto(t),t}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readLegacyFeature(){return i(this._current,this.geometryType,this.hasZ,this.hasM)}readOptimizedFeature(){return this._current}readLegacyPointGeometry(){return this.readGeometry()?{x:this.getX(),y:this.getY()}:null}readLegacyGeometry(){const t=this.readGeometry();return n(t,this.geometryType,this.hasZ,this.hasM)}readLegacyCentroid(){const e=this.readCentroid();return t(e)?null:{x:e.coords[0]*this._sx+this._tx,y:e.coords[1]*this._sy+this._ty}}readGeometryArea(){return u(this._current)?o(this._current.geometry,2):0}readUnquantizedGeometry(){const t=this.readGeometry();if("esriGeometryPoint"===this.geometryType||!t)return t;const e=t.clone();return c(e),e}readHydratedGeometry(){const r=this._current.geometry;if(t(r))return null;const s=r.clone();return e(this._transform)&&a(s,s,this.hasZ,this.hasM,this._transform),s}getXHydrated(){if(!u(this._current))return 0;const e=this._current.geometry.coords[0],r=this.getQuantizationTransform();return t(r)?e:e*r.scale[0]+r.translate[0]}getYHydrated(){if(!u(this._current))return 0;const e=this._current.geometry.coords[1],r=this.getQuantizationTransform();return t(r)?e:r.translate[1]-e*r.scale[1]}getX(){return u(this._current)?this._current.geometry.coords[0]*this._sx+this._tx:0}getY(){return u(this._current)?this._current.geometry.coords[1]*this._sy+this._ty:0}readGeometry(){if(!u(this._current))return null;const t=this._current.geometry.clone();if(t.isPoint)return t.coords[0]=t.coords[0]*this._sx+this._tx,t.coords[1]=t.coords[1]*this._sy+this._ty,t;let e=0;for(const r of t.lengths)t.coords[2*e]=t.coords[2*e]*this._sx+this._tx,t.coords[2*e+1]=t.coords[2*e+1]*this._sy+this._ty,e+=r;return t}readCentroid(){if(!u(this._current))return null;if(t(this._current.centroid)){const e=this._computeCentroid();if(t(e))return null;e.coords[0]=(e.coords[0]-this._tx)/this._sx,e.coords[1]=(e.coords[1]-this._ty)/this._sy,this._current.centroid=e}const e=this._current.centroid.clone();return e.coords[0]=e.coords[0]*this._sx+this._tx,e.coords[1]=e.coords[1]*this._sx+this._ty,e}_readAttribute(t,e){const r=this._current.attributes[t];if(void 0!==r)return null!=r&&e&&this._dateFields.has(t)?new Date(r):r;const s=this.readAttributes(),i=t.toLocaleLowerCase().trim();for(const n in s)if(n.toLocaleLowerCase().trim()===i){const t=this._current.attributes[n];return null!=t&&e&&this._dateFields.has(n)?new Date(t):t}}copyInto(t){super.copyInto(t),t._featureIndex=this._featureIndex,t._transform=this._transform,t._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}}export{d as FeatureSetReaderJSON};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/has.js";import{isAbortError as i}from"../../../../../core/promiseUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/set.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as r}from"../../../../../geometry/support/aaBoundingRect.js";import{FeatureTile as a}from"../../../engine/webgl/FeatureTile.js";import{simplifyVVRenderer as o}from"../support/rendererUtils.js";import l from"./BaseTileRenderer.js";import{convertVisualVariables as n}from"./support/visualVariablesUtils.js";import{WGLFeatureView as u}from"./support/WGLFeatureView.js";let p=class extends l{install(e){const t=()=>this.notifyChange("updating"),i=new u(this.tileInfoView,this.layerView,this.layer,t);this.featuresView=i,e.addChild(i)}uninstall(e){e.removeChild(this.featuresView),this.featuresView.destroy()}fetchResource(e,t){const{url:s}=e,r=this.featuresView.stage;try{return r.resourceManager.fetchResource(s,{signal:t.signal})}catch(a){return i(a)?Promise.resolve({width:0,height:0}):Promise.reject(a)}}isUpdating(){var e;const i=super.isUpdating(),s=!this.featuresView||this.featuresView.isUpdating(),r=null==(e=this.featuresView)?void 0:e.hasEmptyAttributeView(),a=i||s||i&&r;return t("esri-2d-log-updating")&&console.log(`Updating SymbolTileRenderer ${a}\n -> updatingTiles ${i}\n -> hasFeaturesView ${!!this.featuresView}\n -> updatingFeaturesView ${s}`),a}hitTest(e){return this.featuresView.hitTest(e)}supportsRenderer(e){return null!=e&&-1!==["simple","class-breaks","unique-value","dot-density","dictionary"].indexOf(e.type)}onConfigUpdate(e){let t=null;if("visualVariables"in e){const i=(o(e).visualVariables||[]).map((e=>{const t=e.clone();return"normalizationField"in e&&(t.normalizationField=null),e.valueExpression&&"$view.scale"!==e.valueExpression&&(t.valueExpression=null,t.field="nop"),t}));t=n(i)}this.featuresView.setRendererInfo(e,t,this.layerView.featureEffect)}onTileData(e){const t=this.tiles.get(e.tileKey);t&&e.data&&this.featuresView.onTileData(t,e.data),this.layerView.view.labelManager.requestUpdate()}onTileError(e){const t=this.tiles.get(e.tileKey);t&&this.featuresView.onTileError(t)}forceAttributeTextureUpload(){this.featuresView.attributeView.forceTextureUpload()}lockGPUUploads(){this.featuresView.attributeView.lockTextureUpload(),this.tiles.forEach((e=>e.lock()))}unlockGPUUploads(){this.featuresView.attributeView.unlockTextureUpload(),this.tiles.forEach((e=>e.unlock()))}async getMaterialItems(e){return this.featuresView.getMaterialItems(e)}invalidateLabels(){this.featuresView.hasLabels&&this.layerView.view.labelManager.requestUpdate()}createTile(e){const t=this.tileInfoView.getTileBounds(r(),e),i=()=>this.layerView.view.labelManager.requestUpdate();return new a(e,t[0],t[3],this.featuresView.attributeView,i)}disposeTile(e){this.featuresView.removeChild(e),e.destroy(),this.layerView.view.labelManager.requestUpdate()}};p=e([s("esri.views.2d.layers.features.tileRenderers.SymbolTileRenderer")],p);const c=p;export{c as default};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/has.js";import{isAbortError as i}from"../../../../../core/promiseUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/set.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as r}from"../../../../../geometry/support/aaBoundingRect.js";import{FeatureTile as a}from"../../../engine/webgl/FeatureTile.js";import{simplifyVVRenderer as o}from"../support/rendererUtils.js";import l from"./BaseTileRenderer.js";import{convertVisualVariables as n}from"./support/visualVariablesUtils.js";import{WGLFeatureView as u}from"./support/WGLFeatureView.js";let p=class extends l{install(e){const t=()=>this.notifyChange("updating"),i=new u(this.tileInfoView,this.layerView,this.layer,t);this.featuresView=i,e.addChild(i)}uninstall(e){e.removeChild(this.featuresView),this.featuresView.destroy(),this.featuresView=null}fetchResource(e,t){const{url:s}=e,r=this.featuresView.stage;try{return r.resourceManager.fetchResource(s,{signal:t.signal})}catch(a){return i(a)?Promise.resolve({width:0,height:0}):Promise.reject(a)}}isUpdating(){var e;const i=super.isUpdating(),s=!this.featuresView||this.featuresView.isUpdating(),r=null==(e=this.featuresView)?void 0:e.hasEmptyAttributeView(),a=i||s||i&&r;return t("esri-2d-log-updating")&&console.log(`Updating SymbolTileRenderer ${a}\n -> updatingTiles ${i}\n -> hasFeaturesView ${!!this.featuresView}\n -> updatingFeaturesView ${s}`),a}hitTest(e){return this.featuresView.hitTest(e)}supportsRenderer(e){return null!=e&&-1!==["simple","class-breaks","unique-value","dot-density","dictionary"].indexOf(e.type)}onConfigUpdate(e){let t=null;if("visualVariables"in e){const i=(o(e).visualVariables||[]).map((e=>{const t=e.clone();return"normalizationField"in e&&(t.normalizationField=null),e.valueExpression&&"$view.scale"!==e.valueExpression&&(t.valueExpression=null,t.field="nop"),t}));t=n(i)}this.featuresView.setRendererInfo(e,t,this.layerView.featureEffect)}onTileData(e){const t=this.tiles.get(e.tileKey);t&&e.data&&this.featuresView.onTileData(t,e.data),this.layerView.view.labelManager.requestUpdate()}onTileError(e){const t=this.tiles.get(e.tileKey);t&&this.featuresView.onTileError(t)}forceAttributeTextureUpload(){this.featuresView.attributeView.forceTextureUpload()}lockGPUUploads(){this.featuresView.attributeView.lockTextureUpload(),this.tiles.forEach((e=>e.lock()))}unlockGPUUploads(){this.featuresView.attributeView.unlockTextureUpload(),this.tiles.forEach((e=>e.unlock()))}async getMaterialItems(e){return this.featuresView.getMaterialItems(e)}invalidateLabels(){this.featuresView.hasLabels&&this.layerView.view.labelManager.requestUpdate()}createTile(e){const t=this.tileInfoView.getTileBounds(r(),e),i=()=>this.layerView.view.labelManager.requestUpdate();return new a(e,t[0],t[3],this.featuresView.attributeView,i)}disposeTile(e){this.featuresView.removeChild(e),e.destroy(),this.layerView.view.labelManager.requestUpdate()}};p=e([s("esri.views.2d.layers.features.tileRenderers.SymbolTileRenderer")],p);const c=p;export{c as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{bidiText as s}from"../../../../core/BidiText.js";import{HandleOwnerMixin as i}from"../../../../core/HandleOwner.js";import r from"../../../../core/has.js";import{isSome as o,isNone as a}from"../../../../core/maybe.js";import{throwIfAborted as h,isAbortError as n,throwIfAbortError as l}from"../../../../core/promiseUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../geometry/SpatialReference.js";import{width as g,height as u,create as m}from"../../../../geometry/support/aaBoundingRect.js";import{closeRingsAndFixWinding as _}from"../../../../geometry/support/coordsUtils.js";import{getJsonType as f,isPolygon as y,isPolyline as b,isExtent as S,isPoint as w,isMultipoint as T}from"../../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridianSync as v}from"../../../../geometry/support/normalizeUtilsSync.js";import{getInfo as I}from"../../../../geometry/support/spatialReferenceUtils.js";import{checkProjectionSupport as G,project as U}from"../../../../layers/graphics/data/projectionSupport.js";import{symbolToCIM as M}from"../../../../symbols/cim/CIMSymbolHelper.js";import{errorPolylineSymbol2D as C,errorPolygonSymbol2D as j,errorPointSymbol2D as P}from"../../../../symbols/support/defaults.js";import{FILTER_FLAG_0 as x}from"../../engine/webgl/definitions.js";import{GraphicTile as A}from"../../engine/webgl/GraphicTile.js";import{TileData as R}from"../../engine/webgl/TileData.js";import q from"../../engine/webgl/WGLDisplayObject.js";import{MeshData as D}from"../../engine/webgl/mesh/MeshData.js";import{WGLMeshFactory as O}from"../../engine/webgl/mesh/factories/WGLMeshFactory.js";import{WGLTemplateStore as z}from"../../engine/webgl/mesh/templates/WGLTemplateStore.js";import{createMatcher as F}from"../../engine/webgl/util/Matcher.js";import{createMatcherSchema as H,createSymbolSchema as k}from"../features/schemaUtils.js";import E from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as N}from"../features/support/ComputedAttributeStorage.js";import{GraphicsReader as V}from"../features/support/GraphicsReader.js";import B from"./GraphicStore.js";import{intersectingInternationalDateline as L,isMarkerSymbol as W,isTextSymbol as J,polygonFromExtent as Z,TILE_SIZE as K,PIXEL_BUFFER as Q}from"./graphicsUtils.js";import{expandSymbol as X}from"../support/cimSymbolUtils.js";import{GraphicsView as Y}from"../../../layers/GraphicsView.js";import{getWebGL1Capabilities as $}from"../../../webgl/capabilities.js";const ee=r("esri-2d-graphic-debug");function te(e,t,s){if(s.has(e))return s.get(e);const i={tile:t,addedOrModified:[],removed:[]};return s.set(e,i),i}let se=class extends(Y(i(t))){constructor(e){super(e),this._storage=new N,this._displayIds=new Map,this._controller=new AbortController,this._tiles=new Map,this._graphicStoreUpdate=!1,this._graphicsSet=new Set,this._matcher=Promise.resolve(null),this._tileUpdateSet=new Set,this._tilesToUpdate=new Map,this._graphicIdToAbortController=new Map,this._attached=!1,this._updatingGraphicsTimer=null,this._hashToExpandedSymbol=new Map,this._hashToExpandedSymbolPromise=new Map,this._hashToCIMSymbolPromise=new Map,this._hashToCIM=new Map,this._processing=!1,this._needsProcessing=!1,this._pendingUpdate={added:new Set,updated:new Set,removed:new Set},this.lastUpdateId=-1,this.updateRequested=!1,this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this._updatingGraphicsTimer&&(clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=null,this.notifyChange("updating")),this._controller.abort(),this.container.destroy(),this._set("graphics",null),this._graphicStore.clear(),this._attributeStore=null,this._hashToExpandedSymbol.clear(),this.view=null,this.renderer=null,this._hashToCIM.clear(),this._hashToCIMSymbolPromise.clear(),this._hashToExpandedSymbolPromise.clear()}_createMatcher(e,t,s){if(e){const i=H({indexCount:0,fields:{}},"feature",e);this._matcher=F(i,t,null,s)}}_createDisplayId(e){return this._displayIds.has(e)||this._displayIds.set(e,this._storage.createDisplayId()),this._displayIds.get(e)}initialize(){this._attributeStore=new E({type:"local",initialize:e=>Promise.resolve(this.container.attributeView.initialize(e)),update:e=>this.container.attributeView.requestUpdate(e),render:()=>this.container.requestRender()},$()),this.container.hasHighlight=()=>this._attributeStore.hasHighlight;const e=e=>{this._createDisplayId(e.uid),this._setFilterState(e.uid,e.visible)},t=e=>{const t=this._displayIds.get(e.uid);this._displayIds.delete(e.uid),this._storage.releaseDisplayId(t)},s=new z(this.container.getMaterialItems.bind(this.container),this.view.featuresTilingScheme.tileInfo);this._graphicStore=new B(this.view.featuresTilingScheme,this.view.state.scale,this.uid,this.graphics,e,t,this._hashToCIM),this._meshFactory=new O(null,this.uid,s),this._templateStore=s,this.handles.add([this.watch("renderer",(e=>{this._createMatcher(e,s,this.container.stage.resourceManager);for(const t of this.graphics)this._pendingUpdate.updated.add(t);this.requestUpdate()})),this.view.graphicsTileStore.on("update",(e=>this._onTileUpdate(e))),this.container.on("attach",(()=>{ee&&this.container.enableRenderingBounds((()=>this._graphicStore.getAllBounds())),this.graphics.items.length>0&&this._graphicsChangeHandler({target:this.graphics,added:this.graphics.items,removed:[],moved:[]}),this.handles.add(this.graphics.on("change",(e=>this._graphicsChangeHandler(e))),"graphics");const e=this.container.stage.resourceManager;this._createMatcher(this.renderer,s,e),this._graphicStore.setResourceManager(e),this._attached=!0,this.notifyChange("updating")}))]);const i=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:i,removed:[]})}get updating(){return!this._attached||null!==this._updatingGraphicsTimer||this._tileUpdateSet.size>0||this._tilesToUpdate.size>0}hitTest(e){if(!this.view||!this.view.position)return null;const{resolution:t,rotation:s}=this.view.state;return this._graphicStore.hitTest(e.x,e.y,2,t,s)}update(e){h(this._controller.signal);const t=e.state,{resolution:s}=t;if(this._graphicStore.updateLevel(s),this._graphicStoreUpdate=!0,this.updateRequested=!1,this._pendingUpdate.updated.size>0){if(!this._processing)return void this._updateGraphics();this._needsProcessing=!0}}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback())}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}graphicUpdateHandler(e){const{graphic:t,property:s,newValue:i}=e;switch(s){case"attributes":break;case"geometry":case"symbol":this._pendingUpdate.updated.add(t),this.requestUpdate();break;case"visible":this._setFilterState(t.uid,i),this._attributeStore.sendUpdates()}}setHighlight(e){const t=e.map((e=>this._displayIds.get(e)));this._attributeStore.setHighlight(e,t)}_getIntersectingTiles(e){const t=this._graphicStore.getBounds(e);if(!t||0===g(t)||0===u(t))return[];const s=L(t,this.view.spatialReference);return o(s)?[...new Set([...this.view.graphicsTileStore.boundsIntersections(s[0]),...this.view.graphicsTileStore.boundsIntersections(s[1])])]:this.view.graphicsTileStore.boundsIntersections(t)}async _updateTile(e){h(this._controller.signal);const t=e.tile,s=this._getGraphicsData(this._templateStore,t,e.addedOrModified),i=await this._processGraphics(t,s);return h(this._controller.signal),this._patchTile(t.key,{type:"update",addOrUpdate:i,remove:e.removed,end:!0,clear:!1,sort:!1}),i}_patchTile(e,t){if(!this._tiles.has(e))return;const s=this._tiles.get(e);this.container.onTileData(s,t),this.container.requestRender()}_graphicsChangeHandler(e){const t=this._pendingUpdate;for(const s of e.added)t.added.add(s);for(const s of e.moved)t.updated.add(s);for(const s of e.removed)this._pendingUpdate.added.has(s)?t.added.delete(s):t.removed.add(s);this._processing?this._needsProcessing=!0:this._updateGraphics()}_getGraphicsToUpdate(){const e={added:[],removed:[],updated:[]};if(!this.graphics)return e;const t=this._pendingUpdate;for(const s of this.graphics.items)t.added.has(s)?e.added.push(s):t.updated.has(s)&&e.updated.push(s);for(const s of t.removed)this._graphicStore.has(s)&&e.removed.push(s);return t.added.clear(),t.removed.clear(),t.updated.clear(),e}async _updateGraphics(){this._processing=!0;const{added:e,removed:t,updated:s}=this._getGraphicsToUpdate(),i=this._tilesToUpdate;let r;try{if(!this._graphicStoreUpdate){const e=this.view.state,{resolution:t}=e;this._graphicStore.updateLevel(t)}const o=[],a=new Array(e.length+t.length);for(let e=0;e<s.length;e++){const t=s[e],h=this._getIntersectingTiles(t);for(const e of h){r=e.id;te(r,e,i).removed.push(this._displayIds.get(t.uid))}o.push(this._updateGraphic(t,null)),a[e]=t}const h=s.length;for(let t=0;t<e.length;t++){const s=e[t];a[h+t]=s,this._graphicsSet.add(s),o.push(this._addGraphic(s))}for(const e of t){this._abortProcessingGraphic(e.uid);const t=this._getIntersectingTiles(e);for(const s of t){r=s.id;te(r,s,i).removed.push(this._displayIds.get(e.uid))}this._graphicsSet.delete(e),this._graphicStore.remove(e)}let n;this._flipUpdatingGraphics(),await Promise.all(o);for(let e=0;e<a.length;e++){n=a[e];const t=this._getIntersectingTiles(n);for(const e of t){r=e.id;te(r,e,i).addedOrModified.push(n)}}this._graphicStore.updateZ();const l=[];for(const[e,t]of i)l.push(this._updateTile(t));await Promise.all(l)}catch(o){n(o),0}for(const a of t)try{const e=await this._getSymbolForGraphic(a,{});if(e){const t=e.hash();this._hashToExpandedSymbol.delete(t)}}catch(o){n(o),0}i.clear(),this.notifyChange("updating"),this._processing=!1,this._needsProcessing&&(this._needsProcessing=!1,this._updateGraphics())}_getArcadeInfo(e){const t=(e.attributes?Object.keys(e.attributes):[]).map((t=>({name:t,alias:t,type:"string"==typeof e.attributes[t]?"esriFieldTypeString":"esriFieldTypeDouble"})));return a(e.geometry)?null:{geometryType:f(e.geometry),spatialReference:c.fromJSON(e.geometry.spatialReference),fields:t}}_getSymbolForGraphic(e,t){return h(this._controller.signal),o(e.symbol)?Promise.resolve(e.symbol):o(this.renderer)?this.renderer.getSymbolAsync(e,{scale:this.view.scale,abortOptions:t}):Promise.resolve(this._getNullSymbol(e))}_getCIMSymbol(e,t,s){let i=this._hashToCIM.get(t);if(i)return Promise.resolve(i);const r=M(e);if(o(r)){if("CIMSymbolReference"===r.type)return i=r,this._hashToCIM.set(t,i),Promise.resolve(i);let e=this._hashToCIMSymbolPromise.get(t);return e||(e=r.fetchCIMSymbol(s).then((e=>(this._hashToCIM.set(t,e.data),this._hashToCIMSymbolPromise.delete(t),e))).catch((e=>(this._hashToCIMSymbolPromise.delete(t),l(e),null))),this._hashToCIMSymbolPromise.set(t,e),e)}return Promise.resolve(null)}_expandCIMSymbol(e,t,s,i){const r=this._hashToExpandedSymbol.get(s);if(r)return Promise.resolve(r);let o=this._hashToExpandedSymbolPromise.get(s);if(o)return o;const a=this.container.stage,h=this._getArcadeInfo(t),n=k(e);return o=X(n,h,a.resourceManager,i),this._hashToExpandedSymbolPromise.set(s,o),o.then((e=>(this._hashToExpandedSymbol.set(s,e),this._hashToExpandedSymbolPromise.delete(s),e))),o}async _getSymbolResources(e,t){h(this._controller.signal);return this.container.stage?this._getSymbolForGraphic(e,t).then((i=>{const r=i.hash();return this._getCIMSymbol(i,r,t).then((i=>a(i)?null:this._expandCIMSymbol(i,e,r,t).then((e=>{const t=e.layers.filter((e=>"text"===e.type&&"string"==typeof e.text));if(t&&t.length>0){const i=new Array(t.length);for(let e=0;e<t.length;e++){const r=t[e],o=[],[a]=s(r.text);for(let e=0;e<a.length;e++)o.push(a.charCodeAt(e));i[e]={symbol:r,id:e,glyphIds:o}}const o=new Map;return this.container.getMaterialItems(i).then((s=>{for(let e=0;e<t.length;e++){const i=t[e];o.set(i.cim,{text:i.text,mosaicItem:s[e].mosaicItem})}return{symbol:e,textInfo:o,hash:r}}))}return{symbol:e,hash:r}}))))})).catch((e=>(l(e),null))):null}async _projectAndNormalizeGeometry(e,t){if(h(this._controller.signal),a(e.geometry)||"mesh"===e.geometry.type)return null;let s=e.geometry;if(y(s)){const e=s.rings;s.rings=e}else if(b(s)){const e=s.paths;s.paths=e}else if(S(s)){const i=await this._getSymbolForGraphic(e,t);if(h(this._controller.signal),W(i.type)||J(i.type)){s=s.center}else s=Z(s)}await G(s.spatialReference,this.view.spatialReference);const i=v(s),r=U(i,s.spatialReference,this.view.spatialReference);return _(r),r}_onTileUpdate(e){const t=I(this.view.spatialReference);if(e.added&&e.added.length>0)for(const s of e.added)this._addNewTile(s,t);if(e.removed&&e.removed.length>0)for(const s of e.removed)this._removeTile(s.key)}async _addGraphic(e){this._abortProcessingGraphic(e.uid),h(this._controller.signal);const t=new AbortController;this._graphicIdToAbortController.set(e.uid,t);const s={signal:t.signal};try{await this._addOrUpdateGraphic(e,s),h(this._controller.signal),this._graphicIdToAbortController.delete(e.uid)}catch(i){if(this._graphicIdToAbortController.delete(e.uid),!n(i))throw i}}_updateGraphic(e,t){h(this._controller.signal);const s=this._projectAndNormalizeGeometry(e,t),i=this._getSymbolResources(e,t);return Promise.all([s,i]).then((([t,s])=>{h(this._controller.signal),this._graphicStore.addOrModify(e,s,t)}))}_addOrUpdateGraphic(e,t){h(this._controller.signal);const s=this._projectAndNormalizeGeometry(e,t),i=this._getSymbolResources(e,t);return Promise.all([s,i]).then((([t,s])=>{h(this._controller.signal),this._graphicsSet.has(e)&&this._graphicStore.addOrModify(e,s,t)}))}_addTile(e){const t=this.view.featuresTilingScheme.getTileBounds(m(),e),s=new A(e,t[0],t[3]);return this._tiles.set(e,s),this.container.addChild(s),s}async _addNewTile(e,t){const s=this._addTile(e.key),i=this._graphicStore.queryTileData(this._templateStore,e);if(0===i.length)return;if(t){const s=Math.round((t.valid[1]-t.valid[0])/e.resolution);for(const e of i)e.geometry&&(w(e.geometry)||T(e.geometry))&&this._wrapPoints(e,s)}const r=e.key;this._tileUpdateSet.add(e.key),this.notifyChange("updating");try{const t={type:"update",clear:!1,addOrUpdate:await this._processGraphics(e,i),remove:[],end:!0,sort:!1};s.patch(t),this._tileUpdateSet.delete(r),this.notifyChange("updating")}catch(o){if(this._tileUpdateSet.delete(r),this.notifyChange("updating"),!n(o))throw o}}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_setFilterState(e,t){const s=this._displayIds.get(e),i=this._attributeStore.getHighlightFlag(e);this._attributeStore.setData(s,0,0,i|(t?x:0))}_getGraphicsData(e,t,s){const i=this.view,r=I(i.spatialReference),o=this._graphicStore.getGraphicsData(e,t,s);if(r){const e=Math.round((r.valid[1]-r.valid[0])/t.resolution);for(const t of o)t.geometry&&(w(t.geometry)||T(t.geometry))&&this._wrapPoints(t,e)}return o}_wrapPoints(e,t){const s=e.geometry;T(s)?this._wrapMultipoint(s,t):this._wrapPoint(e,t)}_wrapMultipoint(e,t){const s=e.points,i=[];let r=0,o=0;for(const[a,h]of s){if(i.push([a+r,h]),r=0,t===K){const e=5*Q;a+o<e?(i.push([t,0]),r=-t):a+o>K-e&&(i.push([-t,0]),r=t)}else a+o<-Q?(i.push([t,0]),r=-t):a+o>K+Q&&(i.push([-t,0]),r=t);o+=a}e.points=i}_wrapPoint(e,t){const s=e.geometry;if(t===K){const i=5*Q;s.x<i?e.geometry={points:[[s.x,s.y],[t,0]]}:s.x>K-i&&(e.geometry={points:[[s.x,s.y],[-t,0]]})}else s.x<-Q?e.geometry={points:[[s.x,s.y],[t,0]]}:s.x>K+Q&&(e.geometry={points:[[s.x,s.y],[-t,0]]})}_processGraphics(e,t,s){if(!(t&&t.length)||!this._meshFactory)return null;const i=V.from(t),r=this._meshFactory;return this._matcher.then((t=>r.analyzeGraphics(i,this.container.stage.resourceManager,t,null,null,s).then((()=>(this._attributeStore.sendUpdates(),this._processAnalyzedGraphics(e,i))))))}_processAnalyzedGraphics(e,t){const s=this._meshFactory,i=t.getSize(),r=t.getCursor(),o={features:i,records:i,metrics:0},a=new D(e.key.id,o,{fill:"default"},!1,!1),h=[];for(;r.next();){const t=r.readGraphic();t.insertAfter=-1===t.insertAfter?-1:this._displayIds.get(t.insertAfter),t.displayId=this._displayIds.get(t.attributes[this.uid]);const i=new q(t.displayId);i.insertAfter=t.insertAfter,h.push(i),s.writeGraphic(a,r,e.level,this.container.stage.resourceManager)}const n=e.tileInfoView.tileInfo.isWrappable,l=a.serialize(n);if(1!==l.length)return new R;const d=l[0].message;return R.fromVertexData(d,h)}_abortProcessingGraphic(e){if(this._graphicIdToAbortController.has(e)){this._graphicIdToAbortController.get(e).abort()}}_getNullSymbol(e){const t=e.geometry;return b(t)?C:y(t)||S(t)?j:P}_flipUpdatingGraphics(){this._updatingGraphicsTimer&&clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=setTimeout((()=>{this._updatingGraphicsTimer=null,this.notifyChange("updating")}),160),this.notifyChange("updating")}};e([d({constructOnly:!0})],se.prototype,"requestUpdateCallback",void 0),e([d()],se.prototype,"container",void 0),e([d({constructOnly:!0})],se.prototype,"graphics",void 0),e([d()],se.prototype,"updating",null),e([d()],se.prototype,"view",void 0),e([d()],se.prototype,"updateRequested",void 0),se=e([p("esri.views.2d.layers.support.GraphicsView2D")],se);const ie=se;export{ie as default};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{bidiText as s}from"../../../../core/BidiText.js";import{HandleOwnerMixin as i}from"../../../../core/HandleOwner.js";import r from"../../../../core/has.js";import{isSome as o,isNone as a}from"../../../../core/maybe.js";import{throwIfAborted as h,isAbortError as n,throwIfAbortError as l}from"../../../../core/promiseUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../geometry/SpatialReference.js";import{width as g,height as u,create as m}from"../../../../geometry/support/aaBoundingRect.js";import{closeRingsAndFixWinding as _}from"../../../../geometry/support/coordsUtils.js";import{getJsonType as f,isPolygon as y,isPolyline as b,isExtent as S,isPoint as w,isMultipoint as T}from"../../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridianSync as v}from"../../../../geometry/support/normalizeUtilsSync.js";import{getInfo as I}from"../../../../geometry/support/spatialReferenceUtils.js";import{checkProjectionSupport as G,project as U}from"../../../../layers/graphics/data/projectionSupport.js";import{symbolToCIM as M}from"../../../../symbols/cim/CIMSymbolHelper.js";import{errorPolylineSymbol2D as C,errorPolygonSymbol2D as j,errorPointSymbol2D as P}from"../../../../symbols/support/defaults.js";import{FILTER_FLAG_0 as x}from"../../engine/webgl/definitions.js";import{GraphicTile as A}from"../../engine/webgl/GraphicTile.js";import{TileData as R}from"../../engine/webgl/TileData.js";import q from"../../engine/webgl/WGLDisplayObject.js";import{MeshData as D}from"../../engine/webgl/mesh/MeshData.js";import{WGLMeshFactory as O}from"../../engine/webgl/mesh/factories/WGLMeshFactory.js";import{WGLTemplateStore as z}from"../../engine/webgl/mesh/templates/WGLTemplateStore.js";import{createMatcher as F}from"../../engine/webgl/util/Matcher.js";import{createMatcherSchema as H,createSymbolSchemaOptions as k}from"../features/schemaUtils.js";import E from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as N}from"../features/support/ComputedAttributeStorage.js";import{GraphicsReader as V}from"../features/support/GraphicsReader.js";import B from"./GraphicStore.js";import{intersectingInternationalDateline as L,isMarkerSymbol as W,isTextSymbol as J,polygonFromExtent as Z,TILE_SIZE as K,PIXEL_BUFFER as Q}from"./graphicsUtils.js";import{expandSymbol as X}from"../support/cimSymbolUtils.js";import{GraphicsView as Y}from"../../../layers/GraphicsView.js";import{getWebGL1Capabilities as $}from"../../../webgl/capabilities.js";import{createSymbolSchema as ee}from"../features/createSymbolSchema.js";const te=r("esri-2d-graphic-debug");function se(e,t,s){if(s.has(e))return s.get(e);const i={tile:t,addedOrModified:[],removed:[]};return s.set(e,i),i}let ie=class extends(Y(i(t))){constructor(e){super(e),this._storage=new N,this._displayIds=new Map,this._controller=new AbortController,this._tiles=new Map,this._graphicStoreUpdate=!1,this._graphicsSet=new Set,this._matcher=Promise.resolve(null),this._tileUpdateSet=new Set,this._tilesToUpdate=new Map,this._graphicIdToAbortController=new Map,this._attached=!1,this._updatingGraphicsTimer=null,this._hashToExpandedSymbol=new Map,this._hashToExpandedSymbolPromise=new Map,this._hashToCIMSymbolPromise=new Map,this._hashToCIM=new Map,this._processing=!1,this._needsProcessing=!1,this._pendingUpdate={added:new Set,updated:new Set,removed:new Set},this.lastUpdateId=-1,this.updateRequested=!1,this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this._updatingGraphicsTimer&&(clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=null,this.notifyChange("updating")),this._controller.abort(),this.container.destroy(),this._set("graphics",null),this._graphicStore.clear(),this._attributeStore=null,this._hashToExpandedSymbol.clear(),this.view=null,this.renderer=null,this._hashToCIM.clear(),this._hashToCIMSymbolPromise.clear(),this._hashToExpandedSymbolPromise.clear()}_createMatcher(e,t,s){if(e){const i=H({indexCount:0,fields:{}},"feature",e);this._matcher=F(i,t,null,s)}}_createDisplayId(e){return this._displayIds.has(e)||this._displayIds.set(e,this._storage.createDisplayId()),this._displayIds.get(e)}initialize(){this._attributeStore=new E({type:"local",initialize:e=>Promise.resolve(this.container.attributeView.initialize(e)),update:e=>this.container.attributeView.requestUpdate(e),render:()=>this.container.requestRender()},$()),this.container.hasHighlight=()=>this._attributeStore.hasHighlight;const e=e=>{this._createDisplayId(e.uid),this._setFilterState(e.uid,e.visible)},t=e=>{const t=this._displayIds.get(e.uid);this._displayIds.delete(e.uid),this._storage.releaseDisplayId(t)},s=new z(this.container.getMaterialItems.bind(this.container),this.view.featuresTilingScheme.tileInfo);this._graphicStore=new B(this.view.featuresTilingScheme,this.view.state.scale,this.uid,this.graphics,e,t,this._hashToCIM),this._meshFactory=new O(null,this.uid,s),this._templateStore=s,this.handles.add([this.watch("renderer",(e=>{this._createMatcher(e,s,this.container.stage.resourceManager);for(const t of this.graphics)this._pendingUpdate.updated.add(t);this.requestUpdate()})),this.view.graphicsTileStore.on("update",(e=>this._onTileUpdate(e))),this.container.on("attach",(()=>{te&&this.container.enableRenderingBounds((()=>this._graphicStore.getAllBounds())),this.graphics.items.length>0&&this._graphicsChangeHandler({target:this.graphics,added:this.graphics.items,removed:[],moved:[]}),this.handles.add(this.graphics.on("change",(e=>this._graphicsChangeHandler(e))),"graphics");const e=this.container.stage.resourceManager;this._createMatcher(this.renderer,s,e),this._graphicStore.setResourceManager(e),this._attached=!0,this.notifyChange("updating")}))]);const i=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:i,removed:[]})}get updating(){return!this._attached||null!==this._updatingGraphicsTimer||this._tileUpdateSet.size>0||this._tilesToUpdate.size>0}hitTest(e){if(!this.view||!this.view.position)return null;const{resolution:t,rotation:s}=this.view.state;return this._graphicStore.hitTest(e.x,e.y,2,t,s)}update(e){h(this._controller.signal);const t=e.state,{resolution:s}=t;if(this._graphicStore.updateLevel(s),this._graphicStoreUpdate=!0,this.updateRequested=!1,this._pendingUpdate.updated.size>0){if(!this._processing)return void this._updateGraphics();this._needsProcessing=!0}}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback())}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}graphicUpdateHandler(e){const{graphic:t,property:s,newValue:i}=e;switch(s){case"attributes":break;case"geometry":case"symbol":this._pendingUpdate.updated.add(t),this.requestUpdate();break;case"visible":this._setFilterState(t.uid,i),this._attributeStore.sendUpdates()}}setHighlight(e){const t=e.map((e=>this._displayIds.get(e)));this._attributeStore.setHighlight(e,t)}_getIntersectingTiles(e){const t=this._graphicStore.getBounds(e);if(!t||0===g(t)||0===u(t))return[];const s=L(t,this.view.spatialReference);return o(s)?[...new Set([...this.view.graphicsTileStore.boundsIntersections(s[0]),...this.view.graphicsTileStore.boundsIntersections(s[1])])]:this.view.graphicsTileStore.boundsIntersections(t)}async _updateTile(e){h(this._controller.signal);const t=e.tile,s=this._getGraphicsData(this._templateStore,t,e.addedOrModified),i=await this._processGraphics(t,s);return h(this._controller.signal),this._patchTile(t.key,{type:"update",addOrUpdate:i,remove:e.removed,end:!0,clear:!1,sort:!1}),i}_patchTile(e,t){if(!this._tiles.has(e))return;const s=this._tiles.get(e);this.container.onTileData(s,t),this.container.requestRender()}_graphicsChangeHandler(e){const t=this._pendingUpdate;for(const s of e.added)t.added.add(s);for(const s of e.moved)t.updated.add(s);for(const s of e.removed)this._pendingUpdate.added.has(s)?t.added.delete(s):t.removed.add(s);this._processing?this._needsProcessing=!0:this._updateGraphics()}_getGraphicsToUpdate(){const e={added:[],removed:[],updated:[]};if(!this.graphics)return e;const t=this._pendingUpdate;for(const s of this.graphics.items)t.added.has(s)?e.added.push(s):t.updated.has(s)&&e.updated.push(s);for(const s of t.removed)this._graphicStore.has(s)&&e.removed.push(s);return t.added.clear(),t.removed.clear(),t.updated.clear(),e}async _updateGraphics(){this._processing=!0;const{added:e,removed:t,updated:s}=this._getGraphicsToUpdate(),i=this._tilesToUpdate;let r;try{if(!this._graphicStoreUpdate){const e=this.view.state,{resolution:t}=e;this._graphicStore.updateLevel(t)}const o=[],a=new Array(e.length+t.length);for(let e=0;e<s.length;e++){const t=s[e],h=this._getIntersectingTiles(t);for(const e of h){r=e.id;se(r,e,i).removed.push(this._displayIds.get(t.uid))}o.push(this._updateGraphic(t,null)),a[e]=t}const h=s.length;for(let t=0;t<e.length;t++){const s=e[t];a[h+t]=s,this._graphicsSet.add(s),o.push(this._addGraphic(s))}for(const e of t){this._abortProcessingGraphic(e.uid);const t=this._getIntersectingTiles(e);for(const s of t){r=s.id;se(r,s,i).removed.push(this._displayIds.get(e.uid))}this._graphicsSet.delete(e),this._graphicStore.remove(e)}let n;this._flipUpdatingGraphics(),await Promise.all(o);for(let e=0;e<a.length;e++){n=a[e];const t=this._getIntersectingTiles(n);for(const e of t){r=e.id;se(r,e,i).addedOrModified.push(n)}}this._graphicStore.updateZ();const l=[];for(const[e,t]of i)l.push(this._updateTile(t));await Promise.all(l)}catch(o){n(o),0}for(const a of t)try{const e=await this._getSymbolForGraphic(a,{});if(e){const t=e.hash();this._hashToExpandedSymbol.delete(t)}}catch(o){n(o),0}i.clear(),this.notifyChange("updating"),this._processing=!1,this._needsProcessing&&(this._needsProcessing=!1,this._updateGraphics())}_getArcadeInfo(e){const t=(e.attributes?Object.keys(e.attributes):[]).map((t=>({name:t,alias:t,type:"string"==typeof e.attributes[t]?"esriFieldTypeString":"esriFieldTypeDouble"})));return a(e.geometry)?null:{geometryType:f(e.geometry),spatialReference:c.fromJSON(e.geometry.spatialReference),fields:t}}_getSymbolForGraphic(e,t){return h(this._controller.signal),o(e.symbol)?Promise.resolve(e.symbol):o(this.renderer)?this.renderer.getSymbolAsync(e,{scale:this.view.scale,abortOptions:t}):Promise.resolve(this._getNullSymbol(e))}_getCIMSymbol(e,t,s){let i=this._hashToCIM.get(t);if(i)return Promise.resolve(i);const r=M(e);if(o(r)){if("CIMSymbolReference"===r.type)return i=r,this._hashToCIM.set(t,i),Promise.resolve(i);let e=this._hashToCIMSymbolPromise.get(t);return e||(e=r.fetchCIMSymbol(s).then((e=>(this._hashToCIM.set(t,e.data),this._hashToCIMSymbolPromise.delete(t),e))).catch((e=>(this._hashToCIMSymbolPromise.delete(t),l(e),null))),this._hashToCIMSymbolPromise.set(t,e),e)}return Promise.resolve(null)}_expandCIMSymbol(e,t,s,i){const r=this._hashToExpandedSymbol.get(s);if(r)return Promise.resolve(r);let o=this._hashToExpandedSymbolPromise.get(s);if(o)return o;const a=this.container.stage,h=this._getArcadeInfo(t),n=k(null),l=ee(e,n);return o=X(l,h,a.resourceManager,i),this._hashToExpandedSymbolPromise.set(s,o),o.then((e=>(this._hashToExpandedSymbol.set(s,e),this._hashToExpandedSymbolPromise.delete(s),e))),o}async _getSymbolResources(e,t){h(this._controller.signal);return this.container.stage?this._getSymbolForGraphic(e,t).then((i=>{const r=i.hash();return this._getCIMSymbol(i,r,t).then((i=>a(i)?null:this._expandCIMSymbol(i,e,r,t).then((e=>{const t=e.layers.filter((e=>"text"===e.type&&"string"==typeof e.text));if(t&&t.length>0){const i=new Array(t.length);for(let e=0;e<t.length;e++){const r=t[e],o=[],[a]=s(r.text);for(let e=0;e<a.length;e++)o.push(a.charCodeAt(e));i[e]={symbol:r,id:e,glyphIds:o}}const o=new Map;return this.container.getMaterialItems(i).then((s=>{for(let e=0;e<t.length;e++){const i=t[e];o.set(i.cim,{text:i.text,mosaicItem:s[e].mosaicItem})}return{symbol:e,textInfo:o,hash:r}}))}return{symbol:e,hash:r}}))))})).catch((e=>(l(e),null))):null}async _projectAndNormalizeGeometry(e,t){if(h(this._controller.signal),a(e.geometry)||"mesh"===e.geometry.type)return null;let s=e.geometry;if(y(s)){const e=s.rings;s.rings=e}else if(b(s)){const e=s.paths;s.paths=e}else if(S(s)){const i=await this._getSymbolForGraphic(e,t);if(h(this._controller.signal),W(i.type)||J(i.type)){s=s.center}else s=Z(s)}await G(s.spatialReference,this.view.spatialReference);const i=v(s),r=U(i,s.spatialReference,this.view.spatialReference);return _(r),r}_onTileUpdate(e){const t=I(this.view.spatialReference);if(e.added&&e.added.length>0)for(const s of e.added)this._addNewTile(s,t);if(e.removed&&e.removed.length>0)for(const s of e.removed)this._removeTile(s.key)}async _addGraphic(e){this._abortProcessingGraphic(e.uid),h(this._controller.signal);const t=new AbortController;this._graphicIdToAbortController.set(e.uid,t);const s={signal:t.signal};try{await this._addOrUpdateGraphic(e,s),h(this._controller.signal),this._graphicIdToAbortController.delete(e.uid)}catch(i){if(this._graphicIdToAbortController.delete(e.uid),!n(i))throw i}}_updateGraphic(e,t){h(this._controller.signal);const s=this._projectAndNormalizeGeometry(e,t),i=this._getSymbolResources(e,t);return Promise.all([s,i]).then((([t,s])=>{h(this._controller.signal),this._graphicStore.addOrModify(e,s,t)}))}_addOrUpdateGraphic(e,t){h(this._controller.signal);const s=this._projectAndNormalizeGeometry(e,t),i=this._getSymbolResources(e,t);return Promise.all([s,i]).then((([t,s])=>{h(this._controller.signal),this._graphicsSet.has(e)&&this._graphicStore.addOrModify(e,s,t)}))}_addTile(e){const t=this.view.featuresTilingScheme.getTileBounds(m(),e),s=new A(e,t[0],t[3]);return this._tiles.set(e,s),this.container.addChild(s),s}async _addNewTile(e,t){const s=this._addTile(e.key),i=this._graphicStore.queryTileData(this._templateStore,e);if(0===i.length)return;if(t){const s=Math.round((t.valid[1]-t.valid[0])/e.resolution);for(const e of i)e.geometry&&(w(e.geometry)||T(e.geometry))&&this._wrapPoints(e,s)}const r=e.key;this._tileUpdateSet.add(e.key),this.notifyChange("updating");try{const t={type:"update",clear:!1,addOrUpdate:await this._processGraphics(e,i),remove:[],end:!0,sort:!1};s.patch(t),this._tileUpdateSet.delete(r),this.notifyChange("updating")}catch(o){if(this._tileUpdateSet.delete(r),this.notifyChange("updating"),!n(o))throw o}}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_setFilterState(e,t){const s=this._displayIds.get(e),i=this._attributeStore.getHighlightFlag(e);this._attributeStore.setData(s,0,0,i|(t?x:0))}_getGraphicsData(e,t,s){const i=this.view,r=I(i.spatialReference),o=this._graphicStore.getGraphicsData(e,t,s);if(r){const e=Math.round((r.valid[1]-r.valid[0])/t.resolution);for(const t of o)t.geometry&&(w(t.geometry)||T(t.geometry))&&this._wrapPoints(t,e)}return o}_wrapPoints(e,t){const s=e.geometry;T(s)?this._wrapMultipoint(s,t):this._wrapPoint(e,t)}_wrapMultipoint(e,t){const s=e.points,i=[];let r=0,o=0;for(const[a,h]of s){if(i.push([a+r,h]),r=0,t===K){const e=5*Q;a+o<e?(i.push([t,0]),r=-t):a+o>K-e&&(i.push([-t,0]),r=t)}else a+o<-Q?(i.push([t,0]),r=-t):a+o>K+Q&&(i.push([-t,0]),r=t);o+=a}e.points=i}_wrapPoint(e,t){const s=e.geometry;if(t===K){const i=5*Q;s.x<i?e.geometry={points:[[s.x,s.y],[t,0]]}:s.x>K-i&&(e.geometry={points:[[s.x,s.y],[-t,0]]})}else s.x<-Q?e.geometry={points:[[s.x,s.y],[t,0]]}:s.x>K+Q&&(e.geometry={points:[[s.x,s.y],[-t,0]]})}_processGraphics(e,t,s){if(!(t&&t.length)||!this._meshFactory)return null;const i=V.from(t),r=this._meshFactory;return this._matcher.then((t=>r.analyzeGraphics(i,this.container.stage.resourceManager,t,null,null,s).then((()=>(this._attributeStore.sendUpdates(),this._processAnalyzedGraphics(e,i))))))}_processAnalyzedGraphics(e,t){const s=this._meshFactory,i=t.getSize(),r=t.getCursor(),o={features:i,records:i,metrics:0},a=new D(e.key.id,o,{fill:"default"},!1,!1),h=[];for(;r.next();){const t=r.readGraphic();t.insertAfter=-1===t.insertAfter?-1:this._displayIds.get(t.insertAfter),t.displayId=this._displayIds.get(t.attributes[this.uid]);const i=new q(t.displayId);i.insertAfter=t.insertAfter,h.push(i),s.writeGraphic(a,r,e.level,this.container.stage.resourceManager)}const n=e.tileInfoView.tileInfo.isWrappable,l=a.serialize(n);if(1!==l.length)return new R;const d=l[0].message;return R.fromVertexData(d,h)}_abortProcessingGraphic(e){if(this._graphicIdToAbortController.has(e)){this._graphicIdToAbortController.get(e).abort()}}_getNullSymbol(e){const t=e.geometry;return b(t)?C:y(t)||S(t)?j:P}_flipUpdatingGraphics(){this._updatingGraphicsTimer&&clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=setTimeout((()=>{this._updatingGraphicsTimer=null,this.notifyChange("updating")}),160),this.notifyChange("updating")}};e([d({constructOnly:!0})],ie.prototype,"requestUpdateCallback",void 0),e([d()],ie.prototype,"container",void 0),e([d({constructOnly:!0})],ie.prototype,"graphics",void 0),e([d()],ie.prototype,"updating",null),e([d()],ie.prototype,"view",void 0),e([d()],ie.prototype,"updateRequested",void 0),ie=e([p("esri.views.2d.layers.support.GraphicsView2D")],ie);const re=ie;export{re as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import{HandleOwner as t}from"../../../../core/HandleOwner.js";import i from"../../../../core/Logger.js";import{isSome as s,isNone as r,unwrap as l}from"../../../../core/maybe.js";import{debounce as a,isAbortError as o,eachAlways as n}from"../../../../core/promiseUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import u from"../../../../geometry/Point.js";import p from"../../../../layers/support/PixelBlock.js";import y from"../../../../layers/support/TileInfo.js";import{update as d,unregister as g,register as m,getRasterId as _}from"../../../../layers/support/rasterDatasets/RawBlockCache.js";import{extractBands as f}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{getWorldWidth as w,computeProjectedScales as b}from"../../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import"../../tiling/PagedTileQueue.js";import P from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import C from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{getWebGL1Capabilities as v}from"../../../webgl/capabilities.js";import V from"../../../../geometry/Extent.js";const R=[0,0],T=i.getLogger("esri.views.2d.layers.ImageryTileLayerView2D");let S=class extends t{constructor(){super(...arguments),this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=null,this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._globalUpdateRequested=!1,this.container=null,this.layer=null,this.redrawOrRefetch=a(((e,t)=>!this.previousLOD||this.layerView.suspended?Promise.resolve():e?this.doRefresh():this._redrawImage(t)))}get useWebGLForProcessing(){var e;return null==(e=this._get("useWebGLForProcessing"))||e}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return null==this._get("useProgressiveUpdate")||this._get("useProgressiveUpdate")}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){var l;if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s=t.toJSON?t:V.fromJSON(t);d(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,(null==(l=this.previousLOD)?void 0:l.level)!==r.level&&(this.previousLOD=r,null==this._symbolizerParams||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&this._redrawImage(this._abortController.signal).then((()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._fetchQueue.length>0||this._globalUpdateRequested||!(!this.updatingHandles||!this.updatingHandles.updating)}attach(){v().supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new P(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new C({tileInfoView:this._tileInfoView,concurrency:e,process:(e,t)=>this._fetchTile1(e,t)});const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}acquireTile(e){const t=this.container.createTile(e);return this._enqueueTileFetch(t),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",(()=>{e.destroy(),this.layerView.requestUpdate()})),this.layerView.requestUpdate()}uninstall(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,this.notifyChange("updating"),g(this._blockCacheRegistryUrl,this._blockCacheRegistryId)}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&s(this._emptyTilePixelBlock))return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[i,r]=e,l=new p({width:i,height:r,pixels:[new Uint8Array(i*r)],mask:new Uint8Array(i*r),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=l),l}_fetchTile1(e,t){const i=!r(t)&&t.signal,a=this.canUseWebGLForProcessing(),{layerView:o}=this,n=!o.tileInfo.isWrappable&&s(w(o.view.spatialReference)),h={allowPartialFill:!0,datumTransformation:o.datumTransformation,interpolation:a?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:a,signal:l(i),srcResolution:this._srcResolutions[e.level],timeExtent:o.timeExtent,tileInfo:o.tileInfo,disableWrapAround:n};return this.fetchTile(e,h)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const e=this.layerView.view.spatialReference,t=new u({x:this.layerView.fullExtent.xmin,y:this.layerView.fullExtent.ymax,spatialReference:e}),{scales:i,srcResolutions:s,isCustomTilingScheme:r}=b(this.layer.rasterInfo,e),l=y.create({spatialReference:e,size:512,scales:i});(0===l.origin.x||l.origin.x>t.x)&&(l.origin=t),this._isCustomTilingScheme=r,this.layerView.set("tileInfo",l),this._srcResolutions=null!=s?s:[]}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);this.notifyChange("updating");const{bandIds:s}=this.layer;let r=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length){r=!1;try{await this._redrawImage(this._abortController&&this._abortController.signal)}catch(i){o(i)&&T.error(i)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&"rasterVF"!==this.type||this.layerView.hasTilingEffects||null!=this._symbolizerParams||this._updateSymbolizerParams();const l=this._tileInfoView.getTileCoords(R,e.key),a=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:t,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:r,bandIds:s,coords:l,resolution:a}),e.once("attach",(()=>this.layerView.requestUpdate())),this.container.addChild(e)}catch(i){o(i)||T.error(i)}this.layerView.requestUpdate()}}async _redrawImage(e){if(0===this.container.children.length)return;await this.updatingHandles.addPromise(this.layer.updateRenderer()),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map((async e=>this.updateTileSymbolizerParameters(e,{local:this._symbolizerParams,global:this._globalSymbolizerParams})));await n(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},i=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!i||!i.pixelBlock)return;const s=this.layer.symbolizer.generateWebGLParameters({pixelBlock:f(i.pixelBlock,this.layer.bandIds),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds});!this.canUseWebGLForProcessing()&&s&&"stretch"===s.type&&this.layer.renderer&&"raster-stretch"===this.layer.renderer.type&&(s.factor=s.factor.map((e=>255*e)),s.outMin=Math.round(255*s.outMin),s.outMax=Math.round(255*s.outMax)),this._globalSymbolizerParams=s}_updateSymbolizerParams(){this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds})}_updateBlockCacheRegistry(e=!1){const{url:t,rasterInfo:i,raster:s}=this.layer,{multidimensionalDefinition:r}=this.layer.normalizeRasterFetchOptions({multidimensionalDefinition:this.layer.multidimensionalDefinition,timeExtent:this.layerView.timeExtent}),l=null!=i&&i.multidimensionalInfo?s.getSliceIndex(r):null,a=_(t,l);if(a!==this._blockCacheRegistryUrl){if(null!=this._blockCacheRegistryUrl&&g(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=m(a,this.layer.raster.rasterInfo),e){const e=this._tileInfoView.getClosestInfoForScale(this.layerView.view.scale),t=this._srcResolutions[e.level];d(a,this._blockCacheRegistryId,this.layerView.view.extent,this.layerView.view.resolution,t,this.layer.raster.ioConfig.sampling)}this._blockCacheRegistryUrl=a}}async doRefresh(){await this.updatingHandles.addPromise(this.layer.updateRenderer()),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset(),this.notifyChange("updating");const e=[];this._tileStrategy.tiles.forEach((t=>e.push(this._enqueueTileFetch(t)))),await n(e)}};e([h()],S.prototype,"_globalUpdateRequested",void 0),e([h()],S.prototype,"container",void 0),e([h()],S.prototype,"layer",void 0),e([h()],S.prototype,"layerView",void 0),e([h()],S.prototype,"type",void 0),e([h()],S.prototype,"useWebGLForProcessing",null),e([h()],S.prototype,"useProgressiveUpdate",null),e([h()],S.prototype,"updating",null),S=e([c("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],S);export{S as BaseImageryTileSubView2D};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import{HandleOwner as t}from"../../../../core/HandleOwner.js";import i from"../../../../core/Logger.js";import{isSome as s,isNone as r,unwrap as l}from"../../../../core/maybe.js";import{debounce as a,isAbortError as o,eachAlways as h}from"../../../../core/promiseUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import u from"../../../../geometry/Point.js";import p from"../../../../layers/support/PixelBlock.js";import y from"../../../../layers/support/TileInfo.js";import{update as d,unregister as m,register as g,getRasterId as _}from"../../../../layers/support/rasterDatasets/RawBlockCache.js";import{extractBands as f}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{getWorldWidth as w,computeProjectedScales as b}from"../../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import"../../tiling/PagedTileQueue.js";import P from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import I from"../../tiling/TileQueue.js";import C from"../../tiling/TileStrategy.js";import{getWebGL1Capabilities as v}from"../../../webgl/capabilities.js";import R from"../../../../geometry/Extent.js";const V=[0,0],T=i.getLogger("esri.views.2d.layers.ImageryTileLayerView2D");let S=class extends t{constructor(){super(...arguments),this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=null,this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._globalUpdateRequested=!1,this.attached=!1,this.container=null,this.layer=null,this.redrawOrRefetch=a(((e,t)=>!this.previousLOD||this.layerView.suspended?Promise.resolve():e?this.doRefresh():this._redrawImage(t)))}get useWebGLForProcessing(){var e;return null==(e=this._get("useWebGLForProcessing"))||e}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return null==this._get("useProgressiveUpdate")||this._get("useProgressiveUpdate")}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new C({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){var l;if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s=t.toJSON?t:R.fromJSON(t);d(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,(null==(l=this.previousLOD)?void 0:l.level)!==r.level&&(this.previousLOD=r,null==this._symbolizerParams||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&this._redrawImage(this._abortController.signal).then((()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._fetchQueue.updating||this._globalUpdateRequested||!(!this.updatingHandles||!this.updatingHandles.updating)}attach(){v().supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new P(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new I({tileInfoView:this._tileInfoView,concurrency:e,process:(e,t)=>this._fetchTile1(e,t)});const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new C({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,m(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(e){const t=this.container.createTile(e);return this._enqueueTileFetch(t),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",(()=>{e.destroy(),this.layerView.requestUpdate()})),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&s(this._emptyTilePixelBlock))return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[i,r]=e,l=new p({width:i,height:r,pixels:[new Uint8Array(i*r)],mask:new Uint8Array(i*r),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=l),l}_fetchTile1(e,t){const i=!r(t)&&t.signal,a=this.canUseWebGLForProcessing(),{layerView:o}=this,h=!o.tileInfo.isWrappable&&s(w(o.view.spatialReference)),n={allowPartialFill:!0,datumTransformation:o.datumTransformation,interpolation:a?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:a,signal:l(i),srcResolution:this._srcResolutions[e.level],timeExtent:o.timeExtent,tileInfo:o.tileInfo,disableWrapAround:h};return this.fetchTile(e,n)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const e=this.layerView.view.spatialReference,t=new u({x:this.layerView.fullExtent.xmin,y:this.layerView.fullExtent.ymax,spatialReference:e}),{scales:i,srcResolutions:s,isCustomTilingScheme:r}=b(this.layer.rasterInfo,e),l=y.create({spatialReference:e,size:512,scales:i});(0===l.origin.x||l.origin.x>t.x)&&(l.origin=t),this._isCustomTilingScheme=r,this.layerView.set("tileInfo",l),this._srcResolutions=null!=s?s:[]}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key),{bandIds:s}=this.layer;let r=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length){r=!1;try{await this._redrawImage(this._abortController&&this._abortController.signal)}catch(i){o(i)&&T.error(i)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&"rasterVF"!==this.type||this.layerView.hasTilingEffects||null!=this._symbolizerParams||this._updateSymbolizerParams();const l=this._tileInfoView.getTileCoords(V,e.key),a=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:t,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:r,bandIds:s,coords:l,resolution:a}),e.once("attach",(()=>this.layerView.requestUpdate())),this.container.addChild(e)}catch(i){o(i)||T.error(i)}this.layerView.requestUpdate()}}async _redrawImage(e){if(0===this.container.children.length)return;await this.updatingHandles.addPromise(this.layer.updateRenderer()),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map((async e=>this.updateTileSymbolizerParameters(e,{local:this._symbolizerParams,global:this._globalSymbolizerParams})));await h(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},i=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!i||!i.pixelBlock)return;const s=this.layer.symbolizer.generateWebGLParameters({pixelBlock:f(i.pixelBlock,this.layer.bandIds),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds});!this.canUseWebGLForProcessing()&&s&&"stretch"===s.type&&this.layer.renderer&&"raster-stretch"===this.layer.renderer.type&&(s.factor=s.factor.map((e=>255*e)),s.outMin=Math.round(255*s.outMin),s.outMax=Math.round(255*s.outMax)),this._globalSymbolizerParams=s}_updateSymbolizerParams(){this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds})}_updateBlockCacheRegistry(e=!1){const{url:t,rasterInfo:i,raster:s}=this.layer,{multidimensionalDefinition:r}=this.layer.normalizeRasterFetchOptions({multidimensionalDefinition:this.layer.multidimensionalDefinition,timeExtent:this.layerView.timeExtent}),l=null!=i&&i.multidimensionalInfo?s.getSliceIndex(r):null,a=_(t,l);if(a!==this._blockCacheRegistryUrl){if(null!=this._blockCacheRegistryUrl&&m(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=g(a,this.layer.raster.rasterInfo),e){const e=this._tileInfoView.getClosestInfoForScale(this.layerView.view.scale),t=this._srcResolutions[e.level];d(a,this._blockCacheRegistryId,this.layerView.view.extent,this.layerView.view.resolution,t,this.layer.raster.ioConfig.sampling)}this._blockCacheRegistryUrl=a}}async doRefresh(){await this.updatingHandles.addPromise(this.layer.updateRenderer()),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._tileStrategy.tiles.forEach((t=>e.push(this._enqueueTileFetch(t)))),await h(e)}};e([n()],S.prototype,"_fetchQueue",void 0),e([n()],S.prototype,"_globalUpdateRequested",void 0),e([n()],S.prototype,"attached",void 0),e([n()],S.prototype,"container",void 0),e([n()],S.prototype,"layer",void 0),e([n()],S.prototype,"layerView",void 0),e([n()],S.prototype,"type",void 0),e([n()],S.prototype,"useWebGLForProcessing",null),e([n()],S.prototype,"useProgressiveUpdate",null),e([n()],S.prototype,"updating",null),S=e([c("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],S);export{S as BaseImageryTileSubView2D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{isSome as r}from"../../../../core/maybe.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{RasterTileContainer as i}from"../../engine/RasterTileContainer.js";import{BaseImageryTileSubView2D as o}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as l}from"../support/util.js";let
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{isSome as r}from"../../../../core/maybe.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{RasterTileContainer as i}from"../../engine/RasterTileContainer.js";import{BaseImageryTileSubView2D as o}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as l}from"../support/util.js";let a=class extends o{constructor(){super(...arguments),this.container=null,this.layer=null,this.type="raster"}attach(){super.attach(),this.container=new i(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){return this.useWebGLForProcessing&&this.layer.symbolizer.canRenderInWebGL&&!("majority"===this.layer.interpolation&&l(this.layer))}fetchTile(e,r){return this.layer.fetchTile(e.level,e.row,e.col,r)}async updateTileSource(e,t){const{bandIds:s}=this.layer,i=this._getLayerInterpolation(),o=this.canUseWebGLForProcessing(),{source:l,symbolizerParams:a,globalSymbolizerParams:n,suspended:c,coords:p,resolution:u}=t,{bitmap:d}=e;if([d.x,d.y]=p,d.resolution=u,l&&r(l)&&r(l.pixelBlock)){const e={extent:l.extent,pixelBlock:l.pixelBlock};if(d.rawPixelData=e,o)d.source=l.pixelBlock,d.isRendereredSource=!1;else{const r=await this.layer.applyRenderer(e,"stretch"===(null==n?void 0:n.type)?n:null);d.source=r,d.isRendereredSource=!0}d.symbolizerParameters=o?a:null,o?d.transformGrid||(d.transformGrid=l.transformGrid):d.transformGrid=null}else{const e=this.createEmptyTilePixelBlock();d.source=e,d.symbolizerParameters=o?a:null,d.transformGrid=null}d.bandIds=o?s:null,d.width=this._tileInfoView.tileInfo.size[0],d.height=this._tileInfoView.tileInfo.size[1],d.interpolation=i,d.suspended=c,d.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:s,global:i}=t,{bandIds:o}=this.layer,l=this._getLayerInterpolation(),a=this.canUseWebGLForProcessing(),{bitmap:n}=e,{rawPixelData:c}=n;!a&&r(c)?(n.source=await this.layer.applyRenderer(c,"stretch"===(null==i?void 0:i.type)?i:null),n.isRendereredSource=!0):(n.isRendereredSource&&r(c)&&(n.source=c.pixelBlock),n.isRendereredSource=!1),n.symbolizerParameters=a?i||s:null,n.bandIds=a?o:null,n.interpolation=l,n.suspended=!1}_getLayerInterpolation(){const e=this.layer.renderer.type;if("raster-colormap"===e||"unique-value"===e||"class-breaks"===e)return"nearest";const{interpolation:r}=this.layer,{renderer:t}=this.layer;return"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===r||"cubic"===r?"bilinear":"nearest":r}};e([t()],a.prototype,"container",void 0),e([t()],a.prototype,"layer",void 0),e([t()],a.prototype,"type",void 0),a=e([s("esri.views.2d.layers.imagery.ImageryTileView2D")],a);const n=a;export{n as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Logger.js";import{isNone as i}from"../../../../core/maybe.js";import{debounce as s,isAbortError as o}from"../../../../core/promiseUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import l from"../../../../geometry/Extent.js";import{RasterVFDisplayObject as c}from"../../engine/RasterVFDisplayObject.js";const p=r.getLogger("esri.views.2d.layers.imagery.VectorFieldView2D");let m=class extends t{constructor(e){super(e),this.update=s(((e,t)=>this._update(e,t).catch((e=>{o(e)||p.error(e)}))))}get updating(){return!!this._loading}redraw(e){if(!this.container.children.length)return;const t=this.container.children[0];t.symbolizerParameters=e,t.invalidateVAO(),this.container.symbolTypes="wind_speed"===e.style?["scalar","triangle"]:"simple_scalar"===e.style?["scalar"]:["triangle"],this.container.requestRender()}async _update(e,t,r){if(!e.stationary)return;const{extent:i,spatialReference:s}=e.state,o=new l({xmin:i.xmin,ymin:i.ymin,xmax:i.xmax,ymax:i.ymax,spatialReference:s}),[a,n]=e.state.size;this._loading=this.fetchPixels(o,a,n,r);const c=await this._loading;this._addToDisplay(c,t,e.state),this._loading=null}_addToDisplay(e,t,r){if(i(e.pixelBlock))return this.container.children.forEach((e=>e.destroy())),void this.container.removeAllChildren();const{extent:s,pixelBlock:o}=e,a=new c(o);a.offset=[0,0],a.symbolizerParameters=t,a.rawPixelData=e,a.invalidateVAO(),a.x=s.xmin,a.y=s.ymax,a.pixelRatio=r.pixelRatio,a.rotation=r.rotation,a.resolution=r.resolution,a.width=o.width*t.symbolTileSize,a.height=o.height*t.symbolTileSize,this.container.children.forEach((e=>e.destroy())),this.container.removeAllChildren(),this.container.symbolTypes="wind_speed"===t.style?["scalar","triangle"]:"simple_scalar"===t.style?["scalar"]:["triangle"],this.container.addChild(a)}};e([a()],m.prototype,"fetchPixels",void 0),e([a()],m.prototype,"container",void 0),e([a()],m.prototype,"_loading",void 0),e([a()],m.prototype,"updating",null),m=e([n("esri.views.2d.layers.imagery.ImageryVFStrategy")],m);const d=m;export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import r from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{isSome as s}from"../../../../core/maybe.js";import{isAbortError as o}from"../../../../core/promiseUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{enumeration as
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import r from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{isSome as s}from"../../../../core/maybe.js";import{isAbortError as o}from"../../../../core/promiseUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{enumeration as p}from"../../../../core/accessorSupport/decorators/enumeration.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{mosaicPixelData as l}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{BitmapContainer as c}from"../../engine/BitmapContainer.js";import{Container as h}from"../../engine/Container.js";import m from"../../engine/ImageryBitmapSource.js";import u from"../support/ExportStrategy.js";const d=i.getLogger("esri.views.2d.layers.imagery.ImageryView2D");let y=class extends r{constructor(){super(...arguments),this.attached=!1,this.container=new h,this.updateRequested=!1,this.type="Imagery",this._bitmapView=new c}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(e){this.strategy.update(e).catch((e=>{o(e)||d.error(e)}))}hitTest(e){return new t({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,t=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,r=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new u({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:t,imageMaxWidth:r,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports((e=>{e.source instanceof HTMLImageElement?e.requestRender():this.layer.applyRenderer({pixelBlock:e.source.pixelBlock}).then((t=>{const r=e.source;r.pixelBlock=t.pixelBlock,r.filter=e=>this.layer.applyFilter(e),this.container.requestRender()}))}))}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const e=this.strategy.bitmaps;if(1===e.length&&e[0].source)return{extent:e[0].source.extent,pixelBlock:e[0].source.originalPixelBlock};if(e.length>1){const t=this.view.extent,r=e.map((e=>e.source)).filter((e=>e.extent&&e.extent.intersects(t))).map((e=>({extent:e.extent,pixelBlock:e.originalPixelBlock}))),i=l(r,t);return s(i)?{extent:i.extent,pixelBlock:i.pixelBlock}:null}return null}_fetchImage(e,t,r,i){return(i=i||{}).timeExtent=this.timeExtent,i.requestAsImageElement=!0,this.layer.fetchImage(e,t,r,i).then((e=>e.imageElement?e.imageElement:this.layer.applyRenderer(e.pixelData,{signal:i.signal}).then((t=>{const r=new m(t.pixelBlock,t.extent.clone(),e.pixelData.pixelBlock);return r.filter=e=>this.layer.applyFilter(e),r}))))}};e([a()],y.prototype,"attached",void 0),e([a()],y.prototype,"container",void 0),e([a()],y.prototype,"layer",void 0),e([a()],y.prototype,"strategy",void 0),e([a()],y.prototype,"timeExtent",void 0),e([a()],y.prototype,"view",void 0),e([a()],y.prototype,"updateRequested",void 0),e([a()],y.prototype,"updating",null),e([p({imagery:"Imagery"})],y.prototype,"type",void 0),y=e([n("esri.views.2d.layers.imagery.ImageryView2D")],y);const g=y;export{g as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{isSome as t}from"../../../../core/maybe.js";import{
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{isSome as t}from"../../../../core/maybe.js";import{watch as i}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{sampleVectorField as s}from"../../../../layers/support/rasterFunctions/vectorFieldUtils.js";import{RasterVFTileContainer as l}from"../../engine/RasterVFTileContainer.js";import{BaseImageryTileSubView2D as a}from"./BaseImageryTileSubView2D.js";let n=class extends a{constructor(){super(...arguments),this._handle=null,this.container=null,this.layer=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(e,t){t={...t,interpolation:"nearest"};const i=await this.layer.fetchTile(e.level,e.row,e.col,t);return"vector-magdir"===this.layer.rasterInfo.dataType&&null!=i&&i.pixelBlock&&(i.pixelBlock=await this.layer.convertVectorFieldData(i.pixelBlock,t)),i}updateTileSource(e,i){const r=i.symbolizerParams,{tileData:o}=e;o.key=e.key,o.width=this._tileInfoView.tileInfo.size[0],o.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:s}=r,{source:l}=i;if(o.offset=this._getTileSymbolOffset(o.key,s),t(l)&&t(l.pixelBlock)){const e={extent:l.extent,pixelBlock:l.pixelBlock};o.rawPixelData=e,o.source=this._sampleVectorFieldData(l.pixelBlock,r,o.offset),o.symbolizerParameters=r}else{const e=[Math.round((this._tileInfoView.tileInfo[0]-o.offset[0])/s),Math.round((this._tileInfoView.tileInfo[1]-o.offset[1])/s)],t=this.createEmptyTilePixelBlock(e);o.source=t,o.symbolizerParameters=r}return o.invalidateVAO(),Promise.resolve(null)}updateTileSymbolizerParameters(e,i){var r;const o=i.local,{symbolTileSize:s}=o,{tileData:l}=e;l.offset=this._getTileSymbolOffset(l.key,s);const a=l.symbolizerParameters.symbolTileSize;return l.symbolizerParameters=o,t(null==(r=l.rawPixelData)?void 0:r.pixelBlock)&&a!==s&&(l.source=this._sampleVectorFieldData(l.rawPixelData.pixelBlock,l.symbolizerParameters,l.offset)),Promise.resolve(null)}attach(){super.attach(),this.container=new l(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=i((()=>this.layer.renderer),(e=>this._updateSymbolType(e)))}detach(){super.detach(),this.container.removeAllChildren(),this._handle.remove(),this._handle=null}_getTileSymbolOffset(e,t){const i=e.col*this._tileInfoView.tileInfo.size[0]%t,r=e.row*this._tileInfoView.tileInfo.size[1]%t;return[i>t/2?t-i:-i,r>t/2?t-r:-r]}_sampleVectorFieldData(e,t,i){const{symbolTileSize:r}=t;return s(e,"vector-uv",r,i)}_updateSymbolType(e){"vector-field"===e.type&&(this.container.symbolTypes="wind-barb"===e.style?["scalar","triangle"]:"simple-scalar"===e.style?["scalar"]:["triangle"])}};e([r()],n.prototype,"container",void 0),e([r()],n.prototype,"layer",void 0),e([r()],n.prototype,"type",void 0),n=e([o("esri.views.2d.layers.imagery.VectorFieldTileView2D")],n);const c=n;export{c as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import r from"../../../../request.js";import{HandleOwner as i}from"../../../../core/HandleOwner.js";import{isSome as s,isNone as a,unwrap as o}from"../../../../core/maybe.js";import{watch as n,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import p from"../../../../geometry/Extent.js";import{projectExtent as h}from"../../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{snapImageToSymbolTile as y,convertVectorFieldData as u}from"../../../../layers/support/rasterFunctions/vectorFieldUtils.js";import{RasterVFContainer as d}from"../../engine/RasterVFContainer.js";import x from"./ImageryVFStrategy.js";let f=class extends i{constructor(){super(...arguments),this.attached=!1,this.container=new d,this.type="ImageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(e,t,r,i)=>{const n=await this._projectFullExtentPromise,{symbolTileSize:l}=this.layer.renderer,{extent:c,width:m,height:p}=y(e,t,r,l,n);if(s(n)&&!n.intersects(e))return{extent:c,pixelBlock:null};const h={bbox:`${c.xmin}, ${c.ymin}, ${c.xmax}, ${c.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:l,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(h)){const e=this.getPixelData();if(s(e)){if(`${e.extent.xmin}, ${e.extent.ymin}, ${e.extent.xmax}, ${e.extent.ymax}`===h.bbox)return e}}const{pixelData:d}=await this.layer.fetchImage(c,m,p,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:i});if(this._dataParameters=h,a(d.pixelBlock))return{extent:c,pixelBlock:null};return{extent:c,pixelBlock:"vector-uv"===this.layer.rasterInfo.dataType?o(u(d.pixelBlock,"vector-uv")):d.pixelBlock}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new x({container:this.container,fetchPixels:this._fetchpixels}),this.handles.add(n((()=>this.layer.renderer),(e=>this._updateSymbolizerParams(e)),l),"vector-field-view-update")}detach(){this._strategy.destroy(),this.container.children.forEach((e=>e.destroy())),this.container.removeAllChildren(),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){if(this.updating||!this.container.children.length)return null;const{extent:e,pixelBlock:t}=this.container.children[0].rawPixelData;return{extent:e,pixelBlock:t}}hitTest(e){return new t({attributes:{},geometry:e.clone(),layer:this.layer})}update(e){this._strategy.update(e,this._symbolizerParams)}redraw(){this._updateSymbolizerParams(this.layer.renderer),this._strategy.redraw(this._symbolizerParams)}_canReuseVectorFieldData(e){const t=this._dataParameters.exportParametersVersion===e.exportParametersVersion,r=this._dataParameters.time===e.time,i=this._dataParameters.symbolTileSize===e.symbolTileSize,s=this._dataParameters.bbox===e.bbox;return t&&r&&i&&s}async _getProjectedFullExtent(e){try{return await h(this.layer.fullExtent,e)}catch(t){try{const t=(await r(this.layer.url,{query:{option:"footprints",outSR:e.wkid||JSON.stringify(e.toJSON()),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return t?p.fromJSON(t):null}catch{return null}}}_updateSymbolizerParams(e){"vector-field"===e.type&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};e([c()],f.prototype,"attached",void 0),e([c()],f.prototype,"container",void 0),e([c()],f.prototype,"layer",void 0),e([c()],f.prototype,"timeExtent",void 0),e([c()],f.prototype,"type",void 0),e([c()],f.prototype,"view",void 0),e([c()],f.prototype,"updating",null),f=e([m("esri.views.2d.layers.imagery.VectorFieldView2D")],f);const g=f;export{g as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{QueueProcessor as o}from"../../../support/QueueProcessor.js";function n(e){return e.some((e=>e.globalId))}function
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{QueueProcessor as o}from"../../../support/QueueProcessor.js";function n(e){return e.some((e=>e.globalId))}function a(e){return e.filter((e=>!e.error)).map((e=>{var r;return null!=(r=e.objectId)?r:e.globalId}))}function d(e,r){const s=new Set(e);for(const t of r.values())s.add(t);return s}function i(e,r){const s=new Set(e);for(const t of r.values())s.delete(t);return s}let u=class extends r{constructor(e){super(e),this._hasGlobalIds=!1}normalizeCtorArgs(e){return this._queueProcessor=new o({concurrency:1,process:e.process}),{}}destroy(){this.clear()}get updating(){return this._queueProcessor.length>0}clear(){this._queueProcessor.clear()}push(e){const r=this._queueProcessor,s=r.last();switch(e.type){case"update":case"refresh":if((null==s?void 0:s.type)===e.type)return;r.push(e).finally((()=>this.notifyChange("updating")));break;case"edit":{const t="processed-edit"===(null==s?void 0:s.type)?s:null;t&&r.popLast();const o=this._mergeEdits(t,e);for(const e of o)r.push(e).finally((()=>this.notifyChange("updating")));break}}this.notifyChange("updating")}_mergeEdits(e,r){var s,t;const{addedFeatures:o,deletedFeatures:u,updatedFeatures:c}=r.edits;if(this._hasGlobalIds=this._hasGlobalIds||n(o)||n(c)||n(u),this._hasGlobalIds){return[e,{type:"processed-edit",edits:{addOrModified:[...o,...c],removed:u}}]}const l=new Set(a(null!=(s=null==e?void 0:e.edits.addOrModified)?s:[])),p=new Set(a(null!=(t=null==e?void 0:e.edits.removed)?t:[])),f=new Set([...a(o),...a(c)]),h=new Set(a(u));return[{type:"processed-edit",edits:{addOrModified:Array.from(d(i(l,h),f)).map((e=>({objectId:e}))),removed:Array.from(d(i(p,f),h)).map((e=>({objectId:e})))}}]}};e([s({readOnly:!0})],u.prototype,"updating",null),u=e([t("esri.views.2d.layers.support.FeatureCommandQueue")],u);const c=u;export{c as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import i from"../../../Viewpoint.js";import o from"../../../core/Accessor.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import s from"../../../geometry/Point.js";import{rotateBy as a,translateBy as r,padAndScaleAndRotateBy as c}from"../viewpointUtils.js";import
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import i from"../../../Viewpoint.js";import o from"../../../core/Accessor.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import s from"../../../geometry/Point.js";import{rotateBy as a,translateBy as r,padAndScaleAndRotateBy as c}from"../viewpointUtils.js";import h from"./ZoomBox.js";import m from"./actions/Pan.js";import p from"./actions/Pinch.js";import u from"./actions/Rotate.js";const l=10,w=1,v=new i({targetGeometry:new s}),d=[0,0],g=250;let _=class extends o{constructor(t){super(t),this._endTimer=null,this.animationManager=null}initialize(){this.pan=new m({navigation:this}),this.rotate=new u({navigation:this}),this.pinch=new p({navigation:this}),this.zoomBox=new h({view:this.view,navigation:this})}destroy(){this.pan.destroy(),this.rotate.destroy(),this.pinch.destroy(),this.zoomBox.destroy(),this.pan=this.rotate=this.pinch=this.zoomBox=this.animationManager=null}begin(){this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(g)}async zoom(t,i=this._getDefaultAnchor()){if(this.stop(),this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return t<1?this.zoomIn(i):this.zoomOut(i);this.setViewpoint(i,t,0,[0,0])}async zoomIn(t){const i=this.view,o=i.constraints.snapToNextScale(i.scale);return this._zoomToScale(o,t)}async zoomOut(t){const i=this.view,o=i.constraints.snapToPreviousScale(i.scale);return this._zoomToScale(o,t)}setViewpoint(t,i,o,n){this.begin(),this.view.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,t,i,o,n),this.end()}setViewpointImmediate(t,i=0,o=[0,0],n=this._getDefaultAnchor()){this.view.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,n,t,i,o)}continousRotateClockwise(){const t=this.get("view.viewpoint");this.animationManager.animateContinous(t,(t=>{a(t,t,-w)}))}continousRotateCounterclockwise(){const t=this.get("view.viewpoint");this.animationManager.animateContinous(t,(t=>{a(t,t,w)}))}resetRotation(){this.view.rotation=0}continousPanLeft(){this._continuousPan([-l,0])}continousPanRight(){this._continuousPan([l,0])}continousPanUp(){this._continuousPan([0,l])}continousPanDown(){this._continuousPan([0,-l])}stop(){this.pan.stopMomentumNavigation(),this.animationManager.stop(),this.end(),null!==this._endTimer&&(clearTimeout(this._endTimer),this._endTimer=null,this._set("interacting",!1))}_continuousPan(t){const i=this.view.viewpoint;this.animationManager.animateContinous(i,(i=>{r(i,i,t),this.view.constraints.constrainByGeometry(i)}))}_startTimer(t){return null!==this._endTimer||(this._endTimer=setTimeout((()=>{this._endTimer=null;const t=performance.now()-this._lastEventTimestamp;t<g?this._endTimer=this._startTimer(t):this._set("interacting",!1)}),t)),this._endTimer}_getDefaultAnchor(){const{size:t,padding:{left:i,right:o,top:n,bottom:e}}=this.view;return d[0]=.5*(t[0]-o+i),d[1]=.5*(t[1]-e+n),d}async _zoomToScale(t,i=this._getDefaultAnchor()){const{view:o}=this,{constraints:n,scale:e,viewpoint:s,size:a,padding:r}=o,h=n.canZoomInTo(t),m=n.canZoomOutTo(t);if(!(t<e&&!h||t>e&&!m))return c(v,s,t/e,0,i,a,r),n.constrainByGeometry(v),o.goTo(v,{animate:!0})}_scaleRotateTranslateViewpoint(t,i,o,n,e){const{view:s}=this,{size:a,padding:h,constraints:m,scale:p,viewpoint:u}=s,l=p*o,w=m.canZoomInTo(l),v=m.canZoomOutTo(l);return(o<1&&!w||o>1&&!v)&&(o=1),r(u,u,e),c(t,u,o,n,i,a,h),m.constrainByGeometry(t)}};t([n()],_.prototype,"animationManager",void 0),t([n({type:Boolean,readOnly:!0})],_.prototype,"interacting",void 0),t([n()],_.prototype,"pan",void 0),t([n()],_.prototype,"pinch",void 0),t([n()],_.prototype,"rotate",void 0),t([n()],_.prototype,"view",void 0),t([n()],_.prototype,"zoomBox",void 0),_=t([e("esri.views.2d.navigation.MapViewNavigation")],_);const T=_;export{T as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import i from"../../../../Viewpoint.js";import o from"../../../../core/Accessor.js";import{
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import i from"../../../../Viewpoint.js";import o from"../../../../core/Accessor.js";import{when as m}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as s}from"../../../../core/screenUtils.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as r}from"../../../../chunks/vec3.js";import{c as a,f as p}from"../../../../chunks/vec3f64.js";import{translateBy as h}from"../../viewpointUtils.js";import{PanPlanarMomentumEstimator as u}from"../../../navigation/PanPlanarMomentumEstimator.js";import c from"../../../../geometry/Point.js";let d=class extends o{constructor(t){super(t),this.animationTime=0,this.momentumEstimator=new u(500,6,.92),this.momentum=null,this.tmpMomentum=a(),this.momentumFinished=!1,this.viewpoint=new i({targetGeometry:new c,scale:0,rotation:0}),m((()=>this.momentumFinished),(()=>this.navigation.stop()))}begin(t,i){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(i),this.previousDrag=i}update(t,i){this.addToEstimator(i);let o=i.center.x,m=i.center.y;const s=this.previousDrag;o=s?s.center.x-o:-o,m=s?m-s.center.y:m,t.viewpoint=h(this.viewpoint,t.viewpoint,[o||0,m||0]),this.previousDrag=i}end(t,i){this.addToEstimator(i);const o=t.navigation.momentumEnabled;this.momentum=o?this.momentumEstimator.evaluateMomentum():null,this.animationTime=0,this.momentum&&this.onAnimationUpdate(t),this.previousDrag=null,this.navigation.end()}addToEstimator(t){const i=t.center.x,o=t.center.y,m=s(-i,o),e=p(-i,o,0);this.momentumEstimator.add(m,e,.001*t.timestamp)}onAnimationUpdate(t){this.navigation.animationManager.animateContinous(t.viewpoint,((i,o)=>{this.momentumFinished=!this.momentum||this.momentum.isFinished(this.animationTime);const m=.001*o;if(!this.momentumFinished){const o=this.momentum.valueDelta(this.animationTime,m);r(this.tmpMomentum,this.momentum.direction,o),h(i,i,this.tmpMomentum),t.constraints.constrainByGeometry(i)}this.animationTime+=m}))}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};t([e()],d.prototype,"momentumFinished",void 0),t([e()],d.prototype,"viewpoint",void 0),t([e()],d.prototype,"navigation",void 0),d=t([n("esri.views.2d.navigation.actions.Pan")],d);const v=d;export{v as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../Viewpoint.js";import e from"../../core/Collection.js";import{isSome as n,get as r,isNone as o}from"../../core/maybe.js";import{getMetersPerUnitForSR as a}from"../../core/unitUtils.js";import{t as i}from"../../chunks/common.js";import{f as c,r as s,t as u,a as f,s as l,i as m,b as y}from"../../chunks/mat2d.js";import{c as p}from"../../chunks/mat2df64.js";import{g,s as x,c as h,h as b,n as w,f as d,i as j,j as G,k as R,l as k,t as A,m as S}from"../../chunks/vec2.js";import{f as v,a as F}from"../../chunks/vec2f64.js";import N from"../../geometry/Extent.js";import z from"../../geometry/Geometry.js";import I from"../../geometry/Point.js";import{isLoaded as M,canProjectWithoutEngine as V,load as q,project as L}from"../../geometry/projection.js";import P from"../../geometry/SpatialReference.js";import{isValid as C,equals as E,getInfo as O}from"../../geometry/support/spatialReferenceUtils.js";const Q=96,U=39.37,W=180/Math.PI;function B(t){return t.wkid?t:t.spatialReference||P.WGS84}function D(t,e){return e.type?x(t,e.x,e.y):h(t,e)}function T(t){return a(t)}function H(t,e){return Math.max(t.width/e[0],t.height/e[1])*ct(t.spatialReference)}async function J(t,a,i,c){let s,u;if(!t)return null;if(Array.isArray(t)&&!t.length)return null;if(e.isCollection(t)&&(t=t.toArray()),Array.isArray(t)&&t.length&&"object"==typeof t[0]){const e=t.every((t=>"attributes"in t)),r=t.some((t=>!t.geometry));let o=t;if(e&&r&&a&&a.allLayerViews){const e=new Map;for(const n of t){const t=n.layer,r=e.get(t)||[],o=n.attributes[t.objectIdField];null!=o&&r.push(o),e.set(t,r)}const r=[];e.forEach(((t,e)=>{const n=a.allLayerViews.find((t=>t.layer.id===e.id));if("queryFeatures"in n){const o=e.createQuery();o.objectIds=t,o.returnGeometry=!0,r.push(n.queryFeatures(o))}}));const i=await Promise.all(r),c=[];for(const t of i)if(t&&t.features&&t.features.length)for(const e of t.features)n(e.geometry)&&c.push(e.geometry);o=c}for(const t of o)c=await J(t,a,i,c);return c}if(Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])s=new I(t);else if(t instanceof z)s=t;else if("geometry"in t)if(t.geometry)s=t.geometry;else if(t.layer){const e=t.layer,n=a.allLayerViews.find((t=>t.layer.id===e.id));if("queryFeatures"in n){const o=e.createQuery();o.objectIds=[t.attributes[e.objectIdField]],o.returnGeometry=!0;const a=await n.queryFeatures(o);s=r(a,"features",0,"geometry")}}if(o(s))return null;if(u="point"===s.type?new N({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference}):s.extent,!u)return null;M()||V(u.spatialReference,i)||await q();const f=L(u,i);return f?c=c?c.union(f):f:null}function K(t){if(t&&(!Array.isArray(t)||"number"!=typeof t[0])&&("object"==typeof t||Array.isArray(t)&&"object"==typeof t[0])){if("layer"in t&&t.layer&&t.layer.minScale&&t.layer.maxScale){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every((t=>"layer"in t))){let e=0,n=0;for(const r of t){const t=r.layer;t&&t.minScale&&t.maxScale&&(e=t.minScale<e?t.minScale:e,n=t.maxScale>n?t.maxScale:n)}return e&&n?{min:e,max:n}:null}}}function X(t,e){return E(B(t),e)?t:L(t,e)}async function Y(e,r){if(!e||!r)return new t({targetGeometry:new I,scale:0,rotation:0});let o=r.spatialReference;const{constraints:a,padding:i,viewpoint:c,size:s}=r,u=[i?s[0]-i.left-i.right:s[0],i?s[1]-i.top-i.bottom:s[1]];let f=null;e instanceof t?f=e:e.viewpoint?f=e.viewpoint:e.target&&"esri.Viewpoint"===e.target.declaredClass&&(f=e.target);let l=null;f&&f.targetGeometry?l=f.targetGeometry:e instanceof N?l=e:(e||e&&("center"in e||"extent"in e||"target"in e))&&(l=await J(e.center,r,o)||await J(e.extent,r,o)||await J(e.target,r,o)||await J(e,r,o)),!l&&c&&c.targetGeometry?l=c.targetGeometry:!l&&r.extent&&(l=r.extent),o||(o=B(r.spatialReference||r.extent||l)),M()||E(l.spatialReference,o)||V(l,o)||await q();const m=X(l.center?l.center:l,o);let y=null;if(f&&n(f.targetGeometry)&&"point"===f.targetGeometry.type)y=f.scale;else if("scale"in e&&e.scale)y=e.scale;else if("zoom"in e&&-1!==e.zoom&&a&&a.effectiveLODs)y=a.zoomToScale(e.zoom);else if(Array.isArray(l)||"point"===l.type||"extent"===l.type&&0===l.width&&0===l.height){const t=X(r.extent,o);y=n(t)?H(t,u):r.extent?H(r.extent,u):c.scale}else y=H(X(l.extent,o),u);const p=K(e);p&&(p.min&&p.min>y?y=p.min:p.max&&p.max<y&&(y=p.max));let g=0;f?g=f.rotation:e.hasOwnProperty("rotation")?g=e.rotation:c&&(g=c.rotation);let x=new t({targetGeometry:m,scale:y,rotation:g});return a&&(x=a.fit(x),a.constrainByGeometry(x),a.rotationEnabled||(x.rotation=g)),x}function Z(t,e){const n=t.targetGeometry,r=e.targetGeometry;return n.x=r.x,n.y=r.y,n.spatialReference=r.spatialReference,t.scale=e.scale,t.rotation=e.rotation,t}function $(t,e,n){return n?x(t,.5*(e[0]-n.right+n.left),.5*(e[1]-n.bottom+n.top)):g(t,e,.5)}const _=function(){const t=F();return function(e,n,r){const o=n.targetGeometry;D(t,o);const a=.5*ot(n);return e.xmin=t[0]-a*r[0],e.ymin=t[1]-a*r[1],e.xmax=t[0]+a*r[0],e.ymax=t[1]+a*r[1],e.spatialReference=o.spatialReference,e}}();function tt(t,e,n,r,o){return xt(t,e,n.center),t.scale=H(n,r),o&&o.constraints&&o.constraints.constrain(t),t}function et(t,e,n,r){return ft(t,e,n,r),m(t,t)}const nt=function(){const t=F();return function(e,n,r){return b(e,st(e,n),$(t,n,r))}}(),rt=function(){const t=p(),e=F();return function(n,r,o,a){const i=ot(r),f=it(r);return x(e,i,i),c(t,e),s(t,t,f),u(t,t,nt(e,o,a)),u(t,t,[0,a.top-a.bottom]),x(n,t[4],t[5])}}();function ot(t){return t.scale*at(t.targetGeometry)}function at(t){return n(t)&&C(t.spatialReference)?1/(T(t.spatialReference)*U*Q):1}function it(t){return i(t.rotation)||0}function ct(t){return C(t)?T(t)*U*Q:1}function st(t,e){return g(t,e,.5)}const ut=function(){const t=F(),e=F(),n=F();return function(r,o,a,i,c,m){return w(t,o),g(e,a,.5*m),x(n,1/i*m,-1/i*m),f(r,e),c&&s(r,r,c),l(r,r,n),u(r,r,t),r}}(),ft=function(){const t=F();return function(e,n,r,o){const a=ot(n),i=it(n);return D(t,n.targetGeometry),ut(e,t,r,a,i,o)}}(),lt=function(){const t=F();return function(e,n,r,o){const a=ot(n);return D(t,n.targetGeometry),ut(e,t,r,a,0,o)}}();function mt(t){if(t.isWrappable){const e=O(t);return e.valid[1]-e.valid[0]}return 0}function yt(t,e){return Math.round(mt(t)/e)}const pt=function(){const t=F(),e=F(),n=[0,0,0];return function(r,o,a){d(t,r,o),j(t,t),d(e,r,a),j(e,e),G(n,t,e);let i=Math.acos(R(t,e)/(k(t)*k(e)))*W;return n[2]<0&&(i=-i),isNaN(i)&&(i=0),i}}(),gt=function(){const t=F();return function(e,n,r,o){const a=e.targetGeometry;return Z(e,n),rt(t,n,r,o),a.x+=t[0],a.y+=t[1],e}}(),xt=function(t,e,n){Z(t,e);const r=t.targetGeometry;return r.x=n.x,r.y=n.y,t},ht=function(){const t=F();return function(e,n,r,o,a){a||(a="center"),b(t,r,o),g(t,t,.5);const i=t[0],c=t[1];switch(a){case"center":x(t,0,0);break;case"left":x(t,-i,0);break;case"top":x(t,0,c);break;case"right":x(t,i,0);break;case"bottom":x(t,0,-c);break;case"top-left":x(t,-i,c);break;case"bottom-left":x(t,-i,-c);break;case"top-right":x(t,i,c);break;case"bottom-right":x(t,i,-c)}return St(e,n,t),e}}();function bt(t,e,n){return Z(t,e),t.rotation+=n,t}function wt(t,e,n){return Z(t,e),t.rotation=n,t}const dt=function(){const t=F();return function(e,n,r,o,a){return Z(e,n),isNaN(r)||0===r||(kt(t,o,n,a),e.scale=n.scale*r,At(t,t,e,a),St(e,e,x(t,t[0]-o[0],o[1]-t[1]))),e}}();function jt(t,e,n){return Z(t,e),t.scale=n,t}const Gt=function(){const t=F();return function(e,n,r,o,a,i){return Z(e,n),isNaN(r)||0===r||(kt(t,a,n,i),e.scale=n.scale*r,e.rotation+=o,At(t,t,e,i),St(e,e,x(t,t[0]-a[0],a[1]-t[1]))),e}}(),Rt=function(){const t=F(),e=F();return function(n,r,o,a,i,c,s){return nt(e,c,s),S(t,i,e),a?Gt(n,r,o,a,t,c):dt(n,r,o,t,c)}}(),kt=function(){const t=p();return function(e,n,r,o){return A(e,n,et(t,r,o,1))}}(),At=function(){const t=p();return function(e,n,r,o){return A(e,n,ft(t,r,o,1))}}(),St=function(){const t=F(),e=p();return function(n,r,o){Z(n,r);const a=ot(r),i=n.targetGeometry;return y(e,it(r)),l(e,e,v(a,a)),A(t,o,e),i.x+=t[0],i.y+=t[1],n}}();export{gt as addPadding,pt as angleBetween,xt as centerAt,Z as copy,Y as create,H as extentToScale,$ as getAnchor,_ as getExtent,ut as getMatrix,rt as getPaddingMapTranslation,nt as getPaddingScreenTranslation,ot as getResolution,ct as getResolutionToScaleFactor,ft as getTransform,lt as getTransformNoRotation,yt as getWorldScreenWidth,mt as getWorldWidth,Rt as padAndScaleAndRotateBy,ht as resize,bt as rotateBy,wt as rotateTo,Gt as scaleAndRotateBy,jt as scaleTo,tt as setExtent,kt as toMap,At as toScreen,St as translateBy};
|
|
5
|
+
import t from"../../Viewpoint.js";import e from"../../core/Collection.js";import{isSome as n,get as r,isNone as o}from"../../core/maybe.js";import{getMetersPerUnitForSR as a}from"../../core/unitUtils.js";import{t as i}from"../../chunks/common.js";import{f as c,r as s,t as u,a as f,s as l,i as m,b as y}from"../../chunks/mat2d.js";import{c as p}from"../../chunks/mat2df64.js";import{g,s as x,c as h,h as b,n as w,f as d,i as j,j as G,k as R,l as k,t as A,m as S}from"../../chunks/vec2.js";import{f as v,a as F}from"../../chunks/vec2f64.js";import N from"../../geometry/Extent.js";import z from"../../geometry/Geometry.js";import I from"../../geometry/Point.js";import{isLoaded as M,canProjectWithoutEngine as V,load as q,project as L}from"../../geometry/projection.js";import P from"../../geometry/SpatialReference.js";import{isValid as C,equals as E,getInfo as O}from"../../geometry/support/spatialReferenceUtils.js";const Q=96,U=39.37,W=180/Math.PI;function B(t){return t.wkid?t:t.spatialReference||P.WGS84}function D(t,e){return e.type?x(t,e.x,e.y):h(t,e)}function T(t){return a(t)}function H(t,e){return Math.max(t.width/e[0],t.height/e[1])*ct(t.spatialReference)}async function J(t,a,i,c){let s,u;if(!t)return null;if(Array.isArray(t)&&!t.length)return null;if(e.isCollection(t)&&(t=t.toArray()),Array.isArray(t)&&t.length&&"object"==typeof t[0]){const e=t.every((t=>"attributes"in t)),r=t.some((t=>!t.geometry));let o=t;if(e&&r&&a&&a.allLayerViews){const e=new Map;for(const n of t){const t=n.layer,r=e.get(t)||[],o=n.attributes[t.objectIdField];null!=o&&r.push(o),e.set(t,r)}const r=[];e.forEach(((t,e)=>{const n=a.allLayerViews.find((t=>t.layer.id===e.id));if("queryFeatures"in n){const o=e.createQuery();o.objectIds=t,o.returnGeometry=!0,r.push(n.queryFeatures(o))}}));const i=await Promise.all(r),c=[];for(const t of i)if(t&&t.features&&t.features.length)for(const e of t.features)n(e.geometry)&&c.push(e.geometry);o=c}for(const t of o)c=await J(t,a,i,c);return c}if(Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])s=new I(t);else if(t instanceof z)s=t;else if("geometry"in t)if(t.geometry)s=t.geometry;else if(t.layer){const e=t.layer,n=a.allLayerViews.find((t=>t.layer.id===e.id));if("queryFeatures"in n){const o=e.createQuery();o.objectIds=[t.attributes[e.objectIdField]],o.returnGeometry=!0;const a=await n.queryFeatures(o);s=r(a,"features",0,"geometry")}}if(o(s))return null;if(u="point"===s.type?new N({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference}):s.extent,!u)return null;M()||V(u.spatialReference,i)||await q();const f=L(u,i);return f?c=c?c.union(f):f:null}function K(t){if(t&&(!Array.isArray(t)||"number"!=typeof t[0])&&("object"==typeof t||Array.isArray(t)&&"object"==typeof t[0])){if("layer"in t&&t.layer&&t.layer.minScale&&t.layer.maxScale){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every((t=>"layer"in t))){let e=0,n=0;for(const r of t){const t=r.layer;t&&t.minScale&&t.maxScale&&(e=t.minScale<e?t.minScale:e,n=t.maxScale>n?t.maxScale:n)}return e&&n?{min:e,max:n}:null}}}function X(t,e){return E(B(t),e)?t:L(t,e)}async function Y(e,r){if(!e||!r)return new t({targetGeometry:new I,scale:0,rotation:0});let o=r.spatialReference;const{constraints:a,padding:i,viewpoint:c,size:s}=r,u=[i?s[0]-i.left-i.right:s[0],i?s[1]-i.top-i.bottom:s[1]];let f=null;e instanceof t?f=e:e.viewpoint?f=e.viewpoint:e.target&&"esri.Viewpoint"===e.target.declaredClass&&(f=e.target);let l=null;f&&f.targetGeometry?l=f.targetGeometry:e instanceof N?l=e:(e||e&&("center"in e||"extent"in e||"target"in e))&&(l=await J(e.center,r,o)||await J(e.extent,r,o)||await J(e.target,r,o)||await J(e,r,o)),!l&&c&&c.targetGeometry?l=c.targetGeometry:!l&&r.extent&&(l=r.extent),o||(o=B(r.spatialReference||r.extent||l)),M()||E(l.spatialReference,o)||V(l,o)||await q();const m=X(l.center?l.center:l,o);let y=null;if(f&&n(f.targetGeometry)&&"point"===f.targetGeometry.type)y=f.scale;else if("scale"in e&&e.scale)y=e.scale;else if("zoom"in e&&-1!==e.zoom&&a&&a.effectiveLODs)y=a.zoomToScale(e.zoom);else if(Array.isArray(l)||"point"===l.type||"extent"===l.type&&0===l.width&&0===l.height){const t=X(r.extent,o);y=n(t)?H(t,u):r.extent?H(r.extent,u):c.scale}else y=H(X(l.extent,o),u);const p=K(e);p&&(p.min&&p.min>y?y=p.min:p.max&&p.max<y&&(y=p.max));let g=0;f?g=f.rotation:e.hasOwnProperty("rotation")?g=e.rotation:c&&(g=c.rotation);let x=new t({targetGeometry:m,scale:y,rotation:g});return a&&(x=a.fit(x),a.constrainByGeometry(x),a.rotationEnabled||(x.rotation=g)),x}function Z(t,e){const n=t.targetGeometry,r=e.targetGeometry;return n.x=r.x,n.y=r.y,n.spatialReference=r.spatialReference,t.scale=e.scale,t.rotation=e.rotation,t}function $(t,e,n){return n?x(t,.5*(e[0]-n.right+n.left),.5*(e[1]-n.bottom+n.top)):g(t,e,.5)}const _=function(){const t=F();return function(e,n,r){const o=n.targetGeometry;D(t,o);const a=.5*ot(n);return e.xmin=t[0]-a*r[0],e.ymin=t[1]-a*r[1],e.xmax=t[0]+a*r[0],e.ymax=t[1]+a*r[1],e.spatialReference=o.spatialReference,e}}();function tt(t,e,n,r,o){return xt(t,e,n.center),t.scale=H(n,r),o&&o.constraints&&o.constraints.constrain(t),t}function et(t,e,n,r){return ft(t,e,n,r),m(t,t)}const nt=function(){const t=F();return function(e,n,r){return b(e,st(e,n),$(t,n,r))}}(),rt=function(){const t=p(),e=F();return function(n,r,o,a){const i=ot(r),f=it(r);return x(e,i,i),c(t,e),s(t,t,f),u(t,t,nt(e,o,a)),u(t,t,[0,a.top-a.bottom]),x(n,t[4],t[5])}}();function ot(t){return t.scale*at(t.targetGeometry)}function at(t){return n(t)&&C(t.spatialReference)?1/(T(t.spatialReference)*U*Q):1}function it(t){return i(t.rotation)||0}function ct(t){return C(t)?T(t)*U*Q:1}function st(t,e){return g(t,e,.5)}const ut=function(){const t=F(),e=F(),n=F();return function(r,o,a,i,c,m){return w(t,o),g(e,a,.5*m),x(n,1/i*m,-1/i*m),f(r,e),c&&s(r,r,c),l(r,r,n),u(r,r,t),r}}(),ft=function(){const t=F();return function(e,n,r,o){const a=ot(n),i=it(n);return D(t,n.targetGeometry),ut(e,t,r,a,i,o)}}(),lt=function(){const t=F();return function(e,n,r,o){const a=ot(n);return D(t,n.targetGeometry),ut(e,t,r,a,0,o)}}();function mt(t){if(t.isWrappable){const e=O(t);return e.valid[1]-e.valid[0]}return 0}function yt(t,e){return Math.round(mt(t)/e)}const pt=function(){const t=F(),e=F(),n=[0,0,0];return function(r,o,a){d(t,r,o),j(t,t),d(e,r,a),j(e,e),G(n,t,e);let i=Math.acos(R(t,e)/(k(t)*k(e)))*W;return n[2]<0&&(i=-i),isNaN(i)&&(i=0),i}}(),gt=function(){const t=F();return function(e,n,r,o){const a=e.targetGeometry;return Z(e,n),rt(t,n,r,o),a.x+=t[0],a.y+=t[1],e}}(),xt=function(t,e,n){Z(t,e);const r=t.targetGeometry;return r.x=n.x,r.y=n.y,r.spatialReference=n.spatialReference,t},ht=function(){const t=F();return function(e,n,r,o,a){a||(a="center"),b(t,r,o),g(t,t,.5);const i=t[0],c=t[1];switch(a){case"center":x(t,0,0);break;case"left":x(t,-i,0);break;case"top":x(t,0,c);break;case"right":x(t,i,0);break;case"bottom":x(t,0,-c);break;case"top-left":x(t,-i,c);break;case"bottom-left":x(t,-i,-c);break;case"top-right":x(t,i,c);break;case"bottom-right":x(t,i,-c)}return St(e,n,t),e}}();function bt(t,e,n){return Z(t,e),t.rotation+=n,t}function wt(t,e,n){return Z(t,e),t.rotation=n,t}const dt=function(){const t=F();return function(e,n,r,o,a){return Z(e,n),isNaN(r)||0===r||(kt(t,o,n,a),e.scale=n.scale*r,At(t,t,e,a),St(e,e,x(t,t[0]-o[0],o[1]-t[1]))),e}}();function jt(t,e,n){return Z(t,e),t.scale=n,t}const Gt=function(){const t=F();return function(e,n,r,o,a,i){return Z(e,n),isNaN(r)||0===r||(kt(t,a,n,i),e.scale=n.scale*r,e.rotation+=o,At(t,t,e,i),St(e,e,x(t,t[0]-a[0],a[1]-t[1]))),e}}(),Rt=function(){const t=F(),e=F();return function(n,r,o,a,i,c,s){return nt(e,c,s),S(t,i,e),a?Gt(n,r,o,a,t,c):dt(n,r,o,t,c)}}(),kt=function(){const t=p();return function(e,n,r,o){return A(e,n,et(t,r,o,1))}}(),At=function(){const t=p();return function(e,n,r,o){return A(e,n,ft(t,r,o,1))}}(),St=function(){const t=F(),e=p();return function(n,r,o){Z(n,r);const a=ot(r),i=n.targetGeometry;return y(e,it(r)),l(e,e,v(a,a)),A(t,o,e),i.x+=t[0],i.y+=t[1],n}}();export{gt as addPadding,pt as angleBetween,xt as centerAt,Z as copy,Y as create,H as extentToScale,$ as getAnchor,_ as getExtent,ut as getMatrix,rt as getPaddingMapTranslation,nt as getPaddingScreenTranslation,ot as getResolution,ct as getResolutionToScaleFactor,ft as getTransform,lt as getTransformNoRotation,yt as getWorldScreenWidth,mt as getWorldWidth,Rt as padAndScaleAndRotateBy,ht as resize,bt as rotateBy,wt as rotateTo,Gt as scaleAndRotateBy,jt as scaleTo,tt as setExtent,kt as toMap,At as toScreen,St as translateBy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import s from"../../../core/Handles.js";import{equalsShallow as i}from"../../../core/lang.js";import{lerp as r}from"../../../core/mathUtils.js";import{isSome as o,destroyMaybe as n,applySome as a,isNone as h}from"../../../core/maybe.js";import{watch as p,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{when as d}from"../../../core/watchUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{l as c}from"../../../chunks/vec3.js";import{getReferenceEllipsoid as u}from"../../../geometry/projectionEllipsoid.js";import{isMoon as g,isEarth as w}from"../../../geometry/support/spatialReferenceUtils.js";import{enablePrecipitation as v}from"../../../support/featureFlags.js";import{ChapmanAtmosphere as y}from"./ChapmanAtmosphere.js";import{CloudsComposition as f}from"./CloudsComposition.js";import{isReadyCloudsData as R}from"./CloudsData.js";import{CloudsGenerator as A}from"./CloudsGenerator.js";import{cloudPresets as P}from"./CloudsPresets.js";import{Fog as C}from"./Fog.js";import{PanoramicAtmosphere as E}from"./PanoramicAtmosphere.js";import{Precipitation as N}from"./Precipitation.js";import{P as b}from"../../../chunks/Precipitation.glsl.js";import j from"./SimpleAtmosphere.js";import{Stars as T}from"./Stars.js";import{weatherHeightLimit as x}from"./weather.js";import{RenderPass as O}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as S}from"../webgl-engine/lib/RenderSlot.js";const M=[S.POSTPROCESSING_ENVIRONMENT_OPAQUE,S.POSTPROCESSING_ENVIRONMENT_TRANSPARENT];let D=class extends t{constructor(e){super(e),this._handles=new s,this._context=null,this._pendingAtmosphere=null,this._atmosphere=null,this._stars=null,this._precipitation=null,this._clouds=null,this._cloudComposition=null,this._fog=null}get atmosphereType(){return o(this._pendingAtmosphere)?this._pendingAtmosphere.type:o(this._atmosphere)?this._atmosphere.type:"none"}get canRender(){var e;return!(null==(e=this.view.basemapTerrain)||!e.renderer.canRender)||"global"!==this.view.viewingMode}get needsLinearDepth(){return"realistic"===this._selectAtmosphereType()}updateAnimation(e){return!!o(this._precipitation)&&this._precipitation.update(e)}get updating(){return o(this._pendingAtmosphere)||o(this._stars)&&this._stars.updating||o(this._clouds)&&this._clouds.running}get weatherVisible(){return c(this.view.state.camera.eye)-u(this.view.spatialReference).radius<=x}get weatherEnabled(){var e;return!(null==(e=this.view.environmentManager)||!e.weatherEnabled)}get precipitationEnabled(){return v()}initialize(){this.view._stage.addRenderPlugin(M,this)}destroy(){this._pendingAtmosphere=n(this._pendingAtmosphere),this.uninitializeRenderContext(),this._handles=n(this._handles),this.view&&null!=this.view._stage&&(this.view._stage.removeRenderPlugin(this),this._set("view",null))}initializeRenderContext(e=null){this._context=e,this._handles.add([d(this.view,"basemapTerrain",(()=>this._updateBasemapTerrain()),!0),p((()=>({viewingMode:this.view.viewingMode,atmosphereEnabled:this.view.environment.atmosphereEnabled,atmosphereQuality:this.view.environment.atmosphere.quality})),(()=>this._updateAtmosphere()),l),p((()=>this._starsCreationParameters),(e=>this._createOrDestroyStars(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._environmentPostProcessCreationParameters),(e=>this._createOrDestroyPrecipitation(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._cloudsCreationParameters),(e=>this._createOrDestroyClouds(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._environmentPostProcessCreationParameters),(e=>this._createOrDestroyFog(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._weatherUpdateParameters),(e=>{this._updateWeather(e),this._updateFog(e)}),l)])}uninitializeRenderContext(){this._stars=n(this._stars),this._precipitation=n(this._precipitation),this._atmosphere=n(this._atmosphere),this._clouds=n(this._clouds),this._cloudComposition=n(this._cloudComposition),this._fog=n(this._fog)}render(e){if(e.pass===O.MATERIAL)switch(e.slot){case S.POSTPROCESSING_ENVIRONMENT_OPAQUE:o(this._stars)&&this._stars.render(e),o(this._atmosphere)&&this._atmosphere.canRender&&(this._atmosphere.render(e),R(this._clouds)&&o(this._cloudComposition)&&(this._cloudComposition.render(e,this._clouds,o(this.view.animation)),this._cloudComposition.isFading&&this._setNeedsRender()));break;case S.POSTPROCESSING_ENVIRONMENT_TRANSPARENT:if(o(this._atmosphere)&&this._atmosphere.canRender){const t=this.weatherEnabled?this.view.environment.weather.type:"disabled";this._atmosphere.renderHaze(e,"rainy"===t),o(this._fog)&&("foggy"!==t&&"realistic"===this._selectAtmosphereType()||this._fog.render(e,"foggy"===t,"rainy"===t)),"rainy"!==this.view.environment.weather.type&&"snowy"!==this.view.environment.weather.type||o(this._precipitation)&&this._precipitation.render(e,this.view.environment.weather.precipitation,"rainy"===this.view.environment.weather.type?b.RAIN:b.SNOW)}}}get _cloudsCreationParameters(){return this.weatherEnabled?{view:this.view,viewingMode:this.view.state.viewingMode,rctx:o(this._context)?this._context.renderContext.rctx:null,radius:u(this.view.spatialReference).radius}:null}_createOrDestroyClouds(e){this._clouds=n(this._clouds),this._cloudComposition=n(this._cloudComposition),a(e,(({view:e,viewingMode:t,rctx:s,radius:i})=>{this._clouds=new A({rctx:s,view:e,requestRender:()=>this._setNeedsRender()}),this._cloudComposition=new f(s,t,i,c(e.state.camera.eye)-i)})),this._setNeedsRender()}get _weatherUpdateParameters(){const e=this.weatherEnabled?this.view.environment.weather:null;return h(e)?null:{type:e.type,weatherAdjustment:"foggy"===e.type?e.fogStrength:e.cloudCover}}_updateWeather(e){h(e)||h(this._clouds)||this._clouds.applyPreset(P[e.type],e.weatherAdjustment)}_setNeedsRender(){o(this._context)&&this._context.requestRender()}get _starsCreationParameters(){var e,t,s;return{view:this.view,starsEnabled:null!=(e=null==(t=this.view)||null==(s=t.environment)?void 0:s.starsEnabled)&&e}}_createOrDestroyStars({view:e,starsEnabled:t}){t&&h(this._stars)?(this._stars=new T({view:e,requestRender:()=>this._setNeedsRender()}),this._setNeedsRender()):!t&&o(this._stars)&&(this._stars.destroy(),this._stars=null,this._setNeedsRender())}_createOrDestroyPrecipitation(e){this.precipitationEnabled&&h(this._precipitation)?(a(e,(({context:e,view:t})=>{this._precipitation=new N(e,t)})),this._setNeedsRender()):!this.precipitationEnabled&&o(this._precipitation)&&(this._precipitation=n(this._precipitation),this._setNeedsRender())}_updateFog(e){h(this._fog)||h(e)||("foggy"===e.type?this._fog.strength=r(3e-5,.005,e.weatherAdjustment**3):this._fog.strength=4e-6)}get _environmentPostProcessCreationParameters(){return!this.weatherEnabled||h(this._context)?null:{view:this.view,context:this._context}}_createOrDestroyFog(e){this.weatherEnabled&&h(this._fog)?(a(e,(({view:e,context:t})=>{this._fog=new C(t,e)})),this._updateFog(this._weatherUpdateParameters),this._setNeedsRender()):o(this._fog)&&(this._fog.destroy(),this._fog=null,this._setNeedsRender())}_updateAtmosphere(){const e=this._selectAtmosphereType();if(this.atmosphereType===e)return;o(this._pendingAtmosphere)&&(this._pendingAtmosphere!==this._atmosphere&&this._pendingAtmosphere.destroy(),this._pendingAtmosphere=null);const t=this._getAtmosphereClass();if(!t)return o(this._atmosphere)&&(this._atmosphere.destroy(),this._atmosphere=null,this._setNeedsRender()),void this._updateBasemapTerrain();const s=new t(this.view);o(this._context)&&s.initializeRenderContext(this._context),h(this._atmosphere)&&(this._atmosphere=s,this._setNeedsRender()),this._pendingAtmosphere=s,s.when().then((()=>{o(this._atmosphere)&&this._pendingAtmosphere&&this._pendingAtmosphere!==this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=this._pendingAtmosphere),this._pendingAtmosphere=null,this._setNeedsRender(),this._updateBasemapTerrain()})).catch((()=>{this._pendingAtmosphere===s&&(this._pendingAtmosphere=null)}))}_getAtmosphereClass(){switch(this._selectAtmosphereType()){case"none":return null;case"realistic":return y;case"panoramic":return E;case"simple":return j;default:return}}_selectAtmosphereType(){const e=this.view.get("environment.atmosphereEnabled"),t=this.view.get("environment.atmosphere.quality"),s=this.view.viewingMode;return!e||null==t||g(this.view.spatialReference)?"none":"local"===s?"panoramic":"high"===t&&o(this._context)&&y.isSupported(this._context)&&w(this.view.spatialReference)?"realistic":"simple"}_updateBasemapTerrain(){this.view.basemapTerrain&&(this.view.basemapTerrain.velvetOverground=o(this._atmosphere)&&"simple"===this.atmosphereType)}get test(){return{atmosphere:this._atmosphere,clouds:this._clouds,selectAtmosphereType:()=>this._selectAtmosphereType()}}};e([m({constructOnly:!0})],D.prototype,"view",void 0),e([m({type:Boolean,readOnly:!0})],D.prototype,"updating",null),e([m()],D.prototype,"weatherVisible",null),e([m()],D.prototype,"_pendingAtmosphere",void 0),e([m()],D.prototype,"_stars",void 0),e([m()],D.prototype,"_precipitation",void 0),e([m()],D.prototype,"_clouds",void 0),e([m()],D.prototype,"_cloudComposition",void 0),e([m()],D.prototype,"_fog",void 0),e([m()],D.prototype,"weatherEnabled",null),e([m()],D.prototype,"precipitationEnabled",null),e([m()],D.prototype,"_cloudsCreationParameters",null),e([m()],D.prototype,"_weatherUpdateParameters",null),e([m()],D.prototype,"_starsCreationParameters",null),e([m()],D.prototype,"_environmentPostProcessCreationParameters",null),D=e([_("esri.views.3d.environment.EnvironmentRenderer")],D);export{D as EnvironmentRenderer};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import s from"../../../core/Handles.js";import{equalsShallow as i}from"../../../core/lang.js";import{lerp as r}from"../../../core/mathUtils.js";import{isSome as o,destroyMaybe as n,applySome as a,isNone as h}from"../../../core/maybe.js";import{watch as p,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{when as d}from"../../../core/watchUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{l as c}from"../../../chunks/vec3.js";import{getReferenceEllipsoid as u}from"../../../geometry/projectionEllipsoid.js";import{isMoon as g,isEarth as w}from"../../../geometry/support/spatialReferenceUtils.js";import{enablePrecipitation as v}from"../../../support/featureFlags.js";import{ChapmanAtmosphere as y}from"./ChapmanAtmosphere.js";import{CloudsComposition as f}from"./CloudsComposition.js";import{isReadyCloudsData as A}from"./CloudsData.js";import{CloudsGenerator as R}from"./CloudsGenerator.js";import{cloudPresets as C}from"./CloudsPresets.js";import{Fog as P}from"./Fog.js";import{PanoramicAtmosphere as b}from"./PanoramicAtmosphere.js";import{Precipitation as E}from"./Precipitation.js";import{P as N}from"../../../chunks/Precipitation.glsl.js";import j from"./SimpleAtmosphere.js";import{Stars as T}from"./Stars.js";import{weatherHeightLimit as x}from"./weather.js";import{RenderPass as O}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as S}from"../webgl-engine/lib/RenderSlot.js";var M;const D=[S.POSTPROCESSING_ENVIRONMENT_OPAQUE,S.POSTPROCESSING_ENVIRONMENT_TRANSPARENT];let I,U=M=class extends t{constructor(e){super(e),this._handles=new s,this._context=null,this._pendingAtmosphere=null,this._atmosphere=null,this._stars=null,this._precipitation=null,this._clouds=null,this._cloudComposition=null,this._fog=null}get atmosphereType(){return o(this._pendingAtmosphere)?this._pendingAtmosphere.type:o(this._atmosphere)?this._atmosphere.type:"none"}get canRender(){var e;return!(null==(e=this.view.basemapTerrain)||!e.renderer.canRender)||"global"!==this.view.viewingMode}get needsLinearDepth(){return"realistic"===this._selectAtmosphereType()}updateAnimation(e){return!!o(this._precipitation)&&this._precipitation.update(e)}get updating(){return o(this._pendingAtmosphere)||o(this._stars)&&this._stars.updating||o(this._clouds)&&this._clouds.running}get weatherVisible(){return c(this.view.state.camera.eye)-u(this.view.spatialReference).radius<=x}get weatherEnabled(){var e;return!(null==(e=this.view.environmentManager)||!e.weatherEnabled)}get precipitationEnabled(){return v()}initialize(){this.view._stage.addRenderPlugin(D,this)}destroy(){this._pendingAtmosphere=n(this._pendingAtmosphere),this.uninitializeRenderContext(),this._handles=n(this._handles),this.view&&null!=this.view._stage&&(this.view._stage.removeRenderPlugin(this),this._set("view",null))}initializeRenderContext(e=null){this._context=e,this._handles.add([d(this.view,"basemapTerrain",(()=>this._updateBasemapTerrain()),!0),p((()=>({viewingMode:this.view.viewingMode,atmosphereEnabled:this.view.environment.atmosphereEnabled,atmosphereQuality:this.view.environment.atmosphere.quality})),(()=>this._updateAtmosphere()),l),p((()=>this._starsCreationParameters),(e=>this._createOrDestroyStars(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._cloudsCreationParameters),(e=>this._createOrDestroyClouds(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._environmentPostProcessCreationParameters),(e=>this._createOrDestroyPrecipitation(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._environmentPostProcessCreationParameters),(e=>this._createOrDestroyFog(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._weatherUpdateParameters),(e=>{this._updateWeather(e),this._updateFog(e),this._setNeedsRender()}),l)])}uninitializeRenderContext(){this._stars=n(this._stars),this._precipitation=n(this._precipitation),this._atmosphere=n(this._atmosphere),this._clouds=n(this._clouds),this._cloudComposition=n(this._cloudComposition),this._fog=n(this._fog)}render(e){if(e.pass===O.MATERIAL)switch(e.slot){case S.POSTPROCESSING_ENVIRONMENT_OPAQUE:o(this._stars)&&this._stars.render(e),o(this._atmosphere)&&this._atmosphere.canRender&&(this._atmosphere.render(e),A(this._clouds)&&o(this._cloudComposition)&&(this._cloudComposition.render(e,this._clouds,o(this.view.animation)),this._cloudComposition.isFading&&this._setNeedsRender()));break;case S.POSTPROCESSING_ENVIRONMENT_TRANSPARENT:if(o(this._atmosphere)&&this._atmosphere.canRender){const t=this.weatherEnabled?this.view.environment.weather.type:"disabled";if(this._atmosphere.renderHaze(e,"rainy"===t),o(this._fog)){const s="foggy"===t||"rainy"===t||"snowy"===t;(s||"realistic"!==this._selectAtmosphereType())&&this._fog.render(e,s,"rainy"===t)}"rainy"!==this.view.environment.weather.type&&"snowy"!==this.view.environment.weather.type||o(this._precipitation)&&this._precipitation.render(e,this.view.environment.weather.precipitation,"rainy"===this.view.environment.weather.type?N.RAIN:N.SNOW)}}}get _cloudsCreationParameters(){return this.weatherEnabled?{view:this.view,viewingMode:this.view.state.viewingMode,rctx:o(this._context)?this._context.renderContext.rctx:null,radius:u(this.view.spatialReference).radius}:null}_createOrDestroyClouds(e){this._clouds=n(this._clouds),this._cloudComposition=n(this._cloudComposition),a(e,(({view:e,viewingMode:t,rctx:s,radius:i})=>{this._clouds=new R({rctx:s,view:e,requestRender:()=>this._setNeedsRender()}),this._cloudComposition=new f(s,t,i,c(e.state.camera.eye)-i)})),this._setNeedsRender()}get _weatherUpdateParameters(){const e=this.weatherEnabled?this.view.environment.weather:null;return h(e)?null:"rainy"===e.type||"snowy"===e.type?{type:e.type,weatherAdjustment:e.cloudCover,effect:e.precipitation}:{type:e.type,weatherAdjustment:"foggy"===e.type?e.fogStrength:e.cloudCover}}_updateWeather(e){h(e)||h(this._clouds)||this._clouds.applyPreset(C[e.type],e.weatherAdjustment)}_setNeedsRender(){o(this._context)&&this._context.requestRender()}get _starsCreationParameters(){var e,t,s;return{view:this.view,starsEnabled:null!=(e=null==(t=this.view)||null==(s=t.environment)?void 0:s.starsEnabled)&&e}}_createOrDestroyStars({view:e,starsEnabled:t}){t&&h(this._stars)?(this._stars=new T({view:e,requestRender:()=>this._setNeedsRender()}),this._setNeedsRender()):!t&&o(this._stars)&&(this._stars.destroy(),this._stars=null,this._setNeedsRender())}_createOrDestroyPrecipitation(e){this.precipitationEnabled&&h(this._precipitation)?(a(e,(({context:e,view:t})=>{this._precipitation=new E(e,t)})),this._setNeedsRender()):!this.precipitationEnabled&&o(this._precipitation)&&(this._precipitation=n(this._precipitation),this._setNeedsRender())}_updateFog(e){if(!h(this._fog)&&!h(e))switch(e.type){case"foggy":this._fog.strength=r(3e-5,.005,e.weatherAdjustment**3);break;case"rainy":case"snowy":this._fog.strength=r(4e-6,8e-5,e.effect**3);break;default:this._fog.strength=4e-6}}get _environmentPostProcessCreationParameters(){return!this.weatherEnabled||h(this._context)?null:{view:this.view,context:this._context}}_createOrDestroyFog(e){this.weatherEnabled&&h(this._fog)?(a(e,(({view:e,context:t})=>{this._fog=new P(t,e)})),this._updateFog(this._weatherUpdateParameters),this._setNeedsRender()):o(this._fog)&&(this._fog.destroy(),this._fog=null,this._setNeedsRender())}_updateAtmosphere(){const e=this._selectAtmosphereType();if(this.atmosphereType===e)return;o(this._pendingAtmosphere)&&(this._pendingAtmosphere!==this._atmosphere&&this._pendingAtmosphere.destroy(),this._pendingAtmosphere=null);const t=this._getAtmosphereClass();if(!t)return o(this._atmosphere)&&(this._atmosphere.destroy(),this._atmosphere=null,this._setNeedsRender()),void this._updateBasemapTerrain();const s=new t(this.view);o(this._context)&&s.initializeRenderContext(this._context),h(this._atmosphere)&&(this._atmosphere=s,this._setNeedsRender()),this._pendingAtmosphere=s,s.when().then((()=>{o(this._atmosphere)&&this._pendingAtmosphere&&this._pendingAtmosphere!==this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=this._pendingAtmosphere),this._pendingAtmosphere=null,this._setNeedsRender(),this._updateBasemapTerrain()})).catch((()=>{this._pendingAtmosphere===s&&(this._pendingAtmosphere=null)}))}_getAtmosphereClass(){switch(this._selectAtmosphereType()){case"none":return null;case"realistic":return y;case"panoramic":return b;case"simple":return j;default:return}}_selectAtmosphereType(){const e=this.view.get("environment.atmosphereEnabled"),t=this.view.get("environment.atmosphere.quality"),s=this.view.viewingMode;return!e||null==t||g(this.view.spatialReference)?"none":"local"===s?"panoramic":"high"===t&&o(this._context)&&y.isSupported(this._context)&&w(this.view.spatialReference)?"realistic":"simple"}_updateBasemapTerrain(){this.view.basemapTerrain&&(this.view.basemapTerrain.velvetOverground=o(this._atmosphere)&&"simple"===this.atmosphereType)}get test(){return{atmosphere:this._atmosphere,clouds:this._clouds,selectAtmosphereType:()=>this._selectAtmosphereType(),stubGetAtmosphereClass:e=>{I=M.prototype._getAtmosphereClass,M.prototype._getAtmosphereClass=e},restoreGetAtmosphereClass:()=>{M.prototype._getAtmosphereClass=I}}}};e([m({constructOnly:!0})],U.prototype,"view",void 0),e([m({type:Boolean,readOnly:!0})],U.prototype,"updating",null),e([m()],U.prototype,"weatherVisible",null),e([m()],U.prototype,"_pendingAtmosphere",void 0),e([m()],U.prototype,"_stars",void 0),e([m()],U.prototype,"_precipitation",void 0),e([m()],U.prototype,"_clouds",void 0),e([m()],U.prototype,"_cloudComposition",void 0),e([m()],U.prototype,"_fog",void 0),e([m()],U.prototype,"weatherEnabled",null),e([m()],U.prototype,"precipitationEnabled",null),e([m()],U.prototype,"_cloudsCreationParameters",null),e([m()],U.prototype,"_weatherUpdateParameters",null),e([m()],U.prototype,"_starsCreationParameters",null),e([m()],U.prototype,"_environmentPostProcessCreationParameters",null),U=M=e([_("esri.views.3d.environment.EnvironmentRenderer")],U);export{U as EnvironmentRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{smoothstep as e
|
|
5
|
+
import{smoothstep as e}from"../../../core/mathUtils.js";import{isNone as t,releaseMaybe as i,disposeMaybe as r}from"../../../core/maybe.js";import{a as s}from"../../../chunks/mat4.js";import{c as o}from"../../../chunks/mat4f64.js";import{s as h}from"../../../chunks/vec2.js";import{a}from"../../../chunks/vec2f64.js";import{s as n,a as c,n as m,d as _,e as f,l as g}from"../../../chunks/vec3.js";import{c as u}from"../../../chunks/vec3f32.js";import{getReferenceEllipsoid as p}from"../../../geometry/projectionEllipsoid.js";import{atmosphereHeight as d}from"./atmosphereUtils.js";import{FogTechniqueConfiguration as l,FogTechnique as v}from"./FogTechnique.js";import{weatherHeightLimit as F}from"./weather.js";import{Pos2Tex as T}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as q}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as j}from"../../webgl/enums.js";class x{constructor(e,t){this._projectionInverse=o(),this._viewInverse=o(),this._nearFar=a(),this._fogColor=u(),this._fogColorAtNight=u(),this._cameraDirection=u(),this._foggyFadeStart=.3,this._foggyFadeEnd=.6,this._hazeFadeStart=.7,this._hazeFadeEnd=1,this._strength=4e-6,this._view=t;const i=e.renderContext.rctx;this._vao=q(i,T),this._shaderTechniqueRepository=e.shaderTechniqueRep;const r=p(t.spatialReference);this._planetRadius=r.radius,this._atmosphereRadius=r.radius+d}set strength(e){this._strength=e}get strength(){return this._strength}get thickFogTechnique(){if(t(this._thickFogTechnique)){const e=new l;e.haze=!1,this._thickFogTechnique=this._shaderTechniqueRepository.acquire(v,e)}return this._thickFogTechnique}get hazeFogTechnique(){if(t(this._hazeFogTechnique)){const e=new l;e.haze=!0,this._hazeFogTechnique=this._shaderTechniqueRepository.acquire(v,e)}return this._hazeFogTechnique}destroy(){this._hazeFogTechnique=i(this._hazeFogTechnique),this._thickFogTechnique=i(this._thickFogTechnique),this._vao=r(this._vao)}when(){return Promise.resolve()}render(e,t,i){if(0===this._view.basemapTerrain.baseOpacity&&!t)return;if(this._update(e,t,i),this._fogAmount<=0)return;const r=e.offscreenRenderingHelper,s=t?this.thickFogTechnique:this.hazeFogTechnique,o=e.rctx.useTechnique(s);r.renderDepthDetached((()=>{o.bindTexture(r.depthTexture,"depthTex"),this._renderFog(s.program,e)}))}_renderFog(e,i){if(t(this._vao))return!1;const r=i.rctx;return e.setUniform3fv("cameraPosition",i.camera.eye),e.setUniformMatrix4fv("inverseProjectionMatrix",this._projectionInverse),e.setUniformMatrix4fv("inverseViewMatrix",this._viewInverse),e.setUniform2fv("nearFar",this._nearFar),e.setUniform1f("atmosphereC",this._atmosphereC),e.setUniform1f("fogStrength",this._strength),e.setUniform1f("fogAmount",this._fogAmount),e.setUniform3fv("fogColor",this._fogColor),r.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(j.TRIANGLE_STRIP,0,4),!0}_update(i,r,o){if(t(i.camera))return;const a=r?.1:0;o?n(this._fogColor,.5,.5,.5):r?n(this._fogColor,1.5,1.5,1.5):n(this._fogColor,.24,.44,.8),c(this._fogColorAtNight,this._fogColor,a),m(this._cameraDirection,i.camera.eye);const u=Math.max(0,_(this._cameraDirection,i.scenelightingData.lightingMainDirection));f(this._fogColor,this._fogColorAtNight,this._fogColor,u),s(this._projectionInverse,i.camera.projectionMatrix),s(this._viewInverse,i.camera.viewMatrix),h(this._nearFar,i.camera.near,i.camera.far);const p=g(i.camera.eye),d=p*p;this._atmosphereC=d-this._atmosphereRadius*this._atmosphereRadius,this._fogAmount=r?1-e(this._foggyFadeStart*F,this._foggyFadeEnd*F,Math.abs(p-this._planetRadius)):1-e(this._hazeFadeStart*F,this._hazeFadeEnd*F,Math.abs(p-this._planetRadius))}static isSupported(e){return e.capabilities.depthTexture}}export{x as Fog};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{isNone as i,disposeMaybe as e,isSome as r}from"../../../core/maybe.js";import{secondsFromMilliseconds as s}from"../../../core/time.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{s as n,a as h,n as c,d as _,e as p}from"../../../chunks/vec3.js";import{c as m}from"../../../chunks/vec3f32.js";import{c as u}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as f}from"../../../geometry/projectionEllipsoid.js";import{P as l}from"../../../chunks/Precipitation.glsl.js";import{PrecipitationTechniqueConfiguration as d,PrecipitationTechnique as g}from"./PrecipitationTechnique.js";import{glLayout as w}from"../support/buffer/glUtil.js";import{newLayout as T}from"../support/buffer/InterleavedLayout.js";import{bindProjectionMatrix as y}from"../webgl-engine/core/shaderLibrary/util/View.glsl.js";import{AnimationTimer as j}from"../webgl-engine/lib/AnimationTimer.js";import{VertexAttribute as b}from"../webgl-engine/lib/VertexAttribute.js";import{WatchUpdatingTracking as A}from"../../support/WatchUpdatingTracking.js";import{BufferObject as I}from"../../webgl/BufferObject.js";import{PrimitiveType as q,Usage as v}from"../../webgl/enums.js";import{bindVertexBufferLayout as P,unbindVertexBufferLayout as C}from"../../webgl/Util.js";import{VertexArrayObject as R}from"../../webgl/VertexArrayObject.js";let x=class{constructor(t,i){this._numParticles=25e4,this._rainSpeed=.1,this._snowSpeed=.01,this._opacity=1,this._width=500,this._offset=u(),this._tile=u(),this._particleColor=m(),this._particleColorAtNight=m(),this._nightMultiplier=.7,this._cameraDirection=m(),this._renderParameters={camera:null,time:0,radius:1},this._animation=new j,this._updatingTracking=new A,this._renderParameters.time=0,this._renderParameters.radius=f(i.spatialReference).radius,this._shaderTechniqueRepository=t.shaderTechniqueRep}get updating(){return this._updatingTracking.updating}get rainTechnique(){if(i(this._rainTechnique)){const t=new d;t.type=l.RAIN,this._rainTechnique=this._shaderTechniqueRepository.acquire(g,t)}return this._rainTechnique}get snowTechnique(){if(i(this._snowTechnique)){const t=new d;t.type=l.SNOW,this._snowTechnique=this._shaderTechniqueRepository.acquire(g,t)}return this._snowTechnique}destroy(){this._updatingTracking.destroy(),this._numParticles=0,this._snowTechnique=e(this._snowTechnique),this._rainTechnique=e(this._rainTechnique),this._vao=e(this._vao),this._instanceIdBuffer=e(this._instanceIdBuffer)}update(t){return this._animation.advance(t)}render(t,e,o){const{rctx:a,camera:n}=t;this._ensureResources(a);const h=o===l.RAIN?this.rainTechnique:this.snowTechnique;if(i(h)||i(this._vao)||i(this._instanceIdBuffer))return;if(r(t.cloudsCompositionParams)&&(this._opacity=1-t.cloudsCompositionParams.fadeInOutHeight.factor),this._opacity<=0)return;const c=a.useTechnique(h);this._renderParameters.camera=n,this._renderParameters.time=(o===l.RAIN?this._rainSpeed:this._snowSpeed)*s(this._animation.time),this._update(c,n,o,t),a.bindVAO(this._vao);const _=g.attributeLocation;c.assertCompatibleVertexAttributeLocations(this._vao),P(a,_,this._instanceIdBuffer,U,0),a.capabilities.instancing.drawArraysInstanced(q.TRIANGLES,0,3,this._numParticles*e),C(a,_,this._instanceIdBuffer,U)}_update(t,i,e,r){const s=i.eye;this._tile[0]=Math.floor((s[0]+.5*this._width)/this._width),this._tile[1]=Math.floor((s[1]+.5*this._width)/this._width),this._tile[2]=Math.floor((s[2]+.5*this._width)/this._width),this._offset[0]=s[0]-this._tile[0]*this._width,this._offset[1]=s[1]-this._tile[1]*this._width,this._offset[2]=s[2]-this._tile[2]*this._width,t.setUniform1f("width",this._width),t.setUniform3fv("offset",this._offset),t.setUniformMatrix4fv("view",i.viewMatrix),t.setUniform3fv("cameraPosition",s),y(t,i.projectionMatrix),t.setUniform1f("time",this._renderParameters.time),e===l.RAIN?n(this._particleColor,.85,.85,.85):n(this._particleColor,1,1,1),h(this._particleColorAtNight,this._particleColor,this._nightMultiplier),c(this._cameraDirection,s);const o=Math.max(0,_(this._cameraDirection,r.scenelightingData.lightingMainDirection));p(this._particleColor,this._particleColorAtNight,this._particleColor,o),t.setUniform3fv("particleColor",this._particleColor),t.setUniform1f("opacity",this._opacity)}_ensureResources(t){r(this._vao)||(this._vao=this._createVertexArrayObject(t),r(this._instanceIdBuffer)||(this._instanceIdBuffer=this._createInstanceIndices(t)))}_createInstanceIndices(t){const i=[];for(let e=0;e<this._numParticles;e++)i.push(e);return I.createVertex(t,v.STATIC_DRAW,new Float32Array(i))}_createVertexArrayObject(t){const i=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new R(t,g.attributeLocation,{geometry:w(S)},{geometry:I.createVertex(t,v.STATIC_DRAW,i)})}};t([o({constructOnly:!0})],x.prototype,"requestRender",void 0),t([o({readOnly:!0})],x.prototype,"updating",null),t([o()],x.prototype,"_updatingTracking",void 0),x=t([a("esri.views.3d.environment.Precipitation")],x);const S=T().vec3f(b.POSITION),U=w(T().f32(b.INSTANCEFEATUREATTRIBUTE),1);export{x as Precipitation};
|