@arcgis/core 5.2.0-next.147 → 5.2.0-next.148
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/{79c83f4e066682543ca1.js → 0a078721c7e0e24027f0.js} +1 -1
- package/assets/esri/core/workers/chunks/{72019baeba520edb6bb0.js → 112befb3b5b406f29298.js} +1 -1
- package/assets/esri/core/workers/chunks/131e89663014bc76c4ee.js +1 -0
- package/assets/esri/core/workers/chunks/{392bcef780df52fb4cca.js → 16053ce50642c5ffbfa9.js} +1 -1
- package/assets/esri/core/workers/chunks/19689c66776b39cec234.js +1 -0
- package/assets/esri/core/workers/chunks/{ba46869e700ba1d2787f.js → 1b3f59fcad6e14c4d0e0.js} +1 -1
- package/assets/esri/core/workers/chunks/{6dd0b79fa3a629ab4f27.js → 1bca39e0e651426bdbb5.js} +1 -1
- package/assets/esri/core/workers/chunks/{305a718719ef15fda90c.js → 20458fffda7692c78135.js} +1 -1
- package/assets/esri/core/workers/chunks/219d0935ce281902a49f.js +1 -0
- package/assets/esri/core/workers/chunks/2416518db4a0117541a8.js +1 -0
- package/assets/esri/core/workers/chunks/{8b1c17cc52d989924313.js → 27a425d87c57b91489b3.js} +1 -1
- package/assets/esri/core/workers/chunks/2d9a1f23ec6ce90723ac.js +1 -0
- package/assets/esri/core/workers/chunks/{06e7400f5ebe0719b81c.js → 2e75df54852d65e71330.js} +1 -1
- package/assets/esri/core/workers/chunks/39d1d2fbe94afcd0a590.js +1 -0
- package/assets/esri/core/workers/chunks/{d01381b548c204835509.js → 3e9f056e4d1f0d067fc6.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/43321f244effd3d67069.js +1 -0
- package/assets/esri/core/workers/chunks/47e6b5631a625298db5b.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/52c25809edf7ac008a52.js +1 -0
- package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +1 -0
- package/assets/esri/core/workers/chunks/561c48cb4d49b150765b.js +1 -0
- 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/5f0c06f59121e09091f7.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/68be3fb88ca61f82fb90.js +1 -0
- package/assets/esri/core/workers/chunks/6c9266120d46e8c69dbf.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/70ee81ba22badbbf045c.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/7a4f1484b119ebafc2e7.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/8602b3587d4bdd9cc9f5.js +1 -0
- package/assets/esri/core/workers/chunks/{956a40f40bde416efe93.js → 898f43feeec74acde1ec.js} +1 -1
- package/assets/esri/core/workers/chunks/{700b1d5bc67b7e1b3ff3.js → 8aa80b892fde552577e8.js} +1 -1
- package/assets/esri/core/workers/chunks/8ef802ef8d108ae2e473.js +1 -0
- 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/{a52bf03bffb6ffac3b54.js → a101b89c18488f213d80.js} +1 -1
- package/assets/esri/core/workers/chunks/a337ca943862b30b978d.js +1 -0
- package/assets/esri/core/workers/chunks/ac03976b8450331aa31e.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/{97dbbedea9fe03bd1306.js → b0fd7cd5fc9526d30ddc.js} +1 -1
- package/assets/esri/core/workers/chunks/b3e812c3a06b486f05d2.js +1 -0
- package/assets/esri/core/workers/chunks/{6883a5c6883eccaddf64.js → b6ba66a05030d3815dfd.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ab25ee06041f907b9a2.js → c2c1f51a4668055c2838.js} +1 -1
- 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/{820f41d66b2056a3ebc8.js → c7699edd14497d174445.js} +1 -1
- package/assets/esri/core/workers/chunks/{a7985d20fa6e8d4878e7.js → d0f5bee9db1ad51ae687.js} +1 -1
- package/assets/esri/core/workers/chunks/dbcac8c1a76d4a9db13d.js +1 -0
- package/assets/esri/core/workers/chunks/{4ed8655770a3e018e366.js → de8d7f11f5a078c01b83.js} +1 -1
- 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/{4479a166b5ac8db1e12e.js → f2b69bd704db62915a6b.js} +1 -1
- package/assets/esri/core/workers/chunks/{711cfb84659cb4437679.js → f528ac5c648ca6a98582.js} +1 -1
- 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/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/CSVLayer.d.ts +1 -1
- package/layers/CatalogLayer.d.ts +1 -1
- package/layers/FeatureLayer.d.ts +1 -1
- package/layers/GeoJSONLayer.d.ts +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/ParquetLayer.d.ts +4 -3
- 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/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/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/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/package.json +2 -2
- package/popup/FeaturesModel.d.ts +26 -5
- package/popup/FeaturesModel.js +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/rest/print.js +1 -1
- package/rest/support/printTaskUtils.js +1 -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/View2D.d.ts +1 -1
- package/views/interactive/snapping/FeatureSnappingSourceInfo.js +1 -1
- package/views/interactive/snapping/SnappingOptions.d.ts +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +3 -4
- 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/07aa6d36f1006b6ab7ff.js +0 -1
- package/assets/esri/core/workers/chunks/0bb11751efa2023ec937.js +0 -1
- package/assets/esri/core/workers/chunks/2062d46f638eabfc9499.js +0 -1
- package/assets/esri/core/workers/chunks/222af8522773c7dc80b1.js +0 -1
- package/assets/esri/core/workers/chunks/303fde8f3459dde16555.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/3b017b718ea2d4ed498f.js +0 -1
- package/assets/esri/core/workers/chunks/3e81dfc9d621ece038fe.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/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/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/798a63653f82c0e842c5.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/9401cc22373566e1171e.js +0 -1
- package/assets/esri/core/workers/chunks/95b82cbbe355266c65d7.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/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/ca7fb75e2c62e7d37122.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/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{hittestMaskTextureSize as e}from"../../../definitions.js";import{equal as t,Float as n,min as r,max as i,ifElse as a,Bool as o,or as s,greaterThan as c,lessThan as l,Vec2 as u,negate as d,distance as f,texture2D as p,clamp as m,length as h,greaterThanEqual as g,not as _,Vec3 as v,dot as y,and as b,cond as x,normalize as S,abs as C,step as w,Mat3 as T}from"../../graph/glsl.js";import{noHit as
|
|
2
|
+
import{hittestMaskTextureSize as e}from"../../../definitions.js";import{equal as t,Float as n,min as r,max as i,ifElse as a,Bool as o,or as s,greaterThan as c,lessThan as l,Vec2 as u,negate as d,distance as f,texture2D as p,clamp as m,length as h,greaterThanEqual as g,not as _,Vec3 as v,dot as y,and as b,cond as x,normalize as S,abs as C,step as w,Mat3 as T,lessThanEqual as E}from"../../graph/glsl.js";import{noHit as D,trueHit as O,epsilonHitTest as k,candidateHit as A}from"./constants.js";import{cross2 as j}from"./utils.js";function M(e,t){return y(e,S(t))}function N(e,t,r){let i=r.subtract(t),a=M(e.subtract(t),i),o=m(a.divide(h(i)),new n(0),new n(1));return f(e,t.add(o.multiply(r.subtract(t))))}function P(e){let t=C(e);return w(t.x.add(t.y).add(t.z),new n(1.05))}function F(e,t,r,i){let a=new T(r.x.multiply(i.y).subtract(i.x.multiply(r.y)),i.x.multiply(t.y).subtract(t.x.multiply(i.y)),t.x.multiply(r.y).subtract(r.x.multiply(t.y)),r.y.subtract(i.y),i.y.subtract(t.y),t.y.subtract(r.y),i.x.subtract(r.x),t.x.subtract(i.x),r.x.subtract(t.x)),o=t.x.multiply(r.y.subtract(i.y)),s=r.x.multiply(i.y.subtract(t.y)),c=i.x.multiply(t.y.subtract(r.y)),l=o.add(s).add(c);return new n(1).divide(l).multiply(a.multiply(new v(1,e)))}function I(e,r,i,a){return t(P(F(e,r,i,a)),new n(1))}function L(e,t,i,a){let o=i.subtract(t),s=a.subtract(t),u=j(o,s),d=b(l(u,new n(k)),c(u,new n(-k)));return x([b(_(d),I(e.xy,t,i,a)),new n(-1)],[!0,()=>{let n=N(e,t,i),o=N(e,i,a),s=N(e,a,t);return r(r(n,o),s)}])}function R(e,t,n){let r=e.tile.getViewScreenMat3(e.view),i=r.multiply(new v(t.pos,1)),a=r.multiply(new v(n.nextPos1,1)),o=r.multiply(new v(n.nextPos2,1));return L(e.hittestRequest.position,i.xy,a.xy,o.xy)}function z(e,t,n){return f(e,n).subtract(t)}function B(e){return t(e.hittestType,new n(0))}function V(e){return t(e.hittestType,new n(1))}function H(e){return t(e.hittestType,new n(2))}function U(t,r,o){let{pos0:d,pos1:v,pos2:y}=t,b=d.add(v).add(y).divide(3),x=i(i(f(b,d),f(b,v)),f(b,y)),S=new u(b.x.divide(r.x),new n(1).subtract(b.y.divide(r.y))),C=s(s(l(S.x,new n(0)),c(S.x,new n(1))),s(l(S.y,new n(0)),c(S.y,new n(1)))),w=p(o,m(S,new u(0),new u(1))),T=S.subtract(w.xy).multiply(r),E=h(T),j=h(r.divide(e)).multiply(.5).add(k),M=c(w.b,new n(.5)),N=c(w.a,new n(.5)),P=g(x.add(j),E);return a(C,new n(D),a(_(N),a(M,new n(O),new n(D)),a(P,new n(A),a(M,new n(O),new n(D)))))}function W(e,t,r){let{pos0:i,pos1:l,pos2:d}=e,f=i.add(l).add(d).divide(3),m=new o(!1);for(let e of[f,i,l,d]){let i=new u(e.x.divide(t.x),new n(1).subtract(e.y.divide(t.y))),a=b(b(g(i.x,new n(0)),E(i.x,new n(1))),b(g(i.y,new n(0)),E(i.y,new n(1)))),o=c(p(r,i).b,new n(.5));m=s(m,b(a,o))}return a(m,new n(O),new n(D))}function G(e,t,o,s){let l=s.subtract(o).multiply(new n(.5)),d=o.add(s).multiply(new n(.5)),f=C(e.subtract(d)).subtract(l),p=new u(i(f.x,new n(0)),i(f.y,new n(0))),m=r(i(f.x,f.y),new n(0)),g=h(p).add(m).subtract(t);return a(c(g,new n(0)),new n(D),new n(O))}function K(t,r,i,o){let d=t,f=new u(d.x.divide(i.x),new n(1).subtract(d.y.divide(i.y))),v=s(s(l(f.x,new n(0)),c(f.x,new n(1))),s(l(f.y,new n(0)),c(f.y,new n(1)))),y=p(o,m(f,new u(0),new u(1))),b=f.subtract(y.xy).multiply(i),x=h(b),S=h(i.divide(e)).multiply(.5).add(k),C=c(y.b,new n(.5)),w=c(y.a,new n(.5)),T=g(r.add(S),x);return a(v,new n(D),a(_(w),a(C,new n(O),new n(D)),a(T,new n(A),a(C,new n(O),new n(D)))))}function q(e,t,r){let{pos0:o,pos1:s,pos2:u}=e,d=o.add(s).add(u).divide(3),p=i(f(d,o),i(f(d,s),f(d,u))),m=X(d,t,r);return a(l(m.add(p),new n(0)),new n(O),a(c(m.subtract(p),new n(0)),new n(D),new n(A)))}function J(e,{pos0:t,pos1:n,pos2:a},o,c){let d=y(t,e),f=y(n,e),p=y(a,e),m=r(d,r(f,p)),h=i(d,i(f,p)),g=y(o,e),_=y(new u(c.x,o.y),e),v=y(c,e),b=y(new u(o.x,c.y),e),x=r(r(g,_),r(v,b)),S=i(i(g,_),i(v,b));return s(l(h,x),l(S,m))}function Y(e,t,f){let{pos0:p,pos1:m,pos2:h}=e,g=r(p.x,r(m.x,h.x)),_=r(p.y,r(m.y,h.y)),v=i(p.x,i(m.x,h.x)),y=i(p.y,i(m.y,h.y)),b=t.x,x=f.x,S=t.y,C=f.y,w=a(s(l(v,b),s(c(g,x),s(l(y,S),c(_,C)))),new o(!1),new o(!0));return a(w,()=>{let r=p.subtract(m),i=m.subtract(h),o=h.subtract(p),c=new u(d(r.y),r.x),l=new u(d(i.y),i.x),g=new u(d(o.y),o.x);return a(s(J(c,e,t,f),J(l,e,t,f),J(g,e,t,f)),new n(D),new n(O))},new n(D))}function X(e,t,a){let o=new n(.5).multiply(t.add(a)),s=new n(.5).multiply(a.subtract(t)),c=C(e.subtract(o)).subtract(s);return h(i(c,new u(0))).add(r(i(c.x,c.y),new n(0)))}export{N as distPointSegment,L as distPointTriangle,z as hittestCircle,R as hittestFill,W as hittestLabelPolygon,q as hittestMarkerRect,U as hittestPolygon,K as hittestPolygonCircle,Y as hittestRect,G as hittestRectCircle,P as inTriangle,B as isPointHittest,H as isPolygonHittest,V as isRectHittest,M as projectScalar,F as xyToBarycentric};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e,__param as t}from"tslib";import{labelU16ZoomPrecisionFactor as n,labelPlacementOffsetPadding as r,packDegreesU8 as i}from"../../../definitions.js";import{location as a,option as o,uniform as s,texture as c,define as l,input as u,ComputeVertexInput as d}from"../../GraphShaderModule.js";import{Vec4 as f,Vec2 as p,Float as m,Sampler2D as h,mod as g,floor as _,step as v,and as y,lessThan as b,greaterThanEqual as x,Vec3 as S,Mat3 as ee,equal as C,ifElse as w,greaterThan as T,Bool as E,texture2D as D,smoothstep as O,Int as k,bitRShift as A,bitAnd as j}from"../../graph/glsl.js";import{FeatureVertexInput as M,AFeatureShader as te,FeatureFragmentInput as N}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as
|
|
2
|
+
import{__decorate as e,__param as t}from"tslib";import{labelU16ZoomPrecisionFactor as n,labelPlacementOffsetPadding as r,packDegreesU8 as i}from"../../../definitions.js";import{location as a,option as o,uniform as s,texture as c,define as l,input as u,ComputeVertexInput as d}from"../../GraphShaderModule.js";import{Vec4 as f,Vec2 as p,Float as m,Sampler2D as h,mod as g,floor as _,step as v,and as y,lessThan as b,greaterThanEqual as x,Vec3 as S,Mat3 as ee,equal as C,ifElse as w,greaterThan as T,Bool as E,texture2D as D,smoothstep as O,Int as k,bitRShift as A,bitAnd as j}from"../../graph/glsl.js";import{FeatureVertexInput as M,AFeatureShader as te,FeatureFragmentInput as N}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as ne,bitsetTextIsMapAligned as P,noHit as F,trueHit as re}from"../shaders/constants.js";import{isPointHittest as ie,distPointTriangle as ae,isRectHittest as I,hittestRect as L,isPolygonHittest as R,hittestLabelPolygon as z,hittestPolygon as B}from"../shaders/hittestUtils.js";import{MosaicInfo as V}from"../shaders/MosaicInfo.js";import{getBit as H}from"../shaders/utils.js";import{VisualVariableColor as U}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as W}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as G}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as K}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as q}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as oe}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as se}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as J,getVisualVariableRotation as Y}from"../shaders/vvUtils.js";const ce=1/i;class X extends M{}e([a(3,f)],X.prototype,`color`,void 0),e([a(4,p)],X.prototype,`offset`,void 0),e([a(5,p)],X.prototype,`textureUV`,void 0),e([a(6,f)],X.prototype,`fontAndReferenceSize`,void 0),e([a(7,f)],X.prototype,`outlineColor`,void 0),e([a(8,f)],X.prototype,`haloColor`,void 0),e([a(9,p)],X.prototype,`outlineAndHaloSize`,void 0),e([a(10,p)],X.prototype,`zoomRange`,void 0),e([a(11,m)],X.prototype,`clipAngle`,void 0),e([a(12,f)],X.prototype,`referenceSymbol`,void 0);class Z extends d{}e([a(13,p)],Z.prototype,`offsetNextVertex1`,void 0),e([a(14,p)],Z.prototype,`offsetNextVertex2`,void 0);class Q extends N{}class $ extends te{constructor(){super(...arguments),this.type=`TextShader`,this.computeAttributes={offset:[`offsetNextVertex1`,`offsetNextVertex2`]},this.textRenderPassType=0,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t){let{clipAngle:r,zoomRange:i}=e,a=r.multiply(ce),o=g(a.subtract(this.view.getRotation()),new m(360)),s=new m(0),c=n,l=_(this.tileInfo.currentZoom.multiply(c)).divide(c),u=i.x,d=i.y,f=new m(1).subtract(v(u,l)).multiply(2),p=new m(y(x(o,new m(90)),b(o,new m(270)))).multiply(2),h=new m(2).multiply(new m(1).subtract(v(l,d)));return s=s.add(t.multiply(f)),s=s.add(t.multiply(p)),s=s.add(h),s=s.add(new m(2).multiply(this.getLabelHidden(e.id,e.bitset))),s}vertex(e,t){let n=H(e.bitset,ne),i=new m(1).subtract(n),a=this.getFeatureId(e.id,e.bitset),o=e.fontAndReferenceSize[0],s=e.fontAndReferenceSize[1],c=e.fontAndReferenceSize[2],l=e.fontAndReferenceSize[3],u=o.divide(c),d=this.textRenderPassType===1?e.outlineColor:this.textRenderPassType===2?e.haloColor:this._getVertexColor(e,a),h=this.tile.getDisplayViewScreenMat3(this.view).multiply(new S(e.pos,1)),g=e.offset,_=new m(1),v=ee.identity(),y=new p(0);if(this.isLabel){if(!e.referenceSymbol)throw Error(`InternalError: Optional attribute 'referenceSymbol' expected for labels`);let t=e.referenceSymbol,n=t.xy,i=t.z,o=this._unpackDirection(t.w),s=this.getLabelReferenceSymbolVVOffset(e.id),c=C(s.x,new m(0)).and(C(s.y,new m(0))),l=w(c,J(this,a,i).divide(2),i.divide(2)),u=o.multiply(l.add(r)).add(s);y=n.add(u),g=g.add(y)}else _=J(this,a,s).divide(s),o=o.multiply(_),u=u.multiply(_),g=g.multiply(_),v=Y(this,a),g=v.multiply(new S(g,0)).xy;let b=H(e.bitset,P),x=this._getViewRotationMatrix(b).multiply(new S(g,0)).multiply(this.tileInfo.scaleFactor),D=this.isLabel?this.clipLabel(e,b):this.clip(e.id,e.bitset,e.zoomRange);D=this.isBackgroundPass?D.add(i.multiply(2)):D.add(n.multiply(2));let O=new m(0);if(this.textRenderPassType===1&&(D=D.add(w(C(e.outlineAndHaloSize.x,new m(0)),new m(2),new m(0))),O=new m(e.outlineAndHaloSize.x).divide(u).divide(l)),this.textRenderPassType===2){let t=e.outlineAndHaloSize.x,n=new m(e.outlineAndHaloSize.y);D=D.add(w(C(n,new m(0)),new m(2),new m(0))),O=n.add(t).divide(u).divide(l)}let k=this.isLabel?T(D,new m(1)):new E(!1),A=new f(h.xy.add(x.xy),D,1),j=e.textureUV.divide(this.mosaicInfo.size),M=new m(.105).multiply(c).divide(o).divide(this.view.pixelRatio);return{glPosition:A,color:d,size:u,textureUV:j,antialiasingWidth:M,outlineDistanceOffset:O,...this.maybeRunHittest(e,t,{vvSizeAdjustment:_,vvRotation:v,labelOffset:y,labelClipped:k,scaleFactor:this.tileInfo.scaleFactor})}}_getViewRotationMatrix(e){let t=this.view.getDisplayViewMat3(),n=this.view.displayMat3,r=new m(1).subtract(e);return t.multiply(e).add(n.multiply(r))}_getHittestAlignmentMatrix(e){let t=this.tile.getTileMat3(this.view),n=this.view.viewMat3.multiply(t),r=t,i=new m(1).subtract(e);return n.multiply(e).add(r.multiply(i))}fragment(e){let t=new m(2/8),n=new m(1).subtract(t),r=D(this.mosaicTexture,e.textureUV).a,i=n.subtract(e.outlineDistanceOffset);this.highlight&&(i=i.divide(2));let a=e.antialiasingWidth,o=O(i.subtract(a),i.add(a),r);return this.getFragmentOutput(e.color.multiply(o),e)}computeHittestTriangle(e,t,{vvSizeAdjustment:n,vvRotation:r,labelOffset:i,scaleFactor:a}){let o,s,c;this.isLabel?(o=new S(e.offset.multiply(a).add(i),0),s=new S(t.offsetNextVertex1.multiply(a).add(i),0),c=new S(t.offsetNextVertex2.multiply(a).add(i),0)):(o=r.multiply(new S(e.offset.multiply(a).multiply(n),0)),s=r.multiply(new S(t.offsetNextVertex1.multiply(a).multiply(n),0)),c=r.multiply(new S(t.offsetNextVertex2.multiply(a).multiply(n),0)));let l=this.tile.getViewScreenMat3(this.view).multiply(new S(e.pos,1)),u=H(e.bitset,P),d=this._getHittestAlignmentMatrix(u);return{pos0:l.add(d.multiply(o)).xy,pos1:l.add(d.multiply(s)).xy,pos2:l.add(d.multiply(c)).xy}}hittest(e,t,n){let{vvSizeAdjustment:r,vvRotation:i,labelOffset:a,labelClipped:o,scaleFactor:s}=n,{pos0:c,pos1:l,pos2:u}=this.computeHittestTriangle(e,t,{vvSizeAdjustment:r,vvRotation:i,labelOffset:a,scaleFactor:s}),d={pos0:c,pos1:l,pos2:u},f=this.isLabel?o:new E(!1);return w(f,new m(F),()=>w(ie(this.hittestRequest),()=>{let e=ae(this.hittestRequest.position,c,l,u);return w(T(e,this.hittestRequest.distance),new m(F),new m(re))},()=>w(I(this.hittestRequest),L(d,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),w(R(this.hittestRequest),this.isLabel?z(d,this.hittestRequest.viewSize,this.hittestMaskTexture):B(d,this.hittestRequest.viewSize,this.hittestMaskTexture),new m(F)))))}_unpackDirection(e){let t=new k(e),n=A(t,new k(2)),r=j(t,new k(3));return new p(new m(n).subtract(1),new m(r).subtract(1))}_getVertexColor(e,t){let n=e.color;if(this.visualVariableColor){let r=this.getColorValue(t);n=this.visualVariableColor.getColor(r,e.color,new E(!1))}if(this.visualVariableOpacity){let e=this.getOpacityValue(t),r=this.visualVariableOpacity.getOpacity(e);n=n.multiply(r)}return n}}e([o(U)],$.prototype,`visualVariableColor`,void 0),e([o(W)],$.prototype,`visualVariableOpacity`,void 0),e([o(G)],$.prototype,`visualVariableRotation`,void 0),e([o(K)],$.prototype,`visualVariableSizeMinMaxValue`,void 0),e([o(q)],$.prototype,`visualVariableSizeScaleStops`,void 0),e([o(oe)],$.prototype,`visualVariableSizeStops`,void 0),e([o(se)],$.prototype,`visualVariableSizeUnitValue`,void 0),e([s(V)],$.prototype,`mosaicInfo`,void 0),e([c(h)],$.prototype,`mosaicTexture`,void 0),e([l],$.prototype,`textRenderPassType`,void 0),e([l],$.prototype,`isBackgroundPass`,void 0),e([l],$.prototype,`isLabel`,void 0),e([t(0,u(X)),t(1,u(Z))],$.prototype,`vertex`,null),e([t(0,u(Q))],$.prototype,`fragment`,null);export{Q as TextFragmentInput,$ as TextShader,X as TextVertexInput};
|
package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.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/Accessor.js";import{watch as n,sync as r}from"../../../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../../../core/accessorSupport/decorators.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../../core/Accessor.js";import{watch as n,sync as r}from"../../../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../../../core/accessorSupport/decorators.js";import{scaleBoundsPredicate as o}from"../../../../../../geometry/support/scaleUtils.js";import{TileKey as s}from"../../../../../../layers/support/TileKey.js";import{distanceToTile as c}from"../../../../../interactive/snapping/featureSources/featureServiceSource/tileUtils.js";let l=class extends t{get tiles(){let e=this.tilesCoveringView,t=this.pointOfInterest==null?this.view.center:this.pointOfInterest;return e.sort((e,n)=>c(t,e)-c(t,n)),e}_scaleEnabled(){return o(this.view.scale,this.layer.minScale||0,this.layer.maxScale||0)}get tilesCoveringView(){if(!this.view.ready||!this.view.featuresTilingScheme||!this.view.state||this.tileInfo==null||!this._scaleEnabled)return[];let{spans:e,lodInfo:t}=this.view.featuresTilingScheme.getTileCoverage(this.view.state,0),{level:n}=t,r=[];for(let{row:i,colFrom:a,colTo:o}of e)for(let e=a;e<=o;e++){let a=t.normalizeCol(e),o=new s(n,i,a);this.tileInfo.updateTileInfo(o),r.push(o)}return r}get tileInfo(){return this.view.tileInfo??null}get tileSize(){return this.tileInfo==null?256:this.tileInfo.size[0]}constructor(e){super(e),this.pointOfInterest=null,this.updating=!1}initialize(){this.addHandles(n(()=>this.view?.state?.viewpoint,()=>this.notifyChange(`tilesCoveringView`),r))}};e([i({readOnly:!0})],l.prototype,`tiles`,null),e([i({readOnly:!0})],l.prototype,`_scaleEnabled`,null),e([i({readOnly:!0})],l.prototype,`tilesCoveringView`,null),e([i({readOnly:!0})],l.prototype,`tileInfo`,null),e([i({readOnly:!0})],l.prototype,`tileSize`,null),e([i({constructOnly:!0})],l.prototype,`view`,void 0),e([i({constructOnly:!0})],l.prototype,`layer`,void 0),e([i()],l.prototype,`pointOfInterest`,void 0),e([i()],l.prototype,`updating`,void 0),l=e([a(`esri.views.2d.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles2D`)],l);export{l as FeatureServiceTiles2D};
|
|
@@ -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"../../../AggregateGraphic.js";import n from"../../../Graphic.js";import r from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{makeHandle as s,handlesGroup as c}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import l from"../../../core/Logger.js";import{destroyMaybe as u}from"../../../core/maybe.js";import{notDeepEqual as d}from"../../../core/object.js";import{createAbortError as f,ignoreAbortErrors as p,throwIfNotAbortError as m,isAbortError as h}from"../../../core/promiseUtils.js";import{watch as g,sync as _}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as y}from"../../../core/units.js";import{property as b,subclass as x}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import C from"../../../geometry/Extent.js";import{fromJSON as ee}from"../../../geometry/support/jsonUtils.js";import w from"../../../geometry/support/rotate.js";import{isCurvedGeometry as T}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as E}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import te from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as D}from"../../../layers/graphics/featureConversionUtils.js";import O from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as k}from"../../../layers/support/featureLayerUtils.js";import{packFields as ne}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as re}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as ie}from"../../../layers/support/timeSupport.js";import ae from"../../../rest/support/AggregateFeatureSet.js";import oe from"../../../rest/support/AttributeBinsFeatureSet.js";import se from"../../../rest/support/AttributeBinsQuery.js";import A from"../../../rest/support/FeatureSet.js";import j from"../../../rest/support/Query.js";import{HittestDrawHelper as M}from"../../../symbols/cim/CIMSymbolDrawHelper.js";import{symbolToCIM as N}from"../../../symbols/cim/CIMSymbolHelper.js";import{getDisplayedSymbol as P}from"../../../symbols/support/symbolUtils.js";import{LayerView2D as F}from"./LayerView2D.js";import{FeatureContainer as I}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as L}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as R}from"./features/FeatureSourceEventLog.js";import{AnnotationLayerAdapter as z}from"./features/layerAdapters/AnnotationLayerAdapter.js";import{CatalogFootprintLayerAdapter as B}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{DimensionLayerAdapter as V}from"./features/layerAdapters/DimensionLayerAdapter.js";import{FeatureLayerAdapter as H}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as U}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as W}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as G}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as K}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as ce}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as le}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as ue}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as de}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as q}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as J}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as fe}from"./support/FeatureCommandQueue.js";import{createFilterSchemas as pe}from"./support/FilterSchema.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as X}from"./support/util.js";import{getMapPointsFromScreen as me,getHittestType as he}from"../support/hitTestUtils.js";import{FeatureTileSubscriptionManager as ge}from"../tiling/FeatureTileSubscriptionManager.js";import{RefreshableLayerView as _e}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ve}from"../../support/highlightOptionsUtils.js";function Z(e,t){let n=new Set;return e&&e.forEach(e=>n.add(e)),t&&t.forEach(e=>n.add(e)),n.has(`*`)?[`*`]:Array.from(n)}const Q=4294967294;function ye(e,t){return c(e.map(e=>g(()=>{let t=e();return t&&typeof t==`object`?`getTime`in t&&typeof t.getTime==`function`?t.getTime():JSON.stringify(t):t},t,_)))}function $(e){if(!e.geometry||!T(e.geometry))return e;let t=.001/y(e.geometry.spatialReference);return{geometry:E(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:100*t,maxDeviation:0}),attributes:e.attributes}}const be=c=>{let _=_e(F(c)),y=class extends _{constructor(){super(...arguments),this._commandsQueue=new fe({process:e=>{switch(e.type){case`override-batch`:return this._doOverride(e);case`update`:return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this._stationaryRotation=0,this.eventLog=new R,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._hittestDrawHelper=null,this._sourceUpdating=!1,this.featureEffectView=new te}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(f()),this._commandsQueue.destroy(),this._hittestDrawHelper?.destroy()}initialize(){this._workerAttached=Promise.withResolvers(),p(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){let e=this.layer;if(`isTable`in e&&e.isTable)throw new o(`featurelayerview:table-not-supported`,`table feature layer can't be displayed`,{layer:e});if((e.type===`feature`||e.type===`subtype-group`)&&re(e)?.operations.supportsQuery===!1)throw new o(`featurelayerview:query-not-supported`,`layer view requires a layer with query capability`,{layer:e});this._workerProxy&&this._workerProxy.destroy();let t=this._createClientOptions();this._workerProxy=await L(t)}async _attachProxy(){let e=w(this.view.extent,this.view.rotation,this.view.center),t={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON(),initialViewExtent:e.toJSON()};try{await this._workerProxy.pipeline.onAttach(t),this._workerAttached.resolve()}catch(e){this._workerAttached.reject(f()),m(e)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){let e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&e!=null&&e!==`1=1`;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get layerAdapter(){switch(this.layer.type){case`annotation-feature`:return new z(this.layer);case`dimension-feature`:return new V(this.layer);case`feature`:return this.layer.source.type===`memory`?new W(this.layer):new H(this.layer);case`geojson`:case`csv`:case`wfs`:return new W(this.layer);case`parquet`:return new le(this.layer);case`subtype-group`:return new de(this.layer);case`ogc-feature`:return new K(this.layer);case`stream`:return new ue(this.layer);case`oriented-imagery`:return new ce(this.layer);case`knowledge-graph-sublayer`:return new G(this.layer);case`catalog-footprint`:return new B(this.layer);default:this.layer}return null}get timeExtent(){return ie(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get(`timeExtent`))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}highlight(e,t){let r=ve(t),o;if(e instanceof O)o=e;else{let t;e instanceof n?t=[e.getObjectId()]:typeof e==`number`||typeof e==`string`?t=[e]:a.isCollection(e)&&e.length>0?t=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(t=typeof e[0]==`number`||typeof e[0]==`string`?e:e.map(e=>e?.getObjectId()));let r=t?.filter(i);if(!r?.length)return s();o=new O({objectIds:r})}let c=this._addHighlightFilter(o,r);return s(()=>!this.destroyed&&this._removeHighlight(c))}async hitTest(e,i,a){let o=he(i);if(!o)return null;let s=o===`point`,{trueHitIds:c,candidateHitIds:l}=await this.featureContainer.hitTest(i,a??null),u=await this.getWorker(),[d,f]=await Promise.all([u.pipeline.getDisplayFeatures(l),u.pipeline.getDisplayFeatures(c)]),{features:p,aggregates:m,tracks:g}=d,{features:_,aggregates:v,tracks:y}=f,b=[];if(!s&&this.hasRenderer()){let e=new Map,t=new n;for(let n of p){t.attributes=n.attributes,t.geometry=ee(n.geometry),t.symbol=null;let r=this.layerAdapter.getRenderer(t);if(!r){b.push(n);continue}let i=await P(t,{renderer:r,scale:this.view.scale,resolution:this.view.resolution,spatialReference:this.view.spatialReference,viewingMode:`2d`,timeZone:this.view.timeZone});if(!i)continue;let a=null,o=N(i);if(o.type===`web-style`)try{let e=N(await o.fetchSymbol({acceptedFormats:[`cim`,`web`]}));a=e.type===`web-style`?null:e}catch(e){h(e);continue}else a=o;let s=a?.symbol;if(!s)continue;let c=this.view.stage.cimAnalyzer.analyzeSymbolReference(a,!1).some(e=>`alignment`in e&&e.alignment===0);e.set(n,{cimSymbol:s,isScreenAligned:c})}e.size>0&&!this._hittestDrawHelper&&(this._hittestDrawHelper=new M(this.view.stage.painter.textureManager.resourceManager));let{resolution:r,rotation:a}=this.view.state,s=me(this.view,i);for(let[t,{cimSymbol:n,isScreenAligned:i}]of e){if(!t)continue;let e={hittestType:o,textInfo:null,mapRotation:a,resolution:r,searchDist:0,isScreenAligned:i};this._hittestDrawHelper.hitTest(s,n,t.geometry,e)&&b.push(t)}}else b.push(...p);let x=[..._,...b],S=[...v,...m],C=[...y,...g],w=this.featureContainer.getSortKeys(x.map(e=>e.displayId)),T=({displayId:e},{displayId:t})=>w.has(e)&&w.has(t)?w.get(e)-w.get(t):e-t;return x.sort(T).reverse(),S.sort(T).reverse(),[...S.map(n=>this._createAggregateGraphicHit(e,t.fromJSON(n))),...C.map(t=>this._createTrackGraphicHit(e,r.fromJSON(t))),...x.map(t=>this._createFeatureGraphicHit(s?e:null,n.fromJSON(t)))]}async queryAggregateSummaryStatistics(e,t,n){let r={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),r,n);return Y(i,{})}async queryUniqueValues(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,n);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,n);return Y(a,{uniqueValueInfos:[]})}async queryAggregateClassBreaks(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,n);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForHistogram(this._cleanUpQuery(e),i,n);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateCount(e,t){let n=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(n,0)}async queryAggregateHistogram(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,n);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateIds(e,t){let n=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(n,[])}async queryAggregateJSON(e,t){let n=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(n,{features:[]})}async queryAttributeBins(e,t){let n=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),r=await Y(n,{features:[]});return oe.fromJSON(r)}async queryAggregates(e,t){let n=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),r=await Y(n,{features:[]}),i=ae.fromJSON(r);return i.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),i}async queryClassBreaks(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,n);return Y(a,{classBreakInfos:[]})}async queryExtent(e,t){let n=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),r=await Y(n,{count:0,extent:null});return{count:r.count,extent:C.fromJSON(r.extent)}}async queryFeatureCount(e,t){let n=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(n,0)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{let t=A.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryFeaturesJSON(e,t){let n=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(n,{features:[]})}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}async queryObjectIds(e,t){let n=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(n,[])}async queryStatistics(){let e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,n);return Y(a,{})}async queryVisibleFeatures(e,t){let n=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),r=await Y(n,{features:[]}),i=A.fromJSON(r);return i.features.forEach(e=>this._setOriginForFeature(e)),i}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptions)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);let t=this.featureContainer.getPresenting(),n=this._subscriptions.update(e.targetState,this._lastTargetState,t);n&&(this.featureContainer.updateSubscriptions(n),p(this._updatingHandles.addPromise(this.getWorker().then(e=>e.pipeline.updateSubscriptions(n))))),this._subscriptions.coverage&&this.featureContainer.setCoverage(this._subscriptions.coverage)}attach(){has(`esri-2d-update-debug`)&&console.debug(`FeatureLayerView2D.attach`),p(this._updatingHandles.addPromise(this._workerAttached.promise)),p(this._attachProxy()),this.featureContainer=new I(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptions=new ge(this.view.featuresTilingScheme),this._stationaryRotation=this.view.rotation,this.requestUpdate(),this.addAttachHandles([ye([()=>this._displayRefreshVersion,()=>`displayFilterInfo`in this.layer&&this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),g(()=>this.updateSuspended,e=>{e||this._subscriptions.resume(this.featureContainer.getPresenting())}),g(()=>this.view.stationary,e=>{if(!e)return;let t=this.view.rotation;t!==this._stationaryRotation&&(this._stationaryRotation=t,this._update()),this.getWorker().then(e=>{if(this.destroyed)return;let t=w(this.view.extent,this.view.rotation,this.view.center);return e.pipeline.updateViewExtent(t.toJSON(),this.featureContainer.requiresRefresh)}).catch(()=>{})})]),this._update(),this.layer.type!==`stream`&&this.layer.type!==`parquet`&&this.layer.type!==`catalog-footprint`&&this.addAttachHandles(this.layer.on(`edits`,e=>this._editUpdatingHandles.addPromise(this._edit(e))))}emitFirstDraw(e){this.emit(`first-draw`,{timestamp:e})}detach(){has(`esri-2d-update-debug`)&&console.debug(`FeatureLayerView2D.detach`),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptions=u(this._subscriptions),this._workerProxy.pipeline.onDetach(),this._workerAttached=Promise.withResolvers(),p(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:`override`,options:{...e,release:[]}})}removeOverrides(e){for(let t of e)if(t==null)throw new o(`featurelayerview:bad-override`,`Tried to remove an override for an invalid objectId`,{objectId:t});let t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:`override`,options:t})}onProxyClientEvent(e){}hasRenderer(){return`renderer`in this.layer&&this.layer.renderer!=null}isUpdating(){let e=this.hasRenderer(),t=this._commandsQueue.updateTracking.updating,n=this._updatingRequiredPromise!=null,r=this.featureContainer.updating;return this.updateRequested||e&&(t||n)||r||this._pipelineUpdating||this.dataUpdating}_createClientOptions(){let e=this;return{updateSchemaStart(){return e.updateSchemaStart()},updateSchemaEnd(t){return e.updateSchemaEnd(t)},openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){let e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw Error(`InternalError: Layer adapter does not support opening message ports`)},openGlyphPorts:async()=>{let t=await e.container.stage.textureManager.openMessagePorts();return{result:t,transferList:t}},get container(){return e.featureContainer},setUpdating:e=>{this._set(`_pipelineUpdating`,e.pipeline),this._set(`_sourceUpdating`,e.source)},emitEvent:e=>{this.onProxyClientEvent(e)},get eventLog(){return e.eventLog},fetch:async t=>{if(has(`esri-2d-stabilize-glyphs`)){let n=[];for(let r of t)n.push(await e.view.stage.painter.textureManager.rasterizeItem(r));return n}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e))),fetchMesh:e=>Promise.all(e.map(e=>this._fetchMeshRequest(e)))}}async _fetchDictionaryRequest(e){try{if(!(`renderer`in this.layer)||!this.layer.renderer||this.layer.renderer.type!==`dictionary`)throw Error(`InternalError: Expected renderer to be of type 'dictionary'`);let t=this.layer.renderer,n=this._lastSchema.processor.mesh.factory.symbology;if(n.type!==`dictionary`)throw Error(`InternalError: Expected schema to be of type 'dictionary'`);let r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:n.scaleExpression,viewRotation:this._stationaryRotation};this._fields||=this.layer.fields.map(e=>e.toJSON());let i=n.visualVariableUniforms,a=X(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);return!o||!o.data?{type:`dictionary-response`,meshes:[]}:{type:`dictionary-response`,meshes:await q({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:`renderer`,schemaOptions:r})}}catch{return{type:`dictionary-response`,meshes:[]}}}async _fetchMeshRequest(e){let{layer:t}=this;try{let n={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:null,viewRotation:this._stationaryRotation};return this._fields||=t.fields.map(e=>e.toJSON()),{type:`mesh-response`,meshes:await q({...e.symbolReference,hasTextStringTemplates:!0},{path:`anno-like`,schemaOptions:n,uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null}})}}catch{return{type:`mesh-response`,meshes:[]}}}_cleanUpQuery(e){let t=j.from(e)||this.createQuery();return t.outSpatialReference||=this.view.spatialReference,`returnZ`in this.layer&&(t.returnZ??=this.layer.returnZ),`returnM`in this.layer&&(t.returnM??=this.layer.returnM),t.toJSON()}_cleanUpAttributeBinsQuery(e){let t=se.from(e);return t.outSpatialReference||=this.view.spatialReference,t.toJSON()}_cleanUpAggregateQuery(e){let t=j.from(e)||this.createAggregateQuery();t.outSpatialReference||=this.view.spatialReference;let n=t.objectIds??[];for(let e of t.aggregateIds??[])n.push(e);return t.objectIds=n,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:`update`})}_edit(e){return this._commandsQueue.push({type:`edit`,event:e})}async doRefresh(e){this.attached&&(!this.updateSuspended||!e)&&(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion())}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%Q+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%Q+1}async _resolveIdenifiers(e){let t=[],n=[];for(let r of e){if(r.objectId!=null&&r.objectId!==-1){t.push(r.objectId);continue}if(r.globalId!=null){n.push(r.globalId);continue}l.getLogger(this).warn(`mapview-apply-edits`,`A feature identifier must contain either a GlobalId or ObjectId. Ignoring`,{identifier:r})}let r=`globalIdField`in this.layer&&this.layer.globalIdField,i=r&&this.availableFields.includes(r);if(n.length&&!i)return l.getLogger(this).error(new o(`mapview-apply-edits`,`Editing the specified service requires the layer's globalIdField, ${r} to be included the layer's outFields for updates to be reflected on the map`)),t;if(n.length){let e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(n);for(let n of e)t.push(n)}return t}_resolveOverrides(e){let t=X(this.layer.geometryType),n=U(this.layer),r=[];for(let i of e.added){let e=D($(i),t,!1,!1,n);if(e.objectId==null)throw new o(`featurelayerview:bad-override`,`Feature does not have an objectId`,{feature:i});r.push(e)}for(let i of e.updated){let e=D($(i),t,!1,!1,n);if(e.objectId==null)throw new o(`featurelayerview:bad-override`,`Feature does not have an objectId`,{feature:i});r.push(e)}for(let t of e.removed)if(t==null)throw new o(`featurelayerview:bad-override`,`Tried to remove an invalid objectId`,{objectId:t});return{type:`override`,updates:r,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){let t=this.layer,n=e.historicMoment?.getTime()??null,r=`layerId`in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(r&&this._canEditByFeature(r)){let{adds:e,deletes:t,updates:i}=r.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),s=t.map(e=>`attributes`in e?{objectId:a?e.attributes[a]:null}:e),c=await this._resolveIdenifiers(s);return this._resolveOverrides({added:e,updated:o,removed:c,historicMoment:n,isWeak:!0,release:[]})}let[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:`override-by-id`,updates:[...i,...a],removed:o,historicMoment:n,isWeak:!0}}_canEditByFeature(e){let{adds:t,updates:n}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&n.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async updateSchemaStart(){let e=this.layer;`featureReduction`in e&&e.featureReduction&&e.featureReduction!==this._lastFeatureReduction&&(e.featureReduction=e.featureReduction?.clone(),this._lastFeatureReduction=e.featureReduction);try{if(await Promise.allSettled([this._handleChange(),k(e)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptions)return null;let t=this.featureContainer.updateStart(e.type===`subtype-group`);this._lastFeatureEffect=this.featureEffect;let n={store:t,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0,viewRotation:this._stationaryRotation},r=await this._createViewSchemaConfig(),i={source:await this.layerAdapter.createSourceSchema(r,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(n,r,this._displayRefreshVersion)};return d(this._lastSchema?.source.strategy,i.source.strategy)||d(this._lastSchema?.processor,i.processor)?(this._lastSchema=i,this._fields=null,i):null}catch{}return null}async updateSchemaEnd(e){try{this.featureEffectView.featureEffect=this._lastFeatureEffect,e&&this.featureEffectView.endTransition(),await this.featureContainer.updateEnd(this._lastSchema.processor,this.layerAdapter.getLabelingDeconflictionInfo(),e),has(`esri-2d-update-debug`)&&console.debug(`FeatureLayerView2D.updateEnd`)}catch{}}async _doUpdate(){let e=Math.round(performance.now());await(await this.getWorker()).pipeline.updateSchema(e),this.requestUpdate()}async _doOverride(e){let t=await this.getWorker();try{let n=new J;for(let r of e.messages)switch(r.type){case`edit`:n.tryAdd(await this._resolveEdit(r.event))||(await t.pipeline.onOverride(n.toMessage()),n=new J,n.tryAdd(await this._resolveEdit(r.event)));break;case`override`:n.tryAdd(this._resolveOverrides(r.options))||(await t.pipeline.onOverride(n.toMessage()),n=new J,n.tryAdd(this._resolveOverrides(r.options)))}await t.pipeline.onOverride(n.toMessage())}catch(e){h(e)}}_getEffectiveAvailableFields(e){let t=Z(this._lastAvailableFields,e);return this._lastAvailableFields=t,ne(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){let e=this.requiresCurrentUser?await this.signedInUser:null,t=T(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),n=this.featureEffect?.filter?.toJSON()??null,r=this._getHighlightFilterGroups().map(({order:e,filters:t})=>({order:e,filters:t.map(e=>e.toJSON())})),i=pe({layerFilter:t,effectFilter:n,highlightFilters:r});return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:i,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent,returnZ:this.hasZ,returnM:this.hasM}}_onHighlightChange(){this._commandsQueue.push({type:`update`})}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return t.geometry!=null&&(t.geometry.spatialReference=this.view.spatialReference),{type:`graphic`,graphic:t,layer:this.layer,mapPoint:e}}};e([b()],y.prototype,`_commandsQueue`,void 0),e([b()],y.prototype,`_sourceRefreshVersion`,void 0),e([b()],y.prototype,`_displayRefreshVersion`,void 0),e([b({readOnly:!0})],y.prototype,`_pipelineUpdating`,void 0),e([b()],y.prototype,`_sourceUpdating`,void 0),e([b({readOnly:!0})],y.prototype,`dataUpdating`,null),e([b({readOnly:!0})],y.prototype,`hasAllFeatures`,null),e([b({readOnly:!0})],y.prototype,`hasAllFeaturesInView`,null),e([b({readOnly:!0})],y.prototype,`hasFullGeometries`,null),e([b()],y.prototype,`featureEffectView`,void 0),e([b()],y.prototype,`layerAdapter`,null),e([b({readOnly:!0})],y.prototype,`timeExtent`,null),y=e([x(`esri.views.2d.layers.FeatureLikeLayerView2D`)],y);function T(e,t,n,r,i,a){i&&=i.clone();let o=i==null?null:i.timeExtent,s=n!=null&&o!=null?n.intersection(o):n||o;s&&(i??=new O,i.timeExtent=s),i=t.addFilters?.(i,e)??i,a&&(i??=new O,i.where=v(i.where,a));let c=i?.toJSON()??null;return r.size&&(c??=new O().toJSON(),c.hiddenIds=Array.from(r)),c}return y};export{be as FeatureLikeLayerView2D};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import n from"../../../Graphic.js";import r from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{makeHandle as s,handlesGroup as c}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import l from"../../../core/Logger.js";import{destroyMaybe as u}from"../../../core/maybe.js";import{notDeepEqual as d}from"../../../core/object.js";import{createAbortError as f,ignoreAbortErrors as p,throwIfNotAbortError as m,isAbortError as h}from"../../../core/promiseUtils.js";import{watch as g,sync as _}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as y}from"../../../core/units.js";import{property as b,subclass as x}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import C from"../../../geometry/Extent.js";import{fromJSON as w,getJsonType as T}from"../../../geometry/support/jsonUtils.js";import E from"../../../geometry/support/rotate.js";import{isCurvedGeometry as D}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as O}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import ee from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as k}from"../../../layers/graphics/featureConversionUtils.js";import A from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as te}from"../../../layers/support/featureLayerUtils.js";import{packFields as ne}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as re}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as ie}from"../../../layers/support/timeSupport.js";import ae from"../../../rest/support/AggregateFeatureSet.js";import oe from"../../../rest/support/AttributeBinsFeatureSet.js";import se from"../../../rest/support/AttributeBinsQuery.js";import j from"../../../rest/support/FeatureSet.js";import M from"../../../rest/support/Query.js";import{HittestDrawHelper as N}from"../../../symbols/cim/CIMSymbolDrawHelper.js";import{resolveSymbolToCIM as P}from"../../../symbols/cim/CIMSymbolHelper.js";import{getDisplayedSymbol as F}from"../../../symbols/support/symbolUtils.js";import{LayerView2D as I}from"./LayerView2D.js";import{FeatureContainer as L}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as R}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as z}from"./features/FeatureSourceEventLog.js";import{AnnotationLayerAdapter as B}from"./features/layerAdapters/AnnotationLayerAdapter.js";import{CatalogFootprintLayerAdapter as V}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{DimensionLayerAdapter as H}from"./features/layerAdapters/DimensionLayerAdapter.js";import{FeatureLayerAdapter as U}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as W}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as G}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as K}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as ce}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as le}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as ue}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as de}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as fe}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as q}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as J}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as pe}from"./support/FeatureCommandQueue.js";import{createFilterSchemas as me}from"./support/FilterSchema.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as X}from"./support/util.js";import{getMapPointsFromScreen as he,getHittestType as Z}from"../support/hitTestUtils.js";import{FeatureTileSubscriptionManager as ge}from"../tiling/FeatureTileSubscriptionManager.js";import{RefreshableLayerView as _e}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ve}from"../../support/highlightOptionsUtils.js";function ye(e,t){let n=new Set;return e&&e.forEach(e=>n.add(e)),t&&t.forEach(e=>n.add(e)),n.has(`*`)?[`*`]:Array.from(n)}const Q=4294967294;function be(e,t){return c(e.map(e=>g(()=>{let t=e();return t&&typeof t==`object`?`getTime`in t&&typeof t.getTime==`function`?t.getTime():JSON.stringify(t):t},t,_)))}function $(e){if(!e.geometry||!D(e.geometry))return e;let t=.001/y(e.geometry.spatialReference);return{geometry:O(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:100*t,maxDeviation:0}),attributes:e.attributes}}const xe=c=>{let _=_e(I(c)),y=class extends _{constructor(){super(...arguments),this._commandsQueue=new pe({process:e=>{switch(e.type){case`override-batch`:return this._doOverride(e);case`update`:return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this._stationaryRotation=0,this.eventLog=new z,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._hittestDrawHelper=null,this._sourceUpdating=!1,this.featureEffectView=new ee}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(f()),this._commandsQueue.destroy(),this._hittestDrawHelper?.destroy()}initialize(){this._workerAttached=Promise.withResolvers(),p(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){let e=this.layer;if(`isTable`in e&&e.isTable)throw new o(`featurelayerview:table-not-supported`,`table feature layer can't be displayed`,{layer:e});if((e.type===`feature`||e.type===`subtype-group`)&&re(e)?.operations.supportsQuery===!1)throw new o(`featurelayerview:query-not-supported`,`layer view requires a layer with query capability`,{layer:e});this._workerProxy&&this._workerProxy.destroy();let t=this._createClientOptions();this._workerProxy=await R(t)}async _attachProxy(){let e=E(this.view.extent,this.view.rotation,this.view.center),t={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON(),initialViewExtent:e.toJSON()};try{await this._workerProxy.pipeline.onAttach(t),this._workerAttached.resolve()}catch(e){this._workerAttached.reject(f()),m(e)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){let e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&e!=null&&e!==`1=1`;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get layerAdapter(){switch(this.layer.type){case`annotation-feature`:return new B(this.layer);case`dimension-feature`:return new H(this.layer);case`feature`:return this.layer.source.type===`memory`?new G(this.layer):new U(this.layer);case`geojson`:case`csv`:case`wfs`:return new G(this.layer);case`parquet`:return new ue(this.layer);case`subtype-group`:return new fe(this.layer);case`ogc-feature`:return new ce(this.layer);case`stream`:return new de(this.layer);case`oriented-imagery`:return new le(this.layer);case`knowledge-graph-sublayer`:return new K(this.layer);case`catalog-footprint`:return new V(this.layer);default:this.layer}return null}get timeExtent(){return ie(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get(`timeExtent`))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}highlight(e,t){let r=ve(t),o;if(e instanceof A)o=e;else{let t;e instanceof n?t=[e.getObjectId()]:typeof e==`number`||typeof e==`string`?t=[e]:a.isCollection(e)&&e.length>0?t=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(t=typeof e[0]==`number`||typeof e[0]==`string`?e:e.map(e=>e?.getObjectId()));let r=t?.filter(i);if(!r?.length)return s();o=new A({objectIds:r})}let c=this._addHighlightFilter(o,r);return s(()=>!this.destroyed&&this._removeHighlight(c))}async hitTest(e,i,a){let o=Z(i);if(!o)return null;let s=o===`point`,{trueHitIds:c,candidateHitIds:l}=await this.featureContainer.hitTest(i,a??null),u=await this.getWorker(),[d,f]=await Promise.all([u.pipeline.getDisplayFeatures(l),u.pipeline.getDisplayFeatures(c)]),{features:p,aggregates:m,tracks:h}=d,{features:g,aggregates:_,tracks:v}=f,y=s?p:this.hasRenderer()?await this._filterCandidateHits(p,i,o):[],b=[...g,...y],x=[..._,...m],S=[...v,...h],C=this.featureContainer.getSortKeys(b.map(e=>e.displayId)),w=({displayId:e},{displayId:t})=>C.has(e)&&C.has(t)?C.get(e)-C.get(t):e-t;return b.sort(w).reverse(),x.sort(w).reverse(),[...x.map(n=>this._createAggregateGraphicHit(e,t.fromJSON(n))),...S.map(t=>this._createTrackGraphicHit(e,r.fromJSON(t))),...b.map(t=>this._createFeatureGraphicHit(s?e:null,n.fromJSON(t)))]}async _filterCandidateHits(e,t,r){let i=[],a=new n,{resolution:o,rotation:s}=this.view.state,c=he(this.view,t);for(let t of e){a.attributes=t.attributes,a.geometry=w(t.geometry),a.symbol=null;let e=this.layerAdapter.getRenderer(a);if(!e){i.push(t);continue}let n=await F(a,{renderer:e,scale:this.view.scale,resolution:this.view.resolution,spatialReference:this.view.spatialReference,viewingMode:`2d`,timeZone:this.view.timeZone});if(!n)continue;let l=await P(n,null,this.view.spatialReference,T(t.geometry),{scale:this.view.scale,viewingMode:`2d`});if(!l)continue;let u=this.view.stage.cimAnalyzer.analyzeSymbolReference({type:`CIMSymbolReference`,symbol:l},!1).some(e=>`alignment`in e&&e.alignment===0);this._hittestDrawHelper??=new N(this.view.stage.painter.textureManager.resourceManager);let d={hittestType:r,textInfo:null,mapRotation:s,resolution:o,searchDist:0,isScreenAligned:u};this._hittestDrawHelper.hitTest(c,l,t.geometry,d)&&i.push(t)}return i}async queryAggregateSummaryStatistics(e,t,n){let r={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),r,n);return Y(i,{})}async queryUniqueValues(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,n);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,n);return Y(a,{uniqueValueInfos:[]})}async queryAggregateClassBreaks(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,n);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForHistogram(this._cleanUpQuery(e),i,n);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateCount(e,t){let n=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(n,0)}async queryAggregateHistogram(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,n);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateIds(e,t){let n=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(n,[])}async queryAggregateJSON(e,t){let n=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(n,{features:[]})}async queryAttributeBins(e,t){let n=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),r=await Y(n,{features:[]});return oe.fromJSON(r)}async queryAggregates(e,t){let n=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),r=await Y(n,{features:[]}),i=ae.fromJSON(r);return i.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),i}async queryClassBreaks(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,n);return Y(a,{classBreakInfos:[]})}async queryExtent(e,t){let n=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),r=await Y(n,{count:0,extent:null});return{count:r.count,extent:C.fromJSON(r.extent)}}async queryFeatureCount(e,t){let n=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(n,0)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{let t=j.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryFeaturesJSON(e,t){let n=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(n,{features:[]})}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}async queryObjectIds(e,t){let n=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(n,[])}async queryStatistics(){let e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,n);return Y(a,{})}async queryVisibleFeatures(e,t){let n=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),r=await Y(n,{features:[]}),i=j.fromJSON(r);return i.features.forEach(e=>this._setOriginForFeature(e)),i}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptions)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);let t=this.featureContainer.getPresenting(),n=this._subscriptions.update(e.targetState,this._lastTargetState,t);n&&(this.featureContainer.updateSubscriptions(n),p(this._updatingHandles.addPromise(this.getWorker().then(e=>e.pipeline.updateSubscriptions(n))))),this._subscriptions.coverage&&this.featureContainer.setCoverage(this._subscriptions.coverage)}attach(){has(`esri-2d-update-debug`)&&console.debug(`FeatureLayerView2D.attach`),p(this._updatingHandles.addPromise(this._workerAttached.promise)),p(this._attachProxy()),this.featureContainer=new L(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptions=new ge(this.view.featuresTilingScheme),this._stationaryRotation=this.view.rotation,this.requestUpdate(),this.addAttachHandles([be([()=>this._displayRefreshVersion,()=>`displayFilterInfo`in this.layer&&this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),g(()=>this.updateSuspended,e=>{e||this._subscriptions.resume(this.featureContainer.getPresenting())}),g(()=>this.view.stationary,e=>{if(!e)return;let t=this.view.rotation;t!==this._stationaryRotation&&(this._stationaryRotation=t,this._update()),this.getWorker().then(e=>{if(this.destroyed)return;let t=E(this.view.extent,this.view.rotation,this.view.center);return e.pipeline.updateViewExtent(t.toJSON(),this.featureContainer.requiresRefresh)}).catch(()=>{})})]),this._update(),this.layer.type!==`stream`&&this.layer.type!==`parquet`&&this.layer.type!==`catalog-footprint`&&this.addAttachHandles(this.layer.on(`edits`,e=>this._editUpdatingHandles.addPromise(this._edit(e))))}emitFirstDraw(e){this.emit(`first-draw`,{timestamp:e})}detach(){has(`esri-2d-update-debug`)&&console.debug(`FeatureLayerView2D.detach`),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptions=u(this._subscriptions),this._workerProxy.pipeline.onDetach(),this._workerAttached=Promise.withResolvers(),p(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:`override`,options:{...e,release:[]}})}removeOverrides(e){for(let t of e)if(t==null)throw new o(`featurelayerview:bad-override`,`Tried to remove an override for an invalid objectId`,{objectId:t});let t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:`override`,options:t})}onProxyClientEvent(e){}hasRenderer(){return`renderer`in this.layer&&this.layer.renderer!=null}isUpdating(){let e=this.hasRenderer(),t=this._commandsQueue.updateTracking.updating,n=this._updatingRequiredPromise!=null,r=this.featureContainer.updating;return this.updateRequested||e&&(t||n)||r||this._pipelineUpdating||this.dataUpdating}_createClientOptions(){let e=this;return{updateSchemaStart(){return e.updateSchemaStart()},updateSchemaEnd(t){return e.updateSchemaEnd(t)},openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){let e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw Error(`InternalError: Layer adapter does not support opening message ports`)},openGlyphPorts:async()=>{let t=await e.container.stage.textureManager.openMessagePorts();return{result:t,transferList:t}},get container(){return e.featureContainer},setUpdating:e=>{this._set(`_pipelineUpdating`,e.pipeline),this._set(`_sourceUpdating`,e.source)},emitEvent:e=>{this.onProxyClientEvent(e)},get eventLog(){return e.eventLog},fetch:async t=>{if(has(`esri-2d-stabilize-glyphs`)){let n=[];for(let r of t)n.push(await e.view.stage.painter.textureManager.rasterizeItem(r));return n}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e))),fetchMesh:e=>Promise.all(e.map(e=>this._fetchMeshRequest(e)))}}async _fetchDictionaryRequest(e){try{if(!(`renderer`in this.layer)||!this.layer.renderer||this.layer.renderer.type!==`dictionary`)throw Error(`InternalError: Expected renderer to be of type 'dictionary'`);let t=this.layer.renderer,n=this._lastSchema.processor.mesh.factory.symbology;if(n.type!==`dictionary`)throw Error(`InternalError: Expected schema to be of type 'dictionary'`);let r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:n.scaleExpression,viewRotation:this._stationaryRotation};this._fields||=this.layer.fields.map(e=>e.toJSON());let i=n.visualVariableUniforms,a=X(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);return!o||!o.data?{type:`dictionary-response`,meshes:[]}:{type:`dictionary-response`,meshes:await q({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:`renderer`,schemaOptions:r})}}catch{return{type:`dictionary-response`,meshes:[]}}}async _fetchMeshRequest(e){let{layer:t}=this;try{let n={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:null,viewRotation:this._stationaryRotation};return this._fields||=t.fields.map(e=>e.toJSON()),{type:`mesh-response`,meshes:await q({...e.symbolReference,hasTextStringTemplates:!0},{path:`anno-like`,schemaOptions:n,uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null}})}}catch{return{type:`mesh-response`,meshes:[]}}}_cleanUpQuery(e){let t=M.from(e)||this.createQuery();return t.outSpatialReference||=this.view.spatialReference,`returnZ`in this.layer&&(t.returnZ??=this.layer.returnZ),`returnM`in this.layer&&(t.returnM??=this.layer.returnM),t.toJSON()}_cleanUpAttributeBinsQuery(e){let t=se.from(e);return t.outSpatialReference||=this.view.spatialReference,t.toJSON()}_cleanUpAggregateQuery(e){let t=M.from(e)||this.createAggregateQuery();t.outSpatialReference||=this.view.spatialReference;let n=t.objectIds??[];for(let e of t.aggregateIds??[])n.push(e);return t.objectIds=n,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:`update`})}_edit(e){return this._commandsQueue.push({type:`edit`,event:e})}async doRefresh(e){this.attached&&(!this.updateSuspended||!e)&&(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion())}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%Q+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%Q+1}async _resolveIdenifiers(e){let t=[],n=[];for(let r of e){if(r.objectId!=null&&r.objectId!==-1){t.push(r.objectId);continue}if(r.globalId!=null){n.push(r.globalId);continue}l.getLogger(this).warn(`mapview-apply-edits`,`A feature identifier must contain either a GlobalId or ObjectId. Ignoring`,{identifier:r})}let r=`globalIdField`in this.layer&&this.layer.globalIdField,i=r&&this.availableFields.includes(r);if(n.length&&!i)return l.getLogger(this).error(new o(`mapview-apply-edits`,`Editing the specified service requires the layer's globalIdField, ${r} to be included the layer's outFields for updates to be reflected on the map`)),t;if(n.length){let e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(n);for(let n of e)t.push(n)}return t}_resolveOverrides(e){let t=X(this.layer.geometryType),n=W(this.layer),r=[];for(let i of e.added){let e=k($(i),t,!1,!1,n);if(e.objectId==null)throw new o(`featurelayerview:bad-override`,`Feature does not have an objectId`,{feature:i});r.push(e)}for(let i of e.updated){let e=k($(i),t,!1,!1,n);if(e.objectId==null)throw new o(`featurelayerview:bad-override`,`Feature does not have an objectId`,{feature:i});r.push(e)}for(let t of e.removed)if(t==null)throw new o(`featurelayerview:bad-override`,`Tried to remove an invalid objectId`,{objectId:t});return{type:`override`,updates:r,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){let t=this.layer,n=e.historicMoment?.getTime()??null,r=`layerId`in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(r&&this._canEditByFeature(r)){let{adds:e,deletes:t,updates:i}=r.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),s=t.map(e=>`attributes`in e?{objectId:a?e.attributes[a]:null}:e),c=await this._resolveIdenifiers(s);return this._resolveOverrides({added:e,updated:o,removed:c,historicMoment:n,isWeak:!0,release:[]})}let[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:`override-by-id`,updates:[...i,...a],removed:o,historicMoment:n,isWeak:!0}}_canEditByFeature(e){let{adds:t,updates:n}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&n.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async updateSchemaStart(){let e=this.layer;`featureReduction`in e&&e.featureReduction&&e.featureReduction!==this._lastFeatureReduction&&(e.featureReduction=e.featureReduction?.clone(),this._lastFeatureReduction=e.featureReduction);try{if(await Promise.allSettled([this._handleChange(),te(e)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptions)return null;let t=this.featureContainer.updateStart(e.type===`subtype-group`);this._lastFeatureEffect=this.featureEffect;let n={store:t,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0,viewRotation:this._stationaryRotation},r=await this._createViewSchemaConfig(),i={source:await this.layerAdapter.createSourceSchema(r,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(n,r,this._displayRefreshVersion)};return d(this._lastSchema?.source.strategy,i.source.strategy)||d(this._lastSchema?.processor,i.processor)?(this._lastSchema=i,this._fields=null,i):null}catch{}return null}async updateSchemaEnd(e){try{this.featureEffectView.featureEffect=this._lastFeatureEffect,e&&this.featureEffectView.endTransition(),await this.featureContainer.updateEnd(this._lastSchema.processor,this.layerAdapter.getLabelingDeconflictionInfo(),e),has(`esri-2d-update-debug`)&&console.debug(`FeatureLayerView2D.updateEnd`)}catch{}}async _doUpdate(){let e=Math.round(performance.now());await(await this.getWorker()).pipeline.updateSchema(e),this.requestUpdate()}async _doOverride(e){let t=await this.getWorker();try{let n=new J;for(let r of e.messages)switch(r.type){case`edit`:n.tryAdd(await this._resolveEdit(r.event))||(await t.pipeline.onOverride(n.toMessage()),n=new J,n.tryAdd(await this._resolveEdit(r.event)));break;case`override`:n.tryAdd(this._resolveOverrides(r.options))||(await t.pipeline.onOverride(n.toMessage()),n=new J,n.tryAdd(this._resolveOverrides(r.options)))}await t.pipeline.onOverride(n.toMessage())}catch(e){h(e)}}_getEffectiveAvailableFields(e){let t=ye(this._lastAvailableFields,e);return this._lastAvailableFields=t,ne(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){let e=this.requiresCurrentUser?await this.signedInUser:null,t=D(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),n=this.featureEffect?.filter?.toJSON()??null,r=this._getHighlightFilterGroups().map(({order:e,filters:t})=>({order:e,filters:t.map(e=>e.toJSON())})),i=me({layerFilter:t,effectFilter:n,highlightFilters:r});return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:i,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent,returnZ:this.hasZ,returnM:this.hasM}}_onHighlightChange(){this._commandsQueue.push({type:`update`})}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return t.geometry!=null&&(t.geometry.spatialReference=this.view.spatialReference),{type:`graphic`,graphic:t,layer:this.layer,mapPoint:e}}};e([b()],y.prototype,`_commandsQueue`,void 0),e([b()],y.prototype,`_sourceRefreshVersion`,void 0),e([b()],y.prototype,`_displayRefreshVersion`,void 0),e([b({readOnly:!0})],y.prototype,`_pipelineUpdating`,void 0),e([b()],y.prototype,`_sourceUpdating`,void 0),e([b({readOnly:!0})],y.prototype,`dataUpdating`,null),e([b({readOnly:!0})],y.prototype,`hasAllFeatures`,null),e([b({readOnly:!0})],y.prototype,`hasAllFeaturesInView`,null),e([b({readOnly:!0})],y.prototype,`hasFullGeometries`,null),e([b()],y.prototype,`featureEffectView`,void 0),e([b()],y.prototype,`layerAdapter`,null),e([b({readOnly:!0})],y.prototype,`timeExtent`,null),y=e([x(`esri.views.2d.layers.FeatureLikeLayerView2D`)],y);function D(e,t,n,r,i,a){i&&=i.clone();let o=i==null?null:i.timeExtent,s=n!=null&&o!=null?n.intersection(o):n||o;s&&(i??=new A,i.timeExtent=s),i=t.addFilters?.(i,e)??i,a&&(i??=new A,i.where=v(i.where,a));let c=i?.toJSON()??null;return r.size&&(c??=new A().toJSON(),c.hiddenIds=Array.from(r)),c}return y};export{xe as FeatureLikeLayerView2D};
|
|
@@ -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/Collection.js";import{referenceSetter as n}from"../../../core/collectionUtils.js";import{deprecatedFunction as r}from"../../../core/deprecate.js";import i from"../../../core/Error.js";import"../../../core/has.js";import a from"../../../core/Logger.js";import{watch as o,syncAndInitial as s,sync as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{referenceSetter as n}from"../../../core/collectionUtils.js";import{deprecatedFunction as r}from"../../../core/deprecate.js";import i from"../../../core/Error.js";import"../../../core/has.js";import a from"../../../core/Logger.js";import{watch as o,syncAndInitial as s,sync as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{isInEffectiveScaleRange as d}from"../../../geometry/support/scaleUtils.js";import{isLinkChartView as f}from"../../../linkChart/guards.js";import{Container as p}from"../engine/Container.js";import{ClipMesh as m}from"../engine/webgl/ClipMesh.js";import{maxHighlightGroups as h}from"../engine/webgl/definitions.js";import{HighlightRegistry as g}from"./support/HighlightRegistry.js";import{createOrReuseHighlightGradient as _}from"./support/util.js";import v from"../../layers/support/ClipRect.js";import y from"../../layers/support/GeometryClipArea.js";import b from"../../layers/support/Path.js";import{defaultHighlightName as x}from"../../support/HighlightDefaults.js";import S from"../../support/HighlightOptions.js";const C=t.ofType({key:`type`,base:null,typeMap:{rect:v,path:b,geometry:y}}),w=new(t.ofType(S)),T=v=>{let y=v,b=class extends y{constructor(){super(...arguments),this._highlightRegistry=new g,this.attached=!1,this.clips=new C,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){let e=this.view?.spatialReferenceLocked??!0;if(this.view?.spatialReference&&e&&!this.spatialReferenceSupported){this.addResolvingPromise(Promise.reject(new i(`layerview:spatial-reference-incompatible`,`The spatial reference of this layer does not meet the requirements of the view`,{layer:this.layer})));return}this.container||=new p,this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,e=>{this.container&&(this.container.visible=!e)},s),o(()=>this.updateSuspended,e=>{this.view&&!e&&this.updateRequested&&this.view.requestUpdate()},s),o(()=>this.layer?.opacity??1,e=>{this.container&&(this.container.opacity=e)},s),o(()=>this.layer&&`blendMode`in this.layer?this.layer.blendMode:`normal`,e=>{this.container&&(this.container.blendMode=e)},s),o(()=>this.layer&&`effect`in this.layer?this.layer.effect:null,e=>{this.container&&(this.container.effect=e)},s),o(()=>this._effectiveHighlightOptions.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{this.container.highlightGradient=_(this.container.highlightGradient,this._effectiveHighlightOptions.items)},s),o(()=>this._getHighlightFilterGroups(),()=>this._onHighlightChange(),c),o(()=>this.clips.map(e=>e.version),async()=>{if(this.container&&this.view?.spatialReference){let e=this.view.featuresTilingScheme,t=await this._updatingHandles.addPromise(Promise.all(this.clips.items.map(t=>m.create(t,e))));for(let e of this.container.clips)e.destroy();this.container.clips=t.filter(e=>!!e)}},s),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null}),({scale:e,scaleRange:t})=>{let n=d(t,e);n!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=n)},s),o(()=>this.layer?.effectiveVisible,async e=>{this.container.requestDeclutter()})],`constructor`),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(e=>{e===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{})}destroy(){this.processDetach(),this.updateRequested=!1;for(let e of this.container?.clips??[])e.destroy()}get highlightOptions(){return this._logHighlightOptionsDeprecation(),this.highlights?.find(({name:e})=>e===x)}set highlightOptions(e){if(this._logHighlightOptionsDeprecation(),!this.highlights){if(!e)return;this.highlights=new t([new S])}let n=this.highlights.find(({name:e})=>e===x);e?n?.assignFrom(e):(this.highlights.remove(n),this.highlights.length===0&&(this.highlights=null))}_logHighlightOptionsDeprecation(){r(a.getLogger(this),"`LayerView.highlightOptions` is deprecated in favor of View.highlights",{replacement:`View.highlights`,version:`4.34`,see:`https://arcg.is/inbTa1#highlights`,warnOnce:!0})}get hasHighlight(){return this._highlightRegistry.size>0}get _effectiveHighlightOptions(){if(!this.view)return w;if(!this.highlights)return this.view.highlights;let e=this.view.highlights.clone();for(let t of this.highlights){let n=e.find(e=>e.name===t.name);n&&n.assignFrom(t)}return e}get highlightIds(){return this._highlightRegistry.highlightIds}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){let e=this.view?.spatialReference;return e==null||this.supportsSpatialReference(e)}get updating(){return this.spatialReferenceSupported?this.attached?this.suspended?!1:this.updateRequested||this.isUpdating()||this._updatingHandles?.updating||this.container.transitioning:!0:!1}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles(`attach`),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(e){if(this.isFulfilled()&&!this.isResolved()){this.updateRequested=!1;return}this._set(`updateParameters`,e),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(e))}hitTest(e,t,n){return Promise.resolve(null)}supportsSpatialReference(e){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case`link-chart`:case`knowledge-graph-sublayer`:case`graphics`:break;default:if(f(this.view)&&!this.view.inGeographicLayout)return!1}return super.canResume()?this.visibleAtCurrentScale:!1}getSuspendInfo(){let e=super.getSuspendInfo(),t=!this.spatialReferenceSupported;return t&&(e.spatialReferenceNotSupported=t),e}addAttachHandles(e){this.addHandles(e,`attach`)}_addHighlightFilter(e,t){return this._highlightRegistry.register(t,e)}_removeHighlight(e){this._highlightRegistry.unregister(e)}_onHighlightChange(){}_getHighlightFilterGroups(){let e=[];for(let{name:t,filters:n}of this._highlightRegistry.highlightGroups){let r=this._effectiveHighlightOptions.findIndex(e=>e.name===t);r<0||r>=h||e.push({order:r,filters:n})}return e}};return e([l()],b.prototype,`attached`,void 0),e([l({type:C,set(e){let t=n(e,this._get(`clips`),C);this._set(`clips`,t)}})],b.prototype,`clips`,void 0),e([l()],b.prototype,`container`,void 0),e([l({type:S})],b.prototype,`highlightOptions`,null),e([l({type:t.ofType(S)})],b.prototype,`highlights`,void 0),e([l()],b.prototype,`_effectiveHighlightOptions`,null),e([l()],b.prototype,`moving`,void 0),e([l({readOnly:!0})],b.prototype,`spatialReferenceSupported`,null),e([l({readOnly:!0})],b.prototype,`updateParameters`,void 0),e([l()],b.prototype,`updateRequested`,void 0),e([l()],b.prototype,`updating`,null),e([l()],b.prototype,`view`,void 0),e([l()],b.prototype,`_visibleAtCurrentScale`,void 0),e([l({readOnly:!0})],b.prototype,`visibleAtCurrentScale`,null),b=e([u(`esri.views.2d.layers.LayerView2D`)],b),b};export{T as LayerView2D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../../core/object.js";import{ignoreAbortErrors as n,throwIfNotAbortError as r}from"../../../../../core/promiseUtils.js";import{OptimizedFeature as i}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as a}from"../../../../../layers/graphics/data/QueryEngine.js";import{FeatureStoreStatistics as o}from"../FeatureStoreStatistics.js";import{StreamMessenger as s}from"./StreamMessenger.js";import{UpdateStatus as c}from"./strategies/ALoadStrategy.js";import{FeatureDrillDownTileLoadStrategy as l}from"./strategies/FeatureDrillDownTileLoadStrategy.js";import{FeatureHybridTileLoadStrategy as u}from"./strategies/FeatureHybridTileLoadStrategy.js";import{FeaturePagedTileLoadStrategy as d}from"./strategies/FeaturePagedTileLoadStrategy.js";import{FeatureSnapshotLoadStrategy as f}from"./strategies/FeatureSnapshotLoadStrategy.js";import{ParquetSnapshotLoadStrategy as p}from"./strategies/ParquetSnapshotLoadStrategy.js";import{ParquetTileLoadStrategy as m}from"./strategies/ParquetTileLoadStrategy.js";import{StreamLoadStrategy as h}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as g}from"./strategies/chunks/SourceChunkStore.js";import _ from"../support/FeatureFilterEvaluator.js";import{UpdateTracking2D as v}from"../../support/UpdateTracking2D.js";class y{constructor(e,t,n){this._aggregateAdapter=e,this._subscriptions=t,this._connection=n,this._updateTracking=new v({debugName:`FeatureSource`}),this._filters=[],this.store=new g}destroy(){this._strategy?.destroy(),this._streamMessenger?.destroy(),this._updateTracking?.destroy(),this.store.destroy()}get metadata(){return this._strategy.metadata}get streamMessenger(){return this._streamMessenger??this._initStreamMessenger(),this._streamMessenger}get statistics(){return o.from(this.store)}get updateTracking(){return this._updateTracking}get usedMemory(){return this.store.usedMemory}get queryEngine(){if(!this._queryEngine){if(!this.store||!this._strategy)return null;this._queryEngine=new a({featureStore:this.store,fieldsIndex:this.metadata.fieldsIndex,geometryType:this.metadata.geometryType,featureIdInfo:this.metadata.featureIdInfo,hasZ:this.metadata.hasZ,hasM:this.metadata.hasM,spatialReference:this.metadata.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:this.metadata.timeInfo,definitionExpression:this._strategy?.definitionExpression,availableFields:this._strategy?.availableFields})}return this._queryEngine}get isStream(){return this._schema.type===`stream`}get hasQueryDisplayFilter(){if(!this._schema)return!1;switch(this._schema.type){case`feature`:return this._schema.strategy.full.displayFilterInfo!=null;case`parquet`:case`stream`:return!1}}chunks(){return Array.from(this.store.chunks())}async applyCacheUpdate(){this.hasQueryDisplayFilter&&await this._updateTracking.addPromise(this._strategy.applyCacheUpdate())}cleanup(){return this.store.cleanup()}onSubscribe(e){if(this._connection.onEvent({type:`subscribe`,tile:e.tile.id}),!this._strategy)return;let t=this._strategy.load(e);t.then(()=>this._connection.onEvent({type:`loaded`,tile:e.tile.id})).catch(t=>this._connection.onEvent({type:`error`,tile:e.tile.id,error:t})),this._updateTracking.consumePromise(t)}onResume(e){this._updateTracking.consumePromise(n(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:`unsubscribe`,tile:e.tile.id}),this._strategy?.unload(e)}async applyOverride(e){await this._strategy?.applyOverride(e)}takeOverrideUpdate(){return this._strategy?.takeOverrideUpdate()}async update(n,r,i){let a=this._schema,o=this._getCachedObjectIds(this._filters),s=this._getCachedObjectIds(r);if(this._schema=n,this._filters=r,
|
|
2
|
+
import has from"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../../core/object.js";import{ignoreAbortErrors as n,throwIfNotAbortError as r}from"../../../../../core/promiseUtils.js";import{OptimizedFeature as i}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as a}from"../../../../../layers/graphics/data/QueryEngine.js";import{FeatureStoreStatistics as o}from"../FeatureStoreStatistics.js";import{StreamMessenger as s}from"./StreamMessenger.js";import{UpdateStatus as c}from"./strategies/ALoadStrategy.js";import{FeatureDrillDownTileLoadStrategy as l}from"./strategies/FeatureDrillDownTileLoadStrategy.js";import{FeatureHybridTileLoadStrategy as u}from"./strategies/FeatureHybridTileLoadStrategy.js";import{FeaturePagedTileLoadStrategy as d}from"./strategies/FeaturePagedTileLoadStrategy.js";import{FeatureSnapshotLoadStrategy as f}from"./strategies/FeatureSnapshotLoadStrategy.js";import{ParquetSnapshotLoadStrategy as p}from"./strategies/ParquetSnapshotLoadStrategy.js";import{ParquetTileLoadStrategy as m}from"./strategies/ParquetTileLoadStrategy.js";import{StreamLoadStrategy as h}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as g}from"./strategies/chunks/SourceChunkStore.js";import _ from"../support/FeatureFilterEvaluator.js";import{UpdateTracking2D as v}from"../../support/UpdateTracking2D.js";class y{constructor(e,t,n){this._aggregateAdapter=e,this._subscriptions=t,this._connection=n,this._updateTracking=new v({debugName:`FeatureSource`}),this._filters=[],this.store=new g}destroy(){this._strategy?.destroy(),this._streamMessenger?.destroy(),this._updateTracking?.destroy(),this.store.destroy()}get metadata(){return this._strategy.metadata}get streamMessenger(){return this._streamMessenger??this._initStreamMessenger(),this._streamMessenger}get statistics(){return o.from(this.store)}get updateTracking(){return this._updateTracking}get usedMemory(){return this.store.usedMemory}get queryEngine(){if(!this._queryEngine){if(!this.store||!this._strategy)return null;this._queryEngine=new a({featureStore:this.store,fieldsIndex:this.metadata.fieldsIndex,geometryType:this.metadata.geometryType,featureIdInfo:this.metadata.featureIdInfo,hasZ:this.metadata.hasZ,hasM:this.metadata.hasM,spatialReference:this.metadata.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:this.metadata.timeInfo,definitionExpression:this._strategy?.definitionExpression,availableFields:this._strategy?.availableFields})}return this._queryEngine}get isStream(){return this._schema.type===`stream`}get hasQueryDisplayFilter(){if(!this._schema)return!1;switch(this._schema.type){case`feature`:return this._schema.strategy.full.displayFilterInfo!=null;case`parquet`:case`stream`:return!1}}chunks(){return Array.from(this.store.chunks())}async applyCacheUpdate(){this.hasQueryDisplayFilter&&await this._updateTracking.addPromise(this._strategy.applyCacheUpdate())}cleanup(){return this.store.cleanup()}onSubscribe(e){if(this._connection.onEvent({type:`subscribe`,tile:e.tile.id}),!this._strategy)return;let t=this._strategy.load(e);t.then(()=>this._connection.onEvent({type:`loaded`,tile:e.tile.id})).catch(t=>this._connection.onEvent({type:`error`,tile:e.tile.id,error:t})),this._updateTracking.consumePromise(t)}onResume(e){this._updateTracking.consumePromise(n(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:`unsubscribe`,tile:e.tile.id}),this._strategy?.unload(e)}async applyOverride(e){await this._strategy?.applyOverride(e)}takeOverrideUpdate(){return this._strategy?.takeOverrideUpdate()}async update(n,r,i){let a=this._schema,o=this._getCachedObjectIds(this._filters),s=this._getCachedObjectIds(r);if(this._schema=n,this._filters=r,a&&a.type!==n.type)throw Error(`InternalError: Reconfiguring source types is not supported.`);let l=new c;if(!a||t(a.service,n.service)||a.strategy.type!==n.strategy.type||t(n.strategy.full,a.strategy.full)||!await this._strategy.tryUpdate(l,n.strategy.partial)){await this._updateStrategyType(this._schema.service,n,i);let t=null;return`postQueryFilter`in this._schema.strategy.full&&this._schema.strategy.full.postQueryFilter&&(t=await _.create({geometryType:this.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:this.metadata.timeInfo,fieldsIndex:this.metadata.fieldsIndex,spatialReference:this.metadata.outSpatialReference,filterJSON:this._schema.strategy.full.postQueryFilter})),await this.store.update({metadata:this.metadata,definitionExpression:this._schema.strategy.full.definitionExpression,postQueryFilter:t}),this._queryEngine=e(this._queryEngine),!0}return this._updateFilterCache(o,s),this._queryEngine=e(this._queryEngine),l.requiresInvalidation}unsafeSetQueryHistoricMoment(e){this._schema.type===`feature`&&(this._schema.strategy.full.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){this._streamMessenger??=new s(this._connection)}async normalizeOverrides(e){let t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(i.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(i.fromJSON),remove:e.commands.remove,release:e.commands.release}},n=e.commands.updateByIdWeak,r=await this._queryOptimizedFeatures(n);if(r.length!==n.length){let e=new Set(r.map(e=>e.objectId));for(let r of n)e.has(r)||t.commands.removeWeak.push(r)}return t.commands.updateWeak.push(...r),t}async _queryOptimizedFeatures(e){if(e.length===0)return[];let t=[],n=(await this._strategy.queryByObjectId(e,[`*`])).getCursor();for(;n.next();)t.push(n.readOptimizedFeatureWorldSpace());return t}getObjectIdsFromGlobalIds(e){let t=this.metadata.globalIdField;if(t==null)throw Error(`InternalError: Recieved an edit with globalIds, but not supported by the service`);let n=this.store.mapObjectIdsFromGlobalIds(e,t).values();return Array.from(n)}_getCachedObjectIds(e){let t=new Set;for(let{ensureCached:n,filters:r}of e)if(n)for(let e of r)for(let n of e.objectIds??[])t.add(n);return t}_updateFilterCache(e,t){if(!this.hasQueryDisplayFilter)return;let n=new Set,r=new Set;for(let r of t)e.has(r)||n.add(r);for(let n of e)t.has(n)||r.add(n);this._strategy.prepareCacheUpdate(n,r)}async _updateStrategyType(e,t,n){let i=this._createStrategy(e,t);this._connection.onEvent({type:`updateStrategyStart`,about:i.about});let a=!!this._strategy;this.store.clear(),this._strategy?.destroy(),this._strategy=i,has(`esri-2d-update-debug`)&&console.debug(`Version[${n}] FeatureSource.updateStrategy`,{strategy:i});let o=Array.from(this._subscriptions.values());if(!o.length){this._connection.onEvent({type:`updateStrategyEnd`});return}let s=Promise.all(o.map(e=>this._strategy.load(e).then(()=>this._connection.onEvent({type:`loaded`,tile:e.tile.id})).catch(t=>this._connection.onEvent({type:`error`,tile:e.tile.id,error:t}))));this._updateTracking.consumePromise(s),this._strategy.prepareCacheUpdate(this._getCachedObjectIds(this._filters));try{a&&await s}catch(e){r(e)}this._connection.onEvent({type:`updateStrategyEnd`}),has(`esri-2d-update-debug`)&&console.debug(`Version[${n}] FeatureSource.updateStrategyEnd`,{strategy:i})}_createStrategy(e,t){let n={connection:this._connection,store:this.store};switch(t.type){case`feature`:return this._createFeatureLoadStrategy(e,t.strategy,n);case`parquet`:return this._createParquetLoadStrategy(e,t.strategy,n);case`stream`:return this._createStreamLoadStrategy(e,t.strategy,n)}}_createFeatureLoadStrategy(e,t,n){switch(t.type){case`drill-down`:return new l(e,t,n);case`hybrid-tile`:return new u(e,t,n);case`paged-tile`:return new d(e,t,n);case`snapshot`:return new f(e,t,n)}}_createParquetLoadStrategy(e,t,n){switch(t.type){case`xz`:return new m(e,t,n,this._connection);case`snapshot`:return new p(e,t,n,this._connection)}}_createStreamLoadStrategy(e,t,n){let r=new h(e,t,n);return this.streamMessenger.strategy=r,r}}export{y as FeatureSource};
|
|
@@ -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"../../../../analysis/Viewshed.js";import n from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as r,throwIfAborted as i,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as o,sync as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getConvertedElevation as d,absoluteHeightElevationInfo as f}from"../../../../support/elevationInfoUtils.js";import p from"../../../../symbols/support/ElevationInfo.js";import{createDrawTool as m,getFeatureReference as h}from"./placementUtils.js";import{detachToolFromView as g}from"./toolLifecycleUtils.js";import _ from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as v}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as y}from"./viewshedToolUtils.js";import{vectorToRender as b}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as x}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as S}from"../../../input/InputManager.js";import{sketchKeys as C}from"../../../interactive/keybindings.js";import{bindViewToolOptions as w}from"../../../interactive/options/bindViewToolOptions.js";import T from"../../../interactive/options/InteractiveToolOptions.js";const E=Symbol(`hiddenManipulatorHandle`);let D=class extends n{constructor(e){super(e),this.placementMode=`multiple`,this.observerPlacementElevationInfo=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null,this._toolOptions=new T,this._observerScenePoint=u(),this._targetScenePoint=u(),this._mapPointVector=u(),this.creationState=null}initialize(){this.addHandles([w(this._toolOptions,()=>this.view.options),o(()=>[this._drawTool?.tooltipManager,this.creationState],([e,t])=>{e&&(e.enabled=t===`placing-observer`)}),o(()=>[this._drawTool?.activeTooltipInfo,this.creationState],([e,t])=>{e&&(e.elevationModeContext=t===`placing-observer`?this._elevationModeContext:null)}),this.view.on(`key-down`,e=>this._handleKeyDown(e),S.DEFAULT),o(()=>{let{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:e!=null&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{e!=null&&!t&&this.analysis.viewsheds.add(e)},s)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}get _elevationModeContext(){let e=this;return{get mode(){return e._observerDrawToolElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(this.creationState!==`placing-observer`||!t||!n||!r||e===this._observerDrawToolElevationInfo.mode)return;let i=this.observerPlacementElevationInfo?.clone()??new p;i.mode=e;let a=r.clone();t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked||(a.z=d(this.view,r,this._observerDrawToolElevationInfo,i)),t.defaultZ=a.z,this.observerPlacementElevationInfo=i,t.elevationInfo=i,n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(r()),i(t);let{resolve:n,reject:o,promise:s}=Promise.withResolvers(),c=a(t,()=>this._cancelPlacementOperation());return this._placeOperation=new _({abortHandle:c,reject:o,resolve:n}),this.placementMode=e,this.observerPlacementElevationInfo=t?.elevationInfo,this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),s}cancelPlaceOperation(){(this.creationState!=null||this._placeOperation!=null)&&(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return this.creationState!=null&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){this.creationState!=null&&(C.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):C.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&this.placementMode===`multiple`){this.callbacks.setSelectedViewshed(null),this._startObserverPlacement();return}this._destroyDrawTool(),this._abortCreation()}_removeStaged(){let{stagedViewshed:e}=this;return this.stagedViewshed=null,e?(this.analysis.viewsheds.remove(e),!0):!1}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e,n,r){let i=new t({observer:e,elevationInfo:this.observerPlacementElevationInfo,feature:r});this.analysis.viewsheds.add(i),this.stagedViewshed=i,this.creationState=`placing-target`,this._updateStagedViewshed(n),this.callbacks.setSelectedViewshed(null)}_onCancel(e){let t=this._removeStaged();if(this.creationState===`placing-observer`){if(t&&this.placementMode===`multiple`){this.callbacks.setSelectedViewshed(null),this._startObserverPlacement();return}this._destroyDrawTool(e),this._abortCreation();return}if(!t){this._destroyDrawTool(e),this._abortCreation();return}if(this.creationState=`placing-observer`,this.callbacks.setSelectedViewshed(null),this.placementMode===`multiple`){this._startPointPlacement();return}this._destroyDrawTool(e),this._abortCreation()}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e);let t=this.stagedViewshed;return t?.valid?(this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t),!0):!1}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){let t=this._placeOperation;this._placeOperation=null,this.observerPlacementElevationInfo=null,e(t)}_startObserverPlacement(){this.creationState=`placing-observer`,this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);let{drawTool:e,renderer:t}=m({analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,toolOptions:this._toolOptions,elevationInfo:this._observerDrawToolElevationInfo,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e),isPlacingObserver:()=>this.creationState===`placing-observer`});this._drawTool=e,this._renderer=t;try{this.view.addAndActivateTool(e),e.begin([v({mode:this.placementMode,onObserverComplete:(e,t)=>this._onObserverMapPointComplete(e,t),onTargetComplete:e=>this._onTargetMapPointComplete(e),onObserverPreview:e=>this._onObserverMapPointPreview(e),onTargetPreview:e=>this._onTargetMapPointPreview(e)})])}catch(t){this._destroyDrawTool(e),this._rejectPlaceOperation(t instanceof Error?t:Error(String(t)))}}_onComplete(e){this._removeStaged(),this._finishPlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t){let{intersector:n,snappingManager:r,view:i}=this,a=e.clone(),o=this._toScenePoint(e,this._targetScenePoint,this._observerDrawToolElevationInfo),s=h({intersector:n,snappingManager:r,screenPoint:t,view:i});this._renderer?.updatePlacementLocation(o),this._handleObserverPlacementComplete(a,o,s),this._setDrawToolElevationInfo(f)}_onTargetMapPointComplete(e){let t=this._toScenePoint(e,this._targetScenePoint);return this._renderer?.updatePlacementLocation(t),this._handleTargetPlacementComplete(t)?(this.placementMode===`multiple`&&(this.creationState=`placing-observer`,this._setDrawToolElevationInfo(this._observerDrawToolElevationInfo),this._onObserverMapPointPreview(e)),!0):!1}_onObserverMapPointPreview(e){let t=e.clone(),n=this._toScenePoint(t,this._observerScenePoint,this._observerDrawToolElevationInfo);this._renderer?.updatePlacementLocation(n)}_onTargetMapPointPreview(e){let t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._updateStagedViewshed(t)}_setDrawToolElevationInfo(e){let t=this._drawTool;t&&(t.elevationInfo=e)}get _observerDrawToolElevationInfo(){return this.observerPlacementElevationInfo??f}_onManipulatorCountChange(e){e.removeHandles(E);let t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof x&&t.push(e.disableDisplay())}),e.addHandles(t,E)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&g(this.view,e)}_toScenePoint(e,t,n=f){let{x:r,y:i,z:a,spatialReference:o}=e,s=this._mapPointVector;return s[0]=r,s[1]=i,s[2]=a??0,b(s,o,n,this.view,t)}_updateStagedViewshed(e){let t=this.stagedViewshed;if(!t)return;let n=this.callbacks.findViewshedComputedData(t);if(!n)return;let{heading:r,tilt:i,farDistance:a}=y(this.view,n,e);t.farDistance=a,t.tilt=i,t.heading=r}get test(){}};e([c({constructOnly:!0})],D.prototype,`analysis`,void 0),e([c({constructOnly:!0})],D.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],D.prototype,`intersector`,void 0),e([c({constructOnly:!0})],D.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],D.prototype,`view`,void 0),e([c({constructOnly:!0})],D.prototype,`callbacks`,void 0),e([c()],D.prototype,`placementMode`,void 0),e([c()],D.prototype,`observerPlacementElevationInfo`,void 0),e([c()],D.prototype,`stagedViewshed`,void 0),e([c()],D.prototype,`_placeOperation`,void 0),e([c()],D.prototype,`_drawTool`,void 0),e([c()],D.prototype,`_renderer`,void 0),e([c()],D.prototype,`_toolOptions`,void 0),e([c()],D.prototype,`updating`,null),e([c()],D.prototype,`active`,null),e([c()],D.prototype,`creationState`,void 0),e([c()],D.prototype,`_elevationModeContext`,null),D=e([l(`esri.views.3d.analysis.Viewshed.ViewshedPlacementController`)],D);export{D as ViewshedPlacementController};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import n from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as r,throwIfAborted as i,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as o,sync as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getConvertedElevation as d,absoluteHeightElevationInfo as f}from"../../../../support/elevationInfoUtils.js";import p from"../../../../symbols/support/ElevationInfo.js";import{createDrawTool as m,getFeatureReference as h}from"./placementUtils.js";import{detachToolFromView as g}from"./toolLifecycleUtils.js";import _ from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as v}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as y}from"./viewshedToolUtils.js";import{vectorToRender as b}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as x}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as S}from"../../../input/InputManager.js";import{sketchKeys as C}from"../../../interactive/keybindings.js";import{bindViewToolOptions as w}from"../../../interactive/options/bindViewToolOptions.js";import T from"../../../interactive/options/InteractiveToolOptions.js";const E=Symbol(`hiddenManipulatorHandle`);let D=class extends n{constructor(e){super(e),this.placementMode=`multiple`,this.observerPlacementElevationInfo=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null,this._toolOptions=new T,this._observerScenePoint=u(),this._targetScenePoint=u(),this._mapPointVector=u(),this.creationState=null}initialize(){this.addHandles([w(this._toolOptions,()=>this.view.options),o(()=>[this._drawTool?.tooltipManager,this.creationState],([e,t])=>{e&&(e.enabled=t===`placing-observer`)}),o(()=>[this._drawTool?.activeTooltipInfo,this.creationState],([e,t])=>{e&&(e.elevationModeContext=t===`placing-observer`?this._elevationModeContext:null)}),this.view.on(`key-down`,e=>this._handleKeyDown(e),S.DEFAULT),o(()=>{let{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:e!=null&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{e!=null&&!t&&this.analysis.viewsheds.add(e)},s)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}get _elevationModeContext(){let e=this;return{get mode(){return e._observerDrawToolElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(this.creationState!==`placing-observer`||!t||!n||!r||e===this._observerDrawToolElevationInfo.mode)return;let i=this.observerPlacementElevationInfo?.clone()??new p;i.mode=e;let a=r.clone();t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked||(a.z=d(this.view,r,this._observerDrawToolElevationInfo,i)),t.defaultZ=a.z,this.observerPlacementElevationInfo=i,t.elevationInfo=i,n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(r()),i(t);let{resolve:n,reject:o,promise:s}=Promise.withResolvers(),c=a(t,()=>this._cancelPlacementOperation());this._placeOperation=new _({abortHandle:c,reject:o,resolve:n}),this.placementMode=e;let l=t?.elevationInfo;return this.observerPlacementElevationInfo=l?new p({featureExpressionInfo:l.featureExpressionInfo,mode:l.mode,offset:l.offset,unit:l.unit}):null,this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),s}cancelPlaceOperation(){(this.creationState!=null||this._placeOperation!=null)&&(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return this.creationState!=null&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){this.creationState!=null&&(C.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):C.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&this.placementMode===`multiple`){this.callbacks.setSelectedViewshed(null),this._startObserverPlacement();return}this._destroyDrawTool(),this._abortCreation()}_removeStaged(){let{stagedViewshed:e}=this;return this.stagedViewshed=null,e?(this.analysis.viewsheds.remove(e),!0):!1}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e,n,r){let i=new t({observer:e,elevationInfo:this.observerPlacementElevationInfo,feature:r});this.analysis.viewsheds.add(i),this.stagedViewshed=i,this.creationState=`placing-target`,this._updateStagedViewshed(n),this.callbacks.setSelectedViewshed(null)}_onCancel(e){let t=this._removeStaged();if(this.creationState===`placing-observer`){if(t&&this.placementMode===`multiple`){this.callbacks.setSelectedViewshed(null),this._startObserverPlacement();return}this._destroyDrawTool(e),this._abortCreation();return}if(!t){this._destroyDrawTool(e),this._abortCreation();return}if(this.creationState=`placing-observer`,this.callbacks.setSelectedViewshed(null),this.placementMode===`multiple`){this._startPointPlacement();return}this._destroyDrawTool(e),this._abortCreation()}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e);let t=this.stagedViewshed;return t?.valid?(this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t),!0):!1}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){let t=this._placeOperation;this._placeOperation=null,this.observerPlacementElevationInfo=null,e(t)}_startObserverPlacement(){this.creationState=`placing-observer`,this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);let{drawTool:e,renderer:t}=m({analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,toolOptions:this._toolOptions,elevationInfo:this._observerDrawToolElevationInfo,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e),isPlacingObserver:()=>this.creationState===`placing-observer`});this._drawTool=e,this._renderer=t;try{this.view.addAndActivateTool(e),e.begin([v({mode:this.placementMode,onObserverComplete:(e,t)=>this._onObserverMapPointComplete(e,t),onTargetComplete:e=>this._onTargetMapPointComplete(e),onObserverPreview:e=>this._onObserverMapPointPreview(e),onTargetPreview:e=>this._onTargetMapPointPreview(e)})])}catch(t){this._destroyDrawTool(e),this._rejectPlaceOperation(t instanceof Error?t:Error(String(t)))}}_onComplete(e){this._removeStaged(),this._finishPlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t){let{intersector:n,snappingManager:r,view:i}=this,a=e.clone(),o=this._toScenePoint(e,this._targetScenePoint,this._observerDrawToolElevationInfo),s=h({intersector:n,snappingManager:r,screenPoint:t,view:i});this._renderer?.updatePlacementLocation(o),this._handleObserverPlacementComplete(a,o,s),this._setDrawToolElevationInfo(f)}_onTargetMapPointComplete(e){let t=this._toScenePoint(e,this._targetScenePoint);return this._renderer?.updatePlacementLocation(t),this._handleTargetPlacementComplete(t)?(this.placementMode===`multiple`&&(this.creationState=`placing-observer`,this._setDrawToolElevationInfo(this._observerDrawToolElevationInfo),this._onObserverMapPointPreview(e)),!0):!1}_onObserverMapPointPreview(e){let t=e.clone(),n=this._toScenePoint(t,this._observerScenePoint,this._observerDrawToolElevationInfo);this._renderer?.updatePlacementLocation(n)}_onTargetMapPointPreview(e){let t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._updateStagedViewshed(t)}_setDrawToolElevationInfo(e){let t=this._drawTool;t&&(t.elevationInfo=e)}get _observerDrawToolElevationInfo(){return this.observerPlacementElevationInfo??f}_onManipulatorCountChange(e){e.removeHandles(E);let t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof x&&t.push(e.disableDisplay())}),e.addHandles(t,E)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&g(this.view,e)}_toScenePoint(e,t,n=f){let{x:r,y:i,z:a,spatialReference:o}=e,s=this._mapPointVector;return s[0]=r,s[1]=i,s[2]=a??0,b(s,o,n,this.view,t)}_updateStagedViewshed(e){let t=this.stagedViewshed;if(!t)return;let n=this.callbacks.findViewshedComputedData(t);if(!n)return;let{heading:r,tilt:i,farDistance:a}=y(this.view,n,e);t.farDistance=a,t.tilt=i,t.heading=r}get test(){}};e([c({constructOnly:!0})],D.prototype,`analysis`,void 0),e([c({constructOnly:!0})],D.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],D.prototype,`intersector`,void 0),e([c({constructOnly:!0})],D.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],D.prototype,`view`,void 0),e([c({constructOnly:!0})],D.prototype,`callbacks`,void 0),e([c()],D.prototype,`placementMode`,void 0),e([c()],D.prototype,`observerPlacementElevationInfo`,void 0),e([c()],D.prototype,`stagedViewshed`,void 0),e([c()],D.prototype,`_placeOperation`,void 0),e([c()],D.prototype,`_drawTool`,void 0),e([c()],D.prototype,`_renderer`,void 0),e([c()],D.prototype,`_toolOptions`,void 0),e([c()],D.prototype,`updating`,null),e([c()],D.prototype,`active`,null),e([c()],D.prototype,`creationState`,void 0),e([c()],D.prototype,`_elevationModeContext`,null),D=e([l(`esri.views.3d.analysis.Viewshed.ViewshedPlacementController`)],D);export{D as ViewshedPlacementController};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type ElevationInfo from "../../../../symbols/support/ElevationInfo.js";
|
|
2
2
|
import type { AbortOptions } from "../../../../core/promiseUtils.js";
|
|
3
|
+
import type { ElevationInfoProperties } from "../../../../symbols/support/ElevationInfo.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Options for placing a viewshed interactively.
|
|
@@ -9,10 +10,11 @@ import type { AbortOptions } from "../../../../core/promiseUtils.js";
|
|
|
9
10
|
export interface ViewshedPlacementOptions extends AbortOptions {
|
|
10
11
|
/**
|
|
11
12
|
* Specifies how the placed viewshed observer is positioned on the vertical axis (z).
|
|
13
|
+
* Accepts an [ElevationInfo](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/) instance or a plain object with elevation information properties.
|
|
12
14
|
*
|
|
13
15
|
* @since 5.2
|
|
14
16
|
*/
|
|
15
|
-
elevationInfo?: ElevationInfo | null;
|
|
17
|
+
elevationInfo?: ElevationInfo | ElevationInfoProperties | null;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
/**
|
|
@@ -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"../../../Graphic.js";import n from"../../../core/Error.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a,throwIfAbortError as o}from"../../../core/promiseUtils.js";import{syncAndInitial as s,initial as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import d from"../../../core/sql/WhereClause.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Error.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a,throwIfAbortError as o}from"../../../core/promiseUtils.js";import{syncAndInitial as s,initial as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import d from"../../../core/sql/WhereClause.js";import{isInEffectiveScaleRange as f}from"../../../geometry/support/scaleUtils.js";import{fallbackObjectIDAttribute as p}from"../../../layers/LayerConstants.js";import"../../../layers/buildingSublayers/BuildingComponentSublayer.js";import m from"../../../layers/support/FeatureFilter.js";import{fixFields as h,unpackFieldNames as g,populateMissingFields as _}from"../../../layers/support/fieldUtils.js";import v from"../../../rest/support/Query.js";import{isNumber as y}from"../../../support/guards.js";import{BuildingSublayerView3DMixin as b}from"./BuildingSublayerView3D.js";import{I3SMeshView3D as x}from"./I3SMeshView3D.js";import{applyFilterMode as S}from"./i3s/BuildingFilterUtil.js";import{createGetFeatureExtent as C}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as w}from"./i3s/I3SMeshViewFilter.js";import{I3SQueryEngine as T}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as E,I3SQueryFeature as D}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as O}from"./i3s/I3SQueryFeatureStore.js";import{findFieldsCaseInsensitive as k,getIndexCrs as A}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as j}from"./support/DefinitionExpressionSceneLayerView.js";import{TemporalSceneLayerView as M}from"./support/TemporalSceneLayerView.js";import N from"../../layers/BuildingComponentSublayerView.js";import{hasPopupTemplate as P,getRequiredFields as F,getFetchPopupTemplate as I}from"../../layers/support/popupUtils.js";import{TaskPriority as L}from"../../support/Scheduler.js";let R=class extends M(j(x(b(N)))){constructor(e){super(e),this.type=`building-component-sublayer-3d`,this._elevationContext=2,this._supportsLabeling=!1,this.requiredFields=[],this.progressiveLoadFactor=1,this._queryEngine=null,this.layer=e.sublayer}get extractChanges(){return this.layerView.extractChanges}get layerViewUid(){return this.layerView.uid}get layerId(){return this.sublayer.layer.id}get sublayerId(){return this.sublayer.id}get layerPopupEnabledAndHasTemplate(){return this.sublayer.popupEnabled&&P(this.sublayer,this.layerView.view.popup?.defaultPopupTemplateEnabled)}initialize(){this._updatingHandles.add(()=>this.mergedFilter,e=>{if(e==null||!w.checkSupport(e)){this._i3sFilter=i(this._i3sFilter);return}if(this._i3sFilter!=null){this._i3sFilter.viewFilter=e;return}this._i3sFilter=new w({viewFilter:e,layerFieldsIndex:this.sublayer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,t)=>this.addSqlFilter(e,t,this.logError),addTimeFilter:(e,t)=>this.addTimeFilter(e,t)})},s),this._updatingHandles.add(()=>[this.sublayer.renderer,this.definitionExpressionFields,this.filterExpressionFields],()=>this._updateRequiredFields()),this._updatingHandles.add(()=>this.sublayer.renderer,e=>this._rendererChange(e),c);let e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this._i3sFilter?.sortedObjectIds,e),this._updatingHandles.add(()=>this._i3sFilter?.parsedWhereClause,e),this._updatingHandles.add(()=>this.getTimeFilterDependencies(),e),this._updatingHandles.add(()=>this.mergedFilter,e),this._updatingHandles.add(()=>[this._i3sFilter?.parsedGeometry,this.filter?.spatialRelationship],()=>this._geometryFilterChange()),this._updatingHandles.add(()=>this.parsedFilterExpressions,()=>this._updateSymbologyOverride(),c),this.addResolvingPromise(this._updateRequiredFields())}get lodFactor(){return this.view.qualitySettings.sceneService.objectLoDFactor}get parsedFilterExpressions(){return this.sublayer.modelName===`Overview`?[]:this.layerView.filterExpressions.map(([e,t])=>{let n;try{n=d.create(e,{fieldsIndex:this.sublayer.fieldsIndex})}catch(e){return r.getLogger(this).error(`Failed to parse filterExpression: `+e),null}if(!n.isStandardized)return r.getLogger(this).error(`filterExpression is using non standard function`),null;let i=[],a=n.fieldNames;return k(a,this.sublayer.fieldsIndex,{missingFields:i}),i.length>0?(r.getLogger(this).error(`filterExpression references unknown fields: ${i.join(`, `)}`),null):[n,t]}).filter(e=>e!=null)}get filter(){return this._get(`filter`)}set filter(e){this._set(`filter`,w.checkSupport(e)?e:null)}isUpdating(){return super.isUpdating()||(this._i3sFilter?.updating??!1)}_updateSymbologyOverride(){let e=this.parsedFilterExpressions;e.length>0?this._setSymbologyOverride((t,n)=>{for(let[r,i]of e)try{if(r.testFeature(t))return S(n,i)}catch(e){this.logError(e)}return S(n,null)},this.filterExpressionFields):this._setSymbologyOverride(null,null)}get filterExpressionFields(){return h(this.sublayer.fieldsIndex,this.parsedFilterExpressions.reduce((e,[t])=>e.concat(t.fieldNames),[]))}get availableFields(){let e=this.sublayer,t=e.fieldsIndex,n=this.requiredFields;if(e.outFields||e.layer.outFields){let r=[...e.outFields||[],...e.layer.outFields||[]];n=[...g(t,r),...n]}return n=[...n,e.objectIdField??p],h(t,n)}get _graphicOrigin(){return this.sublayer.graphicOrigin}_createLayerGraphic(e){return new t({attributes:e,layer:this.sublayer.layer,sourceLayer:this.sublayer,origin:this._graphicOrigin})}canResume(){return super.canResume()&&f(this.sublayer.effectiveScaleRange,this.view.scale)&&(!this._controller||this._controller.rootNodeVisible)}async patchFeaturesForPopup(e,t){let n=this._validateFetchPopupFeatures(t);if(n)throw n;if(e.length===0)return[];let i=[],s=[],c=this.sublayer.associatedLayer==null?this.sublayer:await this.sublayer.associatedLayer.load(t),l=g(this.sublayer.fieldsIndex,await F(c,I(this.sublayer,t)));a(t);let u=new Set;for(let t of e)_(t,l,u)?s.push(t):i.push(t);return s.length===0?i:(this.sublayer.associatedLayer!=null&&await this.sublayer.associatedLayer.load().catch(()=>r.getLogger(this).warn(`Failed to load associated feature layer. Displaying popup attributes from cached attributes.`)),this.whenGraphicAttributes(s,Array.from(u)).catch(e=>(o(e),s)).then(e=>i.concat(e)))}async _updateRequiredFields(){let e=h(this.sublayer.fieldsIndex,[...this.sublayer.renderer?await this.sublayer.renderer.getRequiredFields(this.sublayer.fieldsIndex):[],...this.definitionExpressionFields,...this.filterExpressionFields]);this._set(`requiredFields`,e)}_validateFetchPopupFeatures(e){let{sublayer:t}=this,{popupEnabled:r}=t;if(!r)return new n(`buildingscenelayerview3d:fetchPopupFeatures`,`Popups are disabled`,{sublayer:t});if(!I(t,e))return new n(`buildingscenelayerview3d:fetchPopupFeatures`,`Layer does not define a popup template`,{sublayer:t})}getFilters(){let e=super.getFilters();return this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),this._i3sFilter?.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}createQuery(){let e={outFields:[`*`],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return this.filter==null?new v(e):this.filter.createQuery(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t?.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t?.signal).then(e=>{if(!e?.features)return e;let t=this.sublayer,n=t.layer,r=this._graphicOrigin;for(let i of e.features)i.layer=n,i.sourceLayer=t,i.origin=r;return e})}async queryObjectIds(e,t){return(await this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t?.signal)).filter(y)}_ensureQueryEngine(){return this._queryEngine??=this._createQueryEngine(),this._queryEngine}_createQueryEngine(){let e=C(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new T({layerView:this,priority:L.FEATURE_QUERY_ENGINE,spatialIndex:new O({featureAdapter:new E({objectIdField:this.sublayer.objectIdField,attributeStorageInfo:this.sublayer.attributeStorageInfo,getFeatureExtent:e}),forAllFeatures:(e,t)=>this._forAllFeatures((t,n,r)=>e(new D(t,n,r)),t,2),getFeatureExtent:e,sourceSpatialReference:A(this.sublayer),viewSpatialReference:this.view.spatialReference})})}_ensureQuery(e){return this._addDefinitionExpressionToQuery(e==null?this.createQuery():v.from(e))}};e([l()],R.prototype,`layerView`,void 0),e([l()],R.prototype,`extractChanges`,null),e([l()],R.prototype,`lodFactor`,null),e([l({readOnly:!0})],R.prototype,`parsedFilterExpressions`,null),e([l({type:m})],R.prototype,`filter`,null),e([l()],R.prototype,`_i3sFilter`,void 0),e([l({type:[String],readOnly:!0})],R.prototype,`filterExpressionFields`,null),e([l({type:[String],readOnly:!0})],R.prototype,`requiredFields`,void 0),e([l({type:[String],readOnly:!0})],R.prototype,`availableFields`,null),e([l()],R.prototype,`_graphicOrigin`,null),R=e([u(`esri.views.3d.layers.BuildingComponentSublayerView3D`)],R);const z=R;export{z 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"../../../core/Accessor.js";import n from"../../../core/Collection.js";import r from"../../../core/Error.js";import{handlesGroup as i}from"../../../core/handleUtils.js";import a from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{abortMaybe as s}from"../../../core/maybe.js";import{isAbortError as c,allSettledValues as l,throwIfAborted as u}from"../../../core/promiseUtils.js";import{watch as d,syncAndInitial as f}from"../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{runUntracked as h}from"../../../core/accessorSupport/tracking.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import n from"../../../core/Collection.js";import r from"../../../core/Error.js";import{handlesGroup as i}from"../../../core/handleUtils.js";import a from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{abortMaybe as s}from"../../../core/maybe.js";import{isAbortError as c,allSettledValues as l,throwIfAborted as u}from"../../../core/promiseUtils.js";import{watch as d,syncAndInitial as f}from"../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{runUntracked as h}from"../../../core/accessorSupport/tracking.js";import{isInEffectiveScaleRange as g}from"../../../geometry/support/scaleUtils.js";import{isBuildingGraphicOrigin as _}from"../../../graphic/isBuildingGraphicOrigin.js";import"../../../layers/buildingSublayers/BuildingGroupSublayer.js";import{I3SExtractChanges as v}from"../../../layers/support/I3SExtractChanges.js";import{isGraphic as y}from"../../../support/graphicInstanceUtils.js";import b from"./BuildingComponentSublayerView3D.js";import{BuildingSublayerView3DMixin as x}from"./BuildingSublayerView3D.js";import{LayerView3D as S}from"./LayerView3D.js";import{parseFilterMode as C}from"./i3s/BuildingFilterUtil.js";import{checkSpatialReference as w}from"./i3s/I3SUtil.js";import{normalizeHighlightTarget as T,emptyHighlightHandle as E}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as D}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as O}from"../support/updatingProperties.js";import k from"../../layers/BuildingSceneLayerView.js";const A=x(t);let j=class extends S(k){constructor(e){super(e),this.type=`building-scene-3d`,this.sublayerViews=new n,this._rejectedSublayerViews=new Map,this._abortController=new AbortController,this._loadingComponents=0,this._pendingWhenSublayerViews=new Map,this.ignoresMemoryFactor=!1}get extractChanges(){return this._extractChanges}get filterExpression(){let e=this.layer.activeFilterId,t=e==null?null:this.layer.filters.find(t=>t.id===e),n=t==null?null:t.filterBlocks?.find(e=>e.filterMode.type===`solid`);return n?n.filterExpression:null}get filterExpressions(){let e=this.layer.activeFilterId,t=e==null?null:this.layer.filters.find(t=>t.id===e);return t?.filterBlocks?t.filterBlocks.toArray().map(e=>[e.filterExpression??``,C(e)]):[]}get updatingProgressValue(){return h(()=>{let e=this.sublayerViews,t=this._loadingComponents+(e?e.length:0);return e.reduce((e,t)=>e+t.updatingProgress,0)/t})}get visibleAtCurrentScale(){return g(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){return this._loadingComponents>0||this.sublayerViews&&this.sublayerViews.some(e=>e.updating)}initialize(){w(this.layer.spatialReference,this.view.spatialReference,this.view.viewingMode),this._extractChanges=new v({layer:this.layer,batchingEnabled:!0}),this._initializeSublayerViews(this.layer.sublayers,this)}destroy(){this.sublayerViews&&=(this.sublayerViews.forEach(e=>e.destroy()),null),this._extractChanges.destroy(),this._rejectedSublayerViews=null,this._abortController=s(this._abortController)}_initializeSublayerViews(e,t){let n=this,i=this.view;e.forEach(e=>{if(!e.isEmpty){if(e.type===`building-group`){let n=new A({sublayer:e,view:i,parent:t});this._initializeSublayerViews(e.sublayers,n)}else e.geometryType===`mesh`?(this._loadingComponents++,e.load({signal:this._abortController.signal}).then(()=>{let r=new b({sublayer:e,layerView:n,view:i,parent:t});this.sublayerViews.push(r);let a=this._pendingWhenSublayerViews.get(e);if(a){for(let e of a)e.resolve(r);this._pendingWhenSublayerViews.delete(e)}this.addHandles([d(()=>r.updating,()=>this.notifyChange(`updating`),f),d(()=>r.updatingProgress,()=>this.notifyChange(`updatingProgressValue`),f)])}).catch(t=>{c(t)||a.getLogger(this).error(`Error while creating view for sublayer ${e.id}\nLayer: ${this.layer.url}\n`,t),this._rejectWhenSublayerView(e,t)}).then(()=>{this._loadingComponents--,this.notifyChange(`updating`),this.notifyChange(`updatingProgressValue`)})):this._rejectWhenSublayerView(e,new r(`view:no-layerview-for-sublayer`,`No layerview created for sublayer ${e.id}`))}})}getGraphicFromIntersectorTarget(e,t){for(let n of this.sublayerViews.items)if(n.sublayer.id===e.sublayerId)return n.getGraphicFromIntersectorTarget(e,t);return null}async patchFeaturesForPopup(e,t){if(e.length===0)return[];let n=M(e,e=>_(e.origin)?e.origin.sublayer:e.sourceLayer),r=[];for(let[e,i]of n){let n=this._findComponent(e);n!=null&&r.push(n.patchFeaturesForPopup(i,t))}let i=await l(r);return u(t),i.flat()}whenGraphicBounds(e){let t=this._findComponent(_(e.origin)?e.origin.sublayer:e.sourceLayer);return t==null?Promise.reject():t.whenGraphicBounds(e)}getAABBFromIntersectorTarget(e){for(let t of this.sublayerViews.items)if(t.sublayer.id===e.sublayerId)return t.getAABBFromIntersectorTarget(e);return null}async whenSublayerView(e){let t=this._findComponent(e);if(t!=null)return t;let n=this._rejectedSublayerViews.get(e);if(n!=null)throw n;let r=this._pendingWhenSublayerViews.get(e),i=Promise.withResolvers();return r?r.push(i):this._pendingWhenSublayerViews.set(e,[i]),i.promise}_rejectWhenSublayerView(e,t){if(this.destroyed)return;this._rejectedSublayerViews.set(e,t);let n=this._pendingWhenSublayerViews.get(e);if(n){for(let e of n)e.reject(t);this._pendingWhenSublayerViews.delete(e)}}_findComponent(e){return this.sublayerViews.find(t=>e===t.sublayer)}highlight(e,t){let n=T(e);if(n.length===0)return E;if(y(n[0])){let e=n,r=new Map;for(let t of e)o(r,_(t.origin)?t.origin.sublayer:t.sourceLayer,()=>[]).push(t);let a=[];return this.sublayerViews.forEach(e=>{let n=r.get(e.sublayer);n&&a.push(e.highlight(n,t))}),i(a)}return E}get usedMemory(){return this.sublayerViews.reduce((e,t)=>e+t.usedMemory,0)}get unloadedMemory(){return this.sublayerViews.reduce((e,t)=>e+t.unloadedMemory,0)}get performanceInfo(){return new D(this.usedMemory)}};e([p()],j.prototype,`sublayerViews`,void 0),e([p()],j.prototype,`_rejectedSublayerViews`,void 0),e([p({readOnly:!0})],j.prototype,`filterExpression`,null),e([p({readOnly:!0})],j.prototype,`filterExpressions`,null),e([p(O)],j.prototype,`updatingProgress`,void 0),e([p({readOnly:!0})],j.prototype,`updatingProgressValue`,null),e([p({readOnly:!0})],j.prototype,`visibleAtCurrentScale`,null),j=e([m(`esri.views.3d.layers.BuildingSceneLayerView3D`)],j);function M(e,t){let n=new Map,r=e.length;for(let i=0;i<r;i++){let r=e[i],a=t(r,i,e),o=n.get(a);o?o.push(r):n.set(a,[r])}return n}const N=j;export{N 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"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{debounce as r,isAbortError as i}from"../../../core/promiseUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{projectAsync as s}from"../../../geometry/projectionUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{debounce as r,isAbortError as i}from"../../../core/promiseUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{projectAsync as s}from"../../../geometry/projectionUtils.js";import{isInEffectiveScaleRange as c}from"../../../geometry/support/scaleUtils.js";import{LayerView3D as l}from"./LayerView3D.js";import{LayerViewPerformanceInfo as u}from"./support/LayerViewPerformanceInfo.js";import d from"../../layers/LayerView.js";import{RefreshableLayerView as f}from"../../layers/RefreshableLayerView.js";const p=l=>{let d=l,f=class extends d{constructor(){super(...arguments),this.fullExtentInLocalViewSpatialReference=null,this.refreshDebounced=r(async e=>{this.destroyed||await this._doRefresh(e).catch(e=>{i(e)||t.getLogger(this).error(e)})},2e3),this.ignoresMemoryFactor=!1,this.unloadedMemory=0}get visibleAtCurrentScale(){let e=this.layer,t=`effectiveScaleRange`in e?e.effectiveScaleRange:null;return c(t,this.view.scale)}isUpdating(){return super.isUpdating()||this.subView?.updating}initialize(){this._initSubView(),this.view.viewingMode===`local`&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await s(this.layer.fullExtent,this.view.spatialReference).catch(()=>null))()),this._updatingHandles.add(()=>this.suspended,()=>this._suspendedChangeHandler())}destroy(){this.subView=n(this.subView)}async doRefresh(){return this._doRefresh()}async _doRefresh(e){this.suspended||await this.subView.doRefresh(e)}getFetchOptions(){}_suspendedChangeHandler(){this.suspended?this.subView.clear():this.refreshDebounced()}get test(){}get usedMemory(){return this.subView.usedMemory}get performanceInfo(){return new u(this.usedMemory)}};return e([a()],f.prototype,`suspended`,void 0),e([a()],f.prototype,`fullExtentInLocalViewSpatialReference`,void 0),e([a({readOnly:!0})],f.prototype,`visibleAtCurrentScale`,null),e([a()],f.prototype,`updating`,void 0),e([a()],f.prototype,`subView`,void 0),f=e([o(`esri.views.3d.layers.DynamicLayerView3D`)],f),f};class m extends p(f(l(d))){}export{m as DynamicLayerView3D,p as DynamicLayerView3DMixin};
|
|
@@ -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{makeHandle as n}from"../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../core/maybe.js";import i from"../../../core/ReactiveMap.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{projectAsync as s}from"../../../geometry/projectionUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../core/maybe.js";import i from"../../../core/ReactiveMap.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{projectAsync as s}from"../../../geometry/projectionUtils.js";import{isInEffectiveScaleRange as c}from"../../../geometry/support/scaleUtils.js";import{hydrateGraphic as l}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as u,hasTimeOptions as d}from"../../../layers/support/timeSupport.js";import f from"../../../rest/support/AttributeBinsQuery.js";import p from"../../../rest/support/Query.js";import{isGraphic as m}from"../../../support/graphicInstanceUtils.js";import{LayerView3D as h}from"./LayerView3D.js";import{attributeLookup as g}from"./support/attributeUtils.js";import{normalizeHighlightTarget as _,emptyHighlightHandle as v,isObjectId as y}from"./support/highlightUtils.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";import{getHighlightName as x}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as S}from"../../support/layerViewUtils.js";const C=C=>{let w=b(h(C)),T=class extends w{constructor(){super(...arguments),this.updatePolicy=1,this.slicePlaneEnabled=!1,this._highlightCounter=new i,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){let e=this.layer;if(`isTable`in e&&e.isTable){this.addResolvingPromise(Promise.reject(new t(`featurelayerview:table-not-supported`,`table feature layer can't be displayed`,{layer:e})));return}this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference=this.view.viewingMode===`local`?await s(this.layer.fullExtent,this.view.spatialReference).catch(()=>null):null,await this._updatingRequiredPromise;let e=await this.createGraphicsPipeline();if(this.destroyed){e.destroy();return}this.graphicsPipeline=e,await e.when()})()),this.notifyChange(`updating`)}destroy(){this.graphicsPipeline=r(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return S()?c(this.layer.effectiveScaleRange,this.view.scale):!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return u(d(this.layer)?this.layer:null,this.view?.timeExtent,this._get(`timeExtent`))}get highlightIds(){return Array.from(this._highlightCounter.keys())}get hasHighlight(){return this.highlightIds.length>0}getHit(e,t){let n=this.graphicsPipeline.findGraphic(t=>t.uid===e);if(n==null)return null;let r=l(n,this.layer,this.layer.graphicOrigin);return{type:`graphic`,graphic:r,layer:r.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryAggregates(e,t){throw Error(`missing implementation`)}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryAttributeBins(e,t){return this.graphicsPipeline.graphicsQuery.executeAttributeBinsQuery(this._ensureAttributeBinsQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return e==null?this.createQuery():p.from(e)}_ensureAttributeBinsQuery(e){let t=f.from(e);return t.outSpatialReference||=this.view.spatialReference,t}_addHighlightIds(e){this._highlightCounter.batch(()=>{for(let t of e){let e=this._highlightCounter.get(t)??0;this._highlightCounter.set(t,e+1)}})}_removeHighlightIds(e){this._highlightCounter.batch(()=>{for(let t of e){let e=this._highlightCounter.get(t);e!=null&&(e--,e>0?this._highlightCounter.set(t,e):this._highlightCounter.delete(t))}})}highlight(e,t){let r=x(t),i=this.layer.objectIdField,a=_(e);if(a.length===0)return v;if(m(a[0])){let e=a;if(g(this.layer.fieldsIndex,e[0].attributes,i)!=null){let t=e.map(e=>g(this.layer.fieldsIndex,e.attributes,i)),a=this.graphicsPipeline.highlightByObjectIds(t,r);return this._addHighlightIds(t),n(()=>{this._removeHighlightIds(t),a.remove()})}return this.graphicsPipeline.highlightByGraphics(e,r)}if(y(a[0])){let e=a;this._addHighlightIds(e);let t=this.graphicsPipeline.highlightByObjectIds(e,r);return n(()=>{t.remove(),this._removeHighlightIds(e)})}return v}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!this.graphicsPipeline||this.graphicsPipeline.destroyed?!1:!(!this.graphicsPipeline?.updating&&this.view?.groundView?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case`multipatch`:case`multipoint`:throw new t(`featurelayerview3d:unsupported-geometry-type`,"Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}};return e([a()],T.prototype,`graphicsPipeline`,void 0),e([a({readOnly:!0})],T.prototype,`dataUpdating`,null),e([a()],T.prototype,`suspended`,void 0),e([a({readOnly:!0})],T.prototype,`legendEnabled`,null),e([a({readOnly:!0})],T.prototype,`visibleAtCurrentScale`,null),e([a()],T.prototype,`updating`,void 0),e([a({readOnly:!0})],T.prototype,`updatePolicy`,void 0),e([a({type:Boolean})],T.prototype,`slicePlaneEnabled`,void 0),e([a({readOnly:!0})],T.prototype,`suspendInfo`,void 0),e([a()],T.prototype,`symbologySnappingSupported`,null),e([a({readOnly:!0})],T.prototype,`hasAllFeatures`,null),e([a({readOnly:!0})],T.prototype,`hasAllFeaturesInView`,null),e([a({readOnly:!0})],T.prototype,`hasFullGeometries`,null),e([a({readOnly:!0})],T.prototype,`timeExtent`,null),e([a()],T.prototype,`highlightIds`,null),e([a()],T.prototype,`hasHighlight`,null),T=e([o(`esri.views.3d.layers.FeatureLikeLayerViewBase3D`)],T),T};export{C as FeatureLikeLayerViewBase3D};
|