@arcgis/core 4.23.0-next.20220128 → 4.23.0-next.20220202
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/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/01a10fe5ad6941b0ee8c.js +1 -0
- package/assets/esri/core/workers/chunks/{7a5f5acfbd4ca1a5c1f3.js → 06116433eb6e669f146b.js} +1 -1
- package/assets/esri/core/workers/chunks/09a05d778b6fac710828.js +1 -0
- package/assets/esri/core/workers/chunks/{83d00afae4406ec78bc9.js → 0c6be307709523eb8a05.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/11750e96065b4d7b926b.js +1 -0
- package/assets/esri/core/workers/chunks/{929c9b7cdab7c4ca3d87.js → 17c51f5a13f471e6656a.js} +1 -1
- package/assets/esri/core/workers/chunks/{ed0bcc66fb1e0ee75a4b.js → 1f34957ef42e5b5977d0.js} +1 -1
- package/assets/esri/core/workers/chunks/2f4e425be3a3bdfd8d29.js +1 -0
- package/assets/esri/core/workers/chunks/34bed896b68993cabaa1.js +1 -0
- package/assets/esri/core/workers/chunks/3e1679b01429fd73cffe.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/4bfc2eeb0738c393d8ec.js +1 -0
- package/assets/esri/core/workers/chunks/4de996ebc432f5e149bc.js +1 -0
- package/assets/esri/core/workers/chunks/{422537fc3df707bb62c9.js → 5038935db9b1ebe61d02.js} +1 -1
- package/assets/esri/core/workers/chunks/50976921acf7bd636123.js +1 -0
- package/assets/esri/core/workers/chunks/50ef2622fd0d9a241979.js +1 -0
- package/assets/esri/core/workers/chunks/{5790d171072b3c7d108f.js → 53aa2ab4e569c994a32d.js} +1 -1
- package/assets/esri/core/workers/chunks/{7903a3e2e0faff0f86c0.js → 56657f890e0f79f5d2ad.js} +1 -1
- package/assets/esri/core/workers/chunks/{db3c729ce0c0b2690dc9.js → 574e33f28c106d607fe3.js} +1 -1
- package/assets/esri/core/workers/chunks/{952980635afc7ec81804.js → 5b02ba8ed152dba53155.js} +1 -1
- package/assets/esri/core/workers/chunks/60c06d1bb3f8a26cb5ac.js +1 -0
- package/assets/esri/core/workers/chunks/{c2253a9f29c1aabb2b75.js → 66c47983e93071de28b1.js} +1 -1
- package/assets/esri/core/workers/chunks/6be326edd9829781d926.js +1 -0
- package/assets/esri/core/workers/chunks/70d6bb3c7112cb702389.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/76c1d663f6d3f935c87f.js +1 -0
- package/assets/esri/core/workers/chunks/7ccbb923f113b3e21545.js +1 -0
- package/assets/esri/core/workers/chunks/810a763373d7f78ae398.js +1 -0
- package/assets/esri/core/workers/chunks/82194fec53054c37061f.js +1 -0
- package/assets/esri/core/workers/chunks/82c59a71b7f087148089.js +1 -0
- package/assets/esri/core/workers/chunks/84eee02122b56a22d49e.js +1 -0
- package/assets/esri/core/workers/chunks/{dd13772a5e2eccc6a2bc.js → 8598f762f15ca68d52b7.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c673495e5f507c4a9e5.js → 88458dcaff8edc50620c.js} +1 -1
- package/assets/esri/core/workers/chunks/{5ec98f4ddac707d0fbd1.js → 88815d533808aabb1fa9.js} +1 -1
- package/assets/esri/core/workers/chunks/{0463ba46df855a92b9c0.js → 8941f09329d9d39fb2fe.js} +1 -1
- package/assets/esri/core/workers/chunks/{655b55ac0cd533d7e9d7.js → 8ad5dc818dc73f4b9a76.js} +1 -1
- package/assets/esri/core/workers/chunks/8e96cddb069b643d864a.js +1 -0
- package/assets/esri/core/workers/chunks/{f2124f4d0f2b8a91f0ea.js → 90c5edcd8a609224ce55.js} +1 -1
- package/assets/esri/core/workers/chunks/9230b20eba4304d421b4.js +1 -0
- 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/{37c03cfc19086ce631c6.js → 9bd603ec98d24cd918e9.js} +1 -1
- package/assets/esri/core/workers/chunks/{c1135cb02ec46c491459.js → 9ce961bc390202c87941.js} +1 -1
- package/assets/esri/core/workers/chunks/9d4a35d4a85db80c4071.js +1 -0
- package/assets/esri/core/workers/chunks/9f0ad28e66862ba971a3.js +1 -0
- package/assets/esri/core/workers/chunks/{b3f5e91116112b0b612a.js → 9fd47b8fe25657ac0237.js} +1 -1
- package/assets/esri/core/workers/chunks/{b9e9cb354822c6d995a4.js → a276e60209f3d877a8d0.js} +1 -1
- package/assets/esri/core/workers/chunks/{aeaa1667c2d9f1b3366b.js → a85ed251d3d3668e474f.js} +1 -1
- package/assets/esri/core/workers/chunks/{44f0c3663b293afbd172.js → acf10f747215e9ff54dc.js} +1 -1
- package/assets/esri/core/workers/chunks/{69fd99b7c76e9992ccf3.js → b32bf9808cb4be3a6bd0.js} +1 -1
- package/assets/esri/core/workers/chunks/b3dc80ddbfa81026e937.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/{9d77467aa71d345fc1b6.js → bcc01bbffaa3bb5f60a8.js} +1 -1
- package/assets/esri/core/workers/chunks/{1f8c6a179e39fd4c5e6f.js → bd152e8b43cc4a6844dd.js} +1 -1
- package/assets/esri/core/workers/chunks/{0d02c6ad1f4688bfa374.js → bf7c44644fe7b0aa60cf.js} +1 -1
- package/assets/esri/core/workers/chunks/c0dc5882362479794224.js +1 -0
- package/assets/esri/core/workers/chunks/c8b574a76807f4ea7a70.js +1 -0
- package/assets/esri/core/workers/chunks/d09a0b2dc3a6fc10fa41.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/{be588873c16770ceb9ef.js → d46b511bbb83e68f1ece.js} +1 -1
- package/assets/esri/core/workers/chunks/{17de7a324dfa7f57ad5d.js → d780e946149b1c3d1246.js} +1 -1
- package/assets/esri/core/workers/chunks/d80bcf5ed1f54e0c4f5a.js +1 -0
- package/assets/esri/core/workers/chunks/{8cbb04a9065aa3756638.js → dc04a8ba6c770bdc2bd4.js} +1 -1
- package/assets/esri/core/workers/chunks/{89820b200ee44e678af5.js → dd891a98105904f8a06b.js} +1 -1
- package/assets/esri/core/workers/chunks/e5ab037c2a90411c453b.js +1 -0
- package/assets/esri/core/workers/chunks/ef2df21e1af3aa7ced29.js +1 -0
- package/assets/esri/core/workers/chunks/f5a7281ae24e837efc61.js +1 -0
- package/assets/esri/core/workers/chunks/{ff6abdc72076f3994659.js → f7150547d7e3259a0f29.js} +1 -1
- package/assets/esri/core/workers/chunks/{2c607d30ff8ca1b61286.js → fe0c3b7c9b428d9c3f25.js} +1 -1
- package/assets/esri/images/portal/mediaservice16.png +0 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- 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/Heatmap.glsl.js +10 -0
- package/chunks/HeatmapDensity.glsl.js +21 -0
- package/core/maybe.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/interfaces.d.ts +455 -45
- package/layers/RouteLayer.d.ts +4 -0
- package/layers/RouteLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.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/rasterFunctions/vectorFieldUtils.js +1 -1
- package/package.json +1 -1
- package/portal/PortalItem.js +1 -1
- package/renderers/support/rendererConversion.js +1 -1
- package/rest/support/DirectionLine.d.ts +4 -0
- package/rest/support/DirectionPoint.d.ts +4 -0
- package/rest/support/FeatureSet.js +1 -1
- package/rest/support/RouteInfo.d.ts +4 -0
- package/rest/support/RouteInfo.js +1 -1
- package/rest/support/RouteSolveResult.d.ts +4 -0
- package/support/featureFlags.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/TextSymbol3DLayer.js +1 -1
- package/symbols/support/Symbol3DHalo.js +1 -1
- package/symbols/support/Symbol3DTextBackground.js +5 -0
- package/views/2d/engine/RasterVFContainer.js +5 -0
- package/views/2d/engine/RasterVFDisplayObject.js +1 -1
- package/views/2d/engine/flow/AnimatedFlowView2D.js +1 -1
- 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/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/RouteLayerView2D.js +1 -1
- 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/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/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/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/NoiseTextureAtlas.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/interactive/analysisTools/lineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.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/labelPlacement.js +1 -1
- package/views/3d/layers/i3s/I3SCrossfadeHelper.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
- package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +5 -0
- package/views/3d/webgl-engine/lib/HighlightHelper.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowHighlightHelper.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- 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/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +5 -0
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- 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/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/webdoc/support/{Thumbnail.js → SlideThumbnail.js} +1 -1
- package/webmap/Bookmark.js +1 -1
- package/webmap/Version.js +1 -1
- package/webscene/Slide.js +1 -1
- package/webscene/Version.js +1 -1
- package/webscene/support/SlideVisibleLayer.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions/support/directionsUtils.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/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/Widget.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/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/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/27474b007988855bea9d.js +0 -1
- package/assets/esri/core/workers/chunks/357033117dfe61eb81ea.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/96f148a556a2418038de.js +0 -1
- package/assets/esri/core/workers/chunks/9876a1bae350795fab36.js +0 -1
- package/assets/esri/core/workers/chunks/a8692bffb76444c34760.js +0 -1
- package/assets/esri/core/workers/chunks/ba762bcfd74af0bb8218.js +0 -1
- package/assets/esri/core/workers/chunks/c093dff4592832ac0973.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/d1fe53b597351dc58305.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/e93dfdede0532a89ffa5.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/assets/esri/core/workers/chunks/fc7e31d87555beb63291.js +0 -1
- package/assets/esri/core/workers/chunks/fff6b0338f06dad0c45d.js +0 -1
- package/views/2d/layers/imagery/ImageryGraphicsView2D.js +0 -5
- package/widgets/Directions/support/CostSummary.js +0 -5
- package/widgets/Directions/support/RouteSection.js +0 -5
- package/widgets/Directions/support/RouteSections.js +0 -5
- package/widgets/Directions/support/maneuverUtils.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{_ as t}from"../chunks/tslib.es6.js";import{clone as
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import{clone as o}from"../core/lang.js";import{isSome as e}from"../core/maybe.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{enumeration as i}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../core/accessorSupport/decorators/writer.js";import l from"./Font.js";import a from"./Symbol3DLayer.js";import{screenSizeProperty as p}from"./support/materialUtils.js";import{Symbol3DHalo as m}from"./support/Symbol3DHalo.js";import{Symbol3DMaterial as h}from"./support/Symbol3DMaterial.js";import{Symbol3DTextBackground as c}from"./support/Symbol3DTextBackground.js";import{lineHeightProperty as u}from"./support/textUtils.js";var f;let y=f=class extends a{constructor(t){super(t),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.text=null,this.type="text",this.verticalAlignment="middle"}get font(){return this._get("font")||null}set font(t){e(t)&&e(this._userSize)&&(t.size=this._userSize),this._set("font",t)}writeFont(t,o,e,r){const i={...r,textSymbol3D:!0};o.font=t.write({},i),delete o.font.size}get size(){return e(this._userSize)?this._userSize:e(this.font)&&null!=this.font.size?this.font.size:9}set size(t){this._userSize=t,e(this.font)&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){return new f({enabled:this.enabled,font:this.font&&o(this.font),halo:this.halo&&o(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:e(this.material)?this.material.clone():null,size:this.size,text:this.text,verticalAlignment:this.verticalAlignment,background:o(this.background)})}static fromTextSymbol(t){return new f({font:e(t.font)?t.font.clone():new l,halo:g(t.haloColor,t.haloSize),horizontalAlignment:t.horizontalAlignment,lineHeight:t.lineHeight,material:t.color?new h({color:t.color.clone()}):null,text:t.text,verticalAlignment:t.verticalAlignment,background:t.backgroundColor?new c({color:t.backgroundColor.clone()}):null})}};function g(t,e){return t&&e>0?new m({color:o(t),size:e}):null}t([r({type:l,json:{write:!0}})],y.prototype,"font",null),t([n("font")],y.prototype,"writeFont",null),t([r({type:m,json:{write:!0}})],y.prototype,"halo",void 0),t([r()],y.prototype,"horizontalAlignment",void 0),t([r(u)],y.prototype,"lineHeight",void 0),t([r({type:h,json:{write:!0}})],y.prototype,"material",void 0),t([r({type:c,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],y.prototype,"background",void 0),t([r(p)],y.prototype,"size",null),t([r({type:String,json:{write:!0}})],y.prototype,"text",void 0),t([i({Text:"text"},{readOnly:!0})],y.prototype,"type",void 0),t([r()],y.prototype,"verticalAlignment",void 0),y=f=t([s("esri.symbols.TextSymbol3DLayer")],y);const d=y;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 o}from"../../chunks/tslib.es6.js";import r from"../../Color.js";import{JSONSupport as s}from"../../core/JSONSupport.js";import{clone as t}from"../../core/lang.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{colorAndTransparencyProperty as c,screenSizeProperty as i}from"./materialUtils.js";var m;let l=m=class extends s{constructor(){super(...arguments),this.color=new r([0,0,0,1]),this.size=0}clone(){
|
|
5
|
+
import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../Color.js";import{JSONSupport as s}from"../../core/JSONSupport.js";import{clone as t}from"../../core/lang.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{colorAndTransparencyProperty as c,screenSizeProperty as i}from"./materialUtils.js";var m;let l=m=class extends s{constructor(){super(...arguments),this.color=new r([0,0,0,1]),this.size=0}clone(){const o={color:t(this.color),size:this.size};return new m(o)}};o([e(c)],l.prototype,"color",void 0),o([e(i)],l.prototype,"size",void 0),l=m=o([p("esri.symbols.support.Symbol3DHalo")],l);export{l as Symbol3DHalo};
|
|
@@ -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 o}from"../../chunks/tslib.es6.js";import r from"../../Color.js";import{ClonableMixin as s}from"../../core/Clonable.js";import{JSONSupport as t}from"../../core/JSONSupport.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 p}from"../../core/accessorSupport/decorators/subclass.js";let c=class extends(s(t)){constructor(o){super(o),this.color=null}};o([e({type:r,json:{write:!0}})],c.prototype,"color",void 0),c=o([p("esri.symbols.support.Symbol3DTextBackground")],c);export{c as Symbol3DTextBackground};
|
|
@@ -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{WGLDrawPhase as e}from"./webgl/enums.js";import r from"./webgl/WGLContainer.js";import s from"./webgl/brushes/raster/BrushVectorField.js";class t extends r{constructor(){super(...arguments),this.symbolTypes=["triangle"]}get requiresDedicatedFBO(){return!1}prepareRenderPasses(r){const t=r.registerRenderPass({name:"imagery (vf)",brushes:[s],target:()=>this.children,drawPhase:e.MAP});return[...super.prepareRenderPasses(r),t]}doRender(r){this.visible&&r.drawPhase===e.MAP&&this.symbolTypes.forEach((e=>{r.renderPass=e,super.doRender(r)}))}}export{t as RasterVFContainer};
|
|
@@ -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"../../../core/has.js";import{isSome as
|
|
5
|
+
import"../../../core/has.js";import{isSome as t}from"../../../core/maybe.js";import{b as e,c as s,r as a,j as r,m as i}from"../../../chunks/mat3.js";import{c as o}from"../../../chunks/mat3f32.js";import{f as n}from"../../../chunks/vec2f32.js";import{createVFMesh as l,createVFMeshScalar as c}from"../../../layers/support/rasterFunctions/vectorFieldUtils.js";import{DisplayObject as h}from"./DisplayObject.js";import{createProgramDescriptor as m}from"./webgl/Utils.js";import{BufferObject as u}from"../../webgl/BufferObject.js";import{Usage as d,DataType as v}from"../../webgl/enums.js";import{VertexArrayObject as f}from"../../webgl/VertexArrayObject.js";class _ extends h{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.width=null,this.source=t}destroy(){var e,s;t(this.vaoData)&&(null==(e=this.vaoData.magdir)||e.vao.dispose(),null==(s=this.vaoData.scalar)||s.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){var e,s;!this._vaoInvalidated&&t(this.vaoData)&&(null==(e=this.vaoData.magdir)||e.vao.dispose(),null==(s=this.vaoData.scalar)||s.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(e){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,t(this.source)&&!t(this.vaoData)){const{style:t}=this.symbolizerParameters;switch(t){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const t=l(this.source,this.symbolizerParameters),s=this._createVectorFieldVAO(e.context,t);this.vaoData={magdir:s}}break;case"simple_scalar":{const t=c(this.source,this.symbolizerParameters),s=this._createVectorFieldVAO(e.context,t);this.vaoData={scalar:s}}break;case"wind_speed":{const t=l(this.source,this.symbolizerParameters),s=this._createVectorFieldVAO(e.context,t),a=c(this.source,this.symbolizerParameters),r=this._createVectorFieldVAO(e.context,a);this.vaoData={magdir:s,scalar:r}}}}this.ready(),this.requestRender()}}_createTransforms(){return{dvs:o()}}setTransform(t){const o=e(this.transforms.dvs),[l,c]=t.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/t.resolution,m=h*this.width,u=h*this.height,d=Math.PI*this.rotation/180;s(o,o,n(l,c)),s(o,o,n(m/2,u/2)),a(o,o,-d),s(o,o,n(-m/2,-u/2)),r(o,o,n(m,u)),i(this.transforms.dvs,t.displayViewMat3,o)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:s,indexData:a}=e,r=u.createVertex(t,d.STATIC_DRAW,new Float32Array(s)),i=u.createIndex(t,d.STATIC_DRAW,new Uint32Array(a)),o=m("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:v.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:v.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:v.FLOAT,normalized:!1}]});return{vao:new f(t,o.attributes,o.bufferLayouts,{geometry:r},i),elementCount:a.length}}}export{_ as RasterVFDisplayObject};
|
|
@@ -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{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 o}from"../../../../core/accessorSupport/decorators/subclass.js";import{loadImagery as
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.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 o}from"../../../../core/accessorSupport/decorators/subclass.js";import{loadImagery as a}from"./dataUtils.js";import i from"./FlowContainer.js";import n from"./FlowStrategy.js";import l from"./FlowStyle.js";let p=class extends r{constructor(){super(...arguments),this._loadImagery=(e,t,r,s)=>a(this.layer,e,t,r,s),this._createStreamlinesMesh=(e,t,r)=>this.layer.createStreamlinesMesh({flowData:t,rendererSettings:e},{signal:r}),this.attached=!1,this.container=null,this.layer=null,this.type="rasterAnimatedFlow",this.redrawOrRefetch=async()=>{this._rendererChanged()}}get updating(){return!this._strategy||this._strategy.updating}attach(){this.container=new i,this._strategy=new n({flowContainer:this.container}),this._rendererChanged()}detach(){this._strategy.destroy(),this.container.removeAllChildren(),this.container=null}update(e){e.stationary?this._strategy.update(e):this.layerView.requestUpdate()}hitTest(e){return new t({attributes:{},geometry:e.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_rendererChanged(){if("animated-flow"!==this.layer.renderer.type)return;const e=new l(this._loadImagery,this._createStreamlinesMesh,this.layer.renderer);this.container.flowStyle=e,this.layerView.requestUpdate()}};e([s()],p.prototype,"_strategy",void 0),e([s()],p.prototype,"attached",void 0),e([s()],p.prototype,"container",void 0),e([s()],p.prototype,"layer",void 0),e([s()],p.prototype,"layerView",void 0),e([s()],p.prototype,"type",void 0),e([s()],p.prototype,"updating",null),p=e([o("esri.views.2d.engine.flow.AnimatedFlowView2D")],p);const h=p;export{h 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"../../../../core/Error.js";import e from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{isNone as s,mapMany as r,isSome as a,
|
|
5
|
+
import t from"../../../../core/Error.js";import e from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{isNone as s,mapMany as r,isSome as a,applySome as h,unwrap as d,forEachSome as n,mapOr as o,unwrapOr as u}from"../../../../core/maybe.js";import{createResolver as l}from"../../../../core/promiseUtils.js";import{ATTRIBUTE_DATA_VV as p,TEXTURE_BINDING_ATTRIBUTE_DATA_0 as _,TEXTURE_BINDING_ATTRIBUTE_DATA_1 as x,TEXTURE_BINDING_ATTRIBUTE_DATA_2 as c,TEXTURE_BINDING_ATTRIBUTE_DATA_3 as g}from"./definitions.js";import{getDisplayIdTexel as f}from"./DisplayId.js";import{getPixelArrayCtor as T,getPixelBytes as b}from"./Utils.js";import{createDebugLogger as m,DEBUG_ATTR_UPDATES as y}from"./util/debug.js";import{TextureWrapMode as w,PixelFormat as z,PixelType as E,TextureSamplingMode as U,TextureType as D,TargetType as S,DepthStencilTargetType as A}from"../../../webgl/enums.js";import{FramebufferObject as j}from"../../../webgl/FramebufferObject.js";import{Texture as k}from"../../../webgl/Texture.js";const M=i.getLogger("esri.views.2d.engine.webgl.AttributeStoreView"),N=m(y,M);class O{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:a}=t,h=T(r);this.shared=i,this.pixelType=r,this.size=e,this.textureOnly=a,a||(this.data=new h(d(s))),this._resetRange()}destroy(){h(this._texture,(t=>t.dispose()));for(const t in this._fbos)h(this._fbos[t],(e=>{"0"===t&&e.detachColorTexture(),e.dispose()})),this._fbos[t]=null;this._texture=null}get _textureDesc(){return{target:D.TEXTURE_2D,wrapMode:w.CLAMP_TO_EDGE,pixelFormat:z.RGBA,dataType:this.pixelType,samplingMode:U.NEAREST,width:this.size,height:this.size}}setData(t,e,i){const s=f(t),r=d(this.data),a=s*this.texelSize+e;!r||a>=r.length||(r[a]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(s(this.data))return null;const i=f(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return u(this._texture,(()=>this._initTexture(t)))}getFBO(t,e=0){if(s(this._fbos[e])){const i={colorTarget:S.TEXTURE,depthStencilTarget:A.NONE},s=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new j(t,i,s)}return this._fbos[e]}get locked(){return!(this.pixelType!==E.UNSIGNED_BYTE||!this.shared||this.textureOnly||!e("esri-atomics")||!this.data)&&1===Atomics.load(this.data,0)}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){if(!this.locked){try{const i=this.dirtyStart,s=this.dirtyEnd;if(!this.hasDirty)return;this._resetRange();const r=d(this.data).buffer,a=this.getTexture(e),h=4,n=(i-i%this.size)/this.size,o=(s-s%this.size)/this.size,u=n,l=this.size,p=o,_=n*this.size*h,x=(l+p*this.size)*h-_,c=T(this.pixelType),g=new c(r,_*c.BYTES_PER_ELEMENT,x),f=this.size,b=p-u+1;if(b>this.size)return void M.error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,u,f,b,g)}catch(s){}i()}}update(t){const{data:e,start:i,end:s}=t;if(a(e)){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const a=1<<i%this.texelSize;t.layout&a&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=T(this.pixelType);this.destroy(),this.data=new s(d(t.buffer))}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new k(t,this._textureDesc,u(this.data,void 0));if(a(this._lastTexture)&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,a=this._lastTexture.descriptor.pixelFormat,h=this.getFBO(t),d=b(r),n=new(T(r))(new ArrayBuffer(i*s*d*this.texelSize)),o=t.getBoundFramebufferObject(),{x:u,y:l,width:p,height:_}=t.getViewport();t.bindFramebuffer(h),h.readPixels(0,0,i,s,a,r,n),e.updateData(0,0,0,2*i,s/2,n),t.setViewport(u,l,p,_),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class F{constructor(t){this._onUpdate=t,this._initialized=!1,this._forceNextUpload=!1,this._locked=!1}initialize(t){const{blocks:e,shared:i,size:h}=t;if(this.shared=i,this.size=h,N("Initializing AttributeStoreView",t),s(this._data))this._data=r(e,(t=>new O(t,h,i)));else for(let r=0;r<this._data.length;r++){const t=this._data[r],d=e[r];a(d)&&(s(t)?this._data[r]=new O(d,h,i):t.resize(d,h))}this._initialized=!0}destroy(){h(this._data,(t=>r(t,(t=>t.destroy())))),h(this._defaultTexture,(t=>t.dispose()))}isEmpty(){const t=this._data;return s(t)}isUpdating(){const t=a(this._pendingAttributeUpdate),i=t;return e("esri-2d-log-updating")&&console.log(`Updating AttributeStoreView ${i}\n -> hasPendingUpdate ${t}`),i}getBlock(t){if(s(this._data))return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVVSize(t){return this.getData(t,p,0,0)}getData(t,e,i,r){if(!this._data)return 0;const h=d(this._data)[e];if(s(h))return 0;const n=h.getData(t,i);return a(n)?n:r}setData(t,e,i,s){const r=d(this._data)[e];d(r).setData(t,i,s)}lockTextureUpload(){this._locked=!0}unlockTextureUpload(){this._locked=!1}forceTextureUpload(){this._forceNextUpload=!0}async requestUpdate(e){if(this._pendingAttributeUpdate)return void M.error(new t("mapview-webgl","Tried to update attribute data with a pending update"));const i=l();return N("AttributeStoreView Update Requested",e),this._pendingAttributeUpdate={data:e,resolver:i},i.promise}update(){if(this._initialized&&a(this._pendingAttributeUpdate)){const{data:t,resolver:e}=this._pendingAttributeUpdate,i=d(this._data);for(let s=0;s<t.blocks.length;s++){const e=t.blocks[s],r=i[s];h(r,(t=>h(e,(e=>{N(`Updating block ${s}`,e),t.update(e)}))))}this._pendingAttributeUpdate=null,e(),this._onUpdate()}}bindTextures(t,e=!0){this.update();const i=this._getDefaultTexture(t);if(!this._initialized)return t.bindTexture(i,_),void(e&&(t.bindTexture(i,x),t.bindTexture(i,c),t.bindTexture(i,g)));const s=d(this._data);this._locked&&!this._forceNextUpload||(n(s,(e=>e.updateTexture(t,(()=>this._onUpdate())))),this._forceNextUpload=!1),t.bindTexture(o(s[0],i,(e=>e.getTexture(t))),_),e&&(t.bindTexture(o(s[1],i,(e=>e.getTexture(t))),x),t.bindTexture(o(s[2],i,(e=>e.getTexture(t))),c),t.bindTexture(o(s[3],i,(e=>e.getTexture(t))),g))}_getDefaultTexture(t){if(s(this._defaultTexture)){const e={wrapMode:w.CLAMP_TO_EDGE,pixelFormat:z.RGBA,dataType:E.UNSIGNED_BYTE,samplingMode:U.NEAREST,width:1,height:1};this._defaultTexture=new k(t,e,new Uint8Array(4))}return this._defaultTexture}}export{F as AttributeStoreView};
|
|
@@ -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 e}from"../../../../../../core/maybe.js";import a from"../WGLBrush.js";import{BlendFactor as t,StencilOperation as r,CompareFunction as s,PrimitiveType as o,DataType as n}from"../../../../../webgl/enums.js";const i=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),
|
|
5
|
+
import{isNone as e}from"../../../../../../core/maybe.js";import a from"../WGLBrush.js";import{BlendFactor as t,StencilOperation as r,CompareFunction as s,PrimitiveType as o,DataType as n}from"../../../../../webgl/enums.js";const i=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),l={beaufort_ft:i,beaufort_m:i,beaufort_km:i,beaufort_mi:i,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),single_arrow:new Float32Array([0,92/255,230/255,1]),wind_speed:new Float32Array([0,0,0,1])};class c extends a{constructor(){super(...arguments),this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:e},a){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilOp(r.KEEP,r.KEEP,r.REPLACE),e.setStencilFunction(s.EQUAL,a.stencilRef,255)}draw(a,t){if(e(t.source)||0===t.source.validPixelCount)return;const{timeline:r}=a;if(r.begin(this.name),t.updateVectorFieldVAO(a),"scalar"===a.renderPass){const e=t.vaoData.scalar;e&&this._drawScalars(a,t,e.vao,e.elementCount)}else{const e=t.vaoData.magdir;e&&this._drawTriangles(a,t,e.vao,e.elementCount)}r.end(this.name)}_drawTriangles(e,a,t,r){const{context:s,painter:i}=e,{symbolizerParameters:c}=a,m=c.dataRange?["dataRange"]:[];"geographic"===c.rotationType&&m.push("rotationGeographic");const d=i.materialManager.getProgram(e,this._desc.magdir,m);s.useProgram(d);const{coordScale:f,opacity:_,transforms:u}=a;d.setUniform2fv("u_coordScale",f),d.setUniform1f("u_opacity",_),d.setUniformMatrix3fv("u_dvsMat3",u.dvs);const{style:g,dataRange:p,rotation:y,symbolPercentRange:S}=c;d.setUniform4fv("u_colors",l[g]||l.single_arrow),d.setUniform2fv("u_dataRange",p),d.setUniform1f("u_rotation",y),d.setUniform2fv("u_symbolPercentRange",S);const v=this._getSymbolSize(e,a);d.setUniform2fv("u_symbolSize",v),s.bindVAO(t),s.drawElements(o.TRIANGLES,r,n.UNSIGNED_INT,0)}_drawScalars(e,a,t,r){const{context:s,painter:i}=e,{symbolizerParameters:l}=a,c=[];"wind_speed"===l.style?c.push("innerCircle"):l.dataRange&&c.push("dataRange"),"geographic"===l.rotationType&&c.push("rotationGeographic");const m=i.materialManager.getProgram(e,this._desc.scalar,c);s.useProgram(m);const{coordScale:d,opacity:f,transforms:_}=a;m.setUniform2fv("u_coordScale",d),m.setUniform1f("u_opacity",f),m.setUniformMatrix3fv("u_dvsMat3",_.dvs);const{dataRange:u,symbolPercentRange:g}=l;m.setUniform2fv("u_dataRange",u),m.setUniform2fv("u_symbolPercentRange",g);const p=this._getSymbolSize(e,a);m.setUniform2fv("u_symbolSize",p),s.bindVAO(t),s.drawElements(o.TRIANGLES,r,n.UNSIGNED_INT,0)}_getSymbolSize(e,a){const t=a.key?2**(e.displayLevel-a.key.level):a.resolution/e.state.resolution,{symbolTileSize:r}=a.symbolizerParameters;return[r/(Math.round((a.width-a.offset[0])/r)*r)/t,r/(Math.round((a.height-a.offset[1])/r)*r)/t]}}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{
|
|
5
|
+
import{applySome as t,isSome as i,unwrapOrThrow as s,isNone as r}from"../../../../../core/maybe.js";import{TypedBuffer as e}from"../BufferPool.js";import{FreeList as h}from"./FreeList.js";import{BufferObject as n}from"../../../../webgl/BufferObject.js";import{Usage as a}from"../../../../webgl/enums.js";const d=1.25,u=32767,c=u<<16|u;class p{constructor(t,i,s){const r=e.create(i*s*Uint32Array.BYTES_PER_ELEMENT);this.strideInt=s,this.bufferType=t,this.dirty={start:1/0,end:0},this.gpu=null,this._cpu=r,this.clear()}get elementSize(){return this._cpu.length/this.strideInt}destroy(){t(this.gpu,(t=>t.dispose())),t(this._cpu,(t=>t.destroy())),t(this._cpu2,(t=>t.destroy()))}clear(){this.dirty.start=1/0,this.dirty.end=0,this.freeList=new h({start:0,end:this._cpu.length/this.strideInt}),this.fillPointer=0}ensure(t){if(this.maxAvailableSpace()>=t)return;if(t*this.strideInt>this._cpu.length-this.fillPointer){i(this.gpu)&&(this.gpu=null);const s=this._cpu.length/this.strideInt,r=Math.round((s+t)*d),e=r*this.strideInt;this._cpu.expand(e*Uint32Array.BYTES_PER_ELEMENT),this.freeList.free(s,r-s)}}set(t,i){this._cpu.array[t]!==i&&(this._cpu.array[t]=i,this.dirty.start=Math.min(t,this.dirty.start),this.dirty.end=Math.max(t,this.dirty.end))}getBuffer(){if(!this._cpu2){const t=this._cpu.slice();this._cpu2=t}return this._cpu2.length!==this._cpu.length&&this._cpu2.expand(this._cpu.length*this._cpu.array.BYTES_PER_ELEMENT),this._cpu2.set(this._cpu),this._cpu2}get bufferSize(){return this._cpu.length/this.strideInt}maxAvailableSpace(){return this.freeList.maxAvailableSpace()}insert(t,i,r,e){const h=r*this.strideInt,n=i*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,a=new Uint32Array(t,n,h),d=s(this.freeList.firstFit(r),"First fit region must be defined")*this.strideInt,u=h,c=d/this.strideInt-i;if(0!==e)for(let s=0;s<a.length;s++)a[s]+=e;return this._cpu.array.set(a,d),this.dirty.start=Math.min(this.dirty.start,d),this.dirty.end=Math.max(this.dirty.end,d+u),this.fillPointer=Math.max(this.fillPointer,d+u),c}free(t,i,s){const r=t*this.strideInt,e=(t+i)*this.strideInt;if(!0===s)for(let h=t;h!==t+i;h++)this._cpu.array[h*this.strideInt]=c;this.dirty.start=Math.min(this.dirty.start,r),this.dirty.end=Math.max(this.dirty.end,e),this.freeList.free(t,i)}upload(t){if(this.dirty.end){if(r(this.gpu))return this.gpu=this._createBuffer(t),this.dirty.start=1/0,void(this.dirty.end=0);this.gpu.setSubDataFromView(this._cpu.array,this.dirty.start,this.dirty.start,this.dirty.end),this.dirty.start=1/0,this.dirty.end=0}}_createBuffer(t){const i=a.DYNAMIC_DRAW;return"index"===this.bufferType?n.createIndex(t,i,this._cpu.array):n.createVertex(t,i,this._cpu.array)}}export{p as Buffer};
|
|
@@ -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{
|
|
5
|
+
import{applySome as e,isNone as t,isSome as i,unwrap as r}from"../../../../../../core/maybe.js";import{pt2px as s}from"../../../../../../core/screenUtils.js";import{deltaDecodeGeometry as o,convertFromGeometry as n}from"../../../../../../layers/graphics/featureConversionUtils.js";import{CIMMarkerPlacementHelper as h}from"../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{MAGIC_LABEL_LINE_HEIGHT as a}from"../../definitions.js";import{WGLGeometryType as x}from"../../enums.js";import{i8888to32 as l,i1616to32 as m}from"../../number.js";import{MaterialKeyBase as d}from"../../materialKey/MaterialKey.js";import{shapeGlyphs as c}from"./shapingUtils.js";const f=8,_=_=>class extends _{constructor(...e){super(...e),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=x.TEXT,this._aux=l(0,0,this._referenceSize,this._bitset)}bindTextInfo(t,i){t&&t.length?this._shapingInfo=e(t,(e=>c(e,i,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:a*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM}))):this._shapingInfo=null}_write(e,t,i,r){const s=t.getDisplayId();this._writeGeometry(e,t,s,i,r)}_writeGeometry(e,r,s,h,a){const x=this._shapingInfo;if(t(x))return;if(i(this._textPlacement)){const t=null!=a?a:r.readLegacyGeometryForDisplay();return this._writePlacedText(e,s,t,x,h)}const l=a?o(n(a),2):"esriGeometryPolygon"===r.geometryType?r.readCentroid():r.readGeometryForDisplay();if(!t(l)){if(l.isPoint){const[t,i]=l.coords;if(!e.hasAggregates&&e.hasPixelBufferEnabled&&(t<0||t>=512||i<0||i>=512))return;return this._writeGlyphs(e,s,{x:t,y:i},x)}l.forEachVertex(((t,i)=>this._writeGlyphs(e,s,{x:t,y:i},x)))}}_writePlacedText(e,t,i,o,n){const a=r(this._textPlacement),x=h.getPlacement(i,a,s(1),n.geometryEngine);if(!x)return;let l=x.next();for(;null!=l;){const i=l.getAngle();o.setRotation(i);const r=l.tx,s=l.ty;r<0||r>=512||s<0||s>=512?l=x.next():(this._writeGlyphs(e,t,{x:r,y:s},o),o.setRotation(-i),l=x.next())}}_writeGlyphs(e,t,i,r){const s=d.load(this._materialKey),o=m(Math.round(f*i.x),Math.round(f*i.y)),n=this._vertexBoundsScale,h=r.bounds,a=2*Math.max(h.width,h.height);for(const x of r.glyphs)s.textureBinding=x.textureBinding,e.recordStart(t,s.data,this.geometryType,!0),e.vertexBounds(i.x+h.x+this._xOffset,i.y+h.y-this._yOffset,a*n,a*n),this._writeVertices(e,t,o,x),e.recordEnd()}_writeGlyph(e,t,i,r,s){const o=d.load(this._materialKey),n=m(Math.round(f*i),Math.round(f*r));o.textureBinding=s.textureBinding,e.recordStart(t,o.data,this.geometryType,!0);const h=s.bounds,a=this._vertexBoundsScale;e.vertexBounds(i+h.x*a,r+h.y*a,h.width*a,h.height*a),this._writeVertices(e,t,n,s),e.recordEnd()}_writeVertices(e,t,i,r){const s=e.vertexCount();this._writeVertexCommon(e,t,i,r),e.vertexWrite(r.offsets.upperLeft),e.vertexWrite(r.texcoords.upperLeft),e.vertexEnd(),this._writeVertexCommon(e,t,i,r),e.vertexWrite(r.offsets.upperRight),e.vertexWrite(r.texcoords.upperRight),e.vertexEnd(),this._writeVertexCommon(e,t,i,r),e.vertexWrite(r.offsets.lowerLeft),e.vertexWrite(r.texcoords.lowerLeft),e.vertexEnd(),this._writeVertexCommon(e,t,i,r),e.vertexWrite(r.offsets.lowerRight),e.vertexWrite(r.texcoords.lowerRight),e.vertexEnd(),e.indexWrite(s+0),e.indexWrite(s+1),e.indexWrite(s+2),e.indexWrite(s+1),e.indexWrite(s+3),e.indexWrite(s+2)}_writeVertexCommon(e,t,i,r){const s=this._color,o=this._haloColor,n=l(0,0,this._referenceSize,this._bitset),h=l(0,0,this._size,this._haloSize);e.vertexWrite(i),e.vertexWrite(t),e.vertexWrite(s),e.vertexWrite(o),e.vertexWrite(h),e.vertexWrite(n),e.vertexWrite(this._minMaxZoom)}};export{_ 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"../../../AggregateGraphic.js";import"../../../geometry.js";import i from"../../../Graphic.js";import r from"../../../core/Collection.js";import s from"../../../core/Error.js";import a from"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import o from"../../../core/Logger.js";import{andThen as l,isSome as h,unwrap as u,isNone as d}from"../../../core/maybe.js";import{debounce as p,isAbortError as c}from"../../../core/promiseUtils.js";import{watch as y}from"../../../core/reactiveUtils.js";import{init as f,whenFalseOnce as g}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 v from"../../../layers/effects/FeatureEffectView.js";import b from"../../../layers/support/FeatureFilter.js";import{calculateTolerance as R}from"../../../renderers/support/clickToleranceUtils.js";import w from"../../../rest/support/FeatureSet.js";import x from"../../../rest/support/Query.js";import{MAX_FILTERS as S}from"../engine/webgl/definitions.js";import{LayerView2DMixin as U}from"./LayerView2D.js";import{createSchema as F}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as I}from"./features/tileRenderers.js";import{findSizeVV as C,createClusterCountSizeVariable as O,isClusterCompatibleRenderer as E,createClusterRenderer as q}from"./support/clusterUtils.js";import T from"./support/FeatureCommandQueue.js";import j from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as V}from"./support/util.js";import{TileManager as N}from"../tiling/TileManager.js";import{FeatureLayerView as P}from"../../layers/FeatureLayerView.js";import k from"../../layers/LayerView.js";import{RefreshableLayerView as L}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as H}from"../../support/drapedUtils.js";import{getWebGL1Capabilities as z}from"../../webgl/capabilities.js";import J from"../../../geometry/Extent.js";function Q(e){return e&&"openPorts"in e}const A=o.getLogger("esri.views.2d.layers.FeatureLayerView2D");let M=class extends(P(L(U(k)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new T({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=p((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new v,this._lastDefinitionExpression=null}destroy(){var e,t;l(this._updateClusterSizeTask,(e=>e.remove())),null==(e=this._proxy)||e.destroy(),null==(t=this.tileRenderer)||t.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.handles.add([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),y((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),{initial:!0,sync:!0})])}async _initProxy(){if("isTable"in this.layer&&this.layer.isTable)throw new s("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});this._proxy&&this._proxy.destroy();const e=this._createClientOptions();return this._set("_proxy",new j({client:e})),this._proxy.when()}async _initServiceOptions(){this._set("_serviceOptions",await this._createServiceOptions())}get orderByFields(){return"stream"!==this._serviceOptions.type&&this._serviceOptions.orderByFields}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,i=this.view.floors,{definitionExpression:r}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="feature"===t.type?t.gdbVersion:void 0,o="feature"===t.type&&t.historicMoment?t.historicMoment.getTime():void 0,{timeExtent:l}=this,u="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,p="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,c=JSON.stringify(this.clips),y=t.featureReduction&&t.featureReduction.toJSON(),f="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),g="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),"");return JSON.stringify({orderBy:f,sublayerHash:g,filterHash:h(this.filter)&&this.filter.toJSON(),effectHash:h(this.featureEffect)&&this.featureEffect.toJSON(),streamFilter:p,gdbVersion:n,definitionExpression:r,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:l,floors:i,clipsHash:c,featureReduction:y,customParameters:u,apiKey:d})}async fetchPopupFeatures(e,t){var i;if(h(t)&&0===t.clientGraphics.length)return[];if(!("cluster"===(null==(i=this.layer.featureReduction)?void 0:i.type))){const i=R({renderer:"renderer"in this.layer&&this.layer.renderer,event:h(t)&&t.event}),r=H(e,i,this.view),{features:s}=await this.queryVisibleFeatures(new x({geometry:r,outFields:["*"],returnGeometry:!0}));t=h(t)?t:{};const a=new Set(t.clientGraphics.map((e=>e.getObjectId())));for(const e of s)a.has(e.getObjectId())||t.clientGraphics.push(e)}return super.fetchPopupFeatures(e,t)}highlight(e){var t;let s;return e instanceof i?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:Array.isArray(e)&&e.length>0?s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>null==e?void 0:e.getObjectId())):r.isCollection(e)&&e.length>0&&(s=e.map((e=>null==e?void 0:e.getObjectId())).toArray()),s=null==(t=s)?void 0:t.filter((e=>null!=e)),s&&s.length?(this._addHighlight(s),{remove:()=>this._removeHighlight(s)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,r){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(r);if(0===s.length)return null;const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((e=>this._createHittestResult(t.fromJSON(e)))),...a.map((e=>this._createHittestResult(i.fromJSON(e))))]}async queryAggregates(){return(await this._proxy.getAggregates()).map((e=>t.fromJSON(e)))}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),r,i)}async queryUniqueValues(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),r,i)}async queryClassBreaks(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),r,i)}async queryHistogram(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),r,i)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=w.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=w.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:J.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:i,removed:r}=this._tileStrategy.update(e);(i.length||r.length)&&this._proxy.updateTiles({added:i,removed:r}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new N({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.handles.add(f(this,"renderingConfigHash",(()=>this._update())),"attach"),"stream"!==this.layer.type&&this.handles.add(this.layer.on("edits",(e=>this._edit(e))),"attach")}detach(){this.container.removeAllChildren(),this.handles.remove("attach"),this.tileRenderer&&(this.tileRenderer.uninstall(this.container),this.tileRenderer=null),this._tileStrategy&&(this._tileStrategy.destroy(),this._tileStrategy=null),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){var e;const t="renderer"in this.layer&&null!=this.layer.renderer,i=this._commandsQueue.updating,r=null!=this._updatingRequiredFieldsPromise,s=!this._proxy||!this._proxy.isReady,n=this._pipelineIsUpdating,o=null===this.tileRenderer||(null==(e=this.tileRenderer)?void 0:e.updating),l=t&&(i||r||s||n||o);return a("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${l}\n -> hasRenderer ${t}\n -> hasPendingCommand ${i}\n -> updatingRequiredFields ${r}\n -> updatingProxy ${s}\n -> updatingPipeline ${n}\n -> updatingTileRenderer ${o}\n`),l}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){var t;const i="path"in e,r="editingInfo"in this.layer&&(null==(t=this.layer.editingInfo)?void 0:t.lastEditDate),s=!!this.layer.refreshInterval,n=!r&&s;if(i&&("feature"===this.layer.type||"subtype-group"===this.layer.type)&&"point"===this.layer.geometryType&&this.layer.capabilities.query.supportsPagination&&!this.layer.capabilities.operations.supportsEditing&&!n&&a("featurelayer-snapshot-enabled"))try{const e=await this.layer.queryFeatureCount();if(e<=a("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=a("featurelayer-snapshot-point-max-threshold"),i=a("featurelayer-snapshot-point-coverage"),r=this.view.extent,s=u(this.layer.fullExtent),n=null==s?void 0:s.clone().intersection(r),o=h(n)?n.width*n.height:0,l=(null==s?void 0:s.width)*(null==s?void 0:s.height),d=0===l?0:o/l;if(e<=t&&d>=i)return{mode:"snapshot",featureCount:e}}catch(o){A.warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:o})}return{mode:"on-demand"}}async _createServiceOptions(){var e;const t=this.layer;if("stream"===t.type)return null;const{capabilities:i,objectIdField:r}=t,s=t.fields.map((e=>e.toJSON())),a=h(t.fullExtent)&&t.fullExtent.toJSON(),o=V(t.geometryType),l=t.timeInfo&&t.timeInfo.toJSON()||null,u=t.spatialReference?t.spatialReference.toJSON():null,d="feature"===t.type?t.globalIdField:null;let p;"ogc-feature"===t.type?p=t.source.getFeatureDefinition():Q(t.source)?p=await t.source.openPorts():t.parsedUrl&&(p=n(t.parsedUrl),"dynamicDataSource"in t&&t.dynamicDataSource&&(p.query={layer:JSON.stringify({source:t.dynamicDataSource})}));const c="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,y=null!=(e="subtypeField"in this.layer&&this.layer.subtypeField)?e:null,{mode:f,featureCount:g}=await this._detectQueryMode(p);let m=this.layer.objectIdField;if("feature"===this.layer.type&&h(this.layer.orderBy)&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(m=e)}return{type:f,timeReferenceUnknownClient:c,subtypeField:y,featureCount:g,globalIdField:d,maxRecordCount:i.query.maxRecordCount,tileMaxRecordCount:i.query.tileMaxRecordCount,capabilities:i,fields:s,fullExtent:a,geometryType:o,objectIdField:r,source:p,timeInfo:l,spatialReference:u,orderByFields:m}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=x.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this._validateEdit(e))return this._commandsQueue.push({type:"edit",edits:e})}async doRefresh(e){return this._commandsQueue.push({type:"refresh",dataChanged:e})}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,i=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),r=t&&this.availableFields.includes(t);return i&&!r?(A.error(new s("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:i}=this;await this._updateRequiredFields();const{renderer:r}=this._getEffectiveRenderer();this._set("_effectiveRenderer",r);const s=this._createSchemaConfig(),a=this._createConfiguration(s,i,t.filter),n=this._lastDefinitionExpression!==a.definitionExpression;this._lastDefinitionExpression=a.definitionExpression;const o=this._createTileRendererHash(r);if("snapshot"===this._serviceOptions.type&&(a.schema.source.featureCount=this._serviceOptions.featureCount),o!==this._tileRendererHash){await this._initTileRenderer(r);const e=this._serviceOptions;this.tileRenderer.onConfigUpdate(r);const t=this.layer;"stream"!==t.type&&Q(t.source)&&(e.source=await t.source.openPorts()),"stream"===t.type&&await this._initServiceOptions();const i={added:this._tileStrategy.tileKeys(),removed:[]};await this._proxy.startup(this.view.featuresTilingScheme,a,e,i),this.hasHighlight()&&await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),await this._onceTilesUpdated(),this.tileRenderer.onConfigUpdate(r)}else{"snapshot"===this._serviceOptions.type&&n&&(a.schema.source.featureCount=await this.layer.queryFeatureCount());const t=await this._proxy.update(a);(t.mesh||t.targets.aggregate)&&this._lockGPUUploads();try{await this._proxy.applyUpdate(t)}catch(e){c(e)||A.error(e)}(t.mesh||t.targets.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(r),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=o,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){c(t),0}}async _doRefresh(e){this._lockGPUUploads();try{await this._proxy.refresh(e)}catch(t){c(t),0}this._unlockGPUUploads()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return this.watch("_aggregateValueRanges",(async i=>{this._updateClusterEffectiveRendererSizeVariable(e,t,i),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,i){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const r=C(e.visualVariables);if(h(r)&&"cluster_count"===r.field){const s=e.visualVariables.indexOf(r);e.visualVariables[s]=O(t,i);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e="renderer"in this.layer&&this.layer.renderer,t=this.layer.featureReduction;if(h(this._updateClusterSizeTask)&&(this._updateClusterSizeTask.remove(),this._updateClusterSizeTask=null),t&&"cluster"===t.type&&E(e)){const i=t,r=[],s=q(r,e,i,this._aggregateValueRanges);return l(this._updateClusterSizeTask,(e=>e.remove())),this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,i),{renderer:s,aggregateFields:r,featureReduction:t}}return{renderer:e,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}async _initTileRenderer(e){const t=await I(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer.destroy(),this.tileRenderer=null),this.destroyed?null:(this._proxy.tileRenderer=t,this._set("tileRenderer",t),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(e),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${"heatmap"===e.type?"heatmap":"symbol"}.${"dot-density"===e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=h(e)?e.timeExtent:null,i=h(this.timeExtent)&&h(t)?this.timeExtent.intersection(t):this.timeExtent||t;let r=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=h(e)&&e.where;r=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!i&&!s)return h(e)?e.toJSON():null;(e=h(e)&&e.clone()||new b).timeExtent=i,r&&(e.where=r);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let i=e||"";if("floorInfo"in t&&t.floorInfo){var r;let e=this.view.floors;if(!e||!e.length)return i;null!=(r=t.floorInfo.viewAllLevelIds)&&r.length&&(e=t.floorInfo.viewAllLevelIds);const s=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));s.push("''");const a=t.floorInfo.floorField;let n="("+a+" IN ({ids}) OR "+a+" IS NULL)";if(n=n.replace("{ids}",s.join(", ")),h(i)&&i.includes(a)){let e=new RegExp("AND \\("+a+".*NULL\\)","g");i=i.replace(e,""),e=new RegExp("\\("+a+".*NULL\\)","g"),i=i.replace(e,""),i=i.replace(/\s+/g," ").trim()}i=""!==i?"("+i+") AND "+n:n}return""!==i?i:null}_createConfiguration(e,t,i){const r="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion:void 0,a=new Array(S),n=this._injectOverrides(t);a[0]=n,a[1]=h(i)?i.toJSON():null;const o=F(e);if(d(o))return null;const l=z();return{definitionExpression:this.layer.definitionExpression,availableFields:this.availableFields,gdbVersion:s,historicMoment:r,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:o,supportsTextureFloat:l.supportsTextureFloat,maxTextureSize:l.maxTextureSize}}_hasRequiredSupport(e){var t;return!("renderer"in e&&"dot-density"===(null==(t=e.renderer)?void 0:t.type)&&!z().supportsTextureFloat)||(A.error(new s("webgl-missing-extension","Missing WebGL extension OES_Texture_Float which is required for DotDensity")),!1)}_onceTilesUpdated(){return this.requestUpdate(),g(this,"_pipelineIsUpdating",!1)}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e="feature"===this.layer.type?this.layer.historicMoment:null,t="feature"===this.layer.type?this.layer.gdbVersion:null;return{renderer:"renderer"in this.layer&&this.layer.renderer,spatialReference:this.layer.spatialReference,timeExtent:this.layer.timeExtent,definitionExpression:this.layer.definitionExpression,featureReduction:this.layer.featureReduction,fields:this.layer.fields,geometryType:this.layer.geometryType,historicMoment:e,labelsVisible:"labelsVisible"in this.layer&&this.layer.labelsVisible,labelingInfo:"labelingInfo"in this.layer&&this.layer.labelingInfo,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:t,pixelBuffer:0,orderBy:"orderBy"in this.layer&&this.layer.orderBy?this.layer.orderBy:null,customParameters:{..."customParameters"in this.layer?this.layer.customParameters:void 0,token:"apiKey"in this.layer?this.layer.apiKey:void 0}}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{c(e)||A.error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{c(e)||A.error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createHittestResult(e){return this._setLayersForFeature(e),h(e.geometry)&&(e.geometry.spatialReference=this.view.spatialReference),e}};e([m()],M.prototype,"_serviceOptions",void 0),e([m()],M.prototype,"_proxy",void 0),e([m()],M.prototype,"_pipelineIsUpdating",void 0),e([m()],M.prototype,"_effectiveRenderer",void 0),e([m()],M.prototype,"_aggregateValueRanges",void 0),e([m()],M.prototype,"_commandsQueue",void 0),e([m()],M.prototype,"featureEffectView",void 0),e([m()],M.prototype,"labelsVisible",null),e([m({readOnly:!0})],M.prototype,"queryMode",null),e([m()],M.prototype,"renderingConfigHash",null),e([m()],M.prototype,"tileRenderer",void 0),e([m()],M.prototype,"updating",void 0),M=e([_("esri.views.2d.layers.FeatureLayerView2D")],M);const B=M;export{B as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import i from"../../../Graphic.js";import r from"../../../core/Collection.js";import s from"../../../core/Error.js";import a from"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import o from"../../../core/Logger.js";import{applySome as l,isSome as h,unwrap as u,isNone as d}from"../../../core/maybe.js";import{debounce as p,isAbortError as c}from"../../../core/promiseUtils.js";import{watch as y}from"../../../core/reactiveUtils.js";import{init as f,whenFalseOnce as g}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 v from"../../../layers/effects/FeatureEffectView.js";import b from"../../../layers/support/FeatureFilter.js";import{calculateTolerance as R}from"../../../renderers/support/clickToleranceUtils.js";import w from"../../../rest/support/FeatureSet.js";import x from"../../../rest/support/Query.js";import{MAX_FILTERS as S}from"../engine/webgl/definitions.js";import{LayerView2DMixin as U}from"./LayerView2D.js";import{createSchema as F}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as I}from"./features/tileRenderers.js";import{findSizeVV as C,createClusterCountSizeVariable as O,isClusterCompatibleRenderer as E,createClusterRenderer as q}from"./support/clusterUtils.js";import T from"./support/FeatureCommandQueue.js";import j from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as V}from"./support/util.js";import{TileManager as N}from"../tiling/TileManager.js";import{FeatureLayerView as P}from"../../layers/FeatureLayerView.js";import k from"../../layers/LayerView.js";import{RefreshableLayerView as L}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as H}from"../../support/drapedUtils.js";import{getWebGL1Capabilities as z}from"../../webgl/capabilities.js";import J from"../../../geometry/Extent.js";function Q(e){return e&&"openPorts"in e}const A=o.getLogger("esri.views.2d.layers.FeatureLayerView2D");let M=class extends(P(L(U(k)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new T({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=p((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new v,this._lastDefinitionExpression=null}destroy(){var e,t;l(this._updateClusterSizeTask,(e=>e.remove())),null==(e=this._proxy)||e.destroy(),null==(t=this.tileRenderer)||t.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.handles.add([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),y((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),{initial:!0,sync:!0})])}async _initProxy(){if("isTable"in this.layer&&this.layer.isTable)throw new s("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});this._proxy&&this._proxy.destroy();const e=this._createClientOptions();return this._set("_proxy",new j({client:e})),this._proxy.when()}async _initServiceOptions(){this._set("_serviceOptions",await this._createServiceOptions())}get orderByFields(){return"stream"!==this._serviceOptions.type&&this._serviceOptions.orderByFields}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,i=this.view.floors,{definitionExpression:r}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="feature"===t.type?t.gdbVersion:void 0,o="feature"===t.type&&t.historicMoment?t.historicMoment.getTime():void 0,{timeExtent:l}=this,u="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,p="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,c=JSON.stringify(this.clips),y=t.featureReduction&&t.featureReduction.toJSON(),f="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),g="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),"");return JSON.stringify({orderBy:f,sublayerHash:g,filterHash:h(this.filter)&&this.filter.toJSON(),effectHash:h(this.featureEffect)&&this.featureEffect.toJSON(),streamFilter:p,gdbVersion:n,definitionExpression:r,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:l,floors:i,clipsHash:c,featureReduction:y,customParameters:u,apiKey:d})}async fetchPopupFeatures(e,t){var i;if(h(t)&&0===t.clientGraphics.length)return[];if(!("cluster"===(null==(i=this.layer.featureReduction)?void 0:i.type))){const i=R({renderer:"renderer"in this.layer&&this.layer.renderer,event:h(t)&&t.event}),r=H(e,i,this.view),{features:s}=await this.queryVisibleFeatures(new x({geometry:r,outFields:["*"],returnGeometry:!0}));t=h(t)?t:{};const a=new Set(t.clientGraphics.map((e=>e.getObjectId())));for(const e of s)a.has(e.getObjectId())||t.clientGraphics.push(e)}return super.fetchPopupFeatures(e,t)}highlight(e){var t;let s;return e instanceof i?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:Array.isArray(e)&&e.length>0?s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>null==e?void 0:e.getObjectId())):r.isCollection(e)&&e.length>0&&(s=e.map((e=>null==e?void 0:e.getObjectId())).toArray()),s=null==(t=s)?void 0:t.filter((e=>null!=e)),s&&s.length?(this._addHighlight(s),{remove:()=>this._removeHighlight(s)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,r){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(r);if(0===s.length)return null;const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((e=>this._createHittestResult(t.fromJSON(e)))),...a.map((e=>this._createHittestResult(i.fromJSON(e))))]}async queryAggregates(){return(await this._proxy.getAggregates()).map((e=>t.fromJSON(e)))}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),r,i)}async queryUniqueValues(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),r,i)}async queryClassBreaks(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),r,i)}async queryHistogram(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),r,i)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=w.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=w.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:J.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:i,removed:r}=this._tileStrategy.update(e);(i.length||r.length)&&this._proxy.updateTiles({added:i,removed:r}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new N({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.handles.add(f(this,"renderingConfigHash",(()=>this._update())),"attach"),"stream"!==this.layer.type&&this.handles.add(this.layer.on("edits",(e=>this._edit(e))),"attach")}detach(){this.container.removeAllChildren(),this.handles.remove("attach"),this.tileRenderer&&(this.tileRenderer.uninstall(this.container),this.tileRenderer=null),this._tileStrategy&&(this._tileStrategy.destroy(),this._tileStrategy=null),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){var e;const t="renderer"in this.layer&&null!=this.layer.renderer,i=this._commandsQueue.updating,r=null!=this._updatingRequiredFieldsPromise,s=!this._proxy||!this._proxy.isReady,n=this._pipelineIsUpdating,o=null===this.tileRenderer||(null==(e=this.tileRenderer)?void 0:e.updating),l=t&&(i||r||s||n||o);return a("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${l}\n -> hasRenderer ${t}\n -> hasPendingCommand ${i}\n -> updatingRequiredFields ${r}\n -> updatingProxy ${s}\n -> updatingPipeline ${n}\n -> updatingTileRenderer ${o}\n`),l}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){var t;const i="path"in e,r="editingInfo"in this.layer&&(null==(t=this.layer.editingInfo)?void 0:t.lastEditDate),s=!!this.layer.refreshInterval,n=!r&&s;if(i&&("feature"===this.layer.type||"subtype-group"===this.layer.type)&&"point"===this.layer.geometryType&&this.layer.capabilities.query.supportsPagination&&!this.layer.capabilities.operations.supportsEditing&&!n&&a("featurelayer-snapshot-enabled"))try{const e=await this.layer.queryFeatureCount();if(e<=a("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=a("featurelayer-snapshot-point-max-threshold"),i=a("featurelayer-snapshot-point-coverage"),r=this.view.extent,s=u(this.layer.fullExtent),n=null==s?void 0:s.clone().intersection(r),o=h(n)?n.width*n.height:0,l=(null==s?void 0:s.width)*(null==s?void 0:s.height),d=0===l?0:o/l;if(e<=t&&d>=i)return{mode:"snapshot",featureCount:e}}catch(o){A.warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:o})}return{mode:"on-demand"}}async _createServiceOptions(){var e;const t=this.layer;if("stream"===t.type)return null;const{capabilities:i,objectIdField:r}=t,s=t.fields.map((e=>e.toJSON())),a=h(t.fullExtent)&&t.fullExtent.toJSON(),o=V(t.geometryType),l=t.timeInfo&&t.timeInfo.toJSON()||null,u=t.spatialReference?t.spatialReference.toJSON():null,d="feature"===t.type?t.globalIdField:null;let p;"ogc-feature"===t.type?p=t.source.getFeatureDefinition():Q(t.source)?p=await t.source.openPorts():t.parsedUrl&&(p=n(t.parsedUrl),"dynamicDataSource"in t&&t.dynamicDataSource&&(p.query={layer:JSON.stringify({source:t.dynamicDataSource})}));const c="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,y=null!=(e="subtypeField"in this.layer&&this.layer.subtypeField)?e:null,{mode:f,featureCount:g}=await this._detectQueryMode(p);let m=this.layer.objectIdField;if("feature"===this.layer.type&&h(this.layer.orderBy)&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(m=e)}return{type:f,timeReferenceUnknownClient:c,subtypeField:y,featureCount:g,globalIdField:d,maxRecordCount:i.query.maxRecordCount,tileMaxRecordCount:i.query.tileMaxRecordCount,capabilities:i,fields:s,fullExtent:a,geometryType:o,objectIdField:r,source:p,timeInfo:l,spatialReference:u,orderByFields:m}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=x.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this._validateEdit(e))return this._commandsQueue.push({type:"edit",edits:e})}async doRefresh(e){return this._commandsQueue.push({type:"refresh",dataChanged:e})}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,i=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),r=t&&this.availableFields.includes(t);return i&&!r?(A.error(new s("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:i}=this;await this._updateRequiredFields();const{renderer:r}=this._getEffectiveRenderer();this._set("_effectiveRenderer",r);const s=this._createSchemaConfig(),a=this._createConfiguration(s,i,t.filter),n=this._lastDefinitionExpression!==a.definitionExpression;this._lastDefinitionExpression=a.definitionExpression;const o=this._createTileRendererHash(r);if("snapshot"===this._serviceOptions.type&&(a.schema.source.featureCount=this._serviceOptions.featureCount),o!==this._tileRendererHash){await this._initTileRenderer(r);const e=this._serviceOptions;this.tileRenderer.onConfigUpdate(r);const t=this.layer;"stream"!==t.type&&Q(t.source)&&(e.source=await t.source.openPorts()),"stream"===t.type&&await this._initServiceOptions();const i={added:this._tileStrategy.tileKeys(),removed:[]};await this._proxy.startup(this.view.featuresTilingScheme,a,e,i),this.hasHighlight()&&await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),await this._onceTilesUpdated(),this.tileRenderer.onConfigUpdate(r)}else{"snapshot"===this._serviceOptions.type&&n&&(a.schema.source.featureCount=await this.layer.queryFeatureCount());const t=await this._proxy.update(a);(t.mesh||t.targets.aggregate)&&this._lockGPUUploads();try{await this._proxy.applyUpdate(t)}catch(e){c(e)||A.error(e)}(t.mesh||t.targets.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(r),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=o,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){c(t),0}}async _doRefresh(e){this._lockGPUUploads();try{await this._proxy.refresh(e)}catch(t){c(t),0}this._unlockGPUUploads()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return this.watch("_aggregateValueRanges",(async i=>{this._updateClusterEffectiveRendererSizeVariable(e,t,i),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,i){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const r=C(e.visualVariables);if(h(r)&&"cluster_count"===r.field){const s=e.visualVariables.indexOf(r);e.visualVariables[s]=O(t,i);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e="renderer"in this.layer&&this.layer.renderer,t=this.layer.featureReduction;if(h(this._updateClusterSizeTask)&&(this._updateClusterSizeTask.remove(),this._updateClusterSizeTask=null),t&&"cluster"===t.type&&E(e)){const i=t,r=[],s=q(r,e,i,this._aggregateValueRanges);return l(this._updateClusterSizeTask,(e=>e.remove())),this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,i),{renderer:s,aggregateFields:r,featureReduction:t}}return{renderer:e,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}async _initTileRenderer(e){const t=await I(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer.destroy(),this.tileRenderer=null),this.destroyed?null:(this._proxy.tileRenderer=t,this._set("tileRenderer",t),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(e),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${"heatmap"===e.type?"heatmap":"symbol"}.${"dot-density"===e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=h(e)?e.timeExtent:null,i=h(this.timeExtent)&&h(t)?this.timeExtent.intersection(t):this.timeExtent||t;let r=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=h(e)&&e.where;r=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!i&&!s)return h(e)?e.toJSON():null;(e=h(e)&&e.clone()||new b).timeExtent=i,r&&(e.where=r);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let i=e||"";if("floorInfo"in t&&t.floorInfo){var r;let e=this.view.floors;if(!e||!e.length)return i;null!=(r=t.floorInfo.viewAllLevelIds)&&r.length&&(e=t.floorInfo.viewAllLevelIds);const s=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));s.push("''");const a=t.floorInfo.floorField;let n="("+a+" IN ({ids}) OR "+a+" IS NULL)";if(n=n.replace("{ids}",s.join(", ")),h(i)&&i.includes(a)){let e=new RegExp("AND \\("+a+".*NULL\\)","g");i=i.replace(e,""),e=new RegExp("\\("+a+".*NULL\\)","g"),i=i.replace(e,""),i=i.replace(/\s+/g," ").trim()}i=""!==i?"("+i+") AND "+n:n}return""!==i?i:null}_createConfiguration(e,t,i){const r="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion:void 0,a=new Array(S),n=this._injectOverrides(t);a[0]=n,a[1]=h(i)?i.toJSON():null;const o=F(e);if(d(o))return null;const l=z();return{definitionExpression:this.layer.definitionExpression,availableFields:this.availableFields,gdbVersion:s,historicMoment:r,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:o,supportsTextureFloat:l.supportsTextureFloat,maxTextureSize:l.maxTextureSize}}_hasRequiredSupport(e){var t;return!("renderer"in e&&"dot-density"===(null==(t=e.renderer)?void 0:t.type)&&!z().supportsTextureFloat)||(A.error(new s("webgl-missing-extension","Missing WebGL extension OES_Texture_Float which is required for DotDensity")),!1)}_onceTilesUpdated(){return this.requestUpdate(),g(this,"_pipelineIsUpdating",!1)}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e="feature"===this.layer.type?this.layer.historicMoment:null,t="feature"===this.layer.type?this.layer.gdbVersion:null;return{renderer:"renderer"in this.layer&&this.layer.renderer,spatialReference:this.layer.spatialReference,timeExtent:this.layer.timeExtent,definitionExpression:this.layer.definitionExpression,featureReduction:this.layer.featureReduction,fields:this.layer.fields,geometryType:this.layer.geometryType,historicMoment:e,labelsVisible:"labelsVisible"in this.layer&&this.layer.labelsVisible,labelingInfo:"labelingInfo"in this.layer&&this.layer.labelingInfo,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:t,pixelBuffer:0,orderBy:"orderBy"in this.layer&&this.layer.orderBy?this.layer.orderBy:null,customParameters:{..."customParameters"in this.layer?this.layer.customParameters:void 0,token:"apiKey"in this.layer?this.layer.apiKey:void 0}}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{c(e)||A.error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{c(e)||A.error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createHittestResult(e){return this._setLayersForFeature(e),h(e.geometry)&&(e.geometry.spatialReference=this.view.spatialReference),e}};e([m()],M.prototype,"_serviceOptions",void 0),e([m()],M.prototype,"_proxy",void 0),e([m()],M.prototype,"_pipelineIsUpdating",void 0),e([m()],M.prototype,"_effectiveRenderer",void 0),e([m()],M.prototype,"_aggregateValueRanges",void 0),e([m()],M.prototype,"_commandsQueue",void 0),e([m()],M.prototype,"featureEffectView",void 0),e([m()],M.prototype,"labelsVisible",null),e([m({readOnly:!0})],M.prototype,"queryMode",null),e([m()],M.prototype,"renderingConfigHash",null),e([m()],M.prototype,"tileRenderer",void 0),e([m()],M.prototype,"updating",void 0),M=e([_("esri.views.2d.layers.FeatureLayerView2D")],M);const B=M;export{B 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 i from"../../../Graphic.js";import t from"../../../core/Collection.js";import{watch as r,syncAndInitial as s,sync as a}from"../../../core/reactiveUtils.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 o}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsCollection as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import i from"../../../Graphic.js";import t from"../../../core/Collection.js";import{watch as r,syncAndInitial as s,sync as a}from"../../../core/reactiveUtils.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 o}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsCollection as n}from"../../../support/GraphicsCollection.js";import l from"../engine/flow/AnimatedFlowView2D.js";import{LayerView2DMixin as u}from"./LayerView2D.js";import c from"./graphics/GraphicsView2D.js";import w from"./graphics/HighlightGraphicContainer.js";import d from"./imagery/ImageryView2D.js";import v from"./imagery/VectorFieldView2D.js";import{ImageryLayerView as p}from"../../layers/ImageryLayerView.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";let g=class extends(p(y(u(m)))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new n,this.subview=null}destroy(){var e;null==(e=this._highlightGraphics)||e.destroy()}get pixelData(){return this.updating?null:"getPixelData"in this.subview?this.subview.getPixelData():null}get updating(){return!!(!this.subview||"updating"in this.subview&&this.subview.updating)}async hitTest(e,i){return this.subview?[this.subview.hitTest(e)]:null}update(e){var i;null==(i=this.subview)||i.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new c({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.handles.add([r((()=>{var e,i;return this.subview&&null!=(e=null==(i=this.layer)?void 0:i.blendMode)?e:"normal"}),(e=>{this.subview&&(this.subview.container.blendMode=e)}),s),r((()=>{var e,i;return this.subview&&null!=(e=null==(i=this.layer)?void 0:i.effect)?e:null}),(e=>{this.subview&&(this.subview.container.effect=e)}),s),r((()=>{var e,i;return null==(e=this.layer)||null==(i=e.exportImageServiceParameters)?void 0:i.version}),(e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())}),a),r((()=>this.subview?this.layer.timeExtent:null),(e=>{"timeExtent"in this.subview&&(this.subview.timeExtent=e),this.requestUpdate()})),this.layer.on("redraw",(()=>{"redraw"in this.subview?this.subview.redraw():this.subview.redrawOrRefetch()})),r((()=>this.layer.renderer),(()=>this._setSubView()))],"imagerylayerview-update")}detach(){var e,i;this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),null==(e=this.subview)||e.destroy(),null==(i=this._highlightView)||i.destroy(),this.container.removeAllChildren(),this.handles.remove("imagerylayerview-update"),this._exportImageVersion=-1}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(e,r){if(!((Array.isArray(e)?e[0]:t.isCollection(e)?e.getItemAt(0):e)instanceof i))return{remove:()=>{}};let s=[];return Array.isArray(e)||t.isCollection(e)?s=e.map((e=>e.clone())):e instanceof i&&(s=[e.clone()]),this._highlightGraphics.addMany(s),{remove:()=>{this._highlightGraphics.removeMany(s)}}}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||this.subview.updating}_setSubView(){var e;if(!this.view)return;const i=null==(e=this.layer.renderer)?void 0:e.type;let t="Imagery";if("vector-field"===i&&"lerc"===this.layer.format?t="ImageryVF":"animated-flow"===i&&(t="Flow"),this.subview){var r;if(this.subview.type===t)return void this._attachSubview(this.subview);this._detachSubview(this.subview),null==(r=this.subview)||r.destroy(),this.subview=null}this.subview="Imagery"===t?new d({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):"ImageryVF"===t?new v({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new l({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0),e.container.blendMode=this.layer.blendMode,e.container.effect=this.layer.effect)}_detachSubview(e){null!=e&&e.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};e([h()],g.prototype,"pixelData",null),e([h({readOnly:!0})],g.prototype,"updating",null),e([h()],g.prototype,"subview",void 0),g=e([o("esri.views.2d.layers.ImageryLayerView2D")],g);const b=g;export{b 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 s from"../../../Graphic.js";import
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../Graphic.js";import t from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{watch as r,syncAndInitial as o,initial as a}from"../../../core/reactiveUtils.js";import{watch as n}from"../../../core/watchUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import l from"../engine/flow/AnimatedFlowView2D.js";import{LayerView2DMixin as c}from"./LayerView2D.js";import d from"./imagery/ImageryTileView2D.js";import p from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as v}from"./support/util.js";import{ImageryTileLayerView as w}from"../../layers/ImageryTileLayerView.js";import b from"../../layers/LayerView.js";import{RefreshableLayerView as m}from"../../layers/RefreshableLayerView.js";const y=t.getLogger("esri.views.2d.layers.ImageryTileLayerView2D");let g=class extends(w(m(c(b)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}update(e){this.subview.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.handles.add([n(this.layer,["bandIds","renderer","interpolation","multidimensionalDefinition"],((e,s,t)=>{const r="multidimensionalDefinition"===t,o="interpolation"===t&&("majority"===e||"majority"===s)&&v(this.layer),a="renderer"===t&&s.type!==e.type;a&&this._updateSubview();const n=r||o||a;this.subview.redrawOrRefetch(n).catch((e=>{i(e)||y.error(e)})),this.notifyChange("updating")})),r((()=>{var e,s;return this.subview&&null!=(e=null==(s=this.layer)?void 0:s.blendMode)?e:"normal"}),(e=>{this.subview&&(this.subview.container.blendMode=e)}),o),r((()=>{var e,s;return this.subview&&null!=(e=null==(s=this.layer)?void 0:s.effect)?e:null}),(e=>{this.subview&&(this.subview.container.effect=e)}),o),r((()=>this.timeExtent),(()=>{this.subview.redrawOrRefetch(!0).catch((e=>{i(e)||y.error(e)}))}),a)],"attach")}detach(){this.handles.remove("attach"),this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}async hitTest(e,t){return[new s({attributes:{},geometry:e.clone()})]}doRefresh(){return this.subview.doRefresh()}_updateSubview(){const e="vector-field"===this.layer.renderer.type?"rasterVF":"animated-flow"===this.layer.renderer.type?"rasterAnimatedFlow":"raster";if(this.subview){var s;if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),null==(s=this.subview)||s.destroy(),this.subview=null}const{layer:t}=this;let i;i="rasterVF"===e?new p({layer:t,layerView:this}):"rasterAnimatedFlow"===e?new l({layer:t,layerView:this}):new d({layer:t,layerView:this}),"useWebGLForProcessing"in i&&(i.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in i&&(i.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in i&&(i.previousLOD=this.subview&&"previousLOD"in this.subview&&this.subview.previousLOD),this._attachSubview(i),this.subview=i,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChild(e.container),e.container.blendMode=this.layer.blendMode,e.container.effect=this.layer.effect)}_detachSubview(e){null!=e&&e.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1,e.destroy())}};e([u()],g.prototype,"subview",void 0),e([u()],g.prototype,"useWebGLForProcessing",null),e([u()],g.prototype,"useProgressiveUpdate",null),g=e([h("esri.views.2d.layers.ImageryTileLayerView2D")],g);const f=g;export{f 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
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../Graphic.js";import i from"../../../core/Collection.js";import{isSome as t,unwrap as r}from"../../../core/maybe.js";import{watch as h,initial as o}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/set.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as n}from"./LayerView2D.js";import c from"./graphics/GraphicContainer.js";import p from"./graphics/GraphicsView2D.js";import l from"../../layers/LayerView.js";const g=["routeInfo","directionLines","directionPoints","polygonBarriers","polylineBarriers","pointBarriers","stops"],d=Object.freeze({remove(){},pause(){},resume(){}});let m=class extends(n(l)){constructor(){super(...arguments),this._graphicsViews=new Map,this._highlightIds=new Map}attach(){for(const e of g)this.handles.add(h((()=>t(this.layer[e])?"routeInfo"===e?[r(this.layer[e])]:r(this.layer[e]).toArray():null),(s=>this._createGraphicsView(e,s)),o),e)}detach(){this._destroyGraphicsViews()}highlight(e){let t;return"number"==typeof e?t=[e]:e instanceof s?t=[e.uid]:Array.isArray(e)&&e.length>0?t="number"==typeof e[0]?e:e.map((e=>e&&e.uid)):i.isCollection(e)&&(t=e.map((e=>e&&e.uid)).toArray()),t=t.filter((e=>null!=e)),t.length?(this._addHighlight(t),{remove:()=>this._removeHighlight(t)}):d}async hitTest(e,s){if(this.suspended||!this._graphicsViews.size)return Promise.resolve(null);const i=Array.from(this._graphicsViews.values()).reverse().map((s=>s.hitTest(e))).flat().filter((e=>!!e));for(const t of i)t.layer=this.layer,t.sourceLayer=this.layer;return i}moveStart(){}moveEnd(){}update(e){for(const s of this._graphicsViews.values())s.processUpdate(e)}viewChange(){for(const e of this._graphicsViews.values())e.viewChange()}isUpdating(){for(const e of this._graphicsViews.values())if(e.updating)return!0;return!1}_createGraphicsView(e,r){this._destroyGraphicsView(e);const a=this.view,n=()=>this.requestUpdate(),l=new i(t(r)?r.map((e=>{const{attributes:i,geometry:t,symbol:r,popupInfo:h}=e.toPortalJSON();return s.fromJSON({attributes:i,geometry:t,symbol:r,popupTemplate:h})})):[]),d=new c(a.featuresTilingScheme),m=new p({container:d,graphics:l,requestUpdateCallback:n,view:a});this._graphicsViews.set(e,m),this.container.addChildAt(d,g.indexOf(e)),this._updateHighlight(),this.handles.add([h((()=>m.updating),(()=>this.notifyChange("updating")),o)],`updating-${e}`)}_destroyGraphicsView(e){if(!this._graphicsViews.has(e))return;const s=this._graphicsViews.get(e);this.container.removeChild(s.container),s.destroy(),this.handles.remove(`updating-${e}`),this._graphicsViews.delete(e)}_destroyGraphicsViews(){this.container.removeAllChildren();for(const[e,s]of this._graphicsViews.entries())this.handles.remove(e),s.destroy();this._graphicsViews.clear()}_addHighlight(e){for(const s of e)if(this._highlightIds.has(s)){const e=this._highlightIds.get(s);this._highlightIds.set(s,e+1)}else this._highlightIds.set(s,1);this._updateHighlight()}_removeHighlight(e){for(const s of e)if(this._highlightIds.has(s)){const e=this._highlightIds.get(s)-1;0===e?this._highlightIds.delete(s):this._highlightIds.set(s,e)}this._updateHighlight()}_updateHighlight(){const e=Array.from(this._highlightIds.keys());for(const s of this._graphicsViews.values())s.setHighlight(e)}};m=e([a("esri.views.2d.layers.RouteLayerView2D")],m);const u=m;export{u 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"../../../../../core/has.js";import{isSome as t,
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import{isSome as t,applySome as s}from"../../../../../core/maybe.js";import"../../../../../core/Logger.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/set.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{diff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{calculateHeatmapIntensityInfoReaders as o}from"../../../../../renderers/support/heatmapUtils.js";import{TILE_SIZE as a}from"../../../engine/webgl/definitions.js";import n from"./BaseProcessor.js";import{getPow2NeighborKey as d}from"../support/tileUtils.js";class p{constructor(e,t){this.offset=e,this.extent=t}}function c(e){const t=e.key,s=new Map,r=256,i=a,o=e.tileInfoView.tileInfo.isWrappable;return s.set(d(t,-1,-1,o).id,new p([-i,-i],[i-r,i-r,i,i])),s.set(d(t,0,-1,o).id,new p([0,-i],[0,i-r,i,i])),s.set(d(t,1,-1,o).id,new p([i,-i],[0,i-r,r,i])),s.set(d(t,-1,0,o).id,new p([-i,0],[i-r,0,i,i])),s.set(d(t,1,0,o).id,new p([i,0],[0,0,r,i])),s.set(d(t,-1,1,o).id,new p([-i,i],[i-r,0,i,r])),s.set(d(t,0,1,o).id,new p([0,i],[0,0,i,r])),s.set(d(t,1,1,o).id,new p([i,i],[0,0,r,r])),s}let l=class extends n{constructor(){super(...arguments),this.type="heatmap",this._tileKeyToFeatureSets=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))])}async update(e,t){const s=t.schema.processors[0];if("heatmap"!==s.type)return;i(this._schema,s)&&(e.mesh=!0,this._schema=s)}onTileUpdate(e){for(const t of e.removed)this._tileKeyToFeatureSets.delete(t.key.id)}onTileClear(e){const t={clear:!0};return this._tileKeyToFeatureSets.delete(e.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t})}async onTileMessage(e,r,i){this._tileKeyToFeatureSets.has(e.key.id)||this._tileKeyToFeatureSets.set(e.key.id,new Map);const a=this._tileKeyToFeatureSets.get(e.key.id);if(t(r.addOrUpdate)&&r.addOrUpdate.hasFeatures&&a.set(r.addOrUpdate.instance,r),r.end){const t=[],r=c(e);this._tileKeyToFeatureSets.forEach(((i,o)=>{if(o===e.key.id)i.forEach((e=>s(e.addOrUpdate,(e=>t.push(e)))));else if(r.has(o)){const e=r.get(o),[a,n]=e.offset;i.forEach((e=>s(e.addOrUpdate,(e=>{const s=e.transform(a,n,1,1);t.push(s)}))))}}));const a=o(t,this._schema.mesh,512,512),n={tileKey:e.key.id,intensityInfo:a},d=[a.matrix];return this.remoteClient.invoke("tileRenderer.onTileData",n,{...i,transferList:d})}}onTileError(e,t,s){return this.remoteClient.invoke("tileRenderer.onTileError",{tileKey:e.id,error:t},s)}};l=e([r("esri.views.2d.layers.features.processors.HeatmapProcessor")],l);const h=l;export{h 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{bidiText as t}from"../../../../../core/BidiText.js";import"../../../../../core/Error.js";import s from"../../../../../core/has.js";import r from"../../../../../core/Logger.js";import{
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{bidiText as t}from"../../../../../core/BidiText.js";import"../../../../../core/Error.js";import s from"../../../../../core/has.js";import r from"../../../../../core/Logger.js";import{applySome as i,isNone as a,isSome as o,unwrapOrThrow as n,unwrap as l}from"../../../../../core/maybe.js";import{throwIfAborted as c,all as d,isAbortError as f}from"../../../../../core/promiseUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/set.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{diff as u,hasDiff as m}from"../../../../../core/accessorSupport/diffUtils.js";import p from"../../../../../geometry/SpatialReference.js";import{isAggregateId as g}from"../../../engine/webgl/DisplayId.js";import{MeshData as y}from"../../../engine/webgl/mesh/MeshData.js";import{WGLMeshFactory as _}from"../../../engine/webgl/mesh/factories/WGLMeshFactory.js";import{WGLTemplateStore as b}from"../../../engine/webgl/mesh/templates/WGLTemplateStore.js";import{createMatcher as S}from"../../../engine/webgl/util/Matcher.js";import{codepoints as w}from"../textUtils.js";import I from"./BaseProcessor.js";import M from"../support/ResourceManagerProxy.js";function v(e,t){return(!e.minScale||e.minScale>=t)&&(!e.maxScale||e.maxScale<=t)}function x(e){const t=e.message,s={message:{data:{},tileKey:t.tileKey,tileKeyOrigin:t.tileKeyOrigin},transferList:new Array};for(const r in t.data){const e=t.data[r];if(s.message.data[r]=null,o(e)){const t=e.stride,a=e.indices.slice(0),o=e.vertices.slice(0),n=e.records.slice(0),l={stride:t,indices:a,vertices:o,records:n,metrics:i(e.metrics,(e=>e.slice(0)))};s.transferList.push(a,o,n),s.message.data[r]=l}}return s}r.getLogger("esri.views.2d.layers.features.processors.SymbolProcessor");let j=class extends I{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new M(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(e){this._bufferIds.forEach((t=>{t.forEach(e)}))}async update(e,t){const r=t.schema.processors[0];if("symbol"!==r.type)return;const i=u(this._schema,r);m(i,"mesh")&&(s("esri-2d-update-debug")&&console.debug("Applying Update - Processor:",i),e.mesh=!0,e.why.mesh.push("Symbology changed"),this._schema=r,this._factory=this._createFactory(r),this._factory.update(r,this.tileStore.tileScheme.tileInfo))}onTileMessage(e,t,s,r){return c(r),this._onTileData(e,t,s,r)}onTileClear(e){const t={clear:!0};return this._bufferData.delete(e.key.id),this._bufferIds.delete(e.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t})}onTileError(e,t,s){const r=s.signal,i={tileKey:e.id,error:t};return this.remoteClient.invoke("tileRenderer.onTileError",i,{signal:r})}onTileUpdate(e){for(const t of e.removed)this._bufferData.has(t.key.id)&&this._bufferData.delete(t.key.id),this._bufferIds.has(t.key.id)&&this._bufferIds.delete(t.key.id);for(const t of e.added)this._bufferData.forEach((e=>{for(const s of e)s.message.tileKey===t.id&&this._updateTileMesh("append",t,x(s),[],!1,!1,null)}))}_addBufferData(e,t){this._bufferData.has(e)||this._bufferData.set(e,[]),this._bufferData.get(e).push(x(t))}_createFactory(e){const{geometryType:t,objectIdField:s,fields:r}=this.service,a=(e,t)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",e,t),o={geometryType:t,fields:r,spatialReference:p.fromJSON(this.spatialReference)},n=new b(a,this.tileStore.tileScheme.tileInfo),{matcher:l,aggregateMatcher:c}=e.mesh;return this._store=n,this._matchers.feature=S(l,n,o,this._resourceManagerProxy),this._matchers.aggregate=i(c,(e=>S(e,n,o,this._resourceManagerProxy))),new _(t,s,n)}async _onTileData(e,t,s,r){c(r);const{type:i,addOrUpdate:n,remove:l}=t,f=t.end,h=!!this._schema.mesh.sortKey;if(!n){const t={type:i,addOrUpdate:null,remove:l,clear:!1,end:f,sort:h};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t},r)}const u=this._processFeatures(e,n,s,r);try{const s=await u;if(a(s)){const t={type:i,addOrUpdate:null,remove:l,clear:!1,end:f,sort:h};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t},r)}const n=[];for(const t of s){let s=!1;const r=t.message.bufferIds,i=e.key.id,a=t.message.tileKey;if(i!==a&&o(r)){if(!this.tileStore.get(a)){this._addBufferData(i,t),n.push(t);continue}let e=this._bufferIds.get(a);e||(e=new Set,this._bufferIds.set(a,e));const o=Array.from(r);for(const t of o){if(e.has(t)){s=!0;break}e.add(t)}}s||(this._addBufferData(i,t),n.push(t))}await d(n.map((s=>{const a=e.key.id===s.message.tileKey,o=a?t.remove:[],n=a&&t.end;return this._updateTileMesh(i,e,s,o,n,t.clear,r.signal)})))}catch(m){this._handleError(e,m,r)}}async _updateTileMesh(e,t,s,r,a,o,n){const d=e,f=s.message.tileKey,h=!!this._schema.mesh.sortKey;f!==t.key.id&&(a=!1);const u=i(s,(e=>e.message)),m=i(s,(e=>e.transferList))||[],p={type:d,addOrUpdate:u,remove:r,clear:!1,end:a,sort:h},g={transferList:l(m)||[],signal:n};return c(g),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:f,data:p},g)}async _processFeatures(e,t,s,r){if(a(t)||!t.hasFeatures)return null;const i={transform:e.transform,hasZ:!1,hasM:!1},o=this._factory,n={viewingMode:"",scale:e.scale},l=await this._matchers.feature,d=await this._matchers.aggregate;c(r);const f=this._getLabelInfos(e,t);return await o.analyze(t.getCursor(),this._resourceManagerProxy,l,d,i,n),c(r),this._writeFeatureSet(e,t,i,f,o,s)}_writeFeatureSet(e,t,s,r,i,a){const n=t.getSize(),l=new y(e.key.id,{features:n,records:n,metrics:0},this._schema.mesh.matcher.stride,a,!0),c={viewingMode:"",scale:e.scale},d=t.getCursor();for(;d.next();)try{const t=d.getDisplayId(),a=o(r)?r.get(t):null;i.writeCursor(l,d,s,c,e.level,a,this._resourceManagerProxy)}catch(h){}const f=e.tileInfoView.tileInfo.isWrappable;return l.serialize(f)}_handleError(e,t,s){if(!f(t)){const r={tileKey:e.id,error:t.message};return this.remoteClient.invoke("tileRenderer.onTileError",r,{signal:s.signal})}}_getLabelingSchemaForScale(e){const t=this._schema.mesh.labels;if(a(t))return null;if("subtype"===t.type){const s={type:"subtype",classes:{}};let r=!1;for(const i in t.classes){const a=t.classes[i].filter((t=>v(t,e.scale)));r=r||!!a.length,s.classes[i]=a}return r?s:null}const s=t.classes.filter((t=>v(t,e.scale)));return s.length?{type:"simple",classes:s}:null}_getLabels(e,t){if("subtype"===t.type){var s;const r=this.service.subtypeField,i=n(r,"Expected to find subtype Field"),a=e.readAttribute(i);return null==a?[]:null!=(s=t.classes[a])?s:[]}return t.classes}_getLabelInfos(e,s){const r=this._getLabelingSchemaForScale(e);if(a(r))return null;const i=new Map,o=s.getCursor();for(;o.next();){const e=o.getDisplayId(),s=[],a=g(e),n=a&&1!==o.readAttribute("cluster_count")?"aggregate":"feature",l=this._getLabels(o,r);for(const r of l){if(r.target!==n)continue;const i=o.getStorage(),l=a&&"feature"===n?i.getComputedStringAtIndex(o.readAttribute("referenceId"),r.fieldIndex):i.getComputedStringAtIndex(e,r.fieldIndex);if(!l)continue;const c=t(l.toString()),d=c[0],f=c[1];this._store.getMosaicItem(r.symbol,w(d)).then((e=>{s[r.index]={glyphs:e.glyphMosaicItems,rtl:f,index:r.index}}))}i.set(e,s)}return i}};j=e([h("esri.views.2d.layers.features.processors.SymbolProcessor")],j);const T=j;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 t from"../../../../../core/Error.js";import e from"../../../../../core/has.js";import i from"../../../../../core/Logger.js";import{clamp as s}from"../../../../../core/mathUtils.js";import{isNone as r,isSome as a,mapMany as o,forEachSome as n,andThen as l,unwrap as h}from"../../../../../core/maybe.js";import{createResolver as c,isAbortError as u}from"../../../../../core/promiseUtils.js";import{diff as d}from"../../../../../core/accessorSupport/diffUtils.js";import p from"../../../../../layers/support/FieldsIndex.js";import{MAX_FILTERS as _,HIGHLIGHT_FLAG as g,ATTRIBUTE_DATA_VV as f,NAN_MAGIC_NUMBER as m,ATTRIBUTE_DATA_ANIMATION as y}from"../../../engine/webgl/definitions.js";import{DISPLAY_ID_TYPE_AGGREGATE as x,DISPLAY_ID_TYPE_FEATURE as b,getDisplayIdTexel as T,getDisplayIdType as z,getDisplayIdFilterMask as S}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as w}from"../../../engine/webgl/Utils.js";import{createDebugLogger as A,DEBUG_ATTR_UPDATES as E}from"../../../engine/webgl/util/debug.js";import{getVisualVariableSizeValueRepresentationRatio as D}from"../tileRenderers/support/visualVariablesUtils.js";import{PixelType as k}from"../../../../webgl/enums.js";const U=i.getLogger("esri.views.layers.2d.features.support.AttributeStore"),F=A(E,U),B={sharedArrayBuffer:e("esri-shared-array-buffer"),atomics:e("esri-atomics")};function C(t,e){return i=>e(t(i))}class R{constructor(t,e,i,s){this.size=0,this.texelSize=4;const{pixelType:r,layout:a,textureOnly:o}=s;this.textureOnly=o||!1,this.pixelType=r,this._ctype=e,this.layout=a,this._resetRange(),this._shared=t,this.size=i,o||(this.data=this._initData(r,i,t,e))}get buffer(){return l(this.data,(t=>t.buffer))}unsetComponentAllTexels(t,e){const i=h(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=h(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=h(this.data);for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){h(this.data)[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){h(this.data)[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=T(t);return h(this.data)[i*this.texelSize+e]}setData(t,e,i){const s=T(t),r=1<<e;0!=(this.layout&r)?(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):U.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){this.pixelType===k.UNSIGNED_BYTE&&this._shared&&B.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){this.pixelType===k.UNSIGNED_BYTE&&this._shared&&B.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t,this._shared,this._ctype),i=h(this.data);e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!(this._shared||"local"===this._ctype),r=this.pixelType,a=this.layout,o=h(this.data);return{start:t,end:e,data:s&&o.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e,i,s){const r=i&&"local"!==s?SharedArrayBuffer:ArrayBuffer,a=w(t),o=new a(new r(e*e*4*a.BYTES_PER_ELEMENT));for(let n=0;n<o.length;n+=4)o[n+1]=255;return o}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class M{constructor(t,e){this._client=t,this.config=e,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(_),this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._idsToHighlight=new Set;const i=e.supportsTextureFloat?k.FLOAT:k.UNSIGNED_BYTE;F(`Creating AttributeStore ${B.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:k.UNSIGNED_BYTE,layout:1},{pixelType:k.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:i,layout:15},{pixelType:i,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}update(t,i){this.config=i;const s=i.schema.processors[0].storage,o=d(this._schema,s);if((t.targets.feature||t.targets.aggregate)&&(t.storage.data=!0),o&&(e("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",o),t.storage.data=!0,this._schema=s,this._attributeComputeMap.clear(),!r(s))){switch(s.target){case"feature":this._targetType=b;break;case"aggregate":this._targetType=x}if("subtype"===s.type)for(const t in s.mapping){const e=s.mapping[t];if(a(e))for(const t of e.mapping)this._bindAttribute(t)}else for(const t of s.mapping)this._bindAttribute(t)}}onTileData(t,e){if(r(e.addOrUpdate))return;const i=e.addOrUpdate.getCursor();for(;i.next();){const t=i.getDisplayId();this.setAttributeData(t,i)}}invalidateResources(){this._createResourcesPromise=null,this._abortController.abort(),this._abortController=new AbortController}async setHighlight(t,e){const i=1,s=this._getBlock(0),r=e.map((t=>T(t)));s.lock(),s.unsetComponentAllTexels(0,i),s.setComponent(0,i,r),s.unlock(),this._idsToHighlight.clear();for(const a of t)this._idsToHighlight.add(a);await this.sendUpdates()}async updateFilters(t,i){const{config:s,service:r,spatialReference:a}=i,{filters:o}=s,n=o.map(((t,e)=>this._updateFilter(t,e,r,a)));(await Promise.all(n)).some((t=>t))&&(t.storage.filters=!0,e("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(t,e,i,s){const r=T(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlag(t){return this._idsToHighlight.has(t)?g:0}unsetAttributeData(t){const e=T(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e){const i=T(t);if(this._ensureSizeForTexel(i),this._getBlock(0).setData(i,0,this.getFilterFlags(e)),this._targetType!==z(t))return;const r=this._attributeComputeMap,a=this.config.supportsTextureFloat?1:2,o=4;r.size&&r.forEach(((t,r)=>{const n=r*a%o,l=Math.floor(r*a/o),h=this._getBlock(l+f),c=t(e);if(this.config.supportsTextureFloat)h.setData(i,n,c);else if(c===m)h.setData(i,n,255),h.setData(i,n+1,255);else{const t=s(Math.round(c),-32767,32766)+32768,e=255&t,r=(65280&t)>>8;h.setData(i,n,e),h.setData(i,n+1,r)}}))}sendUpdates(){if(this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=c(),this._nextUpdate.promise;const e={blocks:this._blocks.map((t=>a(t)?t.toMessage():null))};return this._currUpdate=this._createResources().then((()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const t=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then((()=>t.resolve()))}},i=this._client.update(e,this._signal).then(t).catch(t);return this._client.render(this._signal),i})).catch((e=>u(e)?(this._createResourcesPromise=null,this._createResources()):(U.error(new t("mapview-attribute-store","Encountered an error during client update",e)),Promise.resolve()))),this._currUpdate}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}_bindAttribute(t){function e(){return t.normalizationField?e=>{const i=e.readAttribute(t.normalizationField);if(!i)return null;return e.readAttribute(t.field)/i}:e=>e.readAttribute(t.field)}function i(){return t.normalizationField&&U.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),e=>e.getComputedNumericAtIndex(t.fieldIndex)}let s;if(null!=t.fieldIndex)s=i();else{if(!t.field)return;s=e()}if(t.valueRepresentation){s=C(s,(e=>D(e,t.valueRepresentation)))}const r=t=>null===t||isNaN(t)||t===1/0?m:t;this._attributeComputeMap.set(t.binding,C(s,r))}_createResources(){if(a(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(y),F("Initializing AttributeStore");const e={shared:B.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:o(this._blocks,(t=>({textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType})))},i=this._client.initialize(e,this._signal).catch((e=>{u(e)?this._createResourcesPromise=null:U.error(new t("mapview-attribute-store","Encountered an error during client initialization",e))}));return this._createResourcesPromise=i,i.then((()=>r(this._createResourcesPromise)?this._createResources():void 0)),i}_getBlock(t){const e=this._blocks[t];if(a(e))return e;F(`Initializing AttributeBlock at index ${t}`);const i=B.sharedArrayBuffer,s=this._client.type,r=new R(i,s,this._size,this._blockDescriptors[t]);return this._blocks[t]=r,this._createResourcesPromise=null,r}_expand(){if(this._size<this.config.maxTextureSize){const t=this._size<<=1;return F("Expanding block size to",t,this._blocks),n(this._blocks,(e=>e.expand(t))),this._createResourcesPromise=null,this._size=t,0}return U.error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(t,e,i,s){const o=this._filters[e],n=a(o)&&o.hash;if(!o&&!t)return!1;if(n===JSON.stringify(t))return!1;if(r(t)){if(!o)return!1;const t=1<<e+1,i=this._getBlock(0);return this._filters[e]=null,i.setComponentAllTexels(0,t),this.sendUpdates(),!0}const l=await this._getFilter(e,i);return await l.update(t,s),!0}async _getFilter(t,e){const i=this._filters[t];if(a(i))return i;const{default:s}=await import("./FeatureFilter.js"),r=new s({geometryType:e.geometryType,hasM:!1,hasZ:!1,timeInfo:e.timeInfo,fieldsIndex:new p(e.fields)});return this._filters[t]=r,r}isVisible(t){return!!(2&this._getBlock(0).getData(t,0))}getFilterFlags(t){let e=0;const i=S(t.getDisplayId());for(let a=0;a<this._filters.length;a++){const s=!!(i&1<<a),o=this._filters[a];e|=(!s||r(o)||o.check(t)?1:0)<<a}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlag(e)}return e<<1|s}}export{M as default};
|
|
5
|
+
import t from"../../../../../core/Error.js";import e from"../../../../../core/has.js";import i from"../../../../../core/Logger.js";import{clamp as s}from"../../../../../core/mathUtils.js";import{isNone as r,isSome as a,mapMany as o,forEachSome as n,applySome as l,unwrap as h}from"../../../../../core/maybe.js";import{createResolver as c,isAbortError as u}from"../../../../../core/promiseUtils.js";import{diff as d}from"../../../../../core/accessorSupport/diffUtils.js";import p from"../../../../../layers/support/FieldsIndex.js";import{MAX_FILTERS as _,HIGHLIGHT_FLAG as g,ATTRIBUTE_DATA_VV as f,NAN_MAGIC_NUMBER as m,ATTRIBUTE_DATA_ANIMATION as y}from"../../../engine/webgl/definitions.js";import{DISPLAY_ID_TYPE_AGGREGATE as x,DISPLAY_ID_TYPE_FEATURE as b,getDisplayIdTexel as T,getDisplayIdType as z,getDisplayIdFilterMask as S}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as w}from"../../../engine/webgl/Utils.js";import{createDebugLogger as A,DEBUG_ATTR_UPDATES as E}from"../../../engine/webgl/util/debug.js";import{getVisualVariableSizeValueRepresentationRatio as D}from"../tileRenderers/support/visualVariablesUtils.js";import{PixelType as k}from"../../../../webgl/enums.js";const U=i.getLogger("esri.views.layers.2d.features.support.AttributeStore"),F=A(E,U),B={sharedArrayBuffer:e("esri-shared-array-buffer"),atomics:e("esri-atomics")};function C(t,e){return i=>e(t(i))}class R{constructor(t,e,i,s){this.size=0,this.texelSize=4;const{pixelType:r,layout:a,textureOnly:o}=s;this.textureOnly=o||!1,this.pixelType=r,this._ctype=e,this.layout=a,this._resetRange(),this._shared=t,this.size=i,o||(this.data=this._initData(r,i,t,e))}get buffer(){return l(this.data,(t=>t.buffer))}unsetComponentAllTexels(t,e){const i=h(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=h(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=h(this.data);for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){h(this.data)[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){h(this.data)[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=T(t);return h(this.data)[i*this.texelSize+e]}setData(t,e,i){const s=T(t),r=1<<e;0!=(this.layout&r)?(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):U.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){this.pixelType===k.UNSIGNED_BYTE&&this._shared&&B.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){this.pixelType===k.UNSIGNED_BYTE&&this._shared&&B.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t,this._shared,this._ctype),i=h(this.data);e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!(this._shared||"local"===this._ctype),r=this.pixelType,a=this.layout,o=h(this.data);return{start:t,end:e,data:s&&o.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e,i,s){const r=i&&"local"!==s?SharedArrayBuffer:ArrayBuffer,a=w(t),o=new a(new r(e*e*4*a.BYTES_PER_ELEMENT));for(let n=0;n<o.length;n+=4)o[n+1]=255;return o}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class M{constructor(t,e){this._client=t,this.config=e,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(_),this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._idsToHighlight=new Set;const i=e.supportsTextureFloat?k.FLOAT:k.UNSIGNED_BYTE;F(`Creating AttributeStore ${B.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:k.UNSIGNED_BYTE,layout:1},{pixelType:k.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:i,layout:15},{pixelType:i,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}update(t,i){this.config=i;const s=i.schema.processors[0].storage,o=d(this._schema,s);if((t.targets.feature||t.targets.aggregate)&&(t.storage.data=!0),o&&(e("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",o),t.storage.data=!0,this._schema=s,this._attributeComputeMap.clear(),!r(s))){switch(s.target){case"feature":this._targetType=b;break;case"aggregate":this._targetType=x}if("subtype"===s.type)for(const t in s.mapping){const e=s.mapping[t];if(a(e))for(const t of e.mapping)this._bindAttribute(t)}else for(const t of s.mapping)this._bindAttribute(t)}}onTileData(t,e){if(r(e.addOrUpdate))return;const i=e.addOrUpdate.getCursor();for(;i.next();){const t=i.getDisplayId();this.setAttributeData(t,i)}}invalidateResources(){this._createResourcesPromise=null,this._abortController.abort(),this._abortController=new AbortController}async setHighlight(t,e){const i=1,s=this._getBlock(0),r=e.map((t=>T(t)));s.lock(),s.unsetComponentAllTexels(0,i),s.setComponent(0,i,r),s.unlock(),this._idsToHighlight.clear();for(const a of t)this._idsToHighlight.add(a);await this.sendUpdates()}async updateFilters(t,i){const{config:s,service:r,spatialReference:a}=i,{filters:o}=s,n=o.map(((t,e)=>this._updateFilter(t,e,r,a)));(await Promise.all(n)).some((t=>t))&&(t.storage.filters=!0,e("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(t,e,i,s){const r=T(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlag(t){return this._idsToHighlight.has(t)?g:0}unsetAttributeData(t){const e=T(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e){const i=T(t);if(this._ensureSizeForTexel(i),this._getBlock(0).setData(i,0,this.getFilterFlags(e)),this._targetType!==z(t))return;const r=this._attributeComputeMap,a=this.config.supportsTextureFloat?1:2,o=4;r.size&&r.forEach(((t,r)=>{const n=r*a%o,l=Math.floor(r*a/o),h=this._getBlock(l+f),c=t(e);if(this.config.supportsTextureFloat)h.setData(i,n,c);else if(c===m)h.setData(i,n,255),h.setData(i,n+1,255);else{const t=s(Math.round(c),-32767,32766)+32768,e=255&t,r=(65280&t)>>8;h.setData(i,n,e),h.setData(i,n+1,r)}}))}sendUpdates(){if(this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=c(),this._nextUpdate.promise;const e={blocks:this._blocks.map((t=>a(t)?t.toMessage():null))};return this._currUpdate=this._createResources().then((()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const t=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then((()=>t.resolve()))}},i=this._client.update(e,this._signal).then(t).catch(t);return this._client.render(this._signal),i})).catch((e=>u(e)?(this._createResourcesPromise=null,this._createResources()):(U.error(new t("mapview-attribute-store","Encountered an error during client update",e)),Promise.resolve()))),this._currUpdate}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}_bindAttribute(t){function e(){return t.normalizationField?e=>{const i=e.readAttribute(t.normalizationField);if(!i)return null;return e.readAttribute(t.field)/i}:e=>e.readAttribute(t.field)}function i(){return t.normalizationField&&U.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),e=>e.getComputedNumericAtIndex(t.fieldIndex)}let s;if(null!=t.fieldIndex)s=i();else{if(!t.field)return;s=e()}if(t.valueRepresentation){s=C(s,(e=>D(e,t.valueRepresentation)))}const r=t=>null===t||isNaN(t)||t===1/0?m:t;this._attributeComputeMap.set(t.binding,C(s,r))}_createResources(){if(a(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(y),F("Initializing AttributeStore");const e={shared:B.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:o(this._blocks,(t=>({textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType})))},i=this._client.initialize(e,this._signal).catch((e=>{u(e)?this._createResourcesPromise=null:U.error(new t("mapview-attribute-store","Encountered an error during client initialization",e))}));return this._createResourcesPromise=i,i.then((()=>r(this._createResourcesPromise)?this._createResources():void 0)),i}_getBlock(t){const e=this._blocks[t];if(a(e))return e;F(`Initializing AttributeBlock at index ${t}`);const i=B.sharedArrayBuffer,s=this._client.type,r=new R(i,s,this._size,this._blockDescriptors[t]);return this._blocks[t]=r,this._createResourcesPromise=null,r}_expand(){if(this._size<this.config.maxTextureSize){const t=this._size<<=1;return F("Expanding block size to",t,this._blocks),n(this._blocks,(e=>e.expand(t))),this._createResourcesPromise=null,this._size=t,0}return U.error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(t,e,i,s){const o=this._filters[e],n=a(o)&&o.hash;if(!o&&!t)return!1;if(n===JSON.stringify(t))return!1;if(r(t)){if(!o)return!1;const t=1<<e+1,i=this._getBlock(0);return this._filters[e]=null,i.setComponentAllTexels(0,t),this.sendUpdates(),!0}const l=await this._getFilter(e,i);return await l.update(t,s),!0}async _getFilter(t,e){const i=this._filters[t];if(a(i))return i;const{default:s}=await import("./FeatureFilter.js"),r=new s({geometryType:e.geometryType,hasM:!1,hasZ:!1,timeInfo:e.timeInfo,fieldsIndex:new p(e.fields)});return this._filters[t]=r,r}isVisible(t){return!!(2&this._getBlock(0).getData(t,0))}getFilterFlags(t){let e=0;const i=S(t.getDisplayId());for(let a=0;a<this._filters.length;a++){const s=!!(i&1<<a),o=this._filters[a];e|=(!s||r(o)||o.check(t)?1:0)<<a}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlag(e)}return e<<1|s}}export{M as default};
|