@arcgis/core 5.2.0-next.147 → 5.2.0-next.149
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/03afeefb9d16b6f1d844.js +1 -0
- package/assets/esri/core/workers/chunks/09b9a886363bc1197785.js +1 -0
- package/assets/esri/core/workers/chunks/0ad0484ffcbe4ad21bd3.js +1 -0
- package/assets/esri/core/workers/chunks/{72019baeba520edb6bb0.js → 112befb3b5b406f29298.js} +1 -1
- package/assets/esri/core/workers/chunks/12a7997a40c77f5c9160.js +1 -0
- package/assets/esri/core/workers/chunks/18787aa685524b958561.js +1 -0
- package/assets/esri/core/workers/chunks/{776ae25a34352d3468bc.js → 19743dedaa40446259ec.js} +1 -1
- package/assets/esri/core/workers/chunks/{6dd0b79fa3a629ab4f27.js → 1bca39e0e651426bdbb5.js} +1 -1
- package/assets/esri/core/workers/chunks/{8b1c17cc52d989924313.js → 21f45a47708e6e43147f.js} +1 -1
- package/assets/esri/core/workers/chunks/2c626f525f3483c03477.js +1 -0
- package/assets/esri/core/workers/chunks/2d9a1f23ec6ce90723ac.js +1 -0
- package/assets/esri/core/workers/chunks/{7a05b18f655c1167ce0a.js → 2ef5237e4c876d6a4ee0.js} +1 -1
- package/assets/esri/core/workers/chunks/{79c83f4e066682543ca1.js → 320e5942a098dd104366.js} +1 -1
- package/assets/esri/core/workers/chunks/407f1e8176f3b0af73b4.js +1 -0
- package/assets/esri/core/workers/chunks/{1ba0dfbe0958cdbd7c9f.js → 42fd2a7b22b03dacc6a7.js} +1 -1
- package/assets/esri/core/workers/chunks/444e5f214abce3d607cd.js +1 -0
- package/assets/esri/core/workers/chunks/45367aa8e5c5d574de94.js +1 -0
- package/assets/esri/core/workers/chunks/47d074136a7f8e551a9a.js +1 -0
- package/assets/esri/core/workers/chunks/4a6b92ecbb1f1c55cc43.js +1 -0
- package/assets/esri/core/workers/chunks/4fc337240e7cddd0e988.js +1 -0
- package/assets/esri/core/workers/chunks/{24cc7b6b5e307a89cdd5.js → 50036a323c2e7f155311.js} +1 -1
- package/assets/esri/core/workers/chunks/5116b569a8dbda4910c8.js +1 -0
- package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +1 -0
- package/assets/esri/core/workers/chunks/{b2737120c5999b2f3909.js → 55dcbf296d8d0092e473.js} +1 -1
- package/assets/esri/core/workers/chunks/{5c855af73ee3c3e764fb.js → 5732fdf6d8b87739aeea.js} +1 -1
- package/assets/esri/core/workers/chunks/5924ec3167a2941ebb1f.js +1 -0
- package/assets/esri/core/workers/chunks/5fa1ec357c3ad1f91bc7.js +1 -0
- package/assets/esri/core/workers/chunks/606ea251075fe81a1206.js +1 -0
- package/assets/esri/core/workers/chunks/{ceb680688fe7e570a774.js → 608be1172a908e92b9f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{6f358116f79021ff9687.js → 612104dff305ff062dfa.js} +2 -2
- package/assets/esri/core/workers/chunks/6299be5e7e26bf3c6859.js +1 -0
- package/assets/esri/core/workers/chunks/68be3fb88ca61f82fb90.js +1 -0
- package/assets/esri/core/workers/chunks/6b04285726b803b82564.js +1 -0
- package/assets/esri/core/workers/chunks/6c9266120d46e8c69dbf.js +1 -0
- package/assets/esri/core/workers/chunks/6c9acd9e4e201dc380e9.js +1 -0
- package/assets/esri/core/workers/chunks/6eb5cc8ddf772c0062e6.js +1 -0
- package/assets/esri/core/workers/chunks/709e019885822b1f6f3e.js +1 -0
- package/assets/esri/core/workers/chunks/731018c0deffc41ffc97.js +1 -0
- package/assets/esri/core/workers/chunks/7320a4913b6cad7cc5d7.js +1 -0
- package/assets/esri/core/workers/chunks/7449568eb2305bf2d650.js +1 -0
- package/assets/esri/core/workers/chunks/7572c2bc5062e66f6330.js +1 -0
- package/assets/esri/core/workers/chunks/7d212c415f2709037408.js +1 -0
- package/assets/esri/core/workers/chunks/7f0f9dddc44b1f1600f0.js +1 -0
- package/assets/esri/core/workers/chunks/8293600f94553afc8c38.js +1 -0
- package/assets/esri/core/workers/chunks/{c18189710d6198516175.js → 830ab9b8d000169da675.js} +1 -1
- package/assets/esri/core/workers/chunks/8414ffd937c1099e0bbc.js +1 -0
- package/assets/esri/core/workers/chunks/{700b1d5bc67b7e1b3ff3.js → 8aa80b892fde552577e8.js} +1 -1
- package/assets/esri/core/workers/chunks/900181f68449d8f82eeb.js +1 -0
- package/assets/esri/core/workers/chunks/925271bb763607a326ae.js +1 -0
- package/assets/esri/core/workers/chunks/937824bc7948f7bc7845.js +1 -0
- package/assets/esri/core/workers/chunks/939942b00ba380e2957e.js +1 -0
- package/assets/esri/core/workers/chunks/97d6ef9e34a43ad2e556.js +1 -0
- package/assets/esri/core/workers/chunks/{c76c42c74eedd43263d3.js → 9dd1fc56eb1ea6eb705e.js} +1 -1
- package/assets/esri/core/workers/chunks/a07cb6a2f5b66d4e9f15.js +1 -0
- package/assets/esri/core/workers/chunks/a40b6d8b5c73e06e14d4.js +1 -0
- package/assets/esri/core/workers/chunks/a7f3576208f295b670d6.js +1 -0
- package/assets/esri/core/workers/chunks/a80e49acc827dbf3b524.js +1 -0
- package/assets/esri/core/workers/chunks/aeaaff7a4b1a99540f52.js +1 -0
- package/assets/esri/core/workers/chunks/af349c7bc8ef41a0e1bd.js +1 -0
- package/assets/esri/core/workers/chunks/afc3b2af20e9d1dfd260.js +1 -0
- package/assets/esri/core/workers/chunks/b19b6102ed2d6f67b43b.js +1 -0
- package/assets/esri/core/workers/chunks/b1b4066e8d1c0c9656e5.js +1 -0
- package/assets/esri/core/workers/chunks/b4334713bacdfe40ce3d.js +1 -0
- package/assets/esri/core/workers/chunks/{6883a5c6883eccaddf64.js → b6ba66a05030d3815dfd.js} +1 -1
- package/assets/esri/core/workers/chunks/bbec9d2e3b75a5c59681.js +1 -0
- package/assets/esri/core/workers/chunks/{9ab25ee06041f907b9a2.js → c2c1f51a4668055c2838.js} +1 -1
- package/assets/esri/core/workers/chunks/c337fc0e6dc69c233e6d.js +1 -0
- package/assets/esri/core/workers/chunks/c598b22f78ccc57f9d6d.js +1 -0
- package/assets/esri/core/workers/chunks/c5d85be6e16bc895e7fb.js +1 -0
- package/assets/esri/core/workers/chunks/c62738f84c914671b143.js +1 -0
- package/assets/esri/core/workers/chunks/c8d178a0c82fffd7fed5.js +1 -0
- package/assets/esri/core/workers/chunks/c8d6bb5cca49926a0214.js +1 -0
- package/assets/esri/core/workers/chunks/cde4b044e013b9e41591.js +1 -0
- package/assets/esri/core/workers/chunks/{a7985d20fa6e8d4878e7.js → d0f5bee9db1ad51ae687.js} +1 -1
- package/assets/esri/core/workers/chunks/d2347d6aa1c57fd57029.js +1 -0
- package/assets/esri/core/workers/chunks/dca35dbe427605ef6fcc.js +1 -0
- package/assets/esri/core/workers/chunks/e0351753f6b4d1adf11e.js +1 -0
- package/assets/esri/core/workers/chunks/{534186fc921a0ccf58dc.js → e1f5d00878f27e1d413e.js} +1 -1
- package/assets/esri/core/workers/chunks/f1df76f098a3cc924832.js +1 -0
- package/assets/esri/core/workers/chunks/f4f9d08b2df856e3b694.js +1 -0
- package/assets/esri/core/workers/chunks/{711cfb84659cb4437679.js → f528ac5c648ca6a98582.js} +1 -1
- package/assets/esri/core/workers/chunks/f8a83d447b7aef051876.js +1 -0
- package/assets/esri/core/workers/chunks/fc44227c1756f65b95df.js +1 -0
- package/assets/esri/core/workers/chunks/fdbf6208df5c58746d9d.js +1 -0
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-TW.json +1 -1
- package/config.js +1 -1
- package/core/Loadable.js +1 -1
- package/geometry/HeightModelInfo.js +1 -1
- package/geometry/support/TileClipper.js +1 -1
- package/geometry/support/meshUtils.d.ts +1 -1
- package/geometry/support/scaleUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/BaseDynamicLayer.d.ts +1 -0
- package/layers/BaseElevationLayer.d.ts +2 -0
- package/layers/BaseTileLayer.d.ts +12 -9
- package/layers/CSVLayer.d.ts +1 -16
- package/layers/CatalogLayer.d.ts +1 -1
- package/layers/FeatureLayer.d.ts +3 -16
- package/layers/GeoJSONLayer.d.ts +1 -53
- package/layers/GeoRSSLayer.d.ts +0 -44
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/ParquetLayer.d.ts +84 -5
- package/layers/ParquetLayer.js +1 -1
- package/layers/SceneLayer.d.ts +4 -5
- package/layers/SceneLayer.js +1 -1
- package/layers/SketchLayer.d.ts +0 -1
- package/layers/SubtypeGroupLayer.d.ts +1 -1
- package/layers/VectorTileLayer.d.ts +2 -12
- package/layers/WFSLayer.d.ts +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.d.ts +1 -1
- package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
- package/layers/mixins/ArcGISImageService.d.ts +1 -1
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/mixins/RefreshableLayer.d.ts +1 -3
- package/layers/mixins/ScaleRangeLayer.js +1 -1
- package/layers/mixins/SublayersOwner.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/core/utils.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
- package/layers/support/FeatureFilter.d.ts +1 -1
- package/layers/support/ParquetPortalItemData.js +1 -1
- package/layers/support/PortalItemData.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.d.ts +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/layersLoader.js +1 -1
- package/package.json +2 -2
- package/popup/FeaturesModel.d.ts +27 -6
- package/popup/FeaturesModel.js +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/renderers/VectorFieldRenderer.d.ts +4 -4
- package/rest/print.js +1 -1
- package/rest/support/printTaskUtils.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/dotDensity.js +1 -1
- package/smartMapping/renderers/heatmap.js +1 -1
- package/smartMapping/renderers/pieChart.js +1 -1
- package/smartMapping/renderers/type.js +1 -1
- package/smartMapping/statistics/heatmapStatistics.js +1 -1
- package/smartMapping/statistics/histogram.js +1 -1
- package/smartMapping/statistics/summaryStatistics.js +1 -1
- package/smartMapping/statistics/summaryStatisticsForAttributes.js +1 -1
- package/smartMapping/statistics/uniqueValues.js +1 -1
- package/smartMapping/support/adapters/support/layerUtils.js +1 -1
- package/smartMapping/types.d.ts +3 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/types.d.ts +3 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/support/popupHitTest.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/DOMContainer.d.ts +27 -9
- package/views/DOMContainer.js +1 -1
- package/views/PopupView.d.ts +6 -0
- package/views/VideoView.d.ts +27 -9
- package/views/View.d.ts +16 -7
- package/views/View.js +1 -1
- package/views/View2D.d.ts +1 -1
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/interactive/snapping/FeatureSnappingSourceInfo.js +1 -1
- package/views/interactive/snapping/SnappingManagerPool.js +1 -1
- package/views/interactive/snapping/SnappingOptions.d.ts +1 -1
- package/views/interactive/tooltip/components/ElevationModeSelect.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +2 -3
- package/views/layers/LayerView.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +3 -4
- package/views/layers/ParquetLayerView.d.ts +15 -0
- package/views/layers/PointCloudLayerView.d.ts +1 -1
- package/views/layers/SceneLayerView.d.ts +1 -1
- package/views/layers/ViewshedLayerView.d.ts +5 -6
- package/views/support/layerViewUtils.js +1 -1
- package/webdoc/support/saveUtils.js +1 -1
- package/webdoc/support/unsupportedErrors.js +1 -1
- package/widgets/Editor.d.ts +10 -0
- package/widgets/Legend.d.ts +1 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/draw/HeightMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
- package/widgets/support/SnappingControls.d.ts +1 -1
- package/assets/esri/core/workers/chunks/00a600c71ceebe7bfeee.js +0 -1
- package/assets/esri/core/workers/chunks/0193df3f9fb23633da87.js +0 -1
- package/assets/esri/core/workers/chunks/050c4b212f2b5691db34.js +0 -1
- package/assets/esri/core/workers/chunks/05963f57cbe5a5249496.js +0 -1
- package/assets/esri/core/workers/chunks/06e7400f5ebe0719b81c.js +0 -1
- package/assets/esri/core/workers/chunks/07aa6d36f1006b6ab7ff.js +0 -1
- package/assets/esri/core/workers/chunks/0bb11751efa2023ec937.js +0 -1
- package/assets/esri/core/workers/chunks/14a3808427deaaa85bf2.js +0 -1
- package/assets/esri/core/workers/chunks/1a6027f08893aba9e677.js +0 -1
- package/assets/esri/core/workers/chunks/2062d46f638eabfc9499.js +0 -1
- package/assets/esri/core/workers/chunks/2164fcaced72b0fda31f.js +0 -1
- package/assets/esri/core/workers/chunks/222af8522773c7dc80b1.js +0 -1
- package/assets/esri/core/workers/chunks/25b0885d3bc190b28c04.js +0 -1
- package/assets/esri/core/workers/chunks/303fde8f3459dde16555.js +0 -1
- package/assets/esri/core/workers/chunks/305a718719ef15fda90c.js +0 -1
- package/assets/esri/core/workers/chunks/347bf269c2b1583d2dca.js +0 -1
- package/assets/esri/core/workers/chunks/350540770781b281c39a.js +0 -1
- package/assets/esri/core/workers/chunks/392bcef780df52fb4cca.js +0 -1
- package/assets/esri/core/workers/chunks/3b017b718ea2d4ed498f.js +0 -1
- package/assets/esri/core/workers/chunks/3e81dfc9d621ece038fe.js +0 -1
- package/assets/esri/core/workers/chunks/4479a166b5ac8db1e12e.js +0 -1
- package/assets/esri/core/workers/chunks/46b2d4addfc73f9183a4.js +0 -1
- package/assets/esri/core/workers/chunks/4d82db661365daa513a6.js +0 -1
- package/assets/esri/core/workers/chunks/4ed8655770a3e018e366.js +0 -1
- package/assets/esri/core/workers/chunks/4f48d45baa8ada16f579.js +0 -1
- package/assets/esri/core/workers/chunks/50ca55ad2f5421acc492.js +0 -1
- package/assets/esri/core/workers/chunks/5450f339f97b2b042ee2.js +0 -1
- package/assets/esri/core/workers/chunks/55cc8581978c71b17998.js +0 -1
- package/assets/esri/core/workers/chunks/5ea8809b6519c05ad9f6.js +0 -1
- package/assets/esri/core/workers/chunks/62795a1573cbaa4b8e7a.js +0 -1
- package/assets/esri/core/workers/chunks/633a9051580c5302d2f7.js +0 -1
- package/assets/esri/core/workers/chunks/641d196a554bd07f729e.js +0 -1
- package/assets/esri/core/workers/chunks/655c3afda1eef01611dd.js +0 -1
- package/assets/esri/core/workers/chunks/6569797d3c22442e5e97.js +0 -1
- package/assets/esri/core/workers/chunks/70793967db45fb142962.js +0 -1
- package/assets/esri/core/workers/chunks/794e5a67a88cb10c1a19.js +0 -1
- package/assets/esri/core/workers/chunks/798a63653f82c0e842c5.js +0 -1
- package/assets/esri/core/workers/chunks/820f41d66b2056a3ebc8.js +0 -1
- package/assets/esri/core/workers/chunks/841f67baf6a1634ada48.js +0 -1
- package/assets/esri/core/workers/chunks/84fcbf7a1d04f01685d1.js +0 -1
- package/assets/esri/core/workers/chunks/8e511079918e2fd9261f.js +0 -1
- package/assets/esri/core/workers/chunks/8fcfd515ee1b18c902e5.js +0 -1
- package/assets/esri/core/workers/chunks/9001e9a1e81bce175ddd.js +0 -1
- package/assets/esri/core/workers/chunks/94c5f3bc07fe516dafbe.js +0 -1
- package/assets/esri/core/workers/chunks/956a40f40bde416efe93.js +0 -1
- package/assets/esri/core/workers/chunks/95b82cbbe355266c65d7.js +0 -1
- package/assets/esri/core/workers/chunks/97dbbedea9fe03bd1306.js +0 -1
- package/assets/esri/core/workers/chunks/9c0fd8baa00ee9733ba4.js +0 -1
- package/assets/esri/core/workers/chunks/9c1e69ac82e2bf746191.js +0 -1
- package/assets/esri/core/workers/chunks/a010d2e4e34eb7bc1fec.js +0 -1
- package/assets/esri/core/workers/chunks/a05790444115e4cf1bcc.js +0 -1
- package/assets/esri/core/workers/chunks/a52bf03bffb6ffac3b54.js +0 -1
- package/assets/esri/core/workers/chunks/a7edf7541569fef77cb3.js +0 -1
- package/assets/esri/core/workers/chunks/b2c29bc48c7b3b0c9357.js +0 -1
- package/assets/esri/core/workers/chunks/b7d77dd2abb255fd2e5a.js +0 -1
- package/assets/esri/core/workers/chunks/b8054adc45bca069b948.js +0 -1
- package/assets/esri/core/workers/chunks/ba46869e700ba1d2787f.js +0 -1
- package/assets/esri/core/workers/chunks/ba48045a81acc4cda927.js +0 -1
- package/assets/esri/core/workers/chunks/ca7fb75e2c62e7d37122.js +0 -1
- package/assets/esri/core/workers/chunks/d01381b548c204835509.js +0 -1
- package/assets/esri/core/workers/chunks/d21257d2e2a37266c0f7.js +0 -1
- package/assets/esri/core/workers/chunks/d270cc9807161033686e.js +0 -1
- package/assets/esri/core/workers/chunks/d4f038e04c42aed588c1.js +0 -1
- package/assets/esri/core/workers/chunks/e32b96c08cb272a59851.js +0 -1
- package/assets/esri/core/workers/chunks/e7c60bd85abbd36cdc64.js +0 -1
- package/assets/esri/core/workers/chunks/f05de08e194a3f9b96f2.js +0 -1
- package/assets/esri/core/workers/chunks/f0a68d2900d24f56afa0.js +0 -1
- package/assets/esri/core/workers/chunks/f511a304e9dea9eb3e01.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{id as t}from"../../../kernel.js";import{ClonableMixin as n}from"../../../core/Clonable.js";import r from"../../../core/Error.js";import{JSONSupport as i}from"../../../core/JSONSupport.js";import a from"../../../core/Logger.js";import{isAbsolute as o,addQueryParameter as s}from"../../../core/urlUtils.js";import{property as c,cast as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import d from"../../../geometry/Point.js";import{getGeometryZScaler as f}from"../../../geometry/support/zscale.js";import p from"./CameraOrientation.js";import m from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as h,getEffectiveElevationSource as g,getArcGISServerUrl as _,getMetersPerUnitOfSR as v,orientedImageryTypeMap as y}from"./utils.js";import{ltpToGeographic as b}from"../transformations/utils.js";import{reader as x}from"../../../core/accessorSupport/decorators/reader.js";import{writer as S}from"../../../core/accessorSupport/decorators/writer.js";import{enumeration as C}from"../../../core/accessorSupport/decorators/enumeration.js";function w(e){throw new r(`exposure-point:missing-default-value`,`a value for ${e} is missing in default properties`)}function T(e,t){throw new r(`exposure-point:missing-attribute-value`,`a value for ${e} is missing in attribute table`,{exposurePoint:t})}function E(e){return e.trim().replaceAll(`\\`,`/`).replace(/^\/+/,``)}function D(e,t){return o(e)?e:h(e,t.imagePathPrefix,t.imagePathSuffix)}function O(e,t){if(o(e))return e;let n=t.url?_(t.url):null;return n?`${n}/${E(e)}`:null}function k(e){return t?.findCredential(e.url)?.token??null}function A(e,t){let n=k(t);return n?s(e,`token`,n):e}const j=e=>({cast:e=>{let t=parseFloat(e);return Number.isFinite(t)?t:void 0},json:{name:e,write:{writer:(e,t,n)=>{t[n]=Number.isFinite(e)?e:void 0}}}}),M=e=>({cast:e=>typeof e==`string`?e.split(`;`).map(Number):e,json:{default:e,write:{writer:(e,t,n)=>{t[n]=e?.join(`;`)}}}}),N=`$virtualCacheDirectory:`,P=new Set([`location`]);let F=class extends n(i){constructor(e){super(e),this._geometry=null,this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,t){let n={},{attributes:r,geometry:i}=e,a={};for(let e in r)P.has(e.toLowerCase())||(n[e.toLowerCase()]=r[e],a[e.toLowerCase()]=e);let o=e.layer??{},s=o.effectiveSequenceOrderField,c=null;s?.length&&(s.map(e=>e.fieldName).forEach(e=>{a[e.toLowerCase()]=e}),c=s.map(e=>({value:r[e.fieldName],...e}))),super.read({geometry:i,layer:o,sourceMap:a,sequenceOrder:c,...n},t)}write(e,t){let n=super.write(e,t),{sourceMap:r}=this;if(!r||!n)return n;let i={};for(let e in n){let t=r[e.toLowerCase()];t&&(i[t]=n[e])}return i}readCameraHeading(e,t){let{cameraheading:n,camheading:r,layer:i}=t;return n??r??i.cameraHeading}readCameraHeight(e,t){let{cameraheight:n,avghtag:r,layer:i}=t;return n??r??i.cameraHeight}readCamOffset(e,t){let{cameraoffset:n,camoffset:r}=t;return n?.split(`;`).map(Number)??r?.split(`;`).map(Number)??null}writeCameraOffset(e,t){e&&(t.cameraOffset=e.join(`;`))}readCameraOrientation(e,t){let{cameraorientation:n,camori:r}=t;return n??r}readCameraPitch(e,t){let{camerapitch:n,campitch:r,layer:i}=t;return n??r??i.cameraPitch}readCameraRoll(e,t){let{cameraroll:n,camroll:r,layer:i}=t;return n??r??i.cameraRoll}readDepthImage(e,t){let{depthimage:n,depthimg:r,layer:i}=t,a=n??r??null,{depthImagePathPrefix:o,depthImagePathSuffix:s}=i??{};return h(a,o,s)}readElevationSource(e,t){let{elevationsource:n,layer:r}=t,{demPathSuffix:i,demPathPrefix:a}=r;if(n){let e=this._parseIfJSON(n);return g(e,a,i)}return r.effectiveElevationSource}readFarDistance(e,t){let{fardistance:n,fardist:r,layer:i}=t;return n??r??i.farDistance}get geometry(){let e=this._geometry.clone();if(!e)return null;let{cameraOffset:t}=this;if(t){let[n,r,i]=t;e.x+=n,e.y+=r,e.z!=null&&i!=null&&(e.z+=i)}return e}set geometry(e){this._geometry=e}writeGeometry(e,t){t.geometry=this._geometry.toJSON()}readHFOV(e,t){let{horizontalfieldofview:n,hfov:r,layer:i}=t;return n??r??i.horizontalFieldOfView}readImageURL(e,t){let{connectionid:n,imagepath:r,layer:i}=t;if(r||T(`imagePath`,this),r.startsWith(N))return`${_(i.url)}/rest/directories/dsid_${r.replace(N,i.dataStoreID+`/`)}`;if(n==null)return D(r,i);let a=i.imageAccessPaths?.[n];if(!a)return D(r,i);let o=O(a,i);return o?A(`${o}/${E(r)}`,i):D(r,i)}readImageRotation(e,t){let{imagerotation:n,imgrot:r,layer:i}=t;return n??r??i.imageRotation}get isHorizontal(){return this.orientedImageryType===`horizontal`}get isInspection(){return this.orientedImageryType===`inspection`}get isNadir(){return this.orientedImageryType===`nadir`}get isOblique(){return this.orientedImageryType===`oblique`}get isSpherical(){return this.orientedImageryType?.includes(`360`)??!1}get location(){let{cameraOrientation:e,cameraHeight:t,elevation:n}=this;if(e){let{type:t,x:n,y:r,z:i,horizontalWKID:a,verticalWKID:o}=e,s=typeof a==`number`?{wkid:a}:{wkt:a};if(t===4){let{latitude:t,longitude:n,ellipsoidRadius:r,squaredEccentricity:i,properties:a}=e,{x:o,y:s,z:c}=a;return new d(b([o,s,c],[t,n,r,i]))}let c=new d({x:n,y:r,z:i,spatialReference:s}),l=o?f(`point`,{wkid:o},s):null;return l&&l(c),c}if(typeof t!=`number`)throw w(`cameraHeight`);let r=this.geometry.clone(),i=(n??0)+t/v(r.spatialReference);return r.z=r.hasZ?r.z:i,r}set matrix(e){if(e){if(e.length!==9){a.getLogger(this).warnOnce(`Ignoring rotation matrix because it doesn't have 9 values`,{value:e}),this._set(`matrix`,null);return}this._set(`matrix`,e)}}readNearDistance(e,t){let{neardistance:n,neardist:r,layer:i}=t;return n??r??i.nearDistance}readOffsetFromStart(e,t){return t.offsetfromstart??null}readOrientationAccuracy(e,t){let{accuracy:n,orientationaccuracy:r}=t;return r?.split(`;`).map(Number)??n?.split(`;`).map(Number)??null}writeOrientationAccuracy(e,t){e&&(t.orientationAccuracy=e.join(`;`))}readOIType(e,t){let{orientedimagerytype:n,oitype:r,camerapitch:i,campitch:a,layer:o}=t,s=y.read(n??r??o.orientedImageryType),c=i??a??o.cameraPitch;return s===`oblique`?c<10?`nadir`:`oblique`:s}set radial(e){if(!e){this._set(`radial`,[0,0,0]);return}if(typeof e==`string`){let[t,n,r]=e.split(`;`).map(Number);this._set(`radial`,[t??0,n??0,r??0]);return}this._set(`radial`,e)}set tangential(e){if(!e){this._set(`tangential`,[0,0]);return}if(typeof e==`string`){let[t,n]=e.split(`;`).map(Number);this._set(`tangential`,[t??0,n??0]);return}this._set(`tangential`,e)}readVFOV(e,t){let{verticalfieldofview:n,vfov:r,layer:i}=t;return n??r??i.verticalFieldOfView}_parseIfJSON(e){let t=null;try{t=JSON.parse(e)}catch(t){a.getLogger(this).error(`couldn't parse the given elevation source JSON`,e,t)}return t}clone(){let e=super.clone();return e._geometry=this._geometry.clone(),e}};e([c()],F.prototype,`_geometry`,void 0),e([c(j())],F.prototype,`a0`,void 0),e([c(j())],F.prototype,`a1`,void 0),e([c(j())],F.prototype,`a2`,void 0),e([c({type:Date,json:{write:{enabled:!0,target:`acquisitionDate`},name:`acquisitiondate`}})],F.prototype,`acquisitionDate`,void 0),e([c(j())],F.prototype,`b0`,void 0),e([c(j())],F.prototype,`b1`,void 0),e([c(j())],F.prototype,`b2`,void 0),e([c({type:Number,json:{write:!0,read:{source:[`cameraheading`,`camheading`,`layer.cameraHeading`]}}})],F.prototype,`cameraHeading`,void 0),e([x(`cameraHeading`)],F.prototype,`readCameraHeading`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`cameraHeight`,void 0),e([x(`cameraHeight`,[`cameraheight`,`avghtag`,`layer.cameraHeight`])],F.prototype,`readCameraHeight`,null),e([c()],F.prototype,`cameraOffset`,void 0),e([x(`cameraOffset`,[`cameraoffset`,`camoffset`])],F.prototype,`readCamOffset`,null),e([S(`cameraOffset`)],F.prototype,`writeCameraOffset`,null),e([c({json:{write:{writer:(e,t,n)=>{t[n]=e.toString()}}},type:p}),l(e=>e?m.getCameraOrientation(e):null)],F.prototype,`cameraOrientation`,void 0),e([x(`cameraOrientation`,[`cameraorientation`,`camori`])],F.prototype,`readCameraOrientation`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`cameraPitch`,void 0),e([x(`cameraPitch`,[`camerapitch`,`campitch`,`layer.cameraPitch`])],F.prototype,`readCameraPitch`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`cameraRoll`,void 0),e([x(`cameraRoll`,[`cameraroll`,`camroll`,`layer.cameraRoll`])],F.prototype,`readCameraRoll`,null),e([c({json:{write:!0},type:String})],F.prototype,`depthImage`,void 0),e([x(`depthImage`,[`depthimage`,`depthimg`])],F.prototype,`readDepthImage`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`elevation`,void 0),e([c({json:{write:!0},clonable:`reference`})],F.prototype,`elevationSource`,void 0),e([x(`elevationSource`,[`elevationsource`,`layer.effectiveElevationSource`])],F.prototype,`readElevationSource`,null),e([c({json:{name:`exposurestationid`,write:{target:`exposureStationId`}},type:String})],F.prototype,`exposureStationId`,void 0),e([c({type:Number,json:{write:!0}})],F.prototype,`farDistance`,void 0),e([x(`farDistance`,[`fardistance`,`fardist`,`layer.farDistance`])],F.prototype,`readFarDistance`,null),e([c(j(`focallength`))],F.prototype,`focalLength`,void 0),e([c({type:d,json:{name:`geometry`}})],F.prototype,`geometry`,null),e([S(`geometry`)],F.prototype,`writeGeometry`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`horizontalFieldOfView`,void 0),e([x(`horizontalFieldOfView`,[`horizontalfieldofview`,`hfov`,`layer.horizontalFieldOfView`])],F.prototype,`readHFOV`,null),e([c({json:{write:!0},type:String})],F.prototype,`imagePath`,void 0),e([x(`imagePath`,[`imagepath`])],F.prototype,`readImageURL`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`imageRotation`,void 0),e([x(`imageRotation`,[`imagerotation`,`imgrot`,`layer.imageRotation`])],F.prototype,`readImageRotation`,null),e([c()],F.prototype,`isHorizontal`,null),e([c()],F.prototype,`isInspection`,null),e([c()],F.prototype,`isNadir`,null),e([c()],F.prototype,`isOblique`,null),e([c()],F.prototype,`isSpherical`,null),e([c()],F.prototype,`location`,null),e([c(M())],F.prototype,`matrix`,null),e([c({json:{write:!0},type:String})],F.prototype,`name`,void 0),e([c({type:Number,json:{write:!0}})],F.prototype,`nearDistance`,void 0),e([x(`nearDistance`,[`neardistance`,`neardist`,`layer.nearDistance`])],F.prototype,`readNearDistance`,null),e([c({json:{write:!0,name:`objectid`},type:Number})],F.prototype,`objectId`,void 0),e([c({type:Number,json:{write:!0}})],F.prototype,`offsetFromStart`,void 0),e([x(`offsetFromStart`,[`offsetfromstart`])],F.prototype,`readOffsetFromStart`,null),e([c()],F.prototype,`orientationAccuracy`,void 0),e([x(`orientationAccuracy`,[`accuracy`,`orientationaccuracy`])],F.prototype,`readOrientationAccuracy`,null),e([S(`orientationAccuracy`)],F.prototype,`writeOrientationAccuracy`,null),e([C(y)],F.prototype,`orientedImageryType`,void 0),e([x(`orientedImageryType`,[`orientedimagerytype`,`oitype`,`layer.orientedImageryType`])],F.prototype,`readOIType`,null),e([c({type:Number,json:{write:!0,read:{source:`principalx`}}})],F.prototype,`principalX`,void 0),e([c({type:Number,json:{write:!0,read:{source:`principaly`}}})],F.prototype,`principalY`,void 0),e([c(M([0,0,0]))],F.prototype,`radial`,null),e([c({json:{write:(e,t)=>{e&&e.forEach(e=>t[e.fieldName]=e.value)}}})],F.prototype,`sequenceOrder`,void 0),e([c({type:Object})],F.prototype,`sourceMap`,void 0),e([c(M([0,0]))],F.prototype,`tangential`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`verticalFieldOfView`,void 0),e([x(`verticalFieldOfView`,[`verticalfieldofview`,`vfov`,`layer.verticalFieldOfView`])],F.prototype,`readVFOV`,null),F=e([u(`esri.layers.orientedImagery.core.ExposurePoint`)],F);const I=F;export{I as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{id as t}from"../../../kernel.js";import{ClonableMixin as n}from"../../../core/Clonable.js";import r from"../../../core/Error.js";import{JSONSupport as i}from"../../../core/JSONSupport.js";import a from"../../../core/Logger.js";import{isAbsolute as o,addQueryParameter as s}from"../../../core/urlUtils.js";import{property as c,cast as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import d from"../../../geometry/Point.js";import{getGeometryZScaler as f}from"../../../geometry/support/zscale.js";import p from"./CameraOrientation.js";import m from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as h,getEffectiveElevationSource as g,getArcGISServerUrl as _,getMetersPerUnitOfSR as v,parseOrientationAccuracy as y,normalizeOrientationAccuracy as b,orientedImageryTypeMap as x}from"./utils.js";import{ltpToGeographic as S}from"../transformations/utils.js";import{reader as C}from"../../../core/accessorSupport/decorators/reader.js";import{writer as w}from"../../../core/accessorSupport/decorators/writer.js";import{enumeration as T}from"../../../core/accessorSupport/decorators/enumeration.js";function E(e){throw new r(`exposure-point:missing-default-value`,`a value for ${e} is missing in default properties`)}function D(e,t){throw new r(`exposure-point:missing-attribute-value`,`a value for ${e} is missing in attribute table`,{exposurePoint:t})}function O(e){return e.trim().replaceAll(`\\`,`/`).replace(/^\/+/,``)}function k(e,t){return o(e)?e:h(e,t.imagePathPrefix,t.imagePathSuffix)}function A(e,t){if(o(e))return e;let n=t.url?_(t.url):null;return n?`${n}/${O(e)}`:null}function j(e){return t?.findCredential(e.url)?.token??null}function M(e,t){let n=j(t);return n?s(e,`token`,n):e}const N=e=>({cast:e=>{let t=parseFloat(e);return Number.isFinite(t)?t:void 0},json:{name:e,write:{writer:(e,t,n)=>{t[n]=Number.isFinite(e)?e:void 0}}}}),P=e=>({cast:e=>typeof e==`string`?e.split(`;`).map(Number):e,json:{default:e,write:{writer:(e,t,n)=>{t[n]=e?.join(`;`)}}}}),F=`$virtualCacheDirectory:`,I=new Set([`location`]);let L=class extends n(i){constructor(e){super(e),this._geometry=null,this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,t){let n={},{attributes:r,geometry:i}=e,a={};for(let e in r)I.has(e.toLowerCase())||(n[e.toLowerCase()]=r[e],a[e.toLowerCase()]=e);let o=e.layer??{},s=o.effectiveSequenceOrderField,c=null;s?.length&&(s.map(e=>e.fieldName).forEach(e=>{a[e.toLowerCase()]=e}),c=s.map(e=>({value:r[e.fieldName],...e}))),super.read({geometry:i,layer:o,sourceMap:a,sequenceOrder:c,...n},t)}write(e,t){let n=super.write(e,t),{sourceMap:r}=this;if(!r||!n)return n;let i={};for(let e in n){let t=r[e.toLowerCase()];t&&(i[t]=n[e])}return i}readCameraHeading(e,t){let{cameraheading:n,camheading:r,layer:i}=t;return n??r??i.cameraHeading}readCameraHeight(e,t){let{cameraheight:n,avghtag:r,layer:i}=t;return n??r??i.cameraHeight}readCamOffset(e,t){let{cameraoffset:n,camoffset:r}=t;return n?.split(`;`).map(Number)??r?.split(`;`).map(Number)??null}writeCameraOffset(e,t){e&&(t.cameraOffset=e.join(`;`))}readCameraOrientation(e,t){let{cameraorientation:n,camori:r}=t;return n??r}readCameraPitch(e,t){let{camerapitch:n,campitch:r,layer:i}=t;return n??r??i.cameraPitch}readCameraRoll(e,t){let{cameraroll:n,camroll:r,layer:i}=t;return n??r??i.cameraRoll}readDepthImage(e,t){let{depthimage:n,depthimg:r,layer:i}=t,a=n??r??null,{depthImagePathPrefix:o,depthImagePathSuffix:s}=i??{};return h(a,o,s)}readElevationSource(e,t){let{elevationsource:n,layer:r}=t,{demPathSuffix:i,demPathPrefix:a}=r;if(n){let e=this._parseIfJSON(n);return g(e,a,i)}return r.effectiveElevationSource}readFarDistance(e,t){let{fardistance:n,fardist:r,layer:i}=t;return n??r??i.farDistance}get geometry(){let e=this._geometry.clone();if(!e)return null;let{cameraOffset:t}=this;if(t){let[n,r,i]=t;e.x+=n,e.y+=r,e.z!=null&&i!=null&&(e.z+=i)}return e}set geometry(e){this._geometry=e}writeGeometry(e,t){t.geometry=this._geometry.toJSON()}readHFOV(e,t){let{horizontalfieldofview:n,hfov:r,layer:i}=t;return n??r??i.horizontalFieldOfView}readImageURL(e,t){let{connectionid:n,imagepath:r,layer:i}=t;if(r||D(`imagePath`,this),r.startsWith(F))return`${_(i.url)}/rest/directories/dsid_${r.replace(F,i.dataStoreID+`/`)}`;if(n==null)return k(r,i);let a=i.imageAccessPaths?.[n];if(!a)return k(r,i);let o=A(a,i);return o?M(`${o}/${O(r)}`,i):k(r,i)}readImageRotation(e,t){let{imagerotation:n,imgrot:r,layer:i}=t;return n??r??i.imageRotation}get isHorizontal(){return this.orientedImageryType===`horizontal`}get isInspection(){return this.orientedImageryType===`inspection`}get isNadir(){return this.orientedImageryType===`nadir`}get isOblique(){return this.orientedImageryType===`oblique`}get isSpherical(){return this.orientedImageryType?.includes(`360`)??!1}get location(){let{cameraOrientation:e,cameraHeight:t,elevation:n}=this;if(e){let{type:t,x:n,y:r,z:i,horizontalWKID:a,verticalWKID:o}=e,s=typeof a==`number`?{wkid:a}:{wkt:a};if(t===4){let{latitude:t,longitude:n,ellipsoidRadius:r,squaredEccentricity:i,properties:a}=e,{x:o,y:s,z:c}=a;return new d(S([o,s,c],[t,n,r,i]))}let c=new d({x:n,y:r,z:i,spatialReference:s}),l=o?f(`point`,{wkid:o},s):null;return l&&l(c),c}if(typeof t!=`number`)throw E(`cameraHeight`);let r=this.geometry.clone(),i=(n??0)+t/v(r.spatialReference);return r.z=r.hasZ?r.z:i,r}set matrix(e){if(e){if(e.length!==9){a.getLogger(this).warnOnce(`Ignoring rotation matrix because it doesn't have 9 values`,{value:e}),this._set(`matrix`,null);return}this._set(`matrix`,e)}}readNearDistance(e,t){let{neardistance:n,neardist:r,layer:i}=t;return n??r??i.nearDistance}readOffsetFromStart(e,t){return t.offsetfromstart??null}readOrientationAccuracy(e,t){let{accuracy:n,layer:r,orientationaccuracy:i}=t;return y(i===void 0?n:i)??b(r.orientationAccuracy)}writeOrientationAccuracy(e,t){e&&(t.orientationAccuracy=e.join(`;`))}readOIType(e,t){let{orientedimagerytype:n,oitype:r,camerapitch:i,campitch:a,layer:o}=t,s=x.read(n??r??o.orientedImageryType),c=i??a??o.cameraPitch;return s===`oblique`?c<10?`nadir`:`oblique`:s}set radial(e){if(!e){this._set(`radial`,[0,0,0]);return}if(typeof e==`string`){let[t,n,r]=e.split(`;`).map(Number);this._set(`radial`,[t??0,n??0,r??0]);return}this._set(`radial`,e)}set tangential(e){if(!e){this._set(`tangential`,[0,0]);return}if(typeof e==`string`){let[t,n]=e.split(`;`).map(Number);this._set(`tangential`,[t??0,n??0]);return}this._set(`tangential`,e)}readVFOV(e,t){let{verticalfieldofview:n,vfov:r,layer:i}=t;return n??r??i.verticalFieldOfView}_parseIfJSON(e){let t=null;try{t=JSON.parse(e)}catch(t){a.getLogger(this).error(`couldn't parse the given elevation source JSON`,e,t)}return t}clone(){let e=super.clone();return e._geometry=this._geometry.clone(),e}};e([c()],L.prototype,`_geometry`,void 0),e([c(N())],L.prototype,`a0`,void 0),e([c(N())],L.prototype,`a1`,void 0),e([c(N())],L.prototype,`a2`,void 0),e([c({type:Date,json:{write:{enabled:!0,target:`acquisitionDate`},name:`acquisitiondate`}})],L.prototype,`acquisitionDate`,void 0),e([c(N())],L.prototype,`b0`,void 0),e([c(N())],L.prototype,`b1`,void 0),e([c(N())],L.prototype,`b2`,void 0),e([c({type:Number,json:{write:!0,read:{source:[`cameraheading`,`camheading`,`layer.cameraHeading`]}}})],L.prototype,`cameraHeading`,void 0),e([C(`cameraHeading`)],L.prototype,`readCameraHeading`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`cameraHeight`,void 0),e([C(`cameraHeight`,[`cameraheight`,`avghtag`,`layer.cameraHeight`])],L.prototype,`readCameraHeight`,null),e([c()],L.prototype,`cameraOffset`,void 0),e([C(`cameraOffset`,[`cameraoffset`,`camoffset`])],L.prototype,`readCamOffset`,null),e([w(`cameraOffset`)],L.prototype,`writeCameraOffset`,null),e([c({json:{write:{writer:(e,t,n)=>{t[n]=e.toString()}}},type:p}),l(e=>e?m.getCameraOrientation(e):null)],L.prototype,`cameraOrientation`,void 0),e([C(`cameraOrientation`,[`cameraorientation`,`camori`])],L.prototype,`readCameraOrientation`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`cameraPitch`,void 0),e([C(`cameraPitch`,[`camerapitch`,`campitch`,`layer.cameraPitch`])],L.prototype,`readCameraPitch`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`cameraRoll`,void 0),e([C(`cameraRoll`,[`cameraroll`,`camroll`,`layer.cameraRoll`])],L.prototype,`readCameraRoll`,null),e([c({json:{write:!0},type:String})],L.prototype,`depthImage`,void 0),e([C(`depthImage`,[`depthimage`,`depthimg`])],L.prototype,`readDepthImage`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`elevation`,void 0),e([c({json:{write:!0},clonable:`reference`})],L.prototype,`elevationSource`,void 0),e([C(`elevationSource`,[`elevationsource`,`layer.effectiveElevationSource`])],L.prototype,`readElevationSource`,null),e([c({json:{name:`exposurestationid`,write:{target:`exposureStationId`}},type:String})],L.prototype,`exposureStationId`,void 0),e([c({type:Number,json:{write:!0}})],L.prototype,`farDistance`,void 0),e([C(`farDistance`,[`fardistance`,`fardist`,`layer.farDistance`])],L.prototype,`readFarDistance`,null),e([c(N(`focallength`))],L.prototype,`focalLength`,void 0),e([c({type:d,json:{name:`geometry`}})],L.prototype,`geometry`,null),e([w(`geometry`)],L.prototype,`writeGeometry`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`horizontalFieldOfView`,void 0),e([C(`horizontalFieldOfView`,[`horizontalfieldofview`,`hfov`,`layer.horizontalFieldOfView`])],L.prototype,`readHFOV`,null),e([c({json:{write:!0},type:String})],L.prototype,`imagePath`,void 0),e([C(`imagePath`,[`imagepath`])],L.prototype,`readImageURL`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`imageRotation`,void 0),e([C(`imageRotation`,[`imagerotation`,`imgrot`,`layer.imageRotation`])],L.prototype,`readImageRotation`,null),e([c()],L.prototype,`isHorizontal`,null),e([c()],L.prototype,`isInspection`,null),e([c()],L.prototype,`isNadir`,null),e([c()],L.prototype,`isOblique`,null),e([c()],L.prototype,`isSpherical`,null),e([c()],L.prototype,`location`,null),e([c(P())],L.prototype,`matrix`,null),e([c({json:{write:!0},type:String})],L.prototype,`name`,void 0),e([c({type:Number,json:{write:!0}})],L.prototype,`nearDistance`,void 0),e([C(`nearDistance`,[`neardistance`,`neardist`,`layer.nearDistance`])],L.prototype,`readNearDistance`,null),e([c({json:{write:!0,name:`objectid`},type:Number})],L.prototype,`objectId`,void 0),e([c({type:Number,json:{write:!0}})],L.prototype,`offsetFromStart`,void 0),e([C(`offsetFromStart`,[`offsetfromstart`])],L.prototype,`readOffsetFromStart`,null),e([c()],L.prototype,`orientationAccuracy`,void 0),e([C(`orientationAccuracy`,[`accuracy`,`orientationaccuracy`,`layer.orientationAccuracy`])],L.prototype,`readOrientationAccuracy`,null),e([w(`orientationAccuracy`)],L.prototype,`writeOrientationAccuracy`,null),e([T(x)],L.prototype,`orientedImageryType`,void 0),e([C(`orientedImageryType`,[`orientedimagerytype`,`oitype`,`layer.orientedImageryType`])],L.prototype,`readOIType`,null),e([c({type:Number,json:{write:!0,read:{source:`principalx`}}})],L.prototype,`principalX`,void 0),e([c({type:Number,json:{write:!0,read:{source:`principaly`}}})],L.prototype,`principalY`,void 0),e([c(P([0,0,0]))],L.prototype,`radial`,null),e([c({json:{write:(e,t)=>{e&&e.forEach(e=>t[e.fieldName]=e.value)}}})],L.prototype,`sequenceOrder`,void 0),e([c({type:Object})],L.prototype,`sourceMap`,void 0),e([c(P([0,0]))],L.prototype,`tangential`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`verticalFieldOfView`,void 0),e([C(`verticalFieldOfView`,[`verticalfieldofview`,`vfov`,`layer.verticalFieldOfView`])],L.prototype,`readVFOV`,null),L=e([u(`esri.layers.orientedImagery.core.ExposurePoint`)],L);const R=L;export{R as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{JSONMap as e}from"../../../core/jsonMap.js";import{getMetersPerUnitForSR as t}from"../../../core/units.js";import{geographicToWebMercator as n}from"../../../geometry/support/webMercatorUtils.js";import r from"./cameraOrientationRegistry.js";import{isConstantElevation as i,ConstantElevation as a,ElevationSource as o}from"./ElevationSourceDefinitions.js";function s(e,t,n){return t&&(e=`${t}${e}`),n&&(e+=`${n}`),e}function c(e,t,n){let{url:r}=e;return r?(r=s(r,t,n),new o({...e,url:r})):null}function l(e,t,n){return e&&(i(e)?new a(e):c(e,t,n))}const u=new e({Minutes:`minutes`,Hours:`hours`,Days:`days`,Weeks:`weeks`,Months:`months`,Years:`years`}),d=new e({Feet:`feet`,Meter:`meter`}),f=new e({360:`360`,Horizontal:`horizontal`,Inspection:`inspection`,Nadir:`nadir`,Oblique:`oblique`,Terrestrial360Video:`terrestrial-360-video`,TerrestrialFrameVideo:`terrestrial-frame-video`,Aerial360Video:`aerial-360-video`,AerialFrameVideo:`aerial-frame-video`,"":null}),p=new Map;p.set(`1`,_),p.set(`3`,v),p.set(`2`,m),p.set(`4`,y);function m(e){let[t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:n,x:r,y:i,z:a,omega:o,phi:s,kappa:c,...g([l,u,d,f,p,m],[_,v],[y,b,x],[S,C],h)}}const h=e=>{let t=e.map(e=>parseFloat(e)).filter(e=>!isNaN(e));if(t.length===e.length)return t};function g(e,t,n,r,i){let a=h(e),o=h(t),s=h(n),c=h(r);return{affineTransformations:a?.length===6?a:void 0,focalLength:a?.length===6?parseFloat(i):void 0,principalOffsetPoint:o?.length===2?o:[0,0],radialDistortionCoefficients:s?.length===3?s:[0,0,0],tangentialDistortionCoefficients:c?.length===2?c:[0,0]}}function _(e){let[t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:n,x:r,y:i,z:a,heading:o,pitch:s,roll:c,...g([l,u,d,f,p,m],[_,v],[y,b,x],[S,C],h)}}function v(e){let[t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:n,x:r,y:i,z:a,yaw:o,pitch:s,roll:c,...g([l,u,d,f,p,m],[_,v],[y,b,x],[S,C],h)}}function y(e){let[t,n,i,a,o,...s]=e.slice(1),c=p.get(o),l=r.get(o)?.constructor;return!c||!l?null:{latitude:t,longitude:n,ellipsoidRadius:i,squaredEccentricity:a,properties:new l(c([o,``,...s]))}}function b(e){if(!e)return null;let t=`${e}`.split(`|`);if(t.length===0)return null;let n=r.get(t[0]);if(!n)return null;let i=p.get(t[0]);if(!i)return null;let a=n.constructor;return new a(i(t))}function x(e){
|
|
2
|
+
import{JSONMap as e}from"../../../core/jsonMap.js";import{getMetersPerUnitForSR as t}from"../../../core/units.js";import{geographicToWebMercator as n}from"../../../geometry/support/webMercatorUtils.js";import r from"./cameraOrientationRegistry.js";import{isConstantElevation as i,ConstantElevation as a,ElevationSource as o}from"./ElevationSourceDefinitions.js";function s(e,t,n){return t&&(e=`${t}${e}`),n&&(e+=`${n}`),e}function c(e,t,n){let{url:r}=e;return r?(r=s(r,t,n),new o({...e,url:r})):null}function l(e,t,n){return e&&(i(e)?new a(e):c(e,t,n))}const u=new e({Minutes:`minutes`,Hours:`hours`,Days:`days`,Weeks:`weeks`,Months:`months`,Years:`years`}),d=new e({Feet:`feet`,Meter:`meter`}),f=new e({360:`360`,Horizontal:`horizontal`,Inspection:`inspection`,Nadir:`nadir`,Oblique:`oblique`,Terrestrial360Video:`terrestrial-360-video`,TerrestrialFrameVideo:`terrestrial-frame-video`,Aerial360Video:`aerial-360-video`,AerialFrameVideo:`aerial-frame-video`,"":null}),p=new Map;p.set(`1`,_),p.set(`3`,v),p.set(`2`,m),p.set(`4`,y);function m(e){let[t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:n,x:r,y:i,z:a,omega:o,phi:s,kappa:c,...g([l,u,d,f,p,m],[_,v],[y,b,x],[S,C],h)}}const h=e=>{let t=e.map(e=>parseFloat(e)).filter(e=>!isNaN(e));if(t.length===e.length)return t};function g(e,t,n,r,i){let a=h(e),o=h(t),s=h(n),c=h(r);return{affineTransformations:a?.length===6?a:void 0,focalLength:a?.length===6?parseFloat(i):void 0,principalOffsetPoint:o?.length===2?o:[0,0],radialDistortionCoefficients:s?.length===3?s:[0,0,0],tangentialDistortionCoefficients:c?.length===2?c:[0,0]}}function _(e){let[t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:n,x:r,y:i,z:a,heading:o,pitch:s,roll:c,...g([l,u,d,f,p,m],[_,v],[y,b,x],[S,C],h)}}function v(e){let[t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:n,x:r,y:i,z:a,yaw:o,pitch:s,roll:c,...g([l,u,d,f,p,m],[_,v],[y,b,x],[S,C],h)}}function y(e){let[t,n,i,a,o,...s]=e.slice(1),c=p.get(o),l=r.get(o)?.constructor;return!c||!l?null:{latitude:t,longitude:n,ellipsoidRadius:i,squaredEccentricity:a,properties:new l(c([o,``,...s]))}}function b(e){if(!e)return null;let t=`${e}`.split(`|`);if(t.length===0)return null;let n=r.get(t[0]);if(!n)return null;let i=p.get(t[0]);if(!i)return null;let a=n.constructor;return new a(i(t))}function x(e){if(!Array.isArray(e)||e.length<=5)return!1;for(let t of e)if(typeof t!=`number`||!Number.isFinite(t)||t<0)return!1;return!0}function S(e){for(e=e.slice(0,8);e.length<8;)e.push(0);return e}function C(e){return x(e)?S(e):null}function w(e){if(typeof e!=`string`)return null;let t=e.split(`;`);return t.some(e=>!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(e.trim()))?null:C(t.map(e=>Number(e.trim())))}function T(e){return e.spatialReference.isGeographic?n(e):e.clone()}function E(e){return e.isGeographic?1:t(e)}function D(e){let t=e.match(/^(.*)\/rest\/services\/(.*)$/);return t?t[1]:null}const O=`sequenceorder`;function k(e,t){return e?.length?e.map(({field:e,order:n})=>{let r=t.find(t=>t.name.toLowerCase()===e.toLowerCase());return r?{fieldName:r.name,sortOrder:n?.toLowerCase()===`desc`?`desc`:`asc`}:null}).filter(e=>e!=null):null}function A(e,t,n){let r=k(n,t);if(r?.length)return r;if(!e){let e=t.find(e=>e.name.toLocaleLowerCase()===O.toLocaleLowerCase());return e?[{fieldName:e.name,sortOrder:`asc`}]:null}let i=t.find(t=>t.name.toLowerCase()===e.trim().toLowerCase());return i?[{fieldName:i.name,sortOrder:`asc`}]:null}export{s as appendPrefixAndSuffix,T as convertGeographicToWebMercator,b as createCameraOrientation,O as defaultSequenceOrderField,D as getArcGISServerUrl,l as getEffectiveElevationSource,E as getMetersPerUnitOfSR,x as isOrientationAccuracy,C as normalizeOrientationAccuracy,f as orientedImageryTypeMap,S as padAccuracyArray,w as parseOrientationAccuracy,A as parseSequenceOrderFields,c as processElevationSource,u as timeIntervalUnitTypeMap,p as transformersRegistry,d as verticalMeasurementTypeMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../geometry/Point.js";import{GeospatialPDFWorkerClient as a}from"../../geospatialPDF/GeospatialPDFWorkerClient.js";import o from"./BaseRaster.js";import s from"../../support/PixelBlock.js";import c from"../../support/RasterInfo.js";let l=class extends o{constructor(){super(...arguments),this._workerClient=new a,this._extent=null,this._ctm=null,this._neatlineRing=[],this._width=0,this._height=0,this._tileSize=512,this.datasetFormat=`PDF`,this.frame=null,this.neatlineExtent=null,this.page=1,this.tileType=`Raster`}destroy(){this._workerClient.destroy(),this.neatlineExtent=null,this._extent=null,this._ctm=null,this._neatlineRing=[]}async fetchRawTile(e,t,n,r={}){let i=this._extent,a=this._ctm,o=this.getTileExtentPDF(e,t,n);return o.intersects(i)?
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../geometry/Point.js";import{GeospatialPDFWorkerClient as a}from"../../geospatialPDF/GeospatialPDFWorkerClient.js";import o from"./BaseRaster.js";import s from"../../support/PixelBlock.js";import c from"../../support/RasterInfo.js";let l=class extends o{constructor(){super(...arguments),this._workerClient=new a,this._extent=null,this._ctm=null,this._neatlineRing=[],this._width=0,this._height=0,this._tileSize=512,this.datasetFormat=`PDF`,this.frame=null,this.neatlineExtent=null,this.page=1,this.tileType=`Raster`}destroy(){this._workerClient.destroy(),this.neatlineExtent=null,this._extent=null,this._ctm=null,this._neatlineRing=[]}async fetchRawTile(e,t,n,r={}){let i=this._extent,a=this._ctm,o=this.getTileExtentPDF(e,t,n);return o.intersects(i)?d(await this._workerClient.render(o,this._tileSize,this._tileSize,a,this._neatlineRing,r)):null}async _open(e){if(!this.url)throw new t(`geospatial-pdf-raster:open`,`GeospatialPDFRaster requires a url.`);let n=await this._workerClient.loadPDF({url:this.url,page:this.page},e);this.frame=n.frame;let r=this.frame.outerExtentMediabox;if(!r)throw new t(`geospatial-pdf-raster:open`,`Failed to compute Geospatial PDF extent.`);this.neatlineExtent=n.fullExtent,this._extent=r,this._ctm=this.frame.ctm,this._neatlineRing=this.frame.sourceMediaBoxPolygon.rings[0];let i=f(this.frame.ctm,this._extent);this._width=i[0],this._height=i[1];let a={x:r.width/this._width,y:r.height/this._height},o=new c({width:this._width,height:this._height,pixelType:`u8`,extent:r,pixelSize:a,spatialReference:r.spatialReference,bandCount:3,keyProperties:{DataType:`Processed`}});this.createRemoteDatasetStorageInfo(o,this._tileSize,this._tileSize),this._set(`rasterInfo`,o),this.updateTileInfo()}getTileExtentPDF(e,t,n){let r=this._extent,a=2**e,o=r.width/this._width*a,s=r.height/this._height*a,c=new i({x:r.xmin,y:r.ymax});return this.getTileExtent({x:o,y:s},t,n,c,r.spatialReference,[512,512])}};e([n({type:String,json:{write:!0}})],l.prototype,`datasetFormat`,void 0),e([n({constructOnly:!0})],l.prototype,`page`,void 0),e([n({readOnly:!0})],l.prototype,`tileType`,void 0),l=e([r(`esri.layers.raster.datasets.GeospatialPDFRaster`)],l);const u=l;function d(e){return new s({width:e.width,height:e.height,pixelType:`u8`,pixels:[e.red,e.green,e.blue],mask:e.mask})}function f(e,n){let[r,i,a,o]=e,s=r*o-i*a;if(!Number.isFinite(s)||s===0)throw new t(`geospatial-pdf-raster:open`,`Failed to derive raster dimensions from an invalid PDF CTM.`);let c=10*Math.hypot(o,i)/Math.abs(s),l=10*Math.hypot(a,r)/Math.abs(s),u=Math.max(1,Math.ceil(n.width*c)),d=Math.max(1,Math.ceil(n.height*l));if(!Number.isFinite(u)||!Number.isFinite(d))throw new t(`geospatial-pdf-raster:open`,`PDF CTM produced invalid raster dimensions.`);return[u,d]}export{u as default};
|
|
@@ -323,7 +323,7 @@ export default class FeatureFilter extends JSONSupport {
|
|
|
323
323
|
* Creates [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) parameters that can be used to fetch features that
|
|
324
324
|
* satisfy the layer's current filters and definitions.
|
|
325
325
|
*
|
|
326
|
-
* @returns The query object representing the layer's filters
|
|
326
|
+
* @returns The query parameter object representing the layer's filters
|
|
327
327
|
* and other definitions.
|
|
328
328
|
* @example
|
|
329
329
|
* // Get a query object from the filter's current configuration
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{Clonable as t}from"../../core/Clonable.js";import{JSONSupportMixin as
|
|
2
|
+
import{__decorate as e}from"tslib";import{Clonable as t}from"../../core/Clonable.js";import n from"../../core/Error.js";import{JSONSupportMixin as r}from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import o from"../../portal/PortalItem.js";import{isCrossPortalWrite as s}from"../../webdoc/support/saveUtils.js";import{reader as c}from"../../core/accessorSupport/decorators/reader.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";let u=class extends r(t){constructor(e){super(e),this.type=`portal-item`}readPortalItem(e,t,n){if(t.itemId)return new o({id:t.itemId,portal:n?.portal})}writePortalItem(e,t,r,i){if(s(e,i)){i.messages?.push(new n(`portal-item-data:cross-portal`,`Data cannot be persisted because it refers to an item on a different portal ('${e?.portal?.url}') than the one being saved to ('${i?.portal?.url}').`,{layer:this,itemId:e?.id}));return}e?.id&&(t.itemId=e.id)}};e([i({type:[`portal-item`],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],u.prototype,`type`,void 0),e([i({type:o,json:{write:{isRequired:!0}}})],u.prototype,`portalItem`,void 0),e([c(`portalItem`,[`itemId`])],u.prototype,`readPortalItem`,null),e([l(`portalItem`,{itemId:{type:String}})],u.prototype,`writePortalItem`,null),u=e([a(`esri.layers.support.ParquetPortalItemData`)],u);const d=u;export{d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{Clonable as t}from"../../core/Clonable.js";import{JSONSupportMixin as
|
|
2
|
+
import{__decorate as e}from"tslib";import{Clonable as t}from"../../core/Clonable.js";import n from"../../core/Error.js";import{JSONSupportMixin as r}from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import o from"../../portal/PortalItem.js";import{isCrossPortalWrite as s}from"../../webdoc/support/saveUtils.js";import{reader as c}from"../../core/accessorSupport/decorators/reader.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";let u=class extends r(t){constructor(e){super(e),this.type=`portal-item`}readPortalItem(e,t,n){if(t.itemId)return new o({id:t.itemId,portal:n?.portal})}writePortalItem(e,t,r,i){if(s(e,i)){i.messages?.push(new n(`portal-item-data:cross-portal`,`Data cannot be persisted because it refers to an item on a different portal ('${e?.portal?.url}') than the one being saved to ('${i?.portal?.url}').`,{layer:this,itemId:e?.id}));return}e?.id&&(t.itemId=e.id)}};e([i({type:[`portal-item`],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],u.prototype,`type`,void 0),e([i({type:o,json:{write:{isRequired:!0}}})],u.prototype,`portalItem`,void 0),e([c(`portalItem`,[`itemId`])],u.prototype,`readPortalItem`,null),e([l(`portalItem`,{itemId:{type:String}})],u.prototype,`writePortalItem`,null),u=e([a(`esri.layers.support.PortalItemData`)],u);export{u as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import n from"../../request.js";import r from"../../core/Collection.js";import i from"../../core/Error.js";import has from"../../core/has.js";import{IdentifiableMixin as a}from"../../core/Identifiable.js";import{clone as o}from"../../core/lang.js";import{Loadable as s}from"../../core/Loadable.js";import c from"../../core/Logger.js";import{MultiOriginJSONSupportMixin as l}from"../../core/MultiOriginJSONSupport.js";import{sqlAnd as u}from"../../core/sql.js";import{objectToQuery as d}from"../../core/urlUtils.js";import{property as f,cast as p,subclass as m}from"../../core/accessorSupport/decorators.js";import{ensureInteger as h,ensureType as g,Integer as _,ensureClass as v}from"../../core/accessorSupport/ensureType.js";import{nameToId as y}from"../../core/accessorSupport/PropertyOrigin.js";import{getProperties as b}from"../../core/accessorSupport/utils.js";import x from"../../geometry/Extent.js";import S from"../../geometry/SpatialReference.js";import{featureGeometryTypeKebabDictionary as C}from"../../geometry/support/typeUtils.js";import ee from"../../graphic/MapImageGraphicOrigin.js";import te from"../../graphic/TileGraphicOrigin.js";import ne from"../graphics/sources/support/QueryTask.js";import{readOrderByInfos as re}from"../mixins/OrderedLayer.js";import ie from"./EditFieldsInfo.js";import{getFeatureType as ae}from"./featureLayerUtils.js";import oe from"./FeatureType.js";import w from"./Field.js";import T from"./FieldsIndex.js";import{fixRendererFields as E}from"./fieldUtils.js";import D from"./LabelClass.js";import{validateLabelingInfo as O}from"./labelingInfo.js";import k from"./LayerFloorInfo.js";import A from"./OrderByInfo.js";import j from"./Relationship.js";import{getFeatureLayerCapabilities as M}from"./serviceCapabilitiesUtils.js";import{webSceneRendererTypes as N,rendererTypes as P}from"../../renderers/support/typeUtils.js";import{parseUrl as F}from"../../rest/utils.js";import I from"../../rest/layerSources/DynamicDataLayer.js";import L from"../../rest/layerSources/DynamicMapLayer.js";import R from"../../rest/support/AttachmentQuery.js";import z from"../../rest/support/Query.js";import{createPopupTemplate as B}from"../../support/popupUtils.js";import{isSymbol3D as V}from"../../symbols/support/typeUtils.js";import H from"../../tables/AttributeTableTemplate.js";import{reader as U}from"../../core/accessorSupport/decorators/reader.js";import{writer as W}from"../../core/accessorSupport/decorators/writer.js";var G;function K(e){return e?.type===`esriSMS`}function q(e,t,n){let r=n.minimumWritableOrigin||n.origin;return r?e.originIdOf(t)>=y(r):!1}function J(e,t,n){let r=q(this,t,n);return{ignoreOrigin:!0,allowNull:r,enabled:n?n.layer?.type===`map-image`&&(n.writeSublayerStructure||r):!1}}function Y(e,t,n){return{enabled:n?n.layer?.type===`tile`&&(q(this,t,n)||this._isOverridden(t)):!1}}function X(e,t,n){return{ignoreOrigin:!0,enabled:n&&n.writeSublayerStructure||!1}}function Z(e,t,n){return{ignoreOrigin:!0,enabled:n?.writeSublayerStructure?this.originIdOf(t)>2:!1}}function Q(e,t,n){return{ignoreOrigin:!0,enabled:n?n.writeSublayerStructure||q(this,t,n):!1}}let se=0;const ce=new Set([`layer`,`parent`,`loaded`,`loadStatus`,`loadError`,`loadWarnings`]);let $=class extends l(a(s)){static{G=this}constructor(e){super(e),this.attributeTableTemplate=null,this.capabilities=void 0,this.editFieldsInfo=null,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type=`sublayer`,this.types=null,this.uniqueIdFields=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise(this.reload(e)),this}readCapabilities(e,t){t=t.layerDefinition||t;let{attachment:n,operations:{supportsQuery:r,supportsQueryAttachments:i},query:{supportsFormatPBF:a,supportsOrderBy:o,supportsPagination:s,relativeTimeBinWindow:c},data:{supportsAttachment:l},queryRelated:u}=M(t,this.url);return{attachment:{supportsOrderByFields:n?.supportsOrderByFields??!1,supportsResize:n?.supportsResize??!1,supportsTypeWildcard:n?.supportsTypeWildcard??!1},exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:r,supportsQueryAttachments:i},data:{supportsAttachment:l},query:{relativeTimeBinWindow:c,supportsFormatPBF:a,supportsOrderBy:o,supportsPagination:s},queryRelated:u}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer(`definitionExpression`,e)}get effectiveScaleRange(){let{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get effectiveUniqueIdFields(){return this.uniqueIdFields?[...this.uniqueIdFields]:this.objectIdField?[this.objectIdField]:[]}readMaxScaleRange(e,t){return t=t.layerDefinition||t,{minScale:t.minScale??0,maxScale:t.maxScale??0}}get fieldsIndex(){return new T(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer(`floorInfo`,e)}readGlobalIdFieldFromService(e,t){if(t=t.layerDefinition||t,t.globalIdField)return t.globalIdField;if(t.fields){for(let e of t.fields)if(e.type===`esriFieldTypeGlobalID`)return e.name}}get graphicOrigin(){if(!this.layer)return null;switch(this.layer.type){case`tile`:return new te(this.layer,this);case`map-image`:return new ee(this.layer,this)}}get id(){return this._get(`id`)??se++}set id(e){if(this._get(`id`)!==e){if(this.layer?.capabilities?.exportMap?.supportsDynamicLayers===!1){this._logLockedError(`id`,`capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'`);return}this._set(`id`,e)}}readIsTable(e,t){return t.type===`Table`}set labelingInfo(e){this._setAndNotifyLayer(`labelingInfo`,e)}writeLabelingInfo(e,t,n,r){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map(e=>e.write({},r))}})}set labelsVisible(e){this._setAndNotifyLayer(`labelsVisible`,e)}set layer(e){this._set(`layer`,e),this.sublayers?.forEach(t=>t.layer=e)}set listMode(e){this._set(`listMode`,e)}get loaded(){return super.loaded}set minScale(e){this._setAndNotifyLayer(`minScale`,e)}readMinScale(e,t){return t.minScale||t.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer(`maxScale`,e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,t){return t=t.layerDefinition||t,t.objectIdField?t.objectIdField:t.fields?.find(e=>e.type===`esriFieldTypeOID`)?.name}set opacity(e){this._setAndNotifyLayer(`opacity`,e)}readOpacity(e,t){let{layerDefinition:n}=t;return 1-(n?.transparency??n?.drawingInfo?.transparency??0)*.01}writeOpacity(e,t,n,r){t.layerDefinition={drawingInfo:{transparency:100-e*100}}}set orderBy(e){this._setAndNotifyLayer(`orderBy`,e)}writeParent(e,t){t.parentLayerId=!this.parent||this.parent===this.layer?-1:h(this.parent.id)}get queryTask(){if(!this.layer)return null;let{capabilities:e,fieldsIndex:t,layer:n,uniqueIdFields:r,url:i}=this,{spatialReference:a}=n,o=`gdbVersion`in n?n.gdbVersion:void 0,s=has(`featurelayer-pbf`)&&e?.query.supportsFormatPBF,c=e?.operations?.supportsQueryAttachments??!1,l=e?.query?.relativeTimeBinWindow??0;return new ne({fieldsIndex:t,gdbVersion:o,pbfSupported:s,queryAttachmentsSupported:c,relativeTimeBinWindow:l,sourceSpatialReference:a,uniqueIdFields:r,url:i})}set renderer(e){if(E(e,this.fieldsIndex),e){for(let t of e.symbols)if(V(t)){c.getLogger(this).warn(`Sublayer renderer should use 2D symbols`);break}}this._setAndNotifyLayer(`renderer`,e)}get source(){return this._get(`source`)||new L({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer(`source`,e)}get sublayers(){return this._get(`sublayers`)}set sublayers(e){this._handleSublayersChange(e,this._get(`sublayers`)),this._set(`sublayers`,e)}castSublayers(e){return g(r.ofType(G),e)}writeSublayers(e,t,n){this.sublayers?.length&&(t[n]=this.sublayers.map(e=>e.id).toArray().reverse())}readTitle(e,t){return t.layerDefinition?.name??t.name}readTypeIdField(e,t){t=t.layerDefinition||t;let n=t.typeIdField;if(n&&t.fields){n=n.toLowerCase();let e=t.fields.find(e=>e.name.toLowerCase()===n);e&&(n=e.name)}return n}readUniqueIdFields(e,t){return t.layerDefinition?.uniqueIdInfo?.OIDFieldContainsHashValue?t.layerDefinition.uniqueIdInfo.fields:null}get url(){let e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,t?.type===`map-layer`)return`${e.path}/${t.mapLayerId}`;let n={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${d(n)}`}set url(e){this._overrideIfSome(`url`,e)}set visible(e){this._setAndNotifyLayer(`visible`,e)}writeVisible(e,t,n,r){t[n]=this.getAtOrigin(`defaultVisibility`,`service`)||e}clone(){let{store:e}=b(this),t=new G;return b(t).store=e.clone(ce),this.commitProperty(`url`),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return B(this,e)}createQuery(){return new z({returnGeometry:!0,where:this.definitionExpression||`1=1`})}async createFeatureLayer(){if(this.sublayers)return null;let e=(await import(`../FeatureLayer.js`)).default,{layer:t,url:n}=this,r;if(n&&this.originIdOf(`url`)>2)r=new e({url:n});else if(t?.parsedUrl){let n=t.parsedUrl;r=new e({url:n.path}),n&&this.source&&(this.source.type===`map-layer`?r.layerId=this.source.mapLayerId:r.dynamicDataSource=this.source)}else throw new i(`createFeatureLayer:missing-information`,`Cannot create a FeatureLayer without a url or a parent layer`);return t?.refreshInterval!=null&&(r.refreshInterval=t.refreshInterval),this.definitionExpression&&(r.definitionExpression=this.definitionExpression),this.floorInfo&&(r.floorInfo=o(this.floorInfo)),this.originIdOf(`labelingInfo`)>2&&(r.labelingInfo=o(this.labelingInfo)),this.originIdOf(`labelsVisible`)>0&&(r.labelsVisible=this.labelsVisible),this.originIdOf(`legendEnabled`)>0&&(r.legendEnabled=this.legendEnabled),this.originIdOf(`visible`)>0&&(r.visible=this.visible),this.originIdOf(`minScale`)>0&&(r.minScale=this.minScale),this.originIdOf(`maxScale`)>0&&(r.maxScale=this.maxScale),this.originIdOf(`opacity`)>0&&(r.opacity=this.opacity),this.originIdOf(`popupTemplate`)>0&&(r.popupTemplate=o(this.popupTemplate)),this.originIdOf(`renderer`)>2&&(r.renderer=o(this.renderer)),this.source?.type===`data-layer`&&(r.dynamicDataSource=this.source.clone()),this.originIdOf(`title`)>0&&(r.title=this.title),t?.type===`map-image`&&t.originIdOf(`customParameters`)>0&&(r.customParameters=t.customParameters),t?.type===`tile`&&t.originIdOf(`customParameters`)>0&&(r.customParameters=t.customParameters),r}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return ae(this.types,this.typeIdField,e)}getFieldDomain(e,t){let n=t?.feature,r=this.getFeatureType(n);if(r){let t=r.domains&&r.domains[e];if(t&&t.type!==`inherited`)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load();let n=R.from(e),r=this.capabilities;if(!r?.data?.supportsAttachment)throw new i(`queryAttachments:not-supported`,`this layer doesn't support attachments`);let{attachmentTypes:a,objectIds:o,globalIds:s,num:c,size:l,start:u,where:d}=n;if(!r?.operations?.supportsQueryAttachments){let e=a?.length>0,t=s?.length>0,r=l?.length>0;if(e||t||r||c||u||d)throw new i(`queryAttachments:option-not-supported`,`when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported`,n)}if(!(o?.length||s?.length||d))throw new i(`queryAttachments:invalid-query`,`'objectIds', 'globalIds', or 'where' are required to perform attachment query`,n);return!r?.attachment?.supportsOrderByFields&&n.orderByFields?.length&&(n=n.clone(),n.orderByFields=null),this.queryTask.executeAttachmentQuery(n,t)}async queryFeatureCount(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new i(`queryFeatureCount:not-supported`,`this layer doesn't support queries.`);if(!this.url)throw new i(`queryFeatureCount:not-supported`,`this layer has no url.`);let n=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...t,query:{...this.layer?.customParameters,token:n}})}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new i(`queryFeatures:not-supported`,`this layer doesn't support queries.`);if(!this.url)throw new i(`queryFeatures:not-supported`,`this layer has no url.`);let n=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(n?.features){let e=this.graphicOrigin;for(let t of n.features)t.sourceLayer=this,t.origin=e}return n}async queryObjectIds(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new i(`queryObjectIds:not-supported`,`this layer doesn't support queries.`);if(!this.url)throw new i(`queryObjectIds:not-supported`,`this layer has no url.`);let n=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...t,query:{...this.layer?.customParameters,token:n}})}async queryRelatedFeatures(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new i(`queryRelatedFeatures:not-supported`,`this layer doesn't support queries.`);if(!this.url)throw new i(`queryRelatedFeatures:not-supported`,`this layer has no url.`);let n=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...t,query:{...this.layer?.customParameters,token:n}})}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new i(`queryRelatedFeaturesCount:not-supported`,`this layer doesn't support queries.`);if(!this.capabilities.queryRelated.supportsCount)throw new i(`queryRelatedFeaturesCount:not-supported`,`this layer doesn't support query related counts.`);if(!this.url)throw new i(`queryRelatedFeaturesCount:not-supported`,`this layer has no url.`);let n=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...t,query:{...this.layer?.customParameters,token:n}})}async reload(e){if(this.loadStatus===`not-loaded`)return this.load(e).then(()=>{});let{layer:t,url:r}=this;if(!t&&!r)throw new i(`sublayer:missing-layer`,`Sublayer can't be loaded without being part of a layer`,{sublayer:this});let a=t?await t.fetchSublayerInfo(this,e):(await n(r,{query:{f:`json`},...e})).data;a&&(this.sourceJSON={...this.sourceJSON,...a},this.read({layerDefinition:a},{origin:`service`,layer:t,url:F(r)}))}toExportImageJSON(e){let t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:`mapLayer`}},n=u(e,this.definitionExpression);n!=null&&(t.definitionExpression=n);let r=[`renderer`,`labelingInfo`,`opacity`,`labelsVisible`].reduce((e,t)=>(e[t]=this.originIdOf(t),e),{});if(Object.keys(r).some(e=>r[e]>2)){let e=t.drawingInfo={};if(r.renderer>2&&(e.renderer=this.renderer?this.renderer.toJSON():null),r.labelsVisible>2&&(e.showLabels=this.labelsVisible),this.labelsVisible&&r.labelingInfo>2){if(!this.labelingInfo)e.showLabels=!1;else{!this.loaded&&this.labelingInfo?.some(e=>!e.labelPlacement)&&c.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let t=this.labelingInfo;this.geometryType!=null&&(t=O(this.labelingInfo,C.toJSON(this.geometryType))),e.showLabels=!0,e.labelingInfo=t.filter(e=>e.labelPlacement).map(e=>e.toJSON({origin:`service`,layer:this.layer}))}}r.opacity>2&&(e.transparency=100-this.opacity*100),this._assignDefaultSymbolColors(e.renderer)}return(this.layer?.capabilities?.exportMap?.supportsSublayerOrderBy??!1)&&this.originIdOf(`orderBy`)>2&&(t.orderBy=this.orderBy?.map(e=>e.toJSON())??null),t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,e=>{e.color||(e.style===`esriSMSX`||e.style===`esriSMSCross`)&&(e.color=e.outline?.color?e.outline.color:[0,0,0,0])})}_forEachSimpleMarkerSymbols(e,t){if(e){let n=(`uniqueValueInfos`in e?e.uniqueValueInfos:`classBreakInfos`in e?e.classBreakInfos:null)??[];for(let e of n)K(e.symbol)&&t(e.symbol);`symbol`in e&&K(e.symbol)&&t(e.symbol),`defaultSymbol`in e&&K(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){let n=this.layer,r=this._get(e),i,a;switch(e){case`definitionExpression`:case`floorInfo`:i=`supportsSublayerDefinitionExpression`;break;case`minScale`:case`maxScale`:case`visible`:i=`supportsSublayerVisibility`;break;case`labelingInfo`:case`labelsVisible`:case`opacity`:case`renderer`:case`source`:i=`supportsDynamicLayers`,a=`supportsModification`;break;case`orderBy`:i=`supportsSublayerOrderBy`,a=`supportsModification`}let o=b(this).getDefaultOrigin();if(o!==`service`){if(i&&this.layer?.capabilities?.exportMap?.[i]===!1){this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${i}'`);return}if(a&&this.capabilities?.exportMap[a]===!1){this._logLockedError(e,`capability not available 'capabilities.exportMap.${a}'`);return}}if(e===`source`&&this.loadStatus!==`not-loaded`){this._logLockedError(e,`'source' can't be changed after calling sublayer.load()`);return}this._set(e,t),o!==`service`&&r!==t&&n?.emit&&n.emit(`sublayer-update`,{propertyName:e,target:this})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null,e.layer=null}),this.removeAllHandles()),e&&(e.forEach(e=>{e.parent=this,e.layer=this.layer}),this.addHandles([e.on(`after-add`,({item:e})=>{e.parent=this,e.layer=this.layer}),e.on(`after-remove`,({item:e})=>{e.parent=null,e.layer=null}),e.on(`before-changes`,e=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??!0)||(c.getLogger(this).error(new i(`sublayer:sublayers-non-modifiable`,`Sublayer can't be added, moved, or removed from the layer's sublayers`,{sublayer:this,layer:this.layer})),e.preventDefault())})]))}_logLockedError(e,t){let{layer:n,declaredClass:r}=this;c.getLogger(r).error(new i(`sublayer:locked`,`Property '${String(e)}' can't be changed on Sublayer from the layer '${n?.id}'`,{reason:t,sublayer:this,layer:n}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}static{this.test={isMapImageLayerOverridePolicy:e=>e===Z||e===X||e===J,isTileImageLayerOverridePolicy:e=>e===Y}}};e([f({type:H,json:{name:`attributeTableInfo`,write:{overridePolicy:J},origins:{"web-scene":{write:!1}}}})],$.prototype,`attributeTableTemplate`,void 0),e([f({readOnly:!0})],$.prototype,`capabilities`,void 0),e([U(`service`,`capabilities`,[`layerDefinition.canModifyLayer`,`layerDefinition.capabilities`])],$.prototype,`readCapabilities`,null),e([f()],$.prototype,`defaultPopupTemplate`,null),e([f({type:String,value:null,json:{name:`layerDefinition.definitionExpression`,write:{allowNull:!0,overridePolicy:J}}})],$.prototype,`definitionExpression`,null),e([f({readOnly:!0,type:ie,json:{origins:{service:{read:{source:`layerDefinition.editFieldsInfo`}}}}})],$.prototype,`editFieldsInfo`,void 0),e([f({readOnly:!0})],$.prototype,`effectiveScaleRange`,null),e([f({readOnly:!0,type:[String]})],$.prototype,`effectiveUniqueIdFields`,null),e([U(`service`,`maxScaleRange`,[`minScale`,`maxScale`])],$.prototype,`readMaxScaleRange`,null),e([f({type:[w],json:{origins:{service:{read:{source:`layerDefinition.fields`}}}}})],$.prototype,`fields`,void 0),e([f({readOnly:!0})],$.prototype,`fieldsIndex`,null),e([f({type:k,value:null,json:{name:`layerDefinition.floorInfo`,read:{source:`layerDefinition.floorInfo`},write:{target:`layerDefinition.floorInfo`,overridePolicy:J},origins:{"web-scene":{read:!1,write:!1}}}})],$.prototype,`floorInfo`,null),e([f({type:x,json:{read:{source:`layerDefinition.extent`}}})],$.prototype,`fullExtent`,void 0),e([f({type:C.apiValues,json:{origins:{service:{name:`layerDefinition.geometryType`,read:{reader:C.read}}}}})],$.prototype,`geometryType`,void 0),e([f({type:String})],$.prototype,`globalIdField`,void 0),e([U(`service`,`globalIdField`,[`layerDefinition.globalIdField`,`layerDefinition.fields`])],$.prototype,`readGlobalIdFieldFromService`,null),e([f({readOnly:!0})],$.prototype,`graphicOrigin`,null),e([f({type:_,json:{write:{ignoreOrigin:!0}}})],$.prototype,`id`,null),e([f({readOnly:!0})],$.prototype,`isTable`,void 0),e([U(`service`,`isTable`,[`type`])],$.prototype,`readIsTable`,null),e([f({value:null,type:[D],json:{read:{source:`layerDefinition.drawingInfo.labelingInfo`},write:{target:`layerDefinition.drawingInfo.labelingInfo`,overridePolicy:Z}}})],$.prototype,`labelingInfo`,null),e([W(`labelingInfo`)],$.prototype,`writeLabelingInfo`,null),e([f({type:Boolean,value:!0,json:{read:{source:`layerDefinition.drawingInfo.showLabels`},write:{target:`layerDefinition.drawingInfo.showLabels`,overridePolicy:X}}})],$.prototype,`labelsVisible`,null),e([f({value:null})],$.prototype,`layer`,null),e([f({type:String,json:{write:{overridePolicy:Y}}})],$.prototype,`layerItemId`,void 0),e([f({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:`showLegend`},write:{target:`showLegend`,overridePolicy:Q}}})],$.prototype,`legendEnabled`,void 0),e([f({type:[`show`,`hide`,`hide-children`],value:`show`,json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],$.prototype,`listMode`,null),e([f({type:Number,value:0,json:{write:{overridePolicy:X}}})],$.prototype,`minScale`,null),e([U(`minScale`,[`minScale`,`layerDefinition.minScale`])],$.prototype,`readMinScale`,null),e([f({type:Number,value:0,json:{write:{overridePolicy:X}}})],$.prototype,`maxScale`,null),e([U(`maxScale`,[`maxScale`,`layerDefinition.maxScale`])],$.prototype,`readMaxScale`,null),e([f()],$.prototype,`objectIdField`,void 0),e([U(`service`,`objectIdField`,[`layerDefinition.objectIdField`,`layerDefinition.fields`])],$.prototype,`readObjectIdFieldFromService`,null),e([f({type:Number,value:1,json:{write:{target:`layerDefinition.drawingInfo.transparency`,overridePolicy:X}}})],$.prototype,`opacity`,null),e([U(`opacity`,[`layerDefinition.drawingInfo.transparency`,`layerDefinition.transparency`])],$.prototype,`readOpacity`,null),e([W(`opacity`)],$.prototype,`writeOpacity`,null),e([f({value:null,type:[A],json:{name:`layerDefinition.orderBy`,read:{reader:re},write:{overridePolicy:J},origins:{"web-scene":{read:!1,write:!1}}}})],$.prototype,`orderBy`,null),e([f({json:{type:_,write:{target:`parentLayerId`,writerEnsuresNonNull:!0,overridePolicy:X}}})],$.prototype,`parent`,void 0),e([W(`parent`)],$.prototype,`writeParent`,null),e([f({type:Boolean,value:!0,json:{read:{source:`disablePopup`,reader(e,t){return!t.disablePopup}},write:{target:`disablePopup`,overridePolicy:Q,writer(e,t,n){t[n]=!e}}}})],$.prototype,`popupEnabled`,void 0),e([f({type:t,json:{read:{source:`popupInfo`},write:{target:`popupInfo`,overridePolicy:Q}}})],$.prototype,`popupTemplate`,void 0),e([f({readOnly:!0})],$.prototype,`queryTask`,null),e([f({type:[j],readOnly:!0,json:{origins:{service:{read:{source:`layerDefinition.relationships`}}}}})],$.prototype,`relationships`,void 0),e([f({types:P,value:null,json:{name:`layerDefinition.drawingInfo.renderer`,write:{overridePolicy:Z},origins:{"web-scene":{types:N,name:`layerDefinition.drawingInfo.renderer`,write:{overridePolicy:Z}}}}})],$.prototype,`renderer`,null),e([f({types:{key:`type`,base:null,typeMap:{"data-layer":I,"map-layer":L}},cast(e){if(e){if(`mapLayerId`in e)return v(L,e);if(`dataSource`in e)return v(I,e)}return e},json:{name:`layerDefinition.source`,write:{overridePolicy:X}}})],$.prototype,`source`,null),e([f()],$.prototype,`sourceJSON`,void 0),e([f({type:S,json:{origins:{service:{read:{source:`layerDefinition.extent.spatialReference`}}}}})],$.prototype,`spatialReference`,void 0),e([f({value:null,json:{type:[_],write:{target:`subLayerIds`,allowNull:!0,overridePolicy:X}}})],$.prototype,`sublayers`,null),e([p(`sublayers`)],$.prototype,`castSublayers`,null),e([W(`sublayers`)],$.prototype,`writeSublayers`,null),e([f({type:String,json:{name:`name`,write:{overridePolicy:Q}}})],$.prototype,`title`,void 0),e([U(`service`,`title`,[`name`,`layerDefinition.name`])],$.prototype,`readTitle`,null),e([f({type:String})],$.prototype,`typeIdField`,void 0),e([f({json:{read:!1},readOnly:!0,value:`sublayer`})],$.prototype,`type`,void 0),e([U(`typeIdField`,[`layerDefinition.typeIdField`])],$.prototype,`readTypeIdField`,null),e([f({type:[oe],json:{origins:{service:{read:{source:`layerDefinition.types`}}}}})],$.prototype,`types`,void 0),e([f({type:[String],readOnly:!0})],$.prototype,`uniqueIdFields`,void 0),e([U(`service`,`uniqueIdFields`,[`layerDefinition.uniqueIdInfo.OIDFieldContainsHashValue`,`layerDefinition.uniqueIdInfo.fields`])],$.prototype,`readUniqueIdFields`,null),e([f({type:String,json:{name:`layerUrl`,write:{overridePolicy:Y}}})],$.prototype,`url`,null),e([f({type:Boolean,value:!0,json:{read:{source:`defaultVisibility`},write:{target:`defaultVisibility`,overridePolicy:X}}})],$.prototype,`visible`,null),e([W(`visible`)],$.prototype,`writeVisible`,null),$=G=e([m(`esri.layers.support.Sublayer`)],$);export{$ as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import n from"../../request.js";import r from"../../core/Collection.js";import i from"../../core/Error.js";import has from"../../core/has.js";import{IdentifiableMixin as a}from"../../core/Identifiable.js";import{clone as o}from"../../core/lang.js";import{Loadable as s}from"../../core/Loadable.js";import c from"../../core/Logger.js";import{MultiOriginJSONSupportMixin as l}from"../../core/MultiOriginJSONSupport.js";import{sqlAnd as u}from"../../core/sql.js";import{objectToQuery as d}from"../../core/urlUtils.js";import{property as f,cast as p,subclass as m}from"../../core/accessorSupport/decorators.js";import{ensureInteger as h,ensureType as g,Integer as _,ensureClass as v}from"../../core/accessorSupport/ensureType.js";import{nameToId as y}from"../../core/accessorSupport/PropertyOrigin.js";import{getProperties as b}from"../../core/accessorSupport/utils.js";import x from"../../geometry/Extent.js";import S from"../../geometry/SpatialReference.js";import{joinScaleRanges as C}from"../../geometry/support/scaleUtils.js";import{featureGeometryTypeKebabDictionary as w}from"../../geometry/support/typeUtils.js";import ee from"../../graphic/MapImageGraphicOrigin.js";import te from"../../graphic/TileGraphicOrigin.js";import ne from"../graphics/sources/support/QueryTask.js";import{readOrderByInfos as re}from"../mixins/OrderedLayer.js";import ie from"./EditFieldsInfo.js";import{getFeatureType as ae}from"./featureLayerUtils.js";import oe from"./FeatureType.js";import T from"./Field.js";import E from"./FieldsIndex.js";import{fixRendererFields as D}from"./fieldUtils.js";import O from"./LabelClass.js";import{validateLabelingInfo as k}from"./labelingInfo.js";import A from"./LayerFloorInfo.js";import j from"./OrderByInfo.js";import M from"./Relationship.js";import{getFeatureLayerCapabilities as N}from"./serviceCapabilitiesUtils.js";import{webSceneRendererTypes as P,rendererTypes as F}from"../../renderers/support/typeUtils.js";import{parseUrl as I}from"../../rest/utils.js";import L from"../../rest/layerSources/DynamicDataLayer.js";import R from"../../rest/layerSources/DynamicMapLayer.js";import z from"../../rest/support/AttachmentQuery.js";import se from"../../rest/support/Query.js";import{createPopupTemplate as B}from"../../support/popupUtils.js";import{isSymbol3D as V}from"../../symbols/support/typeUtils.js";import H from"../../tables/AttributeTableTemplate.js";import{reader as U}from"../../core/accessorSupport/decorators/reader.js";import{writer as W}from"../../core/accessorSupport/decorators/writer.js";var G;function K(e){return e?.type===`esriSMS`}function q(e,t,n){let r=n.minimumWritableOrigin||n.origin;return r?e.originIdOf(t)>=y(r):!1}function J(e,t,n){let r=q(this,t,n);return{ignoreOrigin:!0,allowNull:r,enabled:n?n.layer?.type===`map-image`&&(n.writeSublayerStructure||r):!1}}function Y(e,t,n){return{enabled:n?n.layer?.type===`tile`&&(q(this,t,n)||this._isOverridden(t)):!1}}function X(e,t,n){return{ignoreOrigin:!0,enabled:n&&n.writeSublayerStructure||!1}}function Z(e,t,n){return{ignoreOrigin:!0,enabled:n?.writeSublayerStructure?this.originIdOf(t)>2:!1}}function Q(e,t,n){return{ignoreOrigin:!0,enabled:n?n.writeSublayerStructure||q(this,t,n):!1}}let ce=0;const le=new Set([`layer`,`parent`,`loaded`,`loadStatus`,`loadError`,`loadWarnings`]);let $=class extends l(a(s)){static{G=this}constructor(e){super(e),this.attributeTableTemplate=null,this.capabilities=void 0,this.editFieldsInfo=null,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type=`sublayer`,this.types=null,this.uniqueIdFields=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise(this.reload(e)),this}readCapabilities(e,t){t=t.layerDefinition||t;let{attachment:n,operations:{supportsQuery:r,supportsQueryAttachments:i},query:{supportsFormatPBF:a,supportsOrderBy:o,supportsPagination:s,relativeTimeBinWindow:c},data:{supportsAttachment:l},queryRelated:u}=N(t,this.url);return{attachment:{supportsOrderByFields:n?.supportsOrderByFields??!1,supportsResize:n?.supportsResize??!1,supportsTypeWildcard:n?.supportsTypeWildcard??!1},exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:r,supportsQueryAttachments:i},data:{supportsAttachment:l},query:{relativeTimeBinWindow:c,supportsFormatPBF:a,supportsOrderBy:o,supportsPagination:s},queryRelated:u}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer(`definitionExpression`,e)}get effectiveScaleRange(){let e=this._get(`effectiveScaleRange`),{maxScale:t,minScale:n,parent:r}=this,i={minScale:n,maxScale:t};return r?.effectiveScaleRange!==void 0&&C(i,r.effectiveScaleRange),e&&e.minScale===i.minScale&&e.maxScale===i.maxScale?e:i}get effectiveUniqueIdFields(){return this.uniqueIdFields?[...this.uniqueIdFields]:this.objectIdField?[this.objectIdField]:[]}readMaxScaleRange(e,t){return t=t.layerDefinition||t,{minScale:t.minScale??0,maxScale:t.maxScale??0}}get fieldsIndex(){return new E(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer(`floorInfo`,e)}readGlobalIdFieldFromService(e,t){if(t=t.layerDefinition||t,t.globalIdField)return t.globalIdField;if(t.fields){for(let e of t.fields)if(e.type===`esriFieldTypeGlobalID`)return e.name}}get graphicOrigin(){if(!this.layer)return null;switch(this.layer.type){case`tile`:return new te(this.layer,this);case`map-image`:return new ee(this.layer,this)}}get id(){return this._get(`id`)??ce++}set id(e){if(this._get(`id`)!==e){if(this.layer?.capabilities?.exportMap?.supportsDynamicLayers===!1){this._logLockedError(`id`,`capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'`);return}this._set(`id`,e)}}readIsTable(e,t){return t.type===`Table`}set labelingInfo(e){this._setAndNotifyLayer(`labelingInfo`,e)}writeLabelingInfo(e,t,n,r){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map(e=>e.write({},r))}})}set labelsVisible(e){this._setAndNotifyLayer(`labelsVisible`,e)}set layer(e){this._set(`layer`,e),this.sublayers?.forEach(t=>t.layer=e)}set listMode(e){this._set(`listMode`,e)}get loaded(){return super.loaded}set minScale(e){this._setAndNotifyLayer(`minScale`,e)}readMinScale(e,t){return t.minScale||t.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer(`maxScale`,e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,t){return t=t.layerDefinition||t,t.objectIdField?t.objectIdField:t.fields?.find(e=>e.type===`esriFieldTypeOID`)?.name}set opacity(e){this._setAndNotifyLayer(`opacity`,e)}readOpacity(e,t){let{layerDefinition:n}=t;return 1-(n?.transparency??n?.drawingInfo?.transparency??0)*.01}writeOpacity(e,t,n,r){t.layerDefinition={drawingInfo:{transparency:100-e*100}}}set orderBy(e){this._setAndNotifyLayer(`orderBy`,e)}writeParent(e,t){t.parentLayerId=!this.parent||this.parent===this.layer?-1:h(this.parent.id)}get queryTask(){if(!this.layer)return null;let{capabilities:e,fieldsIndex:t,layer:n,uniqueIdFields:r,url:i}=this,{spatialReference:a}=n,o=`gdbVersion`in n?n.gdbVersion:void 0,s=has(`featurelayer-pbf`)&&e?.query.supportsFormatPBF,c=e?.operations?.supportsQueryAttachments??!1,l=e?.query?.relativeTimeBinWindow??0;return new ne({fieldsIndex:t,gdbVersion:o,pbfSupported:s,queryAttachmentsSupported:c,relativeTimeBinWindow:l,sourceSpatialReference:a,uniqueIdFields:r,url:i})}set renderer(e){if(D(e,this.fieldsIndex),e){for(let t of e.symbols)if(V(t)){c.getLogger(this).warn(`Sublayer renderer should use 2D symbols`);break}}this._setAndNotifyLayer(`renderer`,e)}get source(){return this._get(`source`)||new R({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer(`source`,e)}get sublayers(){return this._get(`sublayers`)}set sublayers(e){this._handleSublayersChange(e,this._get(`sublayers`)),this._set(`sublayers`,e)}castSublayers(e){return g(r.ofType(G),e)}writeSublayers(e,t,n){this.sublayers?.length&&(t[n]=this.sublayers.map(e=>e.id).toArray().reverse())}readTitle(e,t){return t.layerDefinition?.name??t.name}readTypeIdField(e,t){t=t.layerDefinition||t;let n=t.typeIdField;if(n&&t.fields){n=n.toLowerCase();let e=t.fields.find(e=>e.name.toLowerCase()===n);e&&(n=e.name)}return n}readUniqueIdFields(e,t){return t.layerDefinition?.uniqueIdInfo?.OIDFieldContainsHashValue?t.layerDefinition.uniqueIdInfo.fields:null}get url(){let e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,t?.type===`map-layer`)return`${e.path}/${t.mapLayerId}`;let n={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${d(n)}`}set url(e){this._overrideIfSome(`url`,e)}set visible(e){this._setAndNotifyLayer(`visible`,e)}writeVisible(e,t,n,r){t[n]=this.getAtOrigin(`defaultVisibility`,`service`)||e}clone(){let{store:e}=b(this),t=new G;return b(t).store=e.clone(le),this.commitProperty(`url`),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return B(this,e)}createQuery(){return new se({returnGeometry:!0,where:this.definitionExpression||`1=1`})}async createFeatureLayer(){if(this.sublayers)return null;let e=(await import(`../FeatureLayer.js`)).default,{layer:t,url:n}=this,r;if(n&&this.originIdOf(`url`)>2)r=new e({url:n});else if(t?.parsedUrl){let n=t.parsedUrl;r=new e({url:n.path}),n&&this.source&&(this.source.type===`map-layer`?r.layerId=this.source.mapLayerId:r.dynamicDataSource=this.source)}else throw new i(`createFeatureLayer:missing-information`,`Cannot create a FeatureLayer without a url or a parent layer`);return t?.refreshInterval!=null&&(r.refreshInterval=t.refreshInterval),this.definitionExpression&&(r.definitionExpression=this.definitionExpression),this.floorInfo&&(r.floorInfo=o(this.floorInfo)),this.originIdOf(`labelingInfo`)>2&&(r.labelingInfo=o(this.labelingInfo)),this.originIdOf(`labelsVisible`)>0&&(r.labelsVisible=this.labelsVisible),this.originIdOf(`legendEnabled`)>0&&(r.legendEnabled=this.legendEnabled),this.originIdOf(`visible`)>0&&(r.visible=this.visible),this.originIdOf(`minScale`)>0&&(r.minScale=this.minScale),this.originIdOf(`maxScale`)>0&&(r.maxScale=this.maxScale),this.originIdOf(`opacity`)>0&&(r.opacity=this.opacity),this.originIdOf(`popupTemplate`)>0&&(r.popupTemplate=o(this.popupTemplate)),this.originIdOf(`renderer`)>2&&(r.renderer=o(this.renderer)),this.source?.type===`data-layer`&&(r.dynamicDataSource=this.source.clone()),this.originIdOf(`title`)>0&&(r.title=this.title),t?.type===`map-image`&&t.originIdOf(`customParameters`)>0&&(r.customParameters=t.customParameters),t?.type===`tile`&&t.originIdOf(`customParameters`)>0&&(r.customParameters=t.customParameters),r}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return ae(this.types,this.typeIdField,e)}getFieldDomain(e,t){let n=t?.feature,r=this.getFeatureType(n);if(r){let t=r.domains&&r.domains[e];if(t&&t.type!==`inherited`)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load();let n=z.from(e),r=this.capabilities;if(!r?.data?.supportsAttachment)throw new i(`queryAttachments:not-supported`,`this layer doesn't support attachments`);let{attachmentTypes:a,objectIds:o,globalIds:s,num:c,size:l,start:u,where:d}=n;if(!r?.operations?.supportsQueryAttachments){let e=a?.length>0,t=s?.length>0,r=l?.length>0;if(e||t||r||c||u||d)throw new i(`queryAttachments:option-not-supported`,`when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported`,n)}if(!(o?.length||s?.length||d))throw new i(`queryAttachments:invalid-query`,`'objectIds', 'globalIds', or 'where' are required to perform attachment query`,n);return!r?.attachment?.supportsOrderByFields&&n.orderByFields?.length&&(n=n.clone(),n.orderByFields=null),this.queryTask.executeAttachmentQuery(n,t)}async queryFeatureCount(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new i(`queryFeatureCount:not-supported`,`this layer doesn't support queries.`);if(!this.url)throw new i(`queryFeatureCount:not-supported`,`this layer has no url.`);let n=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...t,query:{...this.layer?.customParameters,token:n}})}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new i(`queryFeatures:not-supported`,`this layer doesn't support queries.`);if(!this.url)throw new i(`queryFeatures:not-supported`,`this layer has no url.`);let n=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(n?.features){let e=this.graphicOrigin;for(let t of n.features)t.sourceLayer=this,t.origin=e}return n}async queryObjectIds(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new i(`queryObjectIds:not-supported`,`this layer doesn't support queries.`);if(!this.url)throw new i(`queryObjectIds:not-supported`,`this layer has no url.`);let n=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...t,query:{...this.layer?.customParameters,token:n}})}async queryRelatedFeatures(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new i(`queryRelatedFeatures:not-supported`,`this layer doesn't support queries.`);if(!this.url)throw new i(`queryRelatedFeatures:not-supported`,`this layer has no url.`);let n=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...t,query:{...this.layer?.customParameters,token:n}})}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new i(`queryRelatedFeaturesCount:not-supported`,`this layer doesn't support queries.`);if(!this.capabilities.queryRelated.supportsCount)throw new i(`queryRelatedFeaturesCount:not-supported`,`this layer doesn't support query related counts.`);if(!this.url)throw new i(`queryRelatedFeaturesCount:not-supported`,`this layer has no url.`);let n=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...t,query:{...this.layer?.customParameters,token:n}})}async reload(e){if(this.loadStatus===`not-loaded`)return this.load(e).then(()=>{});let{layer:t,url:r}=this;if(!t&&!r)throw new i(`sublayer:missing-layer`,`Sublayer can't be loaded without being part of a layer`,{sublayer:this});let a=t?await t.fetchSublayerInfo(this,e):(await n(r,{query:{f:`json`},...e})).data;a&&(this.sourceJSON={...this.sourceJSON,...a},this.read({layerDefinition:a},{origin:`service`,layer:t,url:I(r)}))}toExportImageJSON(e){let t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:`mapLayer`}},n=u(e,this.definitionExpression);n!=null&&(t.definitionExpression=n);let r=[`renderer`,`labelingInfo`,`opacity`,`labelsVisible`].reduce((e,t)=>(e[t]=this.originIdOf(t),e),{});if(Object.keys(r).some(e=>r[e]>2)){let e=t.drawingInfo={};if(r.renderer>2&&(e.renderer=this.renderer?this.renderer.toJSON():null),r.labelsVisible>2&&(e.showLabels=this.labelsVisible),this.labelsVisible&&r.labelingInfo>2){if(!this.labelingInfo)e.showLabels=!1;else{!this.loaded&&this.labelingInfo?.some(e=>!e.labelPlacement)&&c.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let t=this.labelingInfo;this.geometryType!=null&&(t=k(this.labelingInfo,w.toJSON(this.geometryType))),e.showLabels=!0,e.labelingInfo=t.filter(e=>e.labelPlacement).map(e=>e.toJSON({origin:`service`,layer:this.layer}))}}r.opacity>2&&(e.transparency=100-this.opacity*100),this._assignDefaultSymbolColors(e.renderer)}return(this.layer?.capabilities?.exportMap?.supportsSublayerOrderBy??!1)&&this.originIdOf(`orderBy`)>2&&(t.orderBy=this.orderBy?.map(e=>e.toJSON())??null),t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,e=>{e.color||(e.style===`esriSMSX`||e.style===`esriSMSCross`)&&(e.color=e.outline?.color?e.outline.color:[0,0,0,0])})}_forEachSimpleMarkerSymbols(e,t){if(e){let n=(`uniqueValueInfos`in e?e.uniqueValueInfos:`classBreakInfos`in e?e.classBreakInfos:null)??[];for(let e of n)K(e.symbol)&&t(e.symbol);`symbol`in e&&K(e.symbol)&&t(e.symbol),`defaultSymbol`in e&&K(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){let n=this.layer,r=this._get(e),i,a;switch(e){case`definitionExpression`:case`floorInfo`:i=`supportsSublayerDefinitionExpression`;break;case`minScale`:case`maxScale`:case`visible`:i=`supportsSublayerVisibility`;break;case`labelingInfo`:case`labelsVisible`:case`opacity`:case`renderer`:case`source`:i=`supportsDynamicLayers`,a=`supportsModification`;break;case`orderBy`:i=`supportsSublayerOrderBy`,a=`supportsModification`}let o=b(this).getDefaultOrigin();if(o!==`service`){if(i&&this.layer?.capabilities?.exportMap?.[i]===!1){this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${i}'`);return}if(a&&this.capabilities?.exportMap[a]===!1){this._logLockedError(e,`capability not available 'capabilities.exportMap.${a}'`);return}}if(e===`source`&&this.loadStatus!==`not-loaded`){this._logLockedError(e,`'source' can't be changed after calling sublayer.load()`);return}this._set(e,t),o!==`service`&&r!==t&&n?.emit&&n.emit(`sublayer-update`,{propertyName:e,target:this})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null,e.layer=null}),this.removeAllHandles()),e&&(e.forEach(e=>{e.parent=this,e.layer=this.layer}),this.addHandles([e.on(`after-add`,({item:e})=>{e.parent=this,e.layer=this.layer}),e.on(`after-remove`,({item:e})=>{e.parent=null,e.layer=null}),e.on(`before-changes`,e=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??!0)||(c.getLogger(this).error(new i(`sublayer:sublayers-non-modifiable`,`Sublayer can't be added, moved, or removed from the layer's sublayers`,{sublayer:this,layer:this.layer})),e.preventDefault())})]))}_logLockedError(e,t){let{layer:n,declaredClass:r}=this;c.getLogger(r).error(new i(`sublayer:locked`,`Property '${String(e)}' can't be changed on Sublayer from the layer '${n?.id}'`,{reason:t,sublayer:this,layer:n}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}static{this.test={isMapImageLayerOverridePolicy:e=>e===Z||e===X||e===J,isTileImageLayerOverridePolicy:e=>e===Y}}};e([f({type:H,json:{name:`attributeTableInfo`,write:{overridePolicy:J},origins:{"web-scene":{write:!1}}}})],$.prototype,`attributeTableTemplate`,void 0),e([f({readOnly:!0})],$.prototype,`capabilities`,void 0),e([U(`service`,`capabilities`,[`layerDefinition.canModifyLayer`,`layerDefinition.capabilities`])],$.prototype,`readCapabilities`,null),e([f()],$.prototype,`defaultPopupTemplate`,null),e([f({type:String,value:null,json:{name:`layerDefinition.definitionExpression`,write:{allowNull:!0,overridePolicy:J}}})],$.prototype,`definitionExpression`,null),e([f({readOnly:!0,type:ie,json:{origins:{service:{read:{source:`layerDefinition.editFieldsInfo`}}}}})],$.prototype,`editFieldsInfo`,void 0),e([f({readOnly:!0})],$.prototype,`effectiveScaleRange`,null),e([f({readOnly:!0,type:[String]})],$.prototype,`effectiveUniqueIdFields`,null),e([U(`service`,`maxScaleRange`,[`minScale`,`maxScale`])],$.prototype,`readMaxScaleRange`,null),e([f({type:[T],json:{origins:{service:{read:{source:`layerDefinition.fields`}}}}})],$.prototype,`fields`,void 0),e([f({readOnly:!0})],$.prototype,`fieldsIndex`,null),e([f({type:A,value:null,json:{name:`layerDefinition.floorInfo`,read:{source:`layerDefinition.floorInfo`},write:{target:`layerDefinition.floorInfo`,overridePolicy:J},origins:{"web-scene":{read:!1,write:!1}}}})],$.prototype,`floorInfo`,null),e([f({type:x,json:{read:{source:`layerDefinition.extent`}}})],$.prototype,`fullExtent`,void 0),e([f({type:w.apiValues,json:{origins:{service:{name:`layerDefinition.geometryType`,read:{reader:w.read}}}}})],$.prototype,`geometryType`,void 0),e([f({type:String})],$.prototype,`globalIdField`,void 0),e([U(`service`,`globalIdField`,[`layerDefinition.globalIdField`,`layerDefinition.fields`])],$.prototype,`readGlobalIdFieldFromService`,null),e([f({readOnly:!0})],$.prototype,`graphicOrigin`,null),e([f({type:_,json:{write:{ignoreOrigin:!0}}})],$.prototype,`id`,null),e([f({readOnly:!0})],$.prototype,`isTable`,void 0),e([U(`service`,`isTable`,[`type`])],$.prototype,`readIsTable`,null),e([f({value:null,type:[O],json:{read:{source:`layerDefinition.drawingInfo.labelingInfo`},write:{target:`layerDefinition.drawingInfo.labelingInfo`,overridePolicy:Z}}})],$.prototype,`labelingInfo`,null),e([W(`labelingInfo`)],$.prototype,`writeLabelingInfo`,null),e([f({type:Boolean,value:!0,json:{read:{source:`layerDefinition.drawingInfo.showLabels`},write:{target:`layerDefinition.drawingInfo.showLabels`,overridePolicy:X}}})],$.prototype,`labelsVisible`,null),e([f({value:null})],$.prototype,`layer`,null),e([f({type:String,json:{write:{overridePolicy:Y}}})],$.prototype,`layerItemId`,void 0),e([f({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:`showLegend`},write:{target:`showLegend`,overridePolicy:Q}}})],$.prototype,`legendEnabled`,void 0),e([f({type:[`show`,`hide`,`hide-children`],value:`show`,json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],$.prototype,`listMode`,null),e([f({type:Number,value:0,json:{write:{overridePolicy:X}}})],$.prototype,`minScale`,null),e([U(`minScale`,[`minScale`,`layerDefinition.minScale`])],$.prototype,`readMinScale`,null),e([f({type:Number,value:0,json:{write:{overridePolicy:X}}})],$.prototype,`maxScale`,null),e([U(`maxScale`,[`maxScale`,`layerDefinition.maxScale`])],$.prototype,`readMaxScale`,null),e([f()],$.prototype,`objectIdField`,void 0),e([U(`service`,`objectIdField`,[`layerDefinition.objectIdField`,`layerDefinition.fields`])],$.prototype,`readObjectIdFieldFromService`,null),e([f({type:Number,value:1,json:{write:{target:`layerDefinition.drawingInfo.transparency`,overridePolicy:X}}})],$.prototype,`opacity`,null),e([U(`opacity`,[`layerDefinition.drawingInfo.transparency`,`layerDefinition.transparency`])],$.prototype,`readOpacity`,null),e([W(`opacity`)],$.prototype,`writeOpacity`,null),e([f({value:null,type:[j],json:{name:`layerDefinition.orderBy`,read:{reader:re},write:{overridePolicy:J},origins:{"web-scene":{read:!1,write:!1}}}})],$.prototype,`orderBy`,null),e([f({json:{type:_,write:{target:`parentLayerId`,writerEnsuresNonNull:!0,overridePolicy:X}}})],$.prototype,`parent`,void 0),e([W(`parent`)],$.prototype,`writeParent`,null),e([f({type:Boolean,value:!0,json:{read:{source:`disablePopup`,reader(e,t){return!t.disablePopup}},write:{target:`disablePopup`,overridePolicy:Q,writer(e,t,n){t[n]=!e}}}})],$.prototype,`popupEnabled`,void 0),e([f({type:t,json:{read:{source:`popupInfo`},write:{target:`popupInfo`,overridePolicy:Q}}})],$.prototype,`popupTemplate`,void 0),e([f({readOnly:!0})],$.prototype,`queryTask`,null),e([f({type:[M],readOnly:!0,json:{origins:{service:{read:{source:`layerDefinition.relationships`}}}}})],$.prototype,`relationships`,void 0),e([f({types:F,value:null,json:{name:`layerDefinition.drawingInfo.renderer`,write:{overridePolicy:Z},origins:{"web-scene":{types:P,name:`layerDefinition.drawingInfo.renderer`,write:{overridePolicy:Z}}}}})],$.prototype,`renderer`,null),e([f({types:{key:`type`,base:null,typeMap:{"data-layer":L,"map-layer":R}},cast(e){if(e){if(`mapLayerId`in e)return v(R,e);if(`dataSource`in e)return v(L,e)}return e},json:{name:`layerDefinition.source`,write:{overridePolicy:X}}})],$.prototype,`source`,null),e([f()],$.prototype,`sourceJSON`,void 0),e([f({type:S,json:{origins:{service:{read:{source:`layerDefinition.extent.spatialReference`}}}}})],$.prototype,`spatialReference`,void 0),e([f({value:null,json:{type:[_],write:{target:`subLayerIds`,allowNull:!0,overridePolicy:X}}})],$.prototype,`sublayers`,null),e([p(`sublayers`)],$.prototype,`castSublayers`,null),e([W(`sublayers`)],$.prototype,`writeSublayers`,null),e([f({type:String,json:{name:`name`,write:{overridePolicy:Q}}})],$.prototype,`title`,void 0),e([U(`service`,`title`,[`name`,`layerDefinition.name`])],$.prototype,`readTitle`,null),e([f({type:String})],$.prototype,`typeIdField`,void 0),e([f({json:{read:!1},readOnly:!0,value:`sublayer`})],$.prototype,`type`,void 0),e([U(`typeIdField`,[`layerDefinition.typeIdField`])],$.prototype,`readTypeIdField`,null),e([f({type:[oe],json:{origins:{service:{read:{source:`layerDefinition.types`}}}}})],$.prototype,`types`,void 0),e([f({type:[String],readOnly:!0})],$.prototype,`uniqueIdFields`,void 0),e([U(`service`,`uniqueIdFields`,[`layerDefinition.uniqueIdInfo.OIDFieldContainsHashValue`,`layerDefinition.uniqueIdInfo.fields`])],$.prototype,`readUniqueIdFields`,null),e([f({type:String,json:{name:`layerUrl`,write:{overridePolicy:Y}}})],$.prototype,`url`,null),e([f({type:Boolean,value:!0,json:{read:{source:`defaultVisibility`},write:{target:`defaultVisibility`,overridePolicy:X}}})],$.prototype,`visible`,null),e([W(`visible`)],$.prototype,`writeVisible`,null),$=G=e([m(`esri.layers.support.Sublayer`)],$);export{$ as default};
|
|
@@ -784,7 +784,7 @@ export default class SubtypeSublayer extends SubtypeSublayerSuperclass {
|
|
|
784
784
|
* Creates query parameters that can be used to fetch features that
|
|
785
785
|
* satisfy the layer's current filters, and definitions.
|
|
786
786
|
*
|
|
787
|
-
* @returns The query object representing the layer's definition expression
|
|
787
|
+
* @returns The query parameter object representing the layer's definition expression
|
|
788
788
|
* and other configurations.
|
|
789
789
|
* @example
|
|
790
790
|
* // this snippet shows the query parameter object that is returned
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import{ClonableMixin as n}from"../../core/Clonable.js";import r from"../../core/Error.js";import{IdentifiableMixin as i}from"../../core/Identifiable.js";import{clone as a}from"../../core/lang.js";import{Loadable as o}from"../../core/Loadable.js";import s from"../../core/Logger.js";import{destroyMaybe as c}from"../../core/maybe.js";import{MultiOriginJSONSupportMixin as l}from"../../core/MultiOriginJSONSupport.js";import{setDeepValue as u}from"../../core/object.js";import{sqlAnd as d}from"../../core/sql.js";import{property as f,subclass as p}from"../../core/accessorSupport/decorators.js";import{excludeTables as m}from"../../core/accessorSupport/layerContainerType.js";import h from"../../form/FormTemplate.js";import g from"../../geometry/SpatialReference.js";import ee from"../../graphic/SubtypeGroupGraphicOrigin.js";import{labelsVisible as te,legendEnabled as ne,minScale as re,maxScale as ie,popupEnabled as ae}from"./commonProperties.js";import{createQuery as _,computeDomainFromSubtypes as v}from"./featureLayerUtils.js";import y from"./FeatureTemplate.js";import b from"./FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as x,fieldConfigurationsFromPopupTemplate as S,fieldConfigurationsFromFields as C}from"./fieldConfigUtils.js";import{defineFieldProperties as w}from"./fieldProperties.js";import{fixRendererFields as T}from"./fieldUtils.js";import oe from"./LabelClass.js";import{reader as se}from"./labelingInfo.js";import{rendererReader as E,supportedRendererTypes as D}from"./subtypeGroupLayerUtils.js";import O from"./TitleCreator.js";import k from"../../renderers/SimpleRenderer.js";import A from"../../rest/support/AttachmentQuery.js";import j from"../../rest/support/Query.js";import{createPopupTemplate as M}from"../../support/popupUtils.js";import{defaultPolygonSymbol2D as N,defaultPolylineSymbol2D as P,defaultPointSymbol2D as F}from"../../symbols/support/defaults.js";import I from"../../tables/AttributeTableTemplate.js";import{writer as L}from"../../core/accessorSupport/decorators/writer.js";import{reader as R}from"../../core/accessorSupport/decorators/reader.js";const z=w();let B=0;function V(e,t){let n=e.json.write;return typeof n!=`object`&&(n=e.json.write={}),n.ignoreOrigin=!0,t?.spatialOnly&&(n.layerContainerTypes=m),e}function H(e){let t={write:{ignoreOrigin:!0}};return e?.name&&(t.name=e.name),typeof t.write==`object`&&(e?.spatialOnly&&(t.write.layerContainerTypes=m),e?.target&&(t.write.target=e.target)),t}function U(e){return new k({symbol:W(e)})}function W(e){switch(e){case`point`:case`multipoint`:return F.clone();case`polyline`:return P.clone();case`polygon`:case`multipatch`:return N.clone();default:return null}}function G(e,t){return t?e?.type===`unique-value`&&e.field!=null&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression:!1}function K(e){return J(e,`user`)===e}function q(e){return J(e,`service`)}function ce(e){return J(e,`portal-item`)}function J(e,t){return(e.parent?.getAtOrigin(`sublayers`,t))?.find(({subtypeCode:t})=>t===e.subtypeCode)}function Y(e,t){return e==null?null:t.subtypes?.find(t=>t.code===e)}function le(e,t){let n=t.geometryType,r=null;switch(n){case`esriGeometryPoint`:case`esriGeometryMultipoint`:r=`point`;break;case`esriGeometryPolyline`:r=`line`;break;case`esriGeometryPolygon`:case`esriGeometryMultiPatch`:r=`polygon`;break;default:t.type,r=null}let i={},a=Y(e,t);if(a!=null){let{defaultValues:e}=a;for(let t in e)i[t]=e[t]}return i[t.subtypeField]=e,new y({name:`New Feature`,drawingTool:r,prototype:{attributes:i}})}let X=class extends l(n(i(o))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.graphicOrigin=new ee(this),this.id=`${Date.now().toString(16)}-subtype-sublayer-${B++}`,this.type=`subtype-sublayer`,this.labelsVisible=!0,this.labelingInfo=null,this.layerType=`ArcGISFeatureLayer`,this.legendEnabled=!0,this.listMode=`show`,this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.visible=!0}load(e){return T(this.renderer,this.fieldsIndex),Promise.resolve(this)}get _titleCreator(){let e=this._get(`_titleCreator`);return c(e),new O({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,displayField:this.parent?.displayField??``,fields:this.fields,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){let{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._override(`fieldConfigurations`,e),!this.parent?.loaded)return;let t=x(this,e);t&&this._set(`popupTemplate`,t)}get fieldConfigurations(){return this._isOverridden(`fieldConfigurations`)?this._get(`fieldConfigurations`):S(this)||null}writeFieldOverrides(e,t,n){let{fields:r,parent:i}=this,o;if(r){o=[];let e=0;r.forEach(({name:t,alias:n,editable:r,visible:a})=>{if(!a)return;let s=i?.fields?.find(e=>e.name===t);if(!s)return;let c={name:t},l=!1;n!==s.alias&&(c.alias=n,l=!0),r!==s.editable&&(c.editable=r,l=!0),o.push(c),l&&e++}),e===0&&o.length===r.length&&(o=null)}else o=a(e);o?.length&&u(n,o,t)}get fields(){let{parent:e,fieldOverrides:t,subtypeCode:n}=this,r=e?.fields;if(!e||!r?.length)return null;let{subtypes:i,subtypeField:a}=e,o=i?.find(e=>e.code===n),s=o?.defaultValues,c=o?.domains,l=[];for(let e of r){let r=e.clone(),{name:i}=r,o=t?.find(e=>e.name===i);if(r.visible=!t?.length||!!o,o){let{alias:e,editable:t}=o;e&&(r.alias=e),t===!1&&(r.editable=!1)}let u=s?.[i]??null;r.defaultValue=i===a?n:u;let d=c?.[i]??null;r.domain=i===a?null:d?d.type===`inherited`?r.domain:d.clone():null,l.push(r)}return l}get floorInfo(){return this.parent?.floorInfo}get isTable(){return!!this.parent?.isTable}get geometryType(){return this.parent?.geometryType}get globalIdField(){return this.parent?this.parent.globalIdField:(s.getLogger(this).error($(`globalIdField`)),null)}get effectiveScaleRange(){let{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||s.getLogger(this).error($(`objectIdField`)),this.parent?.objectIdField}writePopupTemplate(e,t,n,r){e&&(t[n]=e.toJSON({...r,writeFieldFormat:!0}))}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){T(e,this.fieldsIndex),this._override(`renderer`,e)}get renderer(){if(this._isOverridden(`renderer`))return this._get(`renderer`);let{parent:e}=this;return e&&!e.isTable&&e.geometryType!==`mesh`?(K(this)?a(q(this)?.renderer):null)??U(e.geometryType):null}readRendererFromService(e,t,n){if(t.type===`Table`)return null;let r=t.drawingInfo?.renderer,i=E(r,t,n),a,{subtypeCode:o}=this;if(o!=null&&G(i,t.subtypeField)){let e=i.uniqueValueInfos?.find(({value:e})=>(e=typeof e==`number`?String(e):e,e===String(o)));e&&(a=new k({symbol:e.symbol}))}else i?.type===`simple`&&!i.visualVariables?.length&&(a=i);return a}readRenderer(e,t,n){let r=t?.layerDefinition?.drawingInfo?.renderer;if(r)return E(r,t,n)||void 0}get spatialReference(){return this.parent?.spatialReference??g.WGS84}get subtypeField(){return this.parent?.subtypeField}get templates(){return this._isOverridden(`templates`)?this._get(`templates`):a(K(this)?q(this)?.templates:ce(this)?.templates||q(this)?.templates)}set templates(e){this._override(`templates`,e)}readTemplatesFromService(e,t){return[le(this.subtypeCode,t)]}get title(){return this._isOverridden(`title`)?this._get(`title`):(K(this)?q(this):null)?.title}set title(e){this._override(`title`,e)}readTitleFromService(e,t){let n=Y(this.subtypeCode,t);return n==null?null:n.name}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t,n){let{parent:i}=this;if(!i)throw $(`addAttachment`);if(e.getAttribute(i.subtypeField)!==this.subtypeCode)throw new r(`subtype-sublayer:addAttachment`,`The feature provided does not belong to this SubtypeSublayer`);return i.addAttachment(e,t,n)}async updateAttachment(e,t,n,i){let{parent:a}=this;if(!a)throw $(`updateAttachment`);if(e.getAttribute(a.subtypeField)!==this.subtypeCode)throw new r(`subtype-sublayer:updateAttachment`,`The feature provided does not belong to this SubtypeSublayer`);return a.updateAttachment(e,t,n,i)}async deleteAttachments(e,t,n){let{parent:i}=this;if(!i)throw $(`deleteAttachments`);if(e.getAttribute(i.subtypeField)!==this.subtypeCode)throw new r(`subtype-sublayer:deleteAttachments`,`The feature provided does not belong to this SubtypeSublayer`);return i.deleteAttachments(e,t,n)}async applyEdits(e,t){if(!this.parent)throw $(`applyEdits`);return this.parent.applyEdits(e,t)}createFieldConfigurations(){return C(this)}createPopupTemplate(e){let t=this,{parent:n,fields:r,title:i}=this;if(n){let{displayField:e,editFieldsInfo:a,objectIdField:o}=n;t={displayField:e,editFieldsInfo:a,fields:r,objectIdField:o,title:i}}return M(t,e)}createQuery(){if(!this.parent)throw $(`createQuery`);let e=_(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=d(t,this.parent.definitionExpression),e}getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getField(e){return this.fieldsIndex.get(e)}getFieldAlias(e){let t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){let t=v(this.parent,e);if(t)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){let n=await this.load();if(!n.parent)throw $(`queryAttachments`);let r=e instanceof A?e.clone():new A(e);return r.where=Q(r.where,n.parent.subtypeField,n.subtypeCode),n.parent.queryAttachments(r,t)}async queryFeatureCount(e,t){let n=await this.load();if(!n.parent)throw $(`queryFeatureCount`);return n.parent.queryFeatureCount(Z(n.parent,n,e),t)}async queryFeatures(e,t){let n=await this.load();if(!n.parent)throw $(`queryFeatures`);return n.parent.queryFeatures(Z(n.parent,n,e),t)}async queryObjectIds(e,t){let n=await this.load();if(!n.parent)throw $(`queryObjectIds`);return n.parent.queryObjectIds(Z(n.parent,n,e),t)}async queryRelatedFeatures(e,t){let n=await this.load();if(!n.parent)throw $(`queryRelatedFeatures`);return n.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){let n=await this.load();if(!n.parent)throw $(`queryRelatedFeaturesCount`);return n.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){let t=this.fieldsIndex.get(e);return t?t.domain:null}};e([f({clonable:!1,readOnly:!0})],X.prototype,`_titleCreator`,null),e([f({type:I,json:H({name:`attributeTableInfo`})})],X.prototype,`attributeTableTemplate`,void 0),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`capabilities`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`effectiveCapabilities`,null),e([f({json:H()})],X.prototype,`charts`,void 0),e([f({type:Boolean,nonNullable:!0,json:H({name:`enableEditing`})})],X.prototype,`editingEnabled`,void 0),e([f({type:Boolean,readOnly:!0})],X.prototype,`effectiveEditingEnabled`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`elevationInfo`,null),e([f({clonable:!1,readOnly:!0})],X.prototype,`featureTitleFields`,null),e([f({type:[b],json:{name:`layerDefinition.fieldConfigurations`,write:{ignoreOrigin:!0}}})],X.prototype,`fieldConfigurations`,null),e([f({json:{name:`layerDefinition.fieldOverrides`,origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],X.prototype,`fieldOverrides`,void 0),e([L(`fieldOverrides`)],X.prototype,`writeFieldOverrides`,null),e([f({...z.fields,readOnly:!0,json:{read:!1}})],X.prototype,`fields`,null),e([f(z.fieldsIndex)],X.prototype,`fieldsIndex`,void 0),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`floorInfo`,null),e([f({type:h,json:H({name:`formInfo`})})],X.prototype,`formTemplate`,void 0),e([f({readOnly:!0,clonable:!1})],X.prototype,`graphicOrigin`,void 0),e([f({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],X.prototype,`id`,void 0),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`isTable`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`geometryType`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`globalIdField`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`type`,void 0),e([f(V(a(te)))],X.prototype,`labelsVisible`,void 0),e([f({type:[oe],json:{name:`layerDefinition.drawingInfo.labelingInfo`,origins:{service:{read:!1}},read:{reader:se},write:{ignoreOrigin:!0,layerContainerTypes:m}}})],X.prototype,`labelingInfo`,void 0),e([f({type:[`ArcGISFeatureLayer`],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,layerContainerTypes:m}}})],X.prototype,`layerType`,void 0),e([f(V(a(ne)))],X.prototype,`legendEnabled`,void 0),e([f({type:[`show`,`hide`]})],X.prototype,`listMode`,void 0),e([f((()=>{let e=a(re);return e.json.origins.service.read=!1,V(e,{spatialOnly:!0})})())],X.prototype,`minScale`,void 0),e([f((()=>{let e=a(ie);return e.json.origins.service.read=!1,V(e,{spatialOnly:!0})})())],X.prototype,`maxScale`,void 0),e([f({readOnly:!0})],X.prototype,`effectiveScaleRange`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`objectIdField`,null),e([f({type:Number,range:{min:0,max:1},nonNullable:!0,json:H({spatialOnly:!0})})],X.prototype,`opacity`,void 0),e([f({clonable:!1})],X.prototype,`parent`,void 0),e([f(V(a(ae)))],X.prototype,`popupEnabled`,void 0),e([f({type:t,json:H({name:`popupInfo`})})],X.prototype,`popupTemplate`,void 0),e([L(`popupTemplate`)],X.prototype,`writePopupTemplate`,null),e([f({readOnly:!0})],X.prototype,`defaultPopupTemplate`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`relationships`,null),e([f({types:D,json:H({target:`layerDefinition.drawingInfo.renderer`,spatialOnly:!0})})],X.prototype,`renderer`,null),e([R(`service`,`renderer`,[`drawingInfo.renderer`,`subtypeField`,`type`])],X.prototype,`readRendererFromService`,null),e([R(`renderer`,[`layerDefinition.drawingInfo.renderer`])],X.prototype,`readRenderer`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`spatialReference`,null),e([f({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],X.prototype,`subtypeCode`,void 0),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`subtypeField`,null),e([f({type:[y],json:H({name:`layerDefinition.templates`})})],X.prototype,`templates`,null),e([R(`service`,`templates`,[`geometryType`,`subtypeField`,`subtypes`,`type`])],X.prototype,`readTemplatesFromService`,null),e([f({type:String,json:H()})],X.prototype,`title`,null),e([R(`service`,`title`,[`subtypes`])],X.prototype,`readTitleFromService`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`url`,null),e([f({readOnly:!0})],X.prototype,`userHasUpdateItemPrivileges`,null),e([f({type:Boolean,nonNullable:!0,json:H({name:`visibility`,spatialOnly:!0})})],X.prototype,`visible`,void 0),X=e([p(`esri.layers.support.SubtypeSublayer`)],X);const Z=(e,t,n)=>{if(!n)return t.createQuery();let r=j.from(n);return r.where=Q(r.where,e.subtypeField,t.subtypeCode),r},Q=(e,t,n)=>{let r=RegExp(`${t}\\s*=\\s*\\d+`),i=`${t}=${n}`,a=e??``;return r.test(a)?a.replace(r,i):d(i,a)},$=e=>new r(`subtype-sublayer:parent-missing`,`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`);export{X as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import{ClonableMixin as n}from"../../core/Clonable.js";import r from"../../core/Error.js";import{IdentifiableMixin as i}from"../../core/Identifiable.js";import{clone as a}from"../../core/lang.js";import{Loadable as o}from"../../core/Loadable.js";import s from"../../core/Logger.js";import{destroyMaybe as c}from"../../core/maybe.js";import{MultiOriginJSONSupportMixin as l}from"../../core/MultiOriginJSONSupport.js";import{setDeepValue as u}from"../../core/object.js";import{sqlAnd as d}from"../../core/sql.js";import{property as f,subclass as p}from"../../core/accessorSupport/decorators.js";import{excludeTables as m}from"../../core/accessorSupport/layerContainerType.js";import h from"../../form/FormTemplate.js";import ee from"../../geometry/SpatialReference.js";import{joinScaleRanges as te}from"../../geometry/support/scaleUtils.js";import ne from"../../graphic/SubtypeGroupGraphicOrigin.js";import{labelsVisible as re,legendEnabled as ie,minScale as ae,maxScale as oe,popupEnabled as g}from"./commonProperties.js";import{createQuery as _,computeDomainFromSubtypes as v}from"./featureLayerUtils.js";import y from"./FeatureTemplate.js";import b from"./FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as x,fieldConfigurationsFromPopupTemplate as S,fieldConfigurationsFromFields as C}from"./fieldConfigUtils.js";import{defineFieldProperties as w}from"./fieldProperties.js";import{fixRendererFields as T}from"./fieldUtils.js";import se from"./LabelClass.js";import{reader as E}from"./labelingInfo.js";import{rendererReader as D,supportedRendererTypes as O}from"./subtypeGroupLayerUtils.js";import k from"./TitleCreator.js";import A from"../../renderers/SimpleRenderer.js";import j from"../../rest/support/AttachmentQuery.js";import M from"../../rest/support/Query.js";import{createPopupTemplate as N}from"../../support/popupUtils.js";import{defaultPolygonSymbol2D as P,defaultPolylineSymbol2D as F,defaultPointSymbol2D as I}from"../../symbols/support/defaults.js";import L from"../../tables/AttributeTableTemplate.js";import{writer as R}from"../../core/accessorSupport/decorators/writer.js";import{reader as z}from"../../core/accessorSupport/decorators/reader.js";const B=w();let V=0;function H(e,t){let n=e.json.write;return typeof n!=`object`&&(n=e.json.write={}),n.ignoreOrigin=!0,t?.spatialOnly&&(n.layerContainerTypes=m),e}function U(e){let t={write:{ignoreOrigin:!0}};return e?.name&&(t.name=e.name),typeof t.write==`object`&&(e?.spatialOnly&&(t.write.layerContainerTypes=m),e?.target&&(t.write.target=e.target)),t}function W(e){return new A({symbol:G(e)})}function G(e){switch(e){case`point`:case`multipoint`:return I.clone();case`polyline`:return F.clone();case`polygon`:case`multipatch`:return P.clone();default:return null}}function ce(e,t){return t?e?.type===`unique-value`&&e.field!=null&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression:!1}function K(e){return J(e,`user`)===e}function q(e){return J(e,`service`)}function le(e){return J(e,`portal-item`)}function J(e,t){return(e.parent?.getAtOrigin(`sublayers`,t))?.find(({subtypeCode:t})=>t===e.subtypeCode)}function Y(e,t){return e==null?null:t.subtypes?.find(t=>t.code===e)}function ue(e,t){let n=t.geometryType,r=null;switch(n){case`esriGeometryPoint`:case`esriGeometryMultipoint`:r=`point`;break;case`esriGeometryPolyline`:r=`line`;break;case`esriGeometryPolygon`:case`esriGeometryMultiPatch`:r=`polygon`;break;default:t.type,r=null}let i={},a=Y(e,t);if(a!=null){let{defaultValues:e}=a;for(let t in e)i[t]=e[t]}return i[t.subtypeField]=e,new y({name:`New Feature`,drawingTool:r,prototype:{attributes:i}})}let X=class extends l(n(i(o))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.graphicOrigin=new ne(this),this.id=`${Date.now().toString(16)}-subtype-sublayer-${V++}`,this.type=`subtype-sublayer`,this.labelsVisible=!0,this.labelingInfo=null,this.layerType=`ArcGISFeatureLayer`,this.legendEnabled=!0,this.listMode=`show`,this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.visible=!0}load(e){return T(this.renderer,this.fieldsIndex),Promise.resolve(this)}get _titleCreator(){let e=this._get(`_titleCreator`);return c(e),new k({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,displayField:this.parent?.displayField??``,fields:this.fields,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){let{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._override(`fieldConfigurations`,e),!this.parent?.loaded)return;let t=x(this,e);t&&this._set(`popupTemplate`,t)}get fieldConfigurations(){return this._isOverridden(`fieldConfigurations`)?this._get(`fieldConfigurations`):S(this)||null}writeFieldOverrides(e,t,n){let{fields:r,parent:i}=this,o;if(r){o=[];let e=0;r.forEach(({name:t,alias:n,editable:r,visible:a})=>{if(!a)return;let s=i?.fields?.find(e=>e.name===t);if(!s)return;let c={name:t},l=!1;n!==s.alias&&(c.alias=n,l=!0),r!==s.editable&&(c.editable=r,l=!0),o.push(c),l&&e++}),e===0&&o.length===r.length&&(o=null)}else o=a(e);o?.length&&u(n,o,t)}get fields(){let{parent:e,fieldOverrides:t,subtypeCode:n}=this,r=e?.fields;if(!e||!r?.length)return null;let{subtypes:i,subtypeField:a}=e,o=i?.find(e=>e.code===n),s=o?.defaultValues,c=o?.domains,l=[];for(let e of r){let r=e.clone(),{name:i}=r,o=t?.find(e=>e.name===i);if(r.visible=!t?.length||!!o,o){let{alias:e,editable:t}=o;e&&(r.alias=e),t===!1&&(r.editable=!1)}let u=s?.[i]??null;r.defaultValue=i===a?n:u;let d=c?.[i]??null;r.domain=i===a?null:d?d.type===`inherited`?r.domain:d.clone():null,l.push(r)}return l}get floorInfo(){return this.parent?.floorInfo}get isTable(){return!!this.parent?.isTable}get geometryType(){return this.parent?.geometryType}get globalIdField(){return this.parent?this.parent.globalIdField:(s.getLogger(this).error($(`globalIdField`)),null)}get effectiveScaleRange(){let e=this._get(`effectiveScaleRange`),{maxScale:t,minScale:n,parent:r}=this,i={minScale:n,maxScale:t};return r?.effectiveScaleRange!==void 0&&te(i,r.effectiveScaleRange),e&&e.minScale===i.minScale&&e.maxScale===i.maxScale?e:i}get objectIdField(){return this.parent||s.getLogger(this).error($(`objectIdField`)),this.parent?.objectIdField}writePopupTemplate(e,t,n,r){e&&(t[n]=e.toJSON({...r,writeFieldFormat:!0}))}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){T(e,this.fieldsIndex),this._override(`renderer`,e)}get renderer(){if(this._isOverridden(`renderer`))return this._get(`renderer`);let{parent:e}=this;return e&&!e.isTable&&e.geometryType!==`mesh`?(K(this)?a(q(this)?.renderer):null)??W(e.geometryType):null}readRendererFromService(e,t,n){if(t.type===`Table`)return null;let r=t.drawingInfo?.renderer,i=D(r,t,n),a,{subtypeCode:o}=this;if(o!=null&&ce(i,t.subtypeField)){let e=i.uniqueValueInfos?.find(({value:e})=>(e=typeof e==`number`?String(e):e,e===String(o)));e&&(a=new A({symbol:e.symbol}))}else i?.type===`simple`&&!i.visualVariables?.length&&(a=i);return a}readRenderer(e,t,n){let r=t?.layerDefinition?.drawingInfo?.renderer;if(r)return D(r,t,n)||void 0}get spatialReference(){return this.parent?.spatialReference??ee.WGS84}get subtypeField(){return this.parent?.subtypeField}get templates(){return this._isOverridden(`templates`)?this._get(`templates`):a(K(this)?q(this)?.templates:le(this)?.templates||q(this)?.templates)}set templates(e){this._override(`templates`,e)}readTemplatesFromService(e,t){return[ue(this.subtypeCode,t)]}get title(){return this._isOverridden(`title`)?this._get(`title`):(K(this)?q(this):null)?.title}set title(e){this._override(`title`,e)}readTitleFromService(e,t){let n=Y(this.subtypeCode,t);return n==null?null:n.name}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t,n){let{parent:i}=this;if(!i)throw $(`addAttachment`);if(e.getAttribute(i.subtypeField)!==this.subtypeCode)throw new r(`subtype-sublayer:addAttachment`,`The feature provided does not belong to this SubtypeSublayer`);return i.addAttachment(e,t,n)}async updateAttachment(e,t,n,i){let{parent:a}=this;if(!a)throw $(`updateAttachment`);if(e.getAttribute(a.subtypeField)!==this.subtypeCode)throw new r(`subtype-sublayer:updateAttachment`,`The feature provided does not belong to this SubtypeSublayer`);return a.updateAttachment(e,t,n,i)}async deleteAttachments(e,t,n){let{parent:i}=this;if(!i)throw $(`deleteAttachments`);if(e.getAttribute(i.subtypeField)!==this.subtypeCode)throw new r(`subtype-sublayer:deleteAttachments`,`The feature provided does not belong to this SubtypeSublayer`);return i.deleteAttachments(e,t,n)}async applyEdits(e,t){if(!this.parent)throw $(`applyEdits`);return this.parent.applyEdits(e,t)}createFieldConfigurations(){return C(this)}createPopupTemplate(e){let t=this,{parent:n,fields:r,title:i}=this;if(n){let{displayField:e,editFieldsInfo:a,objectIdField:o}=n;t={displayField:e,editFieldsInfo:a,fields:r,objectIdField:o,title:i}}return N(t,e)}createQuery(){if(!this.parent)throw $(`createQuery`);let e=_(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=d(t,this.parent.definitionExpression),e}getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getField(e){return this.fieldsIndex.get(e)}getFieldAlias(e){let t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){let t=v(this.parent,e);if(t)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){let n=await this.load();if(!n.parent)throw $(`queryAttachments`);let r=e instanceof j?e.clone():new j(e);return r.where=Q(r.where,n.parent.subtypeField,n.subtypeCode),n.parent.queryAttachments(r,t)}async queryFeatureCount(e,t){let n=await this.load();if(!n.parent)throw $(`queryFeatureCount`);return n.parent.queryFeatureCount(Z(n.parent,n,e),t)}async queryFeatures(e,t){let n=await this.load();if(!n.parent)throw $(`queryFeatures`);return n.parent.queryFeatures(Z(n.parent,n,e),t)}async queryObjectIds(e,t){let n=await this.load();if(!n.parent)throw $(`queryObjectIds`);return n.parent.queryObjectIds(Z(n.parent,n,e),t)}async queryRelatedFeatures(e,t){let n=await this.load();if(!n.parent)throw $(`queryRelatedFeatures`);return n.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){let n=await this.load();if(!n.parent)throw $(`queryRelatedFeaturesCount`);return n.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){let t=this.fieldsIndex.get(e);return t?t.domain:null}};e([f({clonable:!1,readOnly:!0})],X.prototype,`_titleCreator`,null),e([f({type:L,json:U({name:`attributeTableInfo`})})],X.prototype,`attributeTableTemplate`,void 0),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`capabilities`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`effectiveCapabilities`,null),e([f({json:U()})],X.prototype,`charts`,void 0),e([f({type:Boolean,nonNullable:!0,json:U({name:`enableEditing`})})],X.prototype,`editingEnabled`,void 0),e([f({type:Boolean,readOnly:!0})],X.prototype,`effectiveEditingEnabled`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`elevationInfo`,null),e([f({clonable:!1,readOnly:!0})],X.prototype,`featureTitleFields`,null),e([f({type:[b],json:{name:`layerDefinition.fieldConfigurations`,write:{ignoreOrigin:!0}}})],X.prototype,`fieldConfigurations`,null),e([f({json:{name:`layerDefinition.fieldOverrides`,origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],X.prototype,`fieldOverrides`,void 0),e([R(`fieldOverrides`)],X.prototype,`writeFieldOverrides`,null),e([f({...B.fields,readOnly:!0,json:{read:!1}})],X.prototype,`fields`,null),e([f(B.fieldsIndex)],X.prototype,`fieldsIndex`,void 0),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`floorInfo`,null),e([f({type:h,json:U({name:`formInfo`})})],X.prototype,`formTemplate`,void 0),e([f({readOnly:!0,clonable:!1})],X.prototype,`graphicOrigin`,void 0),e([f({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],X.prototype,`id`,void 0),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`isTable`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`geometryType`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`globalIdField`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`type`,void 0),e([f(H(a(re)))],X.prototype,`labelsVisible`,void 0),e([f({type:[se],json:{name:`layerDefinition.drawingInfo.labelingInfo`,origins:{service:{read:!1}},read:{reader:E},write:{ignoreOrigin:!0,layerContainerTypes:m}}})],X.prototype,`labelingInfo`,void 0),e([f({type:[`ArcGISFeatureLayer`],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,layerContainerTypes:m}}})],X.prototype,`layerType`,void 0),e([f(H(a(ie)))],X.prototype,`legendEnabled`,void 0),e([f({type:[`show`,`hide`]})],X.prototype,`listMode`,void 0),e([f((()=>{let e=a(ae);return e.json.origins.service.read=!1,H(e,{spatialOnly:!0})})())],X.prototype,`minScale`,void 0),e([f((()=>{let e=a(oe);return e.json.origins.service.read=!1,H(e,{spatialOnly:!0})})())],X.prototype,`maxScale`,void 0),e([f({readOnly:!0})],X.prototype,`effectiveScaleRange`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`objectIdField`,null),e([f({type:Number,range:{min:0,max:1},nonNullable:!0,json:U({spatialOnly:!0})})],X.prototype,`opacity`,void 0),e([f({clonable:!1})],X.prototype,`parent`,void 0),e([f(H(a(g)))],X.prototype,`popupEnabled`,void 0),e([f({type:t,json:U({name:`popupInfo`})})],X.prototype,`popupTemplate`,void 0),e([R(`popupTemplate`)],X.prototype,`writePopupTemplate`,null),e([f({readOnly:!0})],X.prototype,`defaultPopupTemplate`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`relationships`,null),e([f({types:O,json:U({target:`layerDefinition.drawingInfo.renderer`,spatialOnly:!0})})],X.prototype,`renderer`,null),e([z(`service`,`renderer`,[`drawingInfo.renderer`,`subtypeField`,`type`])],X.prototype,`readRendererFromService`,null),e([z(`renderer`,[`layerDefinition.drawingInfo.renderer`])],X.prototype,`readRenderer`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`spatialReference`,null),e([f({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],X.prototype,`subtypeCode`,void 0),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`subtypeField`,null),e([f({type:[y],json:U({name:`layerDefinition.templates`})})],X.prototype,`templates`,null),e([z(`service`,`templates`,[`geometryType`,`subtypeField`,`subtypes`,`type`])],X.prototype,`readTemplatesFromService`,null),e([f({type:String,json:U()})],X.prototype,`title`,null),e([z(`service`,`title`,[`subtypes`])],X.prototype,`readTitleFromService`,null),e([f({readOnly:!0,json:{read:!1}})],X.prototype,`url`,null),e([f({readOnly:!0})],X.prototype,`userHasUpdateItemPrivileges`,null),e([f({type:Boolean,nonNullable:!0,json:U({name:`visibility`,spatialOnly:!0})})],X.prototype,`visible`,void 0),X=e([p(`esri.layers.support.SubtypeSublayer`)],X);const Z=(e,t,n)=>{if(!n)return t.createQuery();let r=M.from(n);return r.where=Q(r.where,e.subtypeField,t.subtypeCode),r},Q=(e,t,n)=>{let r=RegExp(`${t}\\s*=\\s*\\d+`),i=`${t}=${n}`,a=e??``;return r.test(a)?a.replace(r,i):d(i,a)},$=e=>new r(`subtype-sublayer:parent-missing`,`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`);export{X as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const e={AnnotationFeatureLayer:async()=>(await import(`../AnnotationFeatureLayer.js`)).default,BingMapsLayer:async()=>(await import(`../BingMapsLayer.js`)).default,BuildingSceneLayer:async()=>(await import(`../BuildingSceneLayer.js`)).default,CSVLayer:async()=>(await import(`../CSVLayer.js`)).default,CatalogLayer:async()=>(await import(`../CatalogLayer.js`)).default,DimensionFeatureLayer:async()=>(await import(`../DimensionFeatureLayer.js`)).default,DimensionLayer:async()=>(await import(`../DimensionLayer.js`)).default,ElevationLayer:async()=>(await import(`../ElevationLayer.js`)).default,FeatureLayer:async()=>(await import(`../FeatureLayer.js`)).default,GaussianSplatLayer:async()=>(await import(`../GaussianSplatLayer.js`)).default,GeoJSONLayer:async()=>(await import(`../GeoJSONLayer.js`)).default,GeoRSSLayer:async()=>(await import(`../GeoRSSLayer.js`)).default,
|
|
2
|
+
const e={AnnotationFeatureLayer:async()=>(await import(`../AnnotationFeatureLayer.js`)).default,BingMapsLayer:async()=>(await import(`../BingMapsLayer.js`)).default,BuildingSceneLayer:async()=>(await import(`../BuildingSceneLayer.js`)).default,CSVLayer:async()=>(await import(`../CSVLayer.js`)).default,CatalogLayer:async()=>(await import(`../CatalogLayer.js`)).default,DimensionFeatureLayer:async()=>(await import(`../DimensionFeatureLayer.js`)).default,DimensionLayer:async()=>(await import(`../DimensionLayer.js`)).default,ElevationLayer:async()=>(await import(`../ElevationLayer.js`)).default,FeatureLayer:async()=>(await import(`../FeatureLayer.js`)).default,GaussianSplatLayer:async()=>(await import(`../GaussianSplatLayer.js`)).default,GeoJSONLayer:async()=>(await import(`../GeoJSONLayer.js`)).default,GeoRSSLayer:async()=>(await import(`../GeoRSSLayer.js`)).default,GroupLayer:async()=>(await import(`../GroupLayer.js`)).default,ImageryLayer:async()=>(await import(`../ImageryLayer.js`)).default,ImageryTileLayer:async()=>(await import(`../ImageryTileLayer.js`)).default,IntegratedMesh3DTilesLayer:async()=>(await import(`../IntegratedMesh3DTilesLayer.js`)).default,IntegratedMeshLayer:async()=>(await import(`../IntegratedMeshLayer.js`)).default,KMLLayer:async()=>(await import(`../KMLLayer.js`)).default,KnowledgeGraphLayer:async()=>(await import(`../KnowledgeGraphLayer.js`)).default,LineOfSightLayer:async()=>(await import(`../LineOfSightLayer.js`)).default,LinkChartLayer:async()=>(await import(`../LinkChartLayer.js`)).default,MapImageLayer:async()=>(await import(`../MapImageLayer.js`)).default,MapNotesLayer:async()=>(await import(`../MapNotesLayer.js`)).default,MediaLayer:async()=>(await import(`../MediaLayer.js`)).default,OGCFeatureLayer:async()=>(await import(`../OGCFeatureLayer.js`)).default,OpenStreetMapLayer:async()=>(await import(`../OpenStreetMapLayer.js`)).default,OrientedImageryLayer:async()=>(await import(`../OrientedImageryLayer.js`)).default,ParquetLayer:async()=>(await import(`../ParquetLayer.js`)).default,PointCloudLayer:async()=>(await import(`../PointCloudLayer.js`)).default,RouteLayer:async()=>(await import(`../RouteLayer.js`)).default,SceneLayer:async()=>(await import(`../SceneLayer.js`)).default,SketchLayer:async()=>(await import(`../SketchLayer.js`)).default,StreamLayer:async()=>(await import(`../StreamLayer.js`)).default,SubtypeGroupLayer:async()=>(await import(`../SubtypeGroupLayer.js`)).default,TileLayer:async()=>(await import(`../TileLayer.js`)).default,UnknownLayer:async()=>(await import(`../UnknownLayer.js`)).default,UnsupportedLayer:async()=>(await import(`../UnsupportedLayer.js`)).default,VectorTileLayer:async()=>(await import(`../VectorTileLayer.js`)).default,VideoLayer:async()=>(await import(`../VideoLayer.js`)).default,ViewshedLayer:async()=>(await import(`../ViewshedLayer.js`)).default,VoxelLayer:async()=>(await import(`../VoxelLayer.js`)).default,WCSLayer:async()=>(await import(`../WCSLayer.js`)).default,WFSLayer:async()=>(await import(`../WFSLayer.js`)).default,WMSLayer:async()=>(await import(`../WMSLayer.js`)).default,WMTSLayer:async()=>(await import(`../WMTSLayer.js`)).default,WebTileLayer:async()=>(await import(`../WebTileLayer.js`)).default};export{e as layersLoaderMap};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.149",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.20.8",
|
|
23
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
23
|
+
"@arcgis/toolkit": "5.2.0-next.149",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
|
|
25
25
|
"@esri/calcite-components": "^5.2.0-next.89",
|
|
26
26
|
"@vaadin/grid": "~25.3.2",
|
package/popup/FeaturesModel.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
|
|
|
20
20
|
import type { FeatureAbilitiesProperties } from "./support/FeatureAbilities.js";
|
|
21
21
|
import type { PointProperties } from "../geometry/Point.js";
|
|
22
22
|
|
|
23
|
-
export interface FeaturesModelProperties extends GoToProperties, Partial<Pick<FeaturesModel, "activeFeature" | "aggregatedFeaturesEnabled" | "content" | "defaultPopupTemplateEnabled" | "featurePage" | "features" | "featuresPerPage" | "featureStream" | "heading" | "highlightEnabled" | "includeDefaultActions" | "initialDisplayMode" | "map" | "open" | "selectedFeatureIndex" | "updateLocationEnabled" | "view" | "zoomFactor">> {
|
|
23
|
+
export interface FeaturesModelProperties extends GoToProperties, Partial<Pick<FeaturesModel, "activeFeature" | "aggregatedFeaturesEnabled" | "content" | "defaultPopupTemplateEnabled" | "featureMenuOpen" | "featurePage" | "features" | "featuresPerPage" | "featureStream" | "heading" | "highlightEnabled" | "includeDefaultActions" | "initialDisplayMode" | "map" | "open" | "selectedFeatureIndex" | "updateLocationEnabled" | "view" | "zoomFactor">> {
|
|
24
24
|
/**
|
|
25
25
|
* [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) of [action](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionButton/) or [action toggle](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionToggle/) objects.
|
|
26
26
|
* Each action may be executed by clicking the icon or image symbolizing them.
|
|
@@ -191,9 +191,28 @@ export default class FeaturesModel extends FeaturesModelSuperclass {
|
|
|
191
191
|
/** Defines the specific [FeatureAbilities](https://developers.arcgis.com/javascript/latest/references/core/popup/support/FeatureAbilities/) that can be used when querying and displaying content. */
|
|
192
192
|
get featureItemAbilities(): FeatureAbilities | null | undefined;
|
|
193
193
|
set featureItemAbilities(value: FeatureAbilitiesProperties | null | undefined);
|
|
194
|
-
/**
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
/**
|
|
195
|
+
* This property enables showing the list of features.
|
|
196
|
+
* Setting this to `true` allows the user to scroll through the list of features.
|
|
197
|
+
* This value will only be honored if [initialDisplayMode](https://developers.arcgis.com/javascript/latest/references/core/popup/FeaturesModel/#initialDisplayMode) is set to `feature`.
|
|
198
|
+
*
|
|
199
|
+
* @default false
|
|
200
|
+
* @internal
|
|
201
|
+
*/
|
|
202
|
+
accessor featureMenuOpen: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Lazily created models indexed by their position in features.
|
|
205
|
+
*
|
|
206
|
+
* @internal
|
|
207
|
+
*/
|
|
208
|
+
get featureModels(): FeatureModel[];
|
|
209
|
+
/**
|
|
210
|
+
* The number of feature batches prepared for browsing. Each batch contains up to [featuresPerPage](https://developers.arcgis.com/javascript/latest/references/core/popup/FeaturesModel/#featuresPerPage) features. This value is `null` when there are no features.
|
|
211
|
+
*
|
|
212
|
+
* Set this value to `1` to reset browsing, or increment it by one to prepare the next batch. Other assignments are ignored. Selecting a feature does not change this value; use [selectedFeatureIndex](https://developers.arcgis.com/javascript/latest/references/core/popup/FeaturesModel/#selectedFeatureIndex) to select any feature independently of browsing.
|
|
213
|
+
*
|
|
214
|
+
* @default null
|
|
215
|
+
*/
|
|
197
216
|
accessor featurePage: number | null | undefined;
|
|
198
217
|
/**
|
|
199
218
|
* An array of features. Each [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) depending on their attributes.
|
|
@@ -246,6 +265,8 @@ export default class FeaturesModel extends FeaturesModelSuperclass {
|
|
|
246
265
|
/**
|
|
247
266
|
* Streams features into the component as they become available.
|
|
248
267
|
*
|
|
268
|
+
* The first feature is published immediately. Subsequent features are published in short batches, with remaining results published when the stream completes or fails. Clearing or replacing the stream discards its unpublished results.
|
|
269
|
+
*
|
|
249
270
|
* @internal
|
|
250
271
|
*/
|
|
251
272
|
accessor featureStream: AsyncGenerator<Graphic> | null | undefined;
|
|
@@ -281,7 +302,7 @@ export default class FeaturesModel extends FeaturesModelSuperclass {
|
|
|
281
302
|
accessor includeDefaultActions: boolean;
|
|
282
303
|
/**
|
|
283
304
|
* Indicates whether to initially display a list of features, or the content for one feature.
|
|
284
|
-
* By default, a list is displayed when the associated view has `
|
|
305
|
+
* By default, a list is displayed when the associated view has `focusRegionVisible` enabled; otherwise, the content for one feature is displayed.
|
|
285
306
|
*/
|
|
286
307
|
accessor initialDisplayMode: InitialDisplayOptions;
|
|
287
308
|
/**
|
|
@@ -384,7 +405,7 @@ export default class FeaturesModel extends FeaturesModelSuperclass {
|
|
|
384
405
|
* > - Values from `date` and `timestamp-offset` [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) should respect the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone).
|
|
385
406
|
*/
|
|
386
407
|
accessor view: MapViewOrSceneView | null | undefined;
|
|
387
|
-
/** Indicates whether
|
|
408
|
+
/** Indicates whether content is being generated for any currently loaded feature models. */
|
|
388
409
|
get waitingForContents(): boolean;
|
|
389
410
|
/**
|
|
390
411
|
* Indicates whether the current feature stream is waiting to yield its first feature. Previously displayed features remain available while this property is `true`. It becomes `false` when the current stream yields a feature or completes.
|
package/popup/FeaturesModel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{EventedAccessor as n}from"../core/Evented.js";import r from"../core/Logger.js";import{abortMaybe as i}from"../core/maybe.js";import{debounce as a,logOnError as o,isAbortError as s}from"../core/promiseUtils.js";import{watch as c,when as l}from"../core/reactiveUtils.js";import{property as u,subclass as d}from"../core/accessorSupport/decorators.js";import f from"../geometry/Point.js";import{project as p}from"../geometry/projectionUtils.js";import m from"../geometry/SpatialReference.js";import{geographicToWebMercator as h}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as g}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as _}from"../layers/LayerConstants.js";import{ActionsCollection as v,createDefaultActions as y}from"./actions.js";import{getSelectedTarget as b}from"./actionUtils.js";import x from"./FeatureModel.js";import S from"./support/FeatureAbilities.js";import{getDisplayedSymbol as C}from"../symbols/support/symbolUtils.js";import{system as w}from"../time/constants.js";import{highlightsSupported as T}from"../views/support/layerViewUtils.js";import{GoTo as E}from"../widgets/support/GoTo.js";let D=null;function O(e,t){switch(e){case`building-scene`:case`map-image`:case`tile`:case`imagery`:return!0;case`imagery-tile`:return t===`2d`;default:return!1}}let k=class extends E(n){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new S,this._activeFeatureStream=null,this._featureStreamHasYielded=!1,this.actions=new v,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=a(async()=>{this._cancelLocationUpdate();let e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([c(()=>this.view?.scale,()=>{this.open&&o(this._debouncedLocationUpdate(),r.getLogger(this))}),c(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),c(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),c(()=>this.location,e=>this._locationChange(e)),c(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),c(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),c(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),c(()=>this.featureItems,()=>this._featureItemsChange()),c(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.actions,this.includeDefaultActions,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),l(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get defaultActions(){let e=this._get(`defaultActions`)||new v;return e.removeAll(),e.addMany(this.selectedFeatureItem?.defaultActions.toArray()??y()),e}get active(){return this.open&&!this.waitingForResult}set content(e){this.featureStream=null,this._set(`diagnostics`,null),this.features=[],this._set(`content`,e)}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get(`features`)===e)return;let t=e||[];this._set(`features`,t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get(`featureStream`)||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,n){this._set(`diagnostics`,n??null),this._get(`featureStream`)!==e&&(this._set(`featureStream`,e),this._cancelFeatureStream(),e&&(this._featureStreamHasYielded=!1,this._set(`pendingLocation`,t??null),this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionEnabled?`list`:`feature`)}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?h(e):e;this._set(`location`,t)}get map(){return this.view?.map??null}set map(e){this._override(`map`,e)}get pendingLocation(){return this._get(`pendingLocation`)??null}get streamingFeatures(){return this._activeFeatureStream!=null}get selectedFeature(){return this.selectedFeatureIndex===-1?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){let e=this._get(`selectedFeatureIndex`);return typeof e==`number`?e:-1}set selectedFeatureIndex(e){let{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set(`selectedFeatureIndex`,e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get state(){return this.view?this.view.ready?`ready`:`disabled`:this.map?`ready`:`disabled`}get timeZone(){return this.view?.timeZone??w}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&!this._featureStreamHasYielded}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set(`diagnostics`,null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,n){let{view:r}=this;if(!r||!e)throw new t(`fetch-features:invalid-screenpoint-or-view`,`Cannot fetch features without a screen point/screen area and view.`,{screenPoint:e,view:r});let i={},a=r.fetchPopupFeatures(e,{diagnostics:i,pointerType:n?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:n?.signal});this._setFeatureStream(a,void 0,i)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){let{selectedFeatureIndex:t}=this,n=this._activeFeatureStream!=null&&e.length>0;if(this.initialDisplayMode===`list`){n||(this.selectedFeatureIndex=-1);return}if(n&&t===-1){this.selectedFeatureIndex=0;return}n&&t!==-1||(this.selectedFeatureIndex=e.length?0:-1)}_centerAtLocation(){let{view:e}=this,n=b(this);this._cancelCenterAtLocation();let i=new AbortController,{signal:a}=i;return this._centerAtLocationController=i,!n||!e?Promise.reject(new t(`center-at-location:invalid-target-or-view`,`Cannot center at a location without a target and view.`,{target:n,view:e})):this.callGoTo({target:{target:n,scale:e.scale},options:{signal:a}}).catch(e=>{s(e)||r.getLogger(this).error(e)})}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){let{selectedFeature:t,updateLocationEnabled:n,view:r}=this;r&&!this._locationUpdateController&&n&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){this.selectedFeatureIndex!==-1&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){let{features:e,featureCount:t,featurePage:n,featuresPerPage:r,featureItems:i}=this;if(n==null)return;let a=((n-1)*r+t)%t,o=Math.min(a+r,i.length);for(let t=a;t<o;t++){let n=i[t];n&&(n.graphic??=e[t])}}async _selectedFeatureChange(e){let{location:t,updateLocationEnabled:n,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;let i=g(e)?.type;if((i===`map-image`||i===`imagery`||i===`imagery-tile`)&&(e.symbol=await C(e)),(n||!t)&&e.geometry){if(e.geometry.type===`point`){this.location=e.geometry;return}let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);this.location=t(e.geometry);return}if(n&&!e.geometry){await this._centerAtLocation();let e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set(`featureItems`,[])}_updateFeatureItems(){let e=this.selectedFeature,t=this.features,n=this.featureItems,r=this.view,i=this.spatialReference,a=this.map,o=this.timeZone,s=this.location,c=this.actions,l=this.includeDefaultActions,u=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length){this._destroyFeatureItems();return}let d=[],f=new Map,p=new Set;n.forEach(e=>{let t=e?.graphic;e&&t&&f.set(t,e)}),t.forEach((t,m)=>{if(!t)return;let h=n[m];if(h&&!p.has(h)&&(h.graphic==null||h.graphic===t)){h.abilities=u,h.actions=c,h.includeDefaultActions=l,d[m]=h,p.add(h);return}let g=f.get(t);if(g&&!p.has(g)){g.abilities=u,g.actions=c,g.includeDefaultActions=l,d[m]=g,p.add(g);return}let _=new x({actions:c,abilities:u,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,includeDefaultActions:l,spatialReference:i,graphic:t===e?t:null,location:s,map:a,view:r,timeZone:o});d[m]=_,p.add(_)}),n.forEach(e=>{e&&!p.has(e)&&!e.destroyed&&e.destroy()}),this._set(`featureItems`,d)}_cancelCenterAtLocation(){this._centerAtLocationController=i(this._centerAtLocationController)}_cancelFeatureStream(){let e=this._activeFeatureStream;this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._get(`featureStream`)===e&&this._set(`featureStream`,null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){let{spatialReference:t}=this,n=this.selectedFeature,i=n?.geometry?.type,a=this.location;if(i&&i!==`mesh`&&t&&a&&n){if(i===`point`){let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);if(e?.signal?.aborted||this.selectedFeature!==n||!n.geometry)return;this.location=t(n.geometry);return}try{let r=n.geometry,i=this._getHighlightLayer(n),o=n.getObjectId();if(!i||!this.view)return;if(o!=null){let n=this.view?.allLayerViews.find(e=>e.layer.uid===i.uid);if(!n||!(`queryFeatures`in n))return;let a=n.createQuery();a.outSpatialReference=t,a.objectIds=[o],a.returnGeometry=!0;let{features:s}=await n.queryFeatures(a,e);if(e?.signal?.aborted)return;r=s[0]?.geometry}if(!r||r.type===`mesh`)return;r=p(r,t),D??=await Promise.all([import(`../geometry/operators/intersectsOperator.js`),import(`../geometry/operators/proximityOperator.js`)]);let[{intersectsExecute:s},{proximityGetNearestCoordinate:c}]=D;if(!s(r,a)){let e=c(r,a).coordinate??a;this.selectedFeature===n&&(this.location=e)}}catch(e){s(e)||r.getLogger(this).error(e)}}}_cancelLocationUpdate(){this._locationUpdateController=i(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){let t=g(e),{layer:n}=e;return t&&`layer`in t&&t.layer?t.layer:t?.type===`map-notes`||t?.type===`sketch`||t?.type===`subtype-group`?t:n??t}_getHighlightLayerView(e,t){return t.type===`subtype-sublayer`&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,n){if(O(t.type,n))return e;let r=e.getObjectId();if(r!=null)return r;let i=t.type===`imagery`?void 0:`objectIdField`in t?t.objectIdField||_:null,a=e.attributes;return a&&i&&a[i]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);let n=this[t];if(!n)return;let{highlightEnabled:r,view:i,open:a}=this;if(!i||!r||!a)return;let o=this._getHighlightLayer(n);if(!o)return;let s=this._getHighlightLayerView(i,o);if(!s)return;this._highlightPromises[e]=s;let c=await s;if(!c||!T(c)||this._highlightPromises[e]!==s||!this[t]||!this.highlightEnabled)return;let l=c.highlight(this._getHighlightTarget(n,o,i.type));this.addHandles(l,e)}async _highlightActiveFeature(){return this._highlightFeature(`highlight-active-feature`,`activeFeature`)}async _highlightSelectedFeature(){return this._highlightFeature(`highlight-selected-feature`,`selectedFeature`)}async _consumeFeatureStream(e,t){try{for await(let n of e){if(e!==this._activeFeatureStream)return;let r=!this._featureStreamHasYielded;r&&(this.features=[]),t!==void 0&&(this.location=t,t=void 0),this._set(`pendingLocation`,null),this._addFeature(n),r&&(this._featureStreamHasYielded=!0)}}finally{this._activeFeatureStream===e&&(this._featureStreamHasYielded||(this.features=[]),this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._waitingForResultChange())}}_addFeature(e){let{features:t}=this;t.includes(e)||(this.features=t.concat(e))}};e([u()],k.prototype,`_initialDisplayMode`,void 0),e([u()],k.prototype,`_activeFeatureStream`,void 0),e([u()],k.prototype,`_featureStreamHasYielded`,void 0),e([u({type:v})],k.prototype,`actions`,void 0),e([u({type:v,readOnly:!0})],k.prototype,`defaultActions`,null),e([u({readOnly:!0})],k.prototype,`active`,null),e([u()],k.prototype,`activeFeature`,void 0),e([u()],k.prototype,`aggregatedFeaturesEnabled`,void 0),e([u({value:null})],k.prototype,`content`,null),e([u({type:Boolean})],k.prototype,`defaultPopupTemplateEnabled`,void 0),e([u({readOnly:!0})],k.prototype,`diagnostics`,void 0),e([u({readOnly:!0})],k.prototype,`effectiveHeading`,null),e([u({readOnly:!0})],k.prototype,`featureCount`,null),e([u()],k.prototype,`featurePage`,void 0),e([u({value:[]})],k.prototype,`features`,null),e([u()],k.prototype,`featureStream`,null),e([u()],k.prototype,`featuresPerPage`,void 0),e([u()],k.prototype,`featureMenuOpen`,void 0),e([u({type:S})],k.prototype,`featureItemAbilities`,void 0),e([u({readOnly:!0})],k.prototype,`featureItems`,void 0),e([u()],k.prototype,`heading`,void 0),e([u()],k.prototype,`highlightEnabled`,void 0),e([u()],k.prototype,`includeDefaultActions`,void 0),e([u()],k.prototype,`initialDisplayMode`,null),e([u({type:f})],k.prototype,`location`,null),e([u()],k.prototype,`map`,null),e([u()],k.prototype,`open`,void 0),e([u({readOnly:!0})],k.prototype,`pendingLocation`,null),e([u({readOnly:!0})],k.prototype,`streamingFeatures`,null),e([u({value:null,readOnly:!0})],k.prototype,`selectedFeature`,null),e([u({value:-1})],k.prototype,`selectedFeatureIndex`,null),e([u({readOnly:!0})],k.prototype,`selectedFeatureItem`,null),e([u({type:m})],k.prototype,`spatialReference`,null),e([u({readOnly:!0})],k.prototype,`state`,null),e([u()],k.prototype,`timeZone`,null),e([u()],k.prototype,`updateLocationEnabled`,void 0),e([u()],k.prototype,`view`,void 0),e([u({readOnly:!0})],k.prototype,`waitingForContents`,null),e([u({readOnly:!0})],k.prototype,`waitingForResult`,null),e([u()],k.prototype,`zoomFactor`,void 0),k=e([d(`esri.popup.FeaturesModel`)],k);const A=k;export{A as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{EventedAccessor as n}from"../core/Evented.js";import r from"../core/Logger.js";import{abortMaybe as i}from"../core/maybe.js";import{debounce as a,logOnError as o,isAbortError as s}from"../core/promiseUtils.js";import{watch as c,when as l}from"../core/reactiveUtils.js";import{throttle as u}from"../core/throttle.js";import{property as d,subclass as f}from"../core/accessorSupport/decorators.js";import p from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import h from"../geometry/SpatialReference.js";import{geographicToWebMercator as g}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as v}from"../layers/LayerConstants.js";import{ActionsCollection as y,createDefaultActions as b}from"./actions.js";import{getSelectedTarget as x}from"./actionUtils.js";import S from"./FeatureModel.js";import C from"./support/FeatureAbilities.js";import{getDisplayedSymbol as w}from"../symbols/support/symbolUtils.js";import{system as T}from"../time/constants.js";import{highlightsSupported as E}from"../views/support/layerViewUtils.js";import{GoTo as D}from"../widgets/support/GoTo.js";const O=Symbol(`feature-stream-flush`);let k=null;function A(e,t){switch(e){case`building-scene`:case`map-image`:case`tile`:case`imagery`:return!0;case`imagery-tile`:return t===`2d`;default:return!1}}let j=class extends D(n){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new C,this._activeFeatureStream=null,this._featureStreamHasYielded=!1,this.actions=new y,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureModels=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=a(async()=>{this._cancelLocationUpdate();let e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([c(()=>this.view?.scale,()=>{this.open&&o(this._debouncedLocationUpdate(),r.getLogger(this))}),c(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),c(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),c(()=>this.location,e=>this._locationChange(e)),c(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),c(()=>[this.featurePage,this.selectedFeatureIndex,this.featuresPerPage,this.featureMenuOpen,this.open,this.initialDisplayMode,this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.actions,this.defaultPopupTemplateEnabled,this.includeDefaultActions,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureModels(),{initial:!0}),l(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._destroyFeatureModels(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get defaultActions(){let e=this._get(`defaultActions`)||new y;return e.removeAll(),e.addMany(this.selectedFeatureItem?.defaultActions.toArray()??b()),e}get active(){return this.open&&!this.waitingForResult}set content(e){this.featureStream=null,this._set(`diagnostics`,null),this.features=[],this._set(`content`,e)}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}get featurePage(){return this._get(`featurePage`)}set featurePage(e){if(e==null){this.featureCount||this._set(`featurePage`,null);return}!Number.isInteger(e)||e<1||e>Math.ceil(this.featureCount/this.featuresPerPage)||e!==1&&e!==(this.featurePage??0)+1||this._set(`featurePage`,e)}set features(e){if(this._get(`features`)===e)return;let t=e||[];this._set(`features`,t),(!this._activeFeatureStream||!t.length||this.featurePage==null)&&(this.featurePage=t.length?1:null),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get(`featureStream`)||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,n){this._set(`diagnostics`,n??null),this._get(`featureStream`)!==e&&(this._set(`featureStream`,e),this._cancelFeatureStream(),e&&(this._featureStreamHasYielded=!1,this._set(`pendingLocation`,t??null),this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionVisible?`list`:`feature`)}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?g(e):e;this._set(`location`,t)}get map(){return this.view?.map??null}set map(e){this._override(`map`,e)}get pendingLocation(){return this._get(`pendingLocation`)??null}get streamingFeatures(){return this._activeFeatureStream!=null}get selectedFeature(){return this.selectedFeatureIndex===-1?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){let e=this._get(`selectedFeatureIndex`);return typeof e==`number`?e:-1}set selectedFeatureIndex(e){let{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set(`selectedFeatureIndex`,e)}get selectedFeatureItem(){return this.featureModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get state(){return this.view?this.view.ready?`ready`:`disabled`:this.map?`ready`:`disabled`}get timeZone(){return this.view?.timeZone??T}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get waitingForContents(){return this.featureModels.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&!this._featureStreamHasYielded}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set(`diagnostics`,null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,n){let{view:r}=this;if(!r||!e)throw new t(`fetch-features:invalid-screenpoint-or-view`,`Cannot fetch features without a screen point/screen area and view.`,{screenPoint:e,view:r});let i={},a=r.fetchPopupFeatures(e,{diagnostics:i,pointerType:n?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:n?.signal});this._setFeatureStream(a,void 0,i)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){let{selectedFeatureIndex:t}=this,n=this._activeFeatureStream!=null&&e.length>0;if(this.initialDisplayMode===`list`){n||(this.selectedFeatureIndex=-1);return}if(n&&t===-1){this.selectedFeatureIndex=0;return}n&&t!==-1||(this.selectedFeatureIndex=e.length?0:-1)}_centerAtLocation(){let{view:e}=this,n=x(this);this._cancelCenterAtLocation();let i=new AbortController,{signal:a}=i;return this._centerAtLocationController=i,!n||!e?Promise.reject(new t(`center-at-location:invalid-target-or-view`,`Cannot center at a location without a target and view.`,{target:n,view:e})):this.callGoTo({target:{target:n,scale:e.scale},options:{signal:a}}).catch(e=>{s(e)||r.getLogger(this).error(e)})}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){let{selectedFeature:t,updateLocationEnabled:n,view:r}=this;r&&!this._locationUpdateController&&n&&e&&(!t||t.geometry)&&this._centerAtLocation()}async _selectedFeatureChange(e){let{location:t,updateLocationEnabled:n,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;let i=_(e)?.type;if((i===`map-image`||i===`imagery`||i===`imagery-tile`)&&(e.symbol=await w(e)),(n||!t)&&e.geometry){if(e.geometry.type===`point`){this.location=e.geometry;return}let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);this.location=t(e.geometry);return}if(n&&!e.geometry){await this._centerAtLocation();let e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureModels(){this.featureModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set(`featureModels`,[])}_reconcileFeatureModels(e){let t=[],n=new Map,r=[];if(this.featureModels.forEach((i,a)=>{let o=i?.graphic;!o||i.destroyed?i.destroy():e[a]===o?t[a]=i:(r.push(i),n.has(o)||n.set(o,[]))}),r.length){for(let r=e.length-1;r>=0;r--)t[r]||n.get(e[r])?.push(r);r.forEach(e=>{let r=n.get(e.graphic)?.pop();r==null?e.destroy():t[r]=e})}return t}_updateFeatureModels(){let{selectedFeature:e,features:t}=this;if(!t.length){this._destroyFeatureModels();return}let n={abilities:this.featureItemAbilities??this._defaultFeatureAbilities,actions:this.actions,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,includeDefaultActions:this.includeDefaultActions,spatialReference:this.spatialReference,location:this.location,map:this.map,view:this.view,timeZone:this.timeZone},r=this._reconcileFeatureModels(t);r.forEach(e=>e.set(n));let i=e=>{let i=t[e];i&&!r[e]&&(r[e]=new S({...n,graphic:i}))};if(e&&i(this.selectedFeatureIndex),(this.featurePage??0)>1||this.open&&(this.featureMenuOpen||this.initialDisplayMode===`list`)){let e=Math.min((this.featurePage??0)*this.featuresPerPage,t.length);for(let t=0;t<e;t++)i(t)}this._set(`featureModels`,r)}_cancelCenterAtLocation(){this._centerAtLocationController=i(this._centerAtLocationController)}_cancelFeatureStream(){this.removeHandles(O);let e=this._activeFeatureStream;this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._get(`featureStream`)===e&&this._set(`featureStream`,null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){let{spatialReference:t}=this,n=this.selectedFeature,i=n?.geometry?.type,a=this.location;if(i&&i!==`mesh`&&t&&a&&n){if(i===`point`){let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);if(e?.signal?.aborted||this.selectedFeature!==n||!n.geometry)return;this.location=t(n.geometry);return}try{let r=n.geometry,i=this._getHighlightLayer(n),o=n.getObjectId();if(!i||!this.view)return;if(o!=null){let n=this.view?.allLayerViews.find(e=>e.layer.uid===i.uid);if(!n||!(`queryFeatures`in n))return;let a=n.createQuery();a.outSpatialReference=t,a.objectIds=[o],a.returnGeometry=!0;let{features:s}=await n.queryFeatures(a,e);if(e?.signal?.aborted)return;r=s[0]?.geometry}if(!r||r.type===`mesh`)return;r=m(r,t),k??=await Promise.all([import(`../geometry/operators/intersectsOperator.js`),import(`../geometry/operators/proximityOperator.js`)]);let[{intersectsExecute:s},{proximityGetNearestCoordinate:c}]=k;if(!s(r,a)){let e=c(r,a).coordinate??a;this.selectedFeature===n&&(this.location=e)}}catch(e){s(e)||r.getLogger(this).error(e)}}}_cancelLocationUpdate(){this._locationUpdateController=i(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){let t=_(e),{layer:n}=e;return t&&`layer`in t&&t.layer?t.layer:t?.type===`map-notes`||t?.type===`sketch`||t?.type===`subtype-group`?t:n??t}_getHighlightLayerView(e,t){return t.type===`subtype-sublayer`&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,n){if(A(t.type,n))return e;let r=e.getObjectId();if(r!=null)return r;let i=t.type===`imagery`?void 0:`objectIdField`in t?t.objectIdField||v:null,a=e.attributes;return a&&i&&a[i]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);let n=this[t];if(!n)return;let{highlightEnabled:r,view:i,open:a}=this;if(!i||!r||!a)return;let o=this._getHighlightLayer(n);if(!o)return;let s=this._getHighlightLayerView(i,o);if(!s)return;this._highlightPromises[e]=s;let c=await s;if(!c||!E(c)||this._highlightPromises[e]!==s||!this[t]||!this.highlightEnabled)return;let l=c.highlight(this._getHighlightTarget(n,o,i.type));this.addHandles(l,e)}async _highlightActiveFeature(){return this._highlightFeature(`highlight-active-feature`,`activeFeature`)}async _highlightSelectedFeature(){return this._highlightFeature(`highlight-selected-feature`,`selectedFeature`)}async _consumeFeatureStream(e,t){if(e!==this._activeFeatureStream)return;let n=[],r=u(()=>{let t=n;n=[],e===this._activeFeatureStream&&t.length&&this._addFeatures(t)},16);this.addHandles({remove:()=>{r.remove(),n=[]}},O);try{for await(let i of e){if(e!==this._activeFeatureStream)return;let a=!this._featureStreamHasYielded;a&&(this.features=[]),t!==void 0&&(this.location=t,t=void 0),this._set(`pendingLocation`,null),a?(this._addFeatures([i]),e===this._activeFeatureStream&&(this._featureStreamHasYielded=!0)):(n.push(i),r())}}finally{this._activeFeatureStream===e&&r.forceUpdate(),this._activeFeatureStream===e&&(this.removeHandles(O),this._featureStreamHasYielded||(this.features=[]),this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._waitingForResultChange())}}_addFeatures(e){let{features:t}=this,n=new Set(t),r=e.filter(e=>!n.has(e)&&(n.add(e),!0));r.length&&(this.features=t.concat(r))}};e([d()],j.prototype,`_initialDisplayMode`,void 0),e([d()],j.prototype,`_activeFeatureStream`,void 0),e([d()],j.prototype,`_featureStreamHasYielded`,void 0),e([d({type:y})],j.prototype,`actions`,void 0),e([d({type:y,readOnly:!0})],j.prototype,`defaultActions`,null),e([d({readOnly:!0})],j.prototype,`active`,null),e([d()],j.prototype,`activeFeature`,void 0),e([d()],j.prototype,`aggregatedFeaturesEnabled`,void 0),e([d({value:null})],j.prototype,`content`,null),e([d({type:Boolean})],j.prototype,`defaultPopupTemplateEnabled`,void 0),e([d({readOnly:!0})],j.prototype,`diagnostics`,void 0),e([d({readOnly:!0})],j.prototype,`effectiveHeading`,null),e([d({readOnly:!0})],j.prototype,`featureCount`,null),e([d({value:null})],j.prototype,`featurePage`,null),e([d({value:[]})],j.prototype,`features`,null),e([d()],j.prototype,`featureStream`,null),e([d()],j.prototype,`featuresPerPage`,void 0),e([d()],j.prototype,`featureMenuOpen`,void 0),e([d({type:C})],j.prototype,`featureItemAbilities`,void 0),e([d({readOnly:!0})],j.prototype,`featureModels`,void 0),e([d()],j.prototype,`heading`,void 0),e([d()],j.prototype,`highlightEnabled`,void 0),e([d()],j.prototype,`includeDefaultActions`,void 0),e([d()],j.prototype,`initialDisplayMode`,null),e([d({type:p})],j.prototype,`location`,null),e([d()],j.prototype,`map`,null),e([d()],j.prototype,`open`,void 0),e([d({readOnly:!0})],j.prototype,`pendingLocation`,null),e([d({readOnly:!0})],j.prototype,`streamingFeatures`,null),e([d({value:null,readOnly:!0})],j.prototype,`selectedFeature`,null),e([d({value:-1})],j.prototype,`selectedFeatureIndex`,null),e([d({readOnly:!0})],j.prototype,`selectedFeatureItem`,null),e([d({type:h})],j.prototype,`spatialReference`,null),e([d({readOnly:!0})],j.prototype,`state`,null),e([d()],j.prototype,`timeZone`,null),e([d()],j.prototype,`updateLocationEnabled`,void 0),e([d()],j.prototype,`view`,void 0),e([d({readOnly:!0})],j.prototype,`waitingForContents`,null),e([d({readOnly:!0})],j.prototype,`waitingForResult`,null),e([d()],j.prototype,`zoomFactor`,void 0),j=e([f(`esri.popup.FeaturesModel`)],j);const M=j;export{M as default};
|