@arcgis/core 5.1.0-next.113 → 5.1.0-next.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Graphic.d.ts +1 -0
- package/Map.js +1 -1
- package/analysis/ShadowCast/MinDurationOptions.d.ts +3 -5
- package/analysis/ShadowCastAnalysis.d.ts +1 -1
- package/arcgisGlobal.d.ts +4 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{31a8bc25aa1441c70caa.js → 009250a7bded12099dd1.js} +1 -1
- package/assets/esri/core/workers/chunks/05c47ca3a266a271974b.js +1 -0
- package/assets/esri/core/workers/chunks/{29bbc0d6d847b065d10e.js → 062aadf426fe97a76bbb.js} +1 -1
- package/assets/esri/core/workers/chunks/0954e82f739d25001bcb.js +1 -0
- package/assets/esri/core/workers/chunks/0a530fbbb4486c670ea2.js +1 -0
- package/assets/esri/core/workers/chunks/0aaee272520c6e5bb617.js +1 -0
- package/assets/esri/core/workers/chunks/{12053c1213465d07d2f6.js → 0b445c1cf281f158c1f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{14b7b55c42af65ffa024.js → 0bd2b035c6ee89c725f9.js} +1 -1
- package/assets/esri/core/workers/chunks/0ded5c114cbb7574f2f4.js +1 -0
- package/assets/esri/core/workers/chunks/102ff3710db4ba5f083d.js +1 -0
- package/assets/esri/core/workers/chunks/{7dafe608c224b9d48ffa.js → 115664cb7d7b22a315bb.js} +1 -1
- package/assets/esri/core/workers/chunks/123a67e84ed68b96ac59.js +1 -0
- package/assets/esri/core/workers/chunks/163ce1be8bfe20e77f97.js +1 -0
- package/assets/esri/core/workers/chunks/16713986893adfbc9331.js +1 -0
- package/assets/esri/core/workers/chunks/{054ae729e7cefa2c7778.js → 170f8dc97614e9609443.js} +1 -1
- package/assets/esri/core/workers/chunks/{9bd713d96502ddc2ce25.js → 1765042635084f75d2b3.js} +1 -1
- package/assets/esri/core/workers/chunks/185c670eb99474906836.js +1 -0
- package/assets/esri/core/workers/chunks/18ebf1d3ed05c8057f7d.js +1 -0
- package/assets/esri/core/workers/chunks/{4a65bc9091d7ea7e80df.js → 19f07c8d0f32ec889861.js} +1 -1
- package/assets/esri/core/workers/chunks/1da2c34743897d1b6a24.js +1 -0
- package/assets/esri/core/workers/chunks/{ca92176d5348e2c533d7.js → 224a9f39876aa426a9bc.js} +1 -1
- package/assets/esri/core/workers/chunks/22d4521637806a8b828f.js +1 -0
- package/assets/esri/core/workers/chunks/233ff588798c8a5eedf4.js +1 -0
- package/assets/esri/core/workers/chunks/24d9e4f1c7b8ff0d2cce.js +1 -0
- package/assets/esri/core/workers/chunks/2562d8905bd05ef6fd07.js +1 -0
- package/assets/esri/core/workers/chunks/{8aac1155b8ac071cd2ad.js → 2855357a2c1f2ab03fb7.js} +1 -1
- package/assets/esri/core/workers/chunks/{e5d969214d9eda5c0b4c.js → 2a5dbed88bbd96cfac9f.js} +1 -1
- package/assets/esri/core/workers/chunks/{33329f5d88e60b4ec568.js → 2a8f198f6c272f92bad5.js} +1 -1
- package/assets/esri/core/workers/chunks/{cb3004998eff7c60930e.js → 2b2a09ce14d00b4b1187.js} +1 -1
- package/assets/esri/core/workers/chunks/2bcd4d395bfe6a19ccc8.js +1 -0
- package/assets/esri/core/workers/chunks/{bd17ac2e6f1eb8cf7abf.js → 2fa080539d039c92ce08.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee635172be7fdea69367.js → 3109b05fe4fc40d4f25b.js} +1 -1
- package/assets/esri/core/workers/chunks/{92db9a6d273ae2862883.js → 315bf08dff4757ffbed3.js} +1 -1
- package/assets/esri/core/workers/chunks/3192586ec7fc73ed1165.js +1 -0
- package/assets/esri/core/workers/chunks/{593772bd8b19ac664b29.js → 35527a01d61cabbfd33e.js} +1 -1
- package/assets/esri/core/workers/chunks/38ca59db0e8f45bd7811.js +1 -0
- package/assets/esri/core/workers/chunks/3b10a962e4ff2f3da5bc.js +1 -0
- package/assets/esri/core/workers/chunks/3e9709e61015993b1c7d.js +1 -0
- package/assets/esri/core/workers/chunks/41074d383af3662673ca.js +1 -0
- package/assets/esri/core/workers/chunks/425c04b26a6ec6d04b08.js +1 -0
- package/assets/esri/core/workers/chunks/4364a3e706294bb6ae41.js +1 -0
- package/assets/esri/core/workers/chunks/44e52fe98ffafe6a2807.js +1 -0
- package/assets/esri/core/workers/chunks/49675e77a351abda2728.js +1 -0
- package/assets/esri/core/workers/chunks/4cecc582513b8a83f194.js +1 -0
- package/assets/esri/core/workers/chunks/5022413f5a41b5d435ea.js +1 -0
- package/assets/esri/core/workers/chunks/{8ade869fa9bae446266a.js → 51816d79c6be15e4bfcf.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf9b0ba30a75c030ca92.js → 5524a71d1abc9568ce26.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba31616de9d73d83d867.js → 557e39e5156b313597f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{5ef37f37e405b3bb5450.js → 59dafa1e1340ea4043e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{77ac243d4dcd901c2eec.js → 621d71d26bd20e296138.js} +1 -1
- package/assets/esri/core/workers/chunks/624b1bb269744142b835.js +1 -0
- package/assets/esri/core/workers/chunks/{52a91c314afec70199bc.js → 62b5972d0ef9bf173308.js} +1 -1
- package/assets/esri/core/workers/chunks/641b8622fbb93c84671d.js +1 -0
- package/assets/esri/core/workers/chunks/643c7506f8fe8e06acd2.js +1 -0
- package/assets/esri/core/workers/chunks/65f02eca694cc1c9f5a7.js +1 -0
- package/assets/esri/core/workers/chunks/{7e203e947846d40f897e.js → 67dffb896b6ef4b2038b.js} +1 -1
- package/assets/esri/core/workers/chunks/696967c8c6f53b94f851.js +1 -0
- package/assets/esri/core/workers/chunks/6d696beddcc5fbed5875.js +1 -0
- package/assets/esri/core/workers/chunks/7014e73dfd3c8baa704c.js +1 -0
- package/assets/esri/core/workers/chunks/728ad5bbbcbf88d6249f.js +1 -0
- package/assets/esri/core/workers/chunks/76a9b64fd573775bf6cd.js +1 -0
- package/assets/esri/core/workers/chunks/{0d2bc1be5802681666a4.js → 77859a61d059738d057f.js} +1 -1
- package/assets/esri/core/workers/chunks/{03a4543b94f9adeb1852.js → 7a3b05e25de2ff150f38.js} +1 -1
- package/assets/esri/core/workers/chunks/7bbffe07e62897928773.js +1 -0
- package/assets/esri/core/workers/chunks/7c292f7b181f3b93352b.js +1 -0
- package/assets/esri/core/workers/chunks/7c2d7df4ef4d775cd648.js +1 -0
- package/assets/esri/core/workers/chunks/{6d20d741b8ae1a45b422.js → 7dc2c21d61ba66a3f461.js} +1 -1
- package/assets/esri/core/workers/chunks/7df05c3c82cd27b77300.js +1 -0
- package/assets/esri/core/workers/chunks/{6c79e8e840c1d027fbb2.js → 7e0daf0864005cdd63c5.js} +1 -1
- package/assets/esri/core/workers/chunks/7eb94fc75926bc739233.js +1 -0
- package/assets/esri/core/workers/chunks/8461f50e9875db4ccfec.js +1 -0
- package/assets/esri/core/workers/chunks/{71e12db99589c98a4357.js → 8477b5fdd99c6ac5c27b.js} +1 -1
- package/assets/esri/core/workers/chunks/{be1e4c3ec53fc92a26f1.js → 8598997340682113a2a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{2dc2487d05381de07e3f.js → 86229634bf008f53dad4.js} +1 -1
- package/assets/esri/core/workers/chunks/86443e47ad99e555753a.js +1 -0
- package/assets/esri/core/workers/chunks/8795c4895df229cb471c.js +1 -0
- package/assets/esri/core/workers/chunks/87a40e7f79f97ca637a9.js +1 -0
- package/assets/esri/core/workers/chunks/{7bc746ea17f4e336e0b0.js → 8b5ee6be52e892fbd325.js} +1 -1
- package/assets/esri/core/workers/chunks/{27d6ad4ca5ab8c9d62cd.js → 8c443c52c846a096a250.js} +1 -1
- package/assets/esri/core/workers/chunks/{86161025b53b916328ff.js → 8ca88cfc0b9f84dc5832.js} +1 -1
- package/assets/esri/core/workers/chunks/{340f2c996f62f7f5ceae.js → 8e7ce4835b3106349684.js} +1 -1
- package/assets/esri/core/workers/chunks/90b0fe5584fb6fc99766.js +1 -0
- package/assets/esri/core/workers/chunks/9133c1b7cc1c9da27deb.js +1 -0
- package/assets/esri/core/workers/chunks/{d4749eb8a47869477037.js → 9250615c78f8570a9cda.js} +1 -1
- package/assets/esri/core/workers/chunks/927c8ca7fd385b28a1b7.js +640 -0
- package/assets/esri/core/workers/chunks/92a7735973b2f82a66ce.js +1 -0
- package/assets/esri/core/workers/chunks/942e527b9b92999886c7.js +1 -0
- package/assets/esri/core/workers/chunks/94a5a834e32fc6cc6ed4.js +1 -0
- package/assets/esri/core/workers/chunks/986d8c3907aeeb18c4f6.js +1 -0
- package/assets/esri/core/workers/chunks/98e489c2b85feded7776.js +1 -0
- package/assets/esri/core/workers/chunks/{eb1d6614eeac6d26bb9c.js → 9a3344f1dd22c425b8cc.js} +1 -1
- package/assets/esri/core/workers/chunks/9a6e62ef984e9c5babc4.js +1 -0
- package/assets/esri/core/workers/chunks/{271e42b7cd3c3441839e.js → 9eab1e1535494ff2050d.js} +10 -22
- package/assets/esri/core/workers/chunks/{466c250537415f12eb59.js → a01f0ffbe555f690bdca.js} +1 -1
- package/assets/esri/core/workers/chunks/a03c4c0bf138734a002e.js +1 -0
- package/assets/esri/core/workers/chunks/a0b6eef4890cc61609dc.js +1 -0
- package/assets/esri/core/workers/chunks/{f37be7e517f0892014e3.js → a320c69bc7528ff0d0cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{660713adb5a845dfa2ef.js → a40003dfe3c081d1a1d2.js} +1 -1
- package/assets/esri/core/workers/chunks/a814069325125466506b.js +1 -0
- package/assets/esri/core/workers/chunks/{e4b2120d7ee1c998b1fc.js → aa03f770178693167aa0.js} +1 -1
- package/assets/esri/core/workers/chunks/aea439d4c2308f88b295.js +1 -0
- package/assets/esri/core/workers/chunks/{7995e6983456c779adf9.js → b002304a45856b024b46.js} +1 -1
- package/assets/esri/core/workers/chunks/b0c242c4f5412e4cce73.js +1 -0
- package/assets/esri/core/workers/chunks/b44f1d08784f2e50c853.js +1 -0
- package/assets/esri/core/workers/chunks/b5937ce657c1fff3864f.js +1 -0
- package/assets/esri/core/workers/chunks/b7a0a5b895ddd2d3d038.js +1 -0
- package/assets/esri/core/workers/chunks/{f3161c47a572194f6017.js → c06ae3a6ecc4a4fc67b2.js} +1 -1
- package/assets/esri/core/workers/chunks/c1b6de0d728d25d7905a.js +1 -0
- package/assets/esri/core/workers/chunks/{970e91de5dfbbc247afb.js → c5b7ff8650235c464dbf.js} +1 -1
- package/assets/esri/core/workers/chunks/c8dedc010fcc2382af24.js +1 -0
- package/assets/esri/core/workers/chunks/{f8b884b529064df4a30a.js → caf80facb0322be054ab.js} +1 -1
- package/assets/esri/core/workers/chunks/{5a6523c903b11dea77d4.js → cdef9c3f80588ae45a04.js} +1 -1
- package/assets/esri/core/workers/chunks/{25d795a1697803d77e56.js → ce0e627a5e1cb78adce8.js} +1 -1
- package/assets/esri/core/workers/chunks/{e973cab79ec2541cb81b.js → d19600336cb6023d3e34.js} +1 -1
- package/assets/esri/core/workers/chunks/{10491b5b106bc5ad0b2b.js → d66f68a811c90739951a.js} +1 -1
- package/assets/esri/core/workers/chunks/{63378b0b4265a547656b.js → d8ec0afb2b91ccf32e55.js} +1 -1
- package/assets/esri/core/workers/chunks/d97c0c18202b8c578f8c.js +1 -0
- package/assets/esri/core/workers/chunks/da3c54e27a808f4fcc18.js +1 -0
- package/assets/esri/core/workers/chunks/db012650fb34c10cecd0.js +1 -0
- package/assets/esri/core/workers/chunks/dc6d50e1097a920ff820.js +1 -0
- package/assets/esri/core/workers/chunks/dce37324a2382d2eef0d.js +1 -0
- package/assets/esri/core/workers/chunks/e0bd550b10dd402c48f1.js +1 -0
- package/assets/esri/core/workers/chunks/{63513e706fe55a1def15.js → e227ae2c1a63e30e62d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4c350dc65aae121171d.js → e29d182460564c2a52ad.js} +1 -1
- package/assets/esri/core/workers/chunks/e2ba57f7119b7182ba02.js +279 -0
- package/assets/esri/core/workers/chunks/e755477dc78e9d6038d4.js +1 -0
- package/assets/esri/core/workers/chunks/ea4057090cf15d602585.js +1 -0
- package/assets/esri/core/workers/chunks/ea8f642b1db933d2c26f.js +1 -0
- package/assets/esri/core/workers/chunks/eabd4a78221b7e733793.js +1 -0
- package/assets/esri/core/workers/chunks/eb16976b4eb7f1300f4a.js +1 -0
- package/assets/esri/core/workers/chunks/efae58f746b108163a50.js +1 -0
- package/assets/esri/core/workers/chunks/f0b5c140a5ba174572b6.js +1 -0
- package/assets/esri/core/workers/chunks/f231548c8ac7ecb59927.js +1 -0
- package/assets/esri/core/workers/chunks/{ce3b5b83237cf37ff523.js → f286680e363eefdf27df.js} +1 -1
- package/assets/esri/core/workers/chunks/f7698c855800e0af3038.js +1 -0
- package/assets/esri/core/workers/chunks/f931d560f3f14598f454.js +1 -0
- package/assets/esri/core/workers/chunks/fe2325efd0d8ad8369ed.js +1 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +26 -3
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -13
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/chunks/GlobalIllumination.glsl.js +22 -34
- package/chunks/Path.glsl.js +22 -17
- package/config.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/editing/templates/TemplateListing.d.ts +32 -0
- package/editing/templates/TemplateListing.js +2 -0
- package/geometry/support/DoubleArray.js +1 -1
- package/geometry/support/Indices.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/interfaces.d.ts +14 -0
- package/kernel.js +1 -1
- package/layers/AnnotationLayer.d.ts +42 -0
- package/layers/AnnotationLayer.js +2 -0
- package/layers/DimensionFeatureLayer.d.ts +36 -1
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/DimensionLayer.d.ts +22 -0
- package/layers/FeatureLayer.d.ts +15 -12
- package/layers/FeatureLayer.js +1 -1
- package/layers/GaussianSplatLayer.d.ts +22 -0
- package/layers/LineOfSightLayer.d.ts +22 -0
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/PointCloudLayer.d.ts +22 -0
- package/layers/ViewshedLayer.d.ts +22 -0
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/support/Field.d.ts +1 -0
- package/layers/support/Field.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/layers/support/types.d.ts +1 -1
- package/layers/types.d.ts +2 -1
- package/networks/support/networkFieldUtils.js +1 -1
- package/package.json +1 -1
- package/rest/support/OutDistance.js +1 -1
- package/rest/support/Query.d.ts +1 -0
- package/rest/support/Query.js +1 -1
- package/support/basemapEnsureType.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMOperators.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/animationUtils.js +1 -1
- package/symbols/cim/defaultCIMValues.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/FeatureMeshFactory.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createTestMeshData.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/util/AnnotationMatcher.js +2 -0
- package/views/2d/engine/webgl/util/DimensionMatcher.js +2 -0
- package/views/2d/engine/webgl/util/Matcher.js +1 -1
- package/views/2d/engine/webgl/util/createMatcher.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/layers/AnnotationLayerView2D.js +2 -0
- package/views/2d/layers/{DimensionLayerView2D.js → DimensionFeatureLayerView2D.js} +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +2 -0
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderAnnotationJSON.js +2 -0
- package/views/2d/layers/features/support/FeatureSetReaderDimensionJSON.js +2 -0
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +2 -0
- package/views/2d/layers/support/annodime/DimensionMatcherSchema.js +2 -0
- package/views/2d/layers/support/annodime/PrivateDimensionEffect.js +2 -0
- package/views/2d/layers/support/annodime/PrivatePlacementMultipoint.js +2 -0
- package/views/2d/layers/support/annodime/annotationGraphic.js +2 -0
- package/views/2d/layers/support/annodime/annotationSchema.js +2 -0
- package/views/2d/layers/support/annodime/annotationUtils.js +2 -0
- package/views/2d/layers/support/annodime/cimAnnotations.js +2 -0
- package/views/2d/layers/support/annodime/dimensionSchema.js +2 -0
- package/views/2d/layers/support/annodime/dimensionSymbols.js +2 -0
- package/views/2d/layers/support/annodime/dimensionUtils.js +2 -0
- package/views/2d/layers/support/annodime/fields.js +2 -0
- package/views/2d/layers/support/annodime/unsupported.js +2 -0
- package/views/2d/layers/support/annodime/utils.js +2 -0
- package/views/2d/layers/support/annodime/virtualFields.js +2 -0
- package/views/2d/support/clippingUtils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/2d/types.d.ts +5 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerWorkerHandle.js +1 -1
- package/views/3d/layers/MapImageLayerView3D.js +1 -1
- package/views/3d/layers/TileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/extrudeUtils.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
- package/views/3d/types.d.ts +2 -0
- package/views/3d/webgl-engine/collections/Component/RenderSubmitSystem.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +225 -0
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +19 -0
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +55 -40
- package/views/3d/webgl-engine/core/shaderModules/Float2sPassUniform.js +2 -0
- package/views/3d/webgl-engine/core/shaderModules/IntegersPassUniform.js +2 -0
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
- package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +18 -1
- package/views/PopupView.d.ts +3 -3
- package/views/PopupView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View2D.d.ts +1 -1
- package/views/View2D.js +1 -1
- package/views/draw/DrawTool.d.ts +34 -1
- package/views/input/EventMatch.js +1 -1
- package/views/layers/AnnotationLayerView.d.ts +18 -0
- package/views/layers/AnnotationLayerView.js +2 -0
- package/views/layers/DimensionFeatureLayerView.d.ts +18 -0
- package/views/layers/DimensionFeatureLayerView.js +2 -0
- package/views/layers/FeatureLikeLayerView.d.ts +2 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/WMSLayerView.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/rendered-content/RelationshipDetails.js +2 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +7 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable/support/types.d.ts +11 -1
- package/widgets/FeatureTable.d.ts +7 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/css.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0175098da590a7109539.js +0 -1
- package/assets/esri/core/workers/chunks/01c70c27aa3a955e2928.js +0 -262
- package/assets/esri/core/workers/chunks/02c0640005b09007bb70.js +0 -1
- package/assets/esri/core/workers/chunks/040884cec4b84dd1bb17.js +0 -1
- package/assets/esri/core/workers/chunks/04ea806b933d4dd41609.js +0 -1
- package/assets/esri/core/workers/chunks/0550dc63b6b1274242b8.js +0 -1
- package/assets/esri/core/workers/chunks/0c8e6ccb5a8174718d62.js +0 -640
- package/assets/esri/core/workers/chunks/13a8346abe5509167578.js +0 -1
- package/assets/esri/core/workers/chunks/13d43a0683c42b94feb6.js +0 -1
- package/assets/esri/core/workers/chunks/13f0e08de2dfab07d212.js +0 -1
- package/assets/esri/core/workers/chunks/1c0e8808d14d8e6dde2c.js +0 -1
- package/assets/esri/core/workers/chunks/1c8c8050d60205cf2156.js +0 -1
- package/assets/esri/core/workers/chunks/1ebb613bbe09fcf274d8.js +0 -1
- package/assets/esri/core/workers/chunks/23119a1b1310b7dab2aa.js +0 -1
- package/assets/esri/core/workers/chunks/282f3d364411efac7b80.js +0 -1
- package/assets/esri/core/workers/chunks/2b9661700743d1f9717e.js +0 -1
- package/assets/esri/core/workers/chunks/2f0a3b22fc46d832e240.js +0 -1
- package/assets/esri/core/workers/chunks/2ffffc1931b2e27c6617.js +0 -1
- package/assets/esri/core/workers/chunks/313a89b334e3518d30a4.js +0 -1
- package/assets/esri/core/workers/chunks/34c11e7c8762fe0c19fb.js +0 -1
- package/assets/esri/core/workers/chunks/3835097520296b0517af.js +0 -1
- package/assets/esri/core/workers/chunks/389e57aab12d52d72695.js +0 -1
- package/assets/esri/core/workers/chunks/3fed503185ea1913fb84.js +0 -1
- package/assets/esri/core/workers/chunks/4020f95d8131493f799e.js +0 -1
- package/assets/esri/core/workers/chunks/4255ad7601c7a7621b71.js +0 -1
- package/assets/esri/core/workers/chunks/453c3b265481c80fc625.js +0 -1
- package/assets/esri/core/workers/chunks/4605a68e40c5c3ac6e3e.js +0 -1
- package/assets/esri/core/workers/chunks/4a41f98210f1da3b5041.js +0 -1
- package/assets/esri/core/workers/chunks/4afe76de6e82e86fe697.js +0 -1
- package/assets/esri/core/workers/chunks/4b130db9b7b4e2e32ea4.js +0 -1
- package/assets/esri/core/workers/chunks/4c5cdd2712c938fafc5d.js +0 -1
- package/assets/esri/core/workers/chunks/4fa3840672c33adb9171.js +0 -1
- package/assets/esri/core/workers/chunks/5a85cbc04c64091d7f46.js +0 -1
- package/assets/esri/core/workers/chunks/5d60253ea3d247cdb3d1.js +0 -1
- package/assets/esri/core/workers/chunks/5e5c7cc74ff1c9603aff.js +0 -1
- package/assets/esri/core/workers/chunks/5ea0096a282e87a269bd.js +0 -1
- package/assets/esri/core/workers/chunks/601edefd8da4eb2eda28.js +0 -1
- package/assets/esri/core/workers/chunks/63ea9035dcf9ce45560c.js +0 -1
- package/assets/esri/core/workers/chunks/66fe1634c6e8f72fc653.js +0 -1
- package/assets/esri/core/workers/chunks/6b66a6f69aa03338c346.js +0 -1
- package/assets/esri/core/workers/chunks/6d59a9cf533ebc590f70.js +0 -1
- package/assets/esri/core/workers/chunks/6f02681bcaa9bef501fc.js +0 -1
- package/assets/esri/core/workers/chunks/7b66691d133dabd87ce6.js +0 -1
- package/assets/esri/core/workers/chunks/7c077e1a63ab97bf3e87.js +0 -1
- package/assets/esri/core/workers/chunks/7dc9ff66e1eceadbae24.js +0 -1
- package/assets/esri/core/workers/chunks/825db2ea15308ee6e5dc.js +0 -1
- package/assets/esri/core/workers/chunks/85a200aecc7a844c9566.js +0 -1
- package/assets/esri/core/workers/chunks/89250d268dc2554a9ece.js +0 -1
- package/assets/esri/core/workers/chunks/8c8fed53c12fb80ef2ed.js +0 -1
- package/assets/esri/core/workers/chunks/8ff83c59462dea6e3427.js +0 -1
- package/assets/esri/core/workers/chunks/958617c3a9854ea04e06.js +0 -1
- package/assets/esri/core/workers/chunks/9890c85a238879490926.js +0 -1
- package/assets/esri/core/workers/chunks/a001e7e8a39f27284d87.js +0 -1
- package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +0 -1
- package/assets/esri/core/workers/chunks/a93a058678c8c8996d54.js +0 -1
- package/assets/esri/core/workers/chunks/a9c9c00432ee41ec91ba.js +0 -1
- package/assets/esri/core/workers/chunks/acb8cff06142f828fb78.js +0 -1
- package/assets/esri/core/workers/chunks/af762422a65c551dcd54.js +0 -1
- package/assets/esri/core/workers/chunks/b041c22885193bdd3004.js +0 -1
- package/assets/esri/core/workers/chunks/b3e8ab68fc38306f13c6.js +0 -1
- package/assets/esri/core/workers/chunks/b432a5a829e309837db6.js +0 -1
- package/assets/esri/core/workers/chunks/b4badbcf1bdb7823d825.js +0 -1
- package/assets/esri/core/workers/chunks/b891d95b7858665cd6c1.js +0 -1
- package/assets/esri/core/workers/chunks/bb2f6b0fcdfb8b158e26.js +0 -1
- package/assets/esri/core/workers/chunks/c0c693c2e0043ecba4a5.js +0 -1
- package/assets/esri/core/workers/chunks/c5ab346a226df1894302.js +0 -1
- package/assets/esri/core/workers/chunks/c91d4f1b42cfe474df52.js +0 -1
- package/assets/esri/core/workers/chunks/cedf3e316d6f89cf7005.js +0 -1
- package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +0 -1
- package/assets/esri/core/workers/chunks/d52172439db02a349542.js +0 -1
- package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +0 -1
- package/assets/esri/core/workers/chunks/e393fd61deb2e7f22ee6.js +0 -1
- package/assets/esri/core/workers/chunks/e8518bd3596543b387f8.js +0 -1
- package/assets/esri/core/workers/chunks/ecf4d07917efc97eb991.js +0 -1
- package/assets/esri/core/workers/chunks/eda51e512eff551ad858.js +0 -1
- package/assets/esri/core/workers/chunks/ee56290e600cbeb25a00.js +0 -1
- package/assets/esri/core/workers/chunks/f14e3693cd644265f909.js +0 -1
- package/assets/esri/core/workers/chunks/f52c6efc5a2abf5ac845.js +0 -1
- package/assets/esri/core/workers/chunks/f635a8e3b0bfeda99ed5.js +0 -1
- package/assets/esri/core/workers/chunks/f91a2c69a93295cf4de6.js +0 -1
- package/assets/esri/core/workers/chunks/fec3fffcf854a6226df4.js +0 -1
- package/symbols/dimensions/effects/LinearDimensionArrowEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionExtensionLineEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionLeaderLineEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionLineEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionPointEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionTextEffect.js +0 -2
- package/views/2d/layers/features/support/FeatureSetReaderDimension.js +0 -2
- package/views/3d/webgl-engine/effects/globalIllumination/BlueNoise.js +0 -2
- package/views/layers/support/dimensionUtils.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../config.js";import r from"../../../request.js";import{isSome as s,remove as a}from"../../../core/arrayUtils.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as n}from"../../../core/jsonMap.js";import{Loadable as o}from"../../../core/Loadable.js";import u from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as c,after as d,throwIfAbortError as p}from"../../../core/promiseUtils.js";import{watch as y}from"../../../core/reactiveUtils.js";import{join as h}from"../../../core/urlUtils.js";import{generateBracedUUID as m}from"../../../core/uuid.js";import{property as f,subclass as g}from"../../../core/accessorSupport/decorators.js";import q from"../../../geometry/Extent.js";import w from"../../../geometry/SpatialReference.js";import S from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as E}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as O}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as _,getFeatureJSON as b,getFeatureIds as R,getAttachmentEditsJSON as F,isProtectedOrPrivateVersionError as A,unpackEditResultData as I,createEditedFeatures as v}from"../applyEditsUtils.js";import{createDrawingInfo as x}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as T}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as M}from"../../support/featureLayerUtils.js";import{getAssetMapTable as N}from"../../support/infoFor3D.js";import{executeQueryJSON as U}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as C}from"../../../rest/query/operations/editsZScale.js";import J from"../../../rest/support/Query.js";import D from"../../../time/TimeExtent.js";import{isSafeToEditVersion as k,isVersionInEditSession as L,isHistoricVersion as Q,currentSessionId as P}from"../../../versionManagement/support/versionManagementUtils.js";const V=new n({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),$=new n({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let B=class extends o{constructor(e){super(e),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=c(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}initialize(){this.addHandles([y(()=>{const e=this.layer;return e&&"lastEditsEventDate"in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:e,parsedUrl:t,gdbVersion:r,spatialReference:s,fieldsIndex:a,uniqueIdFields:i}=this.layer,n="infoFor3D"in this.layer?this.layer.infoFor3D:null,o="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,u=has("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==n,l=u&&e?.query.supportsFormatPBFWithCurves,c=e?.operations?.supportsQueryAttachments??!1,d=e?.query?.relativeTimeBinWindow??0,p=t.path;return new j({dynamicDataSource:o,fieldsIndex:a,gdbVersion:r,infoFor3D:n,pbfSupported:u,pbfSupportedWithCurves:l,queryAttachmentsSupported:c,relativeTimeBinWindow:d,sourceSpatialReference:s,uniqueIdFields:i,url:p})}async addAttachment(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/addAttachment",n=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(t,n.query);try{const e=await r(i,{body:o});return _(e.data.addAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(a,u)}}async updateAttachment(e,t,s){await this.load();const{layer:a}=this;await M(a,"editing");const i=e.attributes[a.objectIdField],n=a.parsedUrl.path+"/"+i+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:t}}),u=this._getFormDataForAttachment(s,o.query);try{const e=await r(n,{body:u});return _(e.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(i,l)}}async applyEdits(e,t){await this.load();const{layer:a}=this;await M(a,"editing");const n="infoFor3D"in a?a.infoFor3D:null,o=null!=n,u=o||(t?.globalIdUsed??!1),l=o?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,c=e.addFeatures?.map(e=>b(this.layer,e,n))??[],d=(await Promise.all(c)).filter(s),p=e.updateFeatures?.map(e=>b(this.layer,e,n))??[],y=(await Promise.all(p)).filter(s),h=R(this.layer,e.deleteFeatures,u);C(d,y,a.spatialReference);const m=await F(this.layer,e),f=a.capabilities.editing.supportsAsyncApplyEdits&&o,g=t?.gdbVersion||a.gdbVersion,q={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,trueCurveClient:t?.editsRespectTrueCurves,usePreviousEditMoment:t?.usePreviousEditMoment,async:f};await k(this.layer.url,g,!0);const w=L(this.layer.url,g||null);if(await Q(a.url,g,a.historicMoment))throw new i("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(q.edits=JSON.stringify([{id:a.layerId,adds:d.length?d:null,updates:y.length?y:null,deletes:h.length?h:null,attachments:m,assetMaps:l}]),q.returnServiceEditsOption=V.toJSON(t?.returnServiceEditsOption),q.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(q.adds=d.length?JSON.stringify(d):null,q.updates=y.length?JSON.stringify(y):null,q.deletes=h.length?u?JSON.stringify(h):h.join(","):null,q.attachments=m&&JSON.stringify(m),q.assetMaps=null!=l?JSON.stringify(l):void 0);const S=this._getLayerRequestOptions({method:"post",query:q});w&&(S.authMode="immediate",S.query.returnEditMoment=!0,S.query.sessionId=P);const E=t?.returnServiceEditsOption?a.url:a.parsedUrl.path;let O;try{O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}catch(_){if(!A(_))throw _;S.authMode="immediate",O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}return this._createEditsResult(O)}async deleteAttachments(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await r(i,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(_)}catch(n){throw this._createAttachmentErrorResult(a,n)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then(async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:s,url:a}=this.layer,{data:i}=await r(`${a}/${s}`,t),{id:n,extent:o,fullExtent:u,timeExtent:l}=i,c=o||u;return{id:n,fullExtent:c&&q.fromJSON(c),timeExtent:l&&D.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();const r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&r.features.length){const t=new Map;if(r.features.forEach(r=>{const s=r.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){const r=e.toLowerCase();r&&r in s&&e!==r&&(s[e]=s[r],delete s[r],t.set(r,e))}})}),null!=r.fields)for(const e of r.fields){const r=t.get(e.name.toLowerCase());null!=r&&(e.name=r)}}return r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryPivot(e,t){return await this.load(),this.queryTask.executePivotQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!T(this.layer.url))return"unavailable";const e=h(this.layer.url,"status"),t=await r(e,{query:{f:"json"}});return $.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:r}=await import("./support/uploadAssets.js");return r(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){const t=this.layer;if(null==e||!("capabilities"in t)||!("effectiveCapabilities"in t))return;if(!(!t.capabilities?.operations?.supportsEditing&&t.effectiveCapabilities?.operations?.supportsEditing))return;const r=t.url;if(null==r)return;"layerId"in t&&h(r,t.layerId.toString());this._getOrCreateEditInterceptor(r).before=t=>{const r=t.requestOptions.method??"auto";if("auto"===r||"head"===r){const r=t.requestOptions.query??{};r._ts=e.getTime(),t.requestOptions.query=r}}}_getOrCreateEditInterceptor(e){return null==this._editInterceptor&&(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&(a(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){const s=(await r(e,t)).data.statusUrl;for(;;){const e=(await r(s,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return r(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new i("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new i("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await d(G)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const s={};has("featurelayer-advanced-symbols")&&(s.returnAdvancedSymbols=!0),t?.cacheBust&&(s._ts=Date.now());const{data:a}=await r(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:s,signal:t?.signal}));e=a}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const s=e.type;if(!this.supportedSourceTypes.has(s))throw new i("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=x(e.geometryType).renderer;l("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{const{data:s}=await r(this.layer.url,this._getLayerRequestOptions({signal:t}));s.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){p(s)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;if(await this._areAllAssetsAlreadyMapped(t))return null;const r=e.addFeatures.filter(e=>e.geometry);if(t.length!==r.length+e.updateFeatures.length)throw new i("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const s=new Array,a=new Map;for(const i of t){const{geometry:e}=i,{vertexSpace:t}=e;if(E(t))s.push(e);else{const t=e.origin,{convertMeshVertexSpace:r}=await import("../../../geometry/support/meshUtils/convertMeshVertexSpace.js"),n=await r(e,new S({origin:[t.x,t.y,t.z??0]}));a.set(n,e),i.geometry=n,s.push(n)}}await this.uploadAssets(s);for(const[i,n]of a)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:i}=e,n=i.getExternalSourcesOnService(s),o=a.getAttribute(r);if(0===n.length){u.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=n.find(O)??n[0];for(const r of l.assets)1===r.parts.length?t.push({globalId:m(),parentGlobalId:o,assetName:r.assetName,assetHash:r.parts[0].partHash,flags:[]}):u.getLogger(this).error(`Skipping asset ${r.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,s=[];let a=null;if(Array.isArray(t))for(const n of t)s.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===r&&(a={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else a=t;const i=I(a);if(s.length>0){i.editedFeatureResults=[];for(const e of s){const{editedFeatures:t}=e,r=t?.spatialReference?new w(t.spatialReference):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:v(t,r)})}}return i}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new i("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const s in t){const e=t[s];null!=e&&(r.set?r.set(s,e):r.append(s,e))}return r}_getLayerRequestOptions(e={}){const{layer:t,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...e,query:{gdbVersion:s,layer:"dynamicDataSource"in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...r.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){const{layer:t}=this,{globalIdField:r,parsedUrl:a}=t,i="infoFor3D"in t?t.infoFor3D:null;if(null==i||null==r)return!1;const n=N(i);if(null==n)return!1;const o=h(a.path,`../${n.id}`),u=new Array;for(const s of e){if(!(s.geometry.metadata.getExternalSourcesOnService(a).length>0))return!1;u.push(s)}const l=u.map(e=>e.getAttribute(r)).filter(s);if(0===l.length)return!1;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:d}}=i,p=new J({where:`${c} IN (${l.map(e=>`'${e}'`)})`,outFields:[d,c],returnGeometry:!1}),y=await U(o,p),{features:m}=y;return 0!==m.length&&!u.some(e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:s}=e.geometry,i=m.filter(e=>e.getAttribute(c)===t);if(0===i.length)return!0;const n=i.map(e=>e.getAttribute(d));return s.getExternalSourcesOnService(a).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>n.every(t=>e!==t))})}};e([f()],B.prototype,"type",void 0),e([f({constructOnly:!0})],B.prototype,"layer",void 0),e([f({constructOnly:!0})],B.prototype,"supportedSourceTypes",void 0),e([f({readOnly:!0})],B.prototype,"queryTask",null),B=e([g("esri.layers.graphics.sources.FeatureLayerSource")],B);const G=1e3;export{B as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../config.js";import r from"../../../request.js";import{isSome as s,remove as a}from"../../../core/arrayUtils.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as n}from"../../../core/jsonMap.js";import{Loadable as o}from"../../../core/Loadable.js";import u from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as c,after as d,throwIfAbortError as p}from"../../../core/promiseUtils.js";import{watch as y}from"../../../core/reactiveUtils.js";import{join as h}from"../../../core/urlUtils.js";import{generateBracedUUID as m}from"../../../core/uuid.js";import{property as f,subclass as g}from"../../../core/accessorSupport/decorators.js";import q from"../../../geometry/Extent.js";import w from"../../../geometry/SpatialReference.js";import S from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as E}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as O}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as b,getFeatureJSON as _,getFeatureIds as R,getAttachmentEditsJSON as A,isProtectedOrPrivateVersionError as F,unpackEditResultData as I,createEditedFeatures as v}from"../applyEditsUtils.js";import{createDrawingInfo as x}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as T}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as M}from"../../support/featureLayerUtils.js";import{getAssetMapTable as N}from"../../support/infoFor3D.js";import{executeQueryJSON as U}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as C}from"../../../rest/query/operations/editsZScale.js";import D from"../../../rest/support/Query.js";import L from"../../../time/TimeExtent.js";import{isSafeToEditVersion as J,isVersionInEditSession as k,isHistoricVersion as Q,currentSessionId as P}from"../../../versionManagement/support/versionManagementUtils.js";const V=new n({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),$=new n({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let B=class extends o{constructor(e){super(e),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer","Annotation Layer","Dimension Layer","Annotation SubLayer","Dimension SubLayer"]),this.refresh=c(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}initialize(){this.addHandles([y(()=>{const e=this.layer;return e&&"lastEditsEventDate"in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:e,parsedUrl:t,gdbVersion:r,spatialReference:s,fieldsIndex:a,uniqueIdFields:i}=this.layer,n="infoFor3D"in this.layer?this.layer.infoFor3D:null,o="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,u=has("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==n,l=u&&e?.query.supportsFormatPBFWithCurves,c=e?.operations?.supportsQueryAttachments??!1,d=e?.query?.relativeTimeBinWindow??0,p=t.path;return new j({dynamicDataSource:o,fieldsIndex:a,gdbVersion:r,infoFor3D:n,pbfSupported:u,pbfSupportedWithCurves:l,queryAttachmentsSupported:c,relativeTimeBinWindow:d,sourceSpatialReference:s,uniqueIdFields:i,url:p})}async addAttachment(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/addAttachment",n=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(t,n.query);try{const e=await r(i,{body:o});return b(e.data.addAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(a,u)}}async updateAttachment(e,t,s){await this.load();const{layer:a}=this;await M(a,"editing");const i=e.attributes[a.objectIdField],n=a.parsedUrl.path+"/"+i+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:t}}),u=this._getFormDataForAttachment(s,o.query);try{const e=await r(n,{body:u});return b(e.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(i,l)}}async applyEdits(e,t){await this.load();const{layer:a}=this;await M(a,"editing");const n="infoFor3D"in a?a.infoFor3D:null,o=null!=n,u=o||(t?.globalIdUsed??!1),l=o?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,c=e.addFeatures?.map(e=>_(this.layer,e,n))??[],d=(await Promise.all(c)).filter(s),p=e.updateFeatures?.map(e=>_(this.layer,e,n))??[],y=(await Promise.all(p)).filter(s),h=R(this.layer,e.deleteFeatures,u);C(d,y,a.spatialReference);const m=await A(this.layer,e),f=a.capabilities.editing.supportsAsyncApplyEdits&&o,g=t?.gdbVersion||a.gdbVersion,q={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,trueCurveClient:t?.editsRespectTrueCurves,usePreviousEditMoment:t?.usePreviousEditMoment,async:f};await J(this.layer.url,g,!0);const w=k(this.layer.url,g||null);if(await Q(a.url,g,a.historicMoment))throw new i("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(q.edits=JSON.stringify([{id:a.layerId,adds:d.length?d:null,updates:y.length?y:null,deletes:h.length?h:null,attachments:m,assetMaps:l}]),q.returnServiceEditsOption=V.toJSON(t?.returnServiceEditsOption),q.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(q.adds=d.length?JSON.stringify(d):null,q.updates=y.length?JSON.stringify(y):null,q.deletes=h.length?u?JSON.stringify(h):h.join(","):null,q.attachments=m&&JSON.stringify(m),q.assetMaps=null!=l?JSON.stringify(l):void 0);const S=this._getLayerRequestOptions({method:"post",query:q});w&&(S.authMode="immediate",S.query.returnEditMoment=!0,S.query.sessionId=P);const E=t?.returnServiceEditsOption?a.url:a.parsedUrl.path;let O;try{O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}catch(b){if(!F(b))throw b;S.authMode="immediate",O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}return this._createEditsResult(O)}async deleteAttachments(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await r(i,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(b)}catch(n){throw this._createAttachmentErrorResult(a,n)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then(async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:s,url:a}=this.layer,{data:i}=await r(`${a}/${s}`,t),{id:n,extent:o,fullExtent:u,timeExtent:l}=i,c=o||u;return{id:n,fullExtent:c&&q.fromJSON(c),timeExtent:l&&L.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();const r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&r.features.length){const t=new Map;if(r.features.forEach(r=>{const s=r.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){const r=e.toLowerCase();r&&r in s&&e!==r&&(s[e]=s[r],delete s[r],t.set(r,e))}})}),null!=r.fields)for(const e of r.fields){const r=t.get(e.name.toLowerCase());null!=r&&(e.name=r)}}return r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryPivot(e,t){return await this.load(),this.queryTask.executePivotQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!T(this.layer.url))return"unavailable";const e=h(this.layer.url,"status"),t=await r(e,{query:{f:"json"}});return $.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:r}=await import("./support/uploadAssets.js");return r(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){const t=this.layer;if(null==e||!("capabilities"in t)||!("effectiveCapabilities"in t))return;if(!(!t.capabilities?.operations?.supportsEditing&&t.effectiveCapabilities?.operations?.supportsEditing))return;const r=t.url;if(null==r)return;"layerId"in t&&h(r,t.layerId.toString());this._getOrCreateEditInterceptor(r).before=t=>{const r=t.requestOptions.method??"auto";if("auto"===r||"head"===r){const r=t.requestOptions.query??{};r._ts=e.getTime(),t.requestOptions.query=r}}}_getOrCreateEditInterceptor(e){return null==this._editInterceptor&&(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&(a(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){const s=(await r(e,t)).data.statusUrl;for(;;){const e=(await r(s,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return r(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new i("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new i("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await d(G)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const s={};has("featurelayer-advanced-symbols")&&(s.returnAdvancedSymbols=!0),t?.cacheBust&&(s._ts=Date.now());const{data:a}=await r(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:s,signal:t?.signal}));e=a}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const s=e.type;if(!this.supportedSourceTypes.has(s))throw new i("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=x(e.geometryType).renderer;l("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{const{data:s}=await r(this.layer.url,this._getLayerRequestOptions({signal:t}));s.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){p(s)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;if(await this._areAllAssetsAlreadyMapped(t))return null;const r=e.addFeatures.filter(e=>e.geometry);if(t.length!==r.length+e.updateFeatures.length)throw new i("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const s=new Array,a=new Map;for(const i of t){const{geometry:e}=i,{vertexSpace:t}=e;if(E(t))s.push(e);else{const t=e.origin,{convertMeshVertexSpace:r}=await import("../../../geometry/support/meshUtils/convertMeshVertexSpace.js"),n=await r(e,new S({origin:[t.x,t.y,t.z??0]}));a.set(n,e),i.geometry=n,s.push(n)}}await this.uploadAssets(s);for(const[i,n]of a)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:i}=e,n=i.getExternalSourcesOnService(s),o=a.getAttribute(r);if(0===n.length){u.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=n.find(O)??n[0];for(const r of l.assets)1===r.parts.length?t.push({globalId:m(),parentGlobalId:o,assetName:r.assetName,assetHash:r.parts[0].partHash,flags:[]}):u.getLogger(this).error(`Skipping asset ${r.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,s=[];let a=null;if(Array.isArray(t))for(const n of t)s.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===r&&(a={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else a=t;const i=I(a);if(s.length>0){i.editedFeatureResults=[];for(const e of s){const{editedFeatures:t}=e,r=t?.spatialReference?new w(t.spatialReference):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:v(t,r)})}}return i}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new i("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const s in t){const e=t[s];null!=e&&(r.set?r.set(s,e):r.append(s,e))}return r}_getLayerRequestOptions(e={}){const{layer:t,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...e,query:{gdbVersion:s,layer:"dynamicDataSource"in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...r.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){const{layer:t}=this,{globalIdField:r,parsedUrl:a}=t,i="infoFor3D"in t?t.infoFor3D:null;if(null==i||null==r)return!1;const n=N(i);if(null==n)return!1;const o=h(a.path,`../${n.id}`),u=new Array;for(const s of e){if(!(s.geometry.metadata.getExternalSourcesOnService(a).length>0))return!1;u.push(s)}const l=u.map(e=>e.getAttribute(r)).filter(s);if(0===l.length)return!1;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:d}}=i,p=new D({where:`${c} IN (${l.map(e=>`'${e}'`)})`,outFields:[d,c],returnGeometry:!1}),y=await U(o,p),{features:m}=y;return 0!==m.length&&!u.some(e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:s}=e.geometry,i=m.filter(e=>e.getAttribute(c)===t);if(0===i.length)return!0;const n=i.map(e=>e.getAttribute(d));return s.getExternalSourcesOnService(a).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>n.every(t=>e!==t))})}};e([f()],B.prototype,"type",void 0),e([f({constructOnly:!0})],B.prototype,"layer",void 0),e([f({constructOnly:!0})],B.prototype,"supportedSourceTypes",void 0),e([f({readOnly:!0})],B.prototype,"queryTask",null),B=e([g("esri.layers.graphics.sources.FeatureLayerSource")],B);const G=1e3;export{B as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import{getJsonType as t,isPoint as i}from"../../../../geometry/support/jsonTypeUtils.js";import{wgs84 as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatures as n,convertToFeature as r,convertFromFeature as a}from"../../featureConversionUtils.js";import{initialObjectId as o,findLastObjectIdFromFeatures as u}from"../../objectIdUtils.js";import l from"../../data/FeatureStore.js";import{checkProjectionSupport as d,project as p}from"../../data/projectionSupport.js";import{QueryEngine as f}from"../../data/QueryEngine.js";import{createDefaultAttributesFunction as c,createDefaultTemplate as y,createDrawingInfo as m}from"./clientSideDefaults.js";import{queryBinsCapabilities as h,loadGeometryEngineForSimplify as g,createFeatureEditErrorResult as I,mixAttributes as b,createFeatureEditSuccessResult as F,simplify as j}from"./sourceUtils.js";import _ from"../../../support/FieldsIndex.js";import{kebabDict as q}from"../../../support/fieldType.js";import{getFieldDefaultLength as E,getFieldDefaultValue as T}from"../../../support/fieldUtils.js";import{utc as x}from"../../../../time/constants.js";const R=s,O={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:s},v={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentsCountOnly:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:["EnvelopeAggregate","CentroidAggregate","ConvexHullAggregate"],supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsOutDistance:!1,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0},queryBinsCapabilities:h};function S(e){return i(e)?null!=e.z:!!e.hasZ}function w(e){return i(e)?null!=e.m:!!e.hasM}function D(e,t){let i;const s=[];if("unique-id-composite"===t.type){const n=[];for(const i of t.fieldNames)e.attributes[i]?n.push(e.attributes[i]):s.push(i);i=0===s.length?JSON.stringify(n):null}else i=e.attributes[t.fieldName],i||s.push(t.fieldName);return{objectId:i,missingFields:s}}class Q{constructor(){this._uniqueIdInfo=null,this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(t){const i=[],{features:s}=t,n=this._inferLayerProperties(s,t.fields),r=t.fields||[],a=null!=t.hasM?t.hasM:!!n.hasM,p=null!=t.hasZ?t.hasZ:!!n.hasZ,h=!t.spatialReference&&!n.spatialReference,g=h?R:t.spatialReference||n.spatialReference,I=h?O:null,b=t.geometryType||n.geometryType,F=!b,j=t.uniqueIdInfo;let S=t.objectIdField??n.objectIdField,w=t.timeInfo;const D=new _(r);if(!F&&(h&&i.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!b))throw new e("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(j){const t=new Set(r.map(({name:e})=>e));if(!j.fields.every(e=>t.has(e))){const i=j.fields.filter(e=>!t.has(e));throw new e("feature-layer:missing-property","UniqueIdFields not set and couldn't be found in the provided fields. Fields: "+i+" are mssing.")}S=null}else if(!S)throw new e("feature-layer:missing-property","objectIdField not set and uniqueIdInfo not provided.");if(n.objectIdField&&S!==n.objectIdField&&(i.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${S}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),S=n.objectIdField),S&&!n.objectIdField){const e=D.get(S);e?(S=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):r.unshift({alias:S,name:S,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const o of r){if(null==o.name&&(o.name=o.alias),null==o.alias&&(o.alias=o.name),!o.name)throw new e("feature-layer:invalid-field-name","field name is missing",{field:o});if(o.name===S&&(o.type="esriFieldTypeOID"),!q.jsonValues.includes(o.type))throw new e("feature-layer:invalid-field-type",`invalid type for field "${o.name}"`,{field:o});null==o.length&&(o.length=E(o))}const Q={};for(const e of r)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=T(e);void 0!==t&&(Q[e.name]=t)}if(w){if(w.startTimeField){const e=D.get(w.startTimeField);e?(w.startTimeField=e.name,e.type="esriFieldTypeDate"):w.startTimeField=null}if(w.endTimeField){const e=D.get(w.endTimeField);e?(w.endTimeField=e.name,e.type="esriFieldTypeDate"):w.endTimeField=null}if(w.trackIdField){const e=D.get(w.trackIdField);e?w.trackIdField=e.name:(w.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:w}}))}w.startTimeField||w.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:w}}),w=null)}const A=D.dateFields.length?{timeZoneIANA:t.dateFieldsTimeZone??x}:null;this._createDefaultAttributes=c(Q,S),this._uniqueIdInfo=t.uniqueIdInfo??void 0;const M={warnings:i,featureErrors:[],layerDefinition:{...v,drawingInfo:m(b),templates:y(Q),extent:I,geometryType:b,objectIdField:S,fields:r,hasZ:p,hasM:a,timeInfo:w,dateFieldsTimeReference:A,uniqueIdInfo:this._uniqueIdInfo??void 0},assignedObjectIds:{}},C=this._uniqueIdInfo?.OIDFieldContainsHashValue?"simple"===this._uniqueIdInfo.type?{type:"unique-id-simple",fieldName:this._uniqueIdInfo.fields[0]}:{type:"unique-id-composite",fieldNames:this._uniqueIdInfo.fields}:{type:"object-id",fieldName:S};if(this._queryEngine=new f({fieldsIndex:_.fromLayerJSON({fields:r,timeInfo:w,dateFieldsTimeReference:A}),geometryType:b,hasM:a,hasZ:p,featureIdInfo:C,spatialReference:g,featureStore:new l({geometryType:b,hasM:a,hasZ:p}),timeInfo:w}),!s?.length)return this._nextObjectId=o,M;if(S){const e=u(S,s);this._nextObjectId=e+1}return await d(s,g),this._loadInitialFeatures(M,s)}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([g(t,i),d(e.adds,t),d(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}queryAttributeBins(e,t={}){return this._queryEngine.executeAttributeBinsQuery(e,t.signal)}_inferLayerProperties(e,i){let s,n,r=null,a=null,o=null;for(const u of e){const e=u.geometry;if(null!=e&&(r||(r=t(e)),a||(a=e.spatialReference),null==s&&(s=S(e)),null==n&&(n=w(e)),r&&a&&null!=s&&null!=n))break}if(i&&i.length){let e=null;i.some(t=>{const i="esriFieldTypeOID"===t.type,s=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,i||s})&&(o=e.name)}return{geometryType:r,spatialReference:a,objectIdField:o,hasM:n,hasZ:s}}async _loadInitialFeatures(e,i){const{geometryType:s,hasM:r,hasZ:a,spatialReference:o,featureStore:u,fieldsIndex:l,featureIdInfo:d}=this._queryEngine,f=[];for(const n of i){if(null!=n.uid&&(e.assignedObjectIds[n.uid]=-1),n.geometry&&s!==t(n.geometry)){e.featureErrors.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),r=b(l,i,n.attributes,!0);r?e.featureErrors.push(r):(this._assignObjectId(i,n.attributes,!0),n.attributes=i,n.uid&&(e.assignedObjectIds[n.uid]=D(n,d).objectId),null!=n.geometry&&(n.geometry=p(n.geometry,n.geometry.spatialReference,o)),f.push(n))}u.addMany(n([],f,s,a,r,d));const{fullExtent:c,timeExtent:y}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=c,y){const{start:t,end:i}=y;e.layerDefinition.timeInfo.timeExtent=[t,i]}return e}async _applyEdits(e){const{adds:t,updates:i,deletes:s}=e,n={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(n,t),i?.length&&this._applyUpdateEdits(n,i),s?.length){for(const e of s)n.deleteResults.push(F(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:r,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:r,timeExtent:a,featureEditResults:n}}_applyAddEdits(e,i){const{addResults:s,updateResults:r}=e,{geometryType:a,hasM:o,hasZ:u,spatialReference:l,featureStore:d,featureIdInfo:f,fieldsIndex:c}=this._queryEngine,y=[];for(const n of i){if(n.geometry&&a!==t(n.geometry)){s.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),o=b(c,i,n.attributes);if(o){s.push(o);continue}this._assignObjectId(i,n.attributes),n.attributes=i;const{objectId:u,missingFields:m}=D(n,f);if(u){if(null!=n.uid&&(e.uidToObjectId[n.uid]=u),null!=n.geometry){const e=n.geometry.spatialReference??l;n.geometry=p(j(n.geometry,e),e,l)}y.push(n);const t=F(u);d.has(u)?r.push(t):s.push(t)}else s.push(I(`Missing unique id field value for fields: ${m.join()}`))}d.addMany(n([],y,a,u,o,f))}_applyUpdateEdits({updateResults:e},i){const{geometryType:s,hasM:n,hasZ:o,spatialReference:u,featureStore:l,fieldsIndex:d,featureIdInfo:f}=this._queryEngine;for(const c of i){const{attributes:i,geometry:y}=c,{objectId:m,missingFields:h}=D(c,f);if(null==m){const t="unique-id-composite"===f.type?h:f.fieldName;e.push(I(`Identifier fields: ${t} missing`));continue}if(!l.has(m)){e.push(I(`Feature with object id ${m} missing`));continue}const g=r(l.getFeature(m),s,o,n);if(null!=y){if(s!==t(y)){e.push(I("Incorrect geometry type."));continue}const i=y.spatialReference??u;g.geometry=p(j(y,i),i,u)}if(i){const t=b(d,g.attributes,i);if(t){e.push(t);continue}}l.add(a(g,s,o,n,f)),e.push(F(m))}}_assignObjectId(e,t,i=!1){if("object-id"===this._queryEngine.featureIdInfo.type){const s=this._queryEngine.featureIdInfo.fieldName;i&&t&&isFinite(t[s])?e[s]=t[s]:e[s]=this._nextObjectId++}}}export{Q as default};
|
|
2
|
+
import{remove as e}from"../../../../core/arrayUtils.js";import t from"../../../../core/Error.js";import{getJsonType as i,isPoint as s}from"../../../../geometry/support/jsonTypeUtils.js";import{wgs84 as n}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatures as r,convertToFeature as a,convertFromFeature as o}from"../../featureConversionUtils.js";import{initialObjectId as u,findLastObjectIdFromFeatures as l}from"../../objectIdUtils.js";import d from"../../data/FeatureStore.js";import{checkProjectionSupport as p,project as f}from"../../data/projectionSupport.js";import{QueryEngine as c}from"../../data/QueryEngine.js";import{createDefaultAttributesFunction as y,createDefaultTemplate as m,createDrawingInfo as h}from"./clientSideDefaults.js";import{queryBinsCapabilities as g,loadGeometryEngineForSimplify as I,createFeatureEditErrorResult as b,mixAttributes as F,createFeatureEditSuccessResult as j,simplify as _}from"./sourceUtils.js";import q from"../../../support/FieldsIndex.js";import{kebabDict as E}from"../../../support/fieldType.js";import{getFieldDefaultLength as T,getFieldDefaultValue as x}from"../../../support/fieldUtils.js";import{utc as R}from"../../../../time/constants.js";const O=n,v={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:n},S={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentsCountOnly:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:["EnvelopeAggregate","CentroidAggregate","ConvexHullAggregate"],supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsOutDistance:!1,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0},queryBinsCapabilities:g};function w(e){return s(e)?null!=e.z:!!e.hasZ}function D(e){return s(e)?null!=e.m:!!e.hasM}function Q(e,t){let i;const s=[];if("unique-id-composite"===t.type){const n=[];for(const i of t.fieldNames)e.attributes[i]?n.push(e.attributes[i]):s.push(i);i=0===s.length?JSON.stringify(n):null}else i=e.attributes[t.fieldName],i||s.push(t.fieldName);return{objectId:i,missingFields:s}}class A{constructor(){this._uniqueIdInfo=null,this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const i=[],{features:s}=e,n=this._inferLayerProperties(s,e.fields),r=e.fields||[],a=null!=e.hasM?e.hasM:!!n.hasM,o=null!=e.hasZ?e.hasZ:!!n.hasZ,f=!e.spatialReference&&!n.spatialReference,g=f?O:e.spatialReference||n.spatialReference,I=f?v:null,b=e.geometryType||n.geometryType,F=!b,j=e.uniqueIdInfo;let _=e.objectIdField??n.objectIdField,w=e.timeInfo;const D=new q(r);if(!F&&(f&&i.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!b))throw new t("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(j){const e=new Set(r.map(({name:e})=>e));if(!j.fields.every(t=>e.has(t))){const i=j.fields.filter(t=>!e.has(t));throw new t("feature-layer:missing-property","UniqueIdFields not set and couldn't be found in the provided fields. Fields: "+i+" are mssing.")}_=null}else if(!_)throw new t("feature-layer:missing-property","objectIdField not set and uniqueIdInfo not provided.");if(n.objectIdField&&_!==n.objectIdField&&(i.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${_}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),_=n.objectIdField),_&&!n.objectIdField){const e=D.get(_);e?(_=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):r.unshift({alias:_,name:_,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const u of r){if(null==u.name&&(u.name=u.alias),null==u.alias&&(u.alias=u.name),!u.name)throw new t("feature-layer:invalid-field-name","field name is missing",{field:u});if(u.name===_&&(u.type="esriFieldTypeOID"),!E.jsonValues.includes(u.type))throw new t("feature-layer:invalid-field-type",`invalid type for field "${u.name}"`,{field:u});null==u.length&&(u.length=T(u))}const Q={};for(const t of r)if("esriFieldTypeOID"!==t.type&&"esriFieldTypeGlobalID"!==t.type){const e=x(t);void 0!==e&&(Q[t.name]=e)}if(w){if(w.startTimeField){const e=D.get(w.startTimeField);e?(w.startTimeField=e.name,e.type="esriFieldTypeDate"):w.startTimeField=null}if(w.endTimeField){const e=D.get(w.endTimeField);e?(w.endTimeField=e.name,e.type="esriFieldTypeDate"):w.endTimeField=null}if(w.trackIdField){const e=D.get(w.trackIdField);e?w.trackIdField=e.name:(w.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:w}}))}w.startTimeField||w.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:w}}),w=null)}const A=D.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??R}:null;this._createDefaultAttributes=y(Q,_),this._uniqueIdInfo=e.uniqueIdInfo??void 0;const M={warnings:i,featureErrors:[],layerDefinition:{...S,drawingInfo:h(b),templates:m(Q),extent:I,geometryType:b,objectIdField:_,fields:r,hasZ:o,hasM:a,timeInfo:w,dateFieldsTimeReference:A,uniqueIdInfo:this._uniqueIdInfo??void 0},assignedObjectIds:{}},C=this._uniqueIdInfo?.OIDFieldContainsHashValue?"simple"===this._uniqueIdInfo.type?{type:"unique-id-simple",fieldName:this._uniqueIdInfo.fields[0]}:{type:"unique-id-composite",fieldNames:this._uniqueIdInfo.fields}:{type:"object-id",fieldName:_};if(this._queryEngine=new c({fieldsIndex:q.fromLayerJSON({fields:r,timeInfo:w,dateFieldsTimeReference:A}),geometryType:b,hasM:a,hasZ:o,featureIdInfo:C,spatialReference:g,featureStore:new d({geometryType:b,hasM:a,hasZ:o}),timeInfo:w}),!s?.length)return this._nextObjectId=u,M;if(_){const e=l(_,s);this._nextObjectId=e+1}return await p(s,g),this._loadInitialFeatures(M,s)}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([I(t,i),p(e.adds,t),p(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}queryAttributeBins(e,t={}){return this._queryEngine.executeAttributeBinsQuery(e,t.signal)}_inferLayerProperties(e,t){let s,n,r=null,a=null,o=null;for(const u of e){const e=u.geometry;if(null!=e&&(r||(r=i(e)),a||(a=e.spatialReference),null==s&&(s=w(e)),null==n&&(n=D(e)),r&&a&&null!=s&&null!=n))break}if(t&&t.length){let e=null;t.some(t=>{const i="esriFieldTypeOID"===t.type,s=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,i||s})&&(o=e.name)}return{geometryType:r,spatialReference:a,objectIdField:o,hasM:n,hasZ:s}}async _loadInitialFeatures(e,t){const{geometryType:s,hasM:n,hasZ:a,spatialReference:o,featureStore:u,fieldsIndex:l,featureIdInfo:d}=this._queryEngine,p=[];for(const r of t){if(null!=r.uid&&(e.assignedObjectIds[r.uid]=-1),r.geometry&&s!==i(r.geometry)){e.featureErrors.push(b("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),n=F(l,t,r.attributes,!0);n?e.featureErrors.push(n):(this._assignObjectId(t,r.attributes,!0),r.attributes=t,r.uid&&(e.assignedObjectIds[r.uid]=Q(r,d).objectId),null!=r.geometry&&(r.geometry=f(r.geometry,r.geometry.spatialReference,o)),p.push(r))}u.addMany(r([],p,s,a,n,d));const{fullExtent:c,timeExtent:y}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=c,y){const{start:t,end:i}=y;e.layerDefinition.timeInfo.timeExtent=[t,i]}return e}async _applyEdits(e){const{adds:t,updates:i,deletes:s}=e,n={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(n,t),i?.length&&this._applyUpdateEdits(n,i),s?.length){for(const e of s)n.deleteResults.push(j(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:r,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:r,timeExtent:a,featureEditResults:n}}_applyAddEdits(t,s){const{addResults:n,updateResults:a}=t,{geometryType:o,hasM:u,hasZ:l,spatialReference:d,featureStore:p,featureIdInfo:c,fieldsIndex:y}=this._queryEngine,m=[],h=new Map;for(const r of s){if(r.geometry&&o!==i(r.geometry)){n.push(b("Incorrect geometry type."));continue}const s=this._createDefaultAttributes(),u=F(y,s,r.attributes);if(u){n.push(u);continue}this._assignObjectId(s,r.attributes),r.attributes=s;const{objectId:l,missingFields:g}=Q(r,c);if(l){if(null!=r.uid&&(t.uidToObjectId[r.uid]=l),null!=r.geometry){const e=r.geometry.spatialReference??d;r.geometry=f(_(r.geometry,e),e,d)}m.push(r);const i=j(l);h.has(l)?e(m,h.get(l)):p.has(l)?a.push(i):n.push(i),h.set(l,r)}else n.push(b(`Missing unique id field value for fields: ${g.join()}`))}p.addMany(r([],m,o,l,u,c))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:n,hasZ:r,spatialReference:u,featureStore:l,fieldsIndex:d,featureIdInfo:p}=this._queryEngine;for(const c of t){const{attributes:t,geometry:y}=c,{objectId:m,missingFields:h}=Q(c,p);if(null==m){const t="unique-id-composite"===p.type?h:p.fieldName;e.push(b(`Identifier fields: ${t} missing`));continue}if(!l.has(m)){e.push(b(`Feature with object id ${m} missing`));continue}const g=a(l.getFeature(m),s,r,n);if(null!=y){if(s!==i(y)){e.push(b("Incorrect geometry type."));continue}const t=y.spatialReference??u;g.geometry=f(_(y,t),t,u)}if(t){const i=F(d,g.attributes,t);if(i){e.push(i);continue}}l.add(o(g,s,r,n,p)),e.push(j(m))}}_assignObjectId(e,t,i=!1){if("object-id"===this._queryEngine.featureIdInfo.type){const s=this._queryEngine.featureIdInfo.fieldName;i&&t&&isFinite(t[s])?e[s]=t[s]:e[s]=this._nextObjectId++}}}export{A as default};
|
|
@@ -173,6 +173,7 @@ export default class Field extends JSONSupport {
|
|
|
173
173
|
* | phone-number | Text that represents a phone number. |
|
|
174
174
|
* | type-or-category | Types or categories that group features based on common characteristics. |
|
|
175
175
|
* | unique-identifier | The values in this field are used to positively distinguish one feature or entity from another. |
|
|
176
|
+
* | url | Text that represents a web address. |
|
|
176
177
|
*
|
|
177
178
|
* @since 4.12
|
|
178
179
|
* @see [Blog - Describing layer attributes with field descriptions](https://www.esri.com/arcgis-blog/products/arcgis-online/data-management/describing-layer-attributes-with-field-descriptions-march-2019/)
|
package/layers/support/Field.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{Integer as n}from"../../core/accessorSupport/ensureType.js";import{fromJSON as l,types as a}from"./domains.js";import{kebabDict as s}from"./fieldType.js";import{reader as p}from"../../core/accessorSupport/decorators/reader.js";import{enumeration as d}from"../../core/accessorSupport/decorators/enumeration.js";var u;const c=new t({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let m=class extends o{static{u=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let o=null;try{o=t?JSON.parse(t):null}catch(r){}return o?.value??null}readValueType(e,{description:t}){let o=null;try{o=t?JSON.parse(t):null}catch(r){}return o?c.fromJSON(o.fieldValueType):null}clone(){return new u({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};e([r({type:String,json:{write:!0}})],m.prototype,"alias",void 0),e([r({type:[String,Number],json:{write:{allowNull:!0}}})],m.prototype,"defaultValue",void 0),e([r()],m.prototype,"description",void 0),e([p("description")],m.prototype,"readDescription",null),e([r({types:a,json:{read:{reader:l},write:!0}})],m.prototype,"domain",void 0),e([r({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),e([r({type:n,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],m.prototype,"length",void 0),e([r({type:String,json:{write:!0}})],m.prototype,"name",void 0),e([r({type:Boolean,json:{write:!0}})],m.prototype,"nullable",void 0),e([d(s)],m.prototype,"type",void 0),e([r()],m.prototype,"valueType",void 0),e([p("valueType",["description"])],m.prototype,"readValueType",null),e([r({type:Boolean,json:{read:!1}})],m.prototype,"visible",void 0),m=u=e([i("esri.layers.support.Field")],m);export{m as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{Integer as n}from"../../core/accessorSupport/ensureType.js";import{fromJSON as l,types as a}from"./domains.js";import{kebabDict as s}from"./fieldType.js";import{reader as p}from"../../core/accessorSupport/decorators/reader.js";import{enumeration as d}from"../../core/accessorSupport/decorators/enumeration.js";var u;const c=new t({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier",url:"url"});let m=class extends o{static{u=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let o=null;try{o=t?JSON.parse(t):null}catch(r){}return o?.value??null}readValueType(e,{description:t}){let o=null;try{o=t?JSON.parse(t):null}catch(r){}return o?c.fromJSON(o.fieldValueType):null}clone(){return new u({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};e([r({type:String,json:{write:!0}})],m.prototype,"alias",void 0),e([r({type:[String,Number],json:{write:{allowNull:!0}}})],m.prototype,"defaultValue",void 0),e([r()],m.prototype,"description",void 0),e([p("description")],m.prototype,"readDescription",null),e([r({types:a,json:{read:{reader:l},write:!0}})],m.prototype,"domain",void 0),e([r({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),e([r({type:n,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],m.prototype,"length",void 0),e([r({type:String,json:{write:!0}})],m.prototype,"name",void 0),e([r({type:Boolean,json:{write:!0}})],m.prototype,"nullable",void 0),e([d(s)],m.prototype,"type",void 0),e([r()],m.prototype,"valueType",void 0),e([p("valueType",["description"])],m.prototype,"readValueType",null),e([r({type:Boolean,json:{read:!1}})],m.prototype,"visible",void 0),m=u=e([i("esri.layers.support.Field")],m);export{m as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONSupport as
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import o from"../../core/Warning.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";import{persistable as a}from"../../core/accessorSupport/decorators/persistable.js";import n from"../../geometry/Polygon.js";import{canProjectWithoutEngine as p,projectPolygon as c}from"../../geometry/projectionUtils.js";import l from"../../geometry/SpatialReference.js";import{equals as m}from"../../geometry/support/spatialReferenceUtils.js";import{default3DTilesSpatialReference as f}from"./tiles3DUtils.js";import{isInitialized as y,switchMeshModificationPolygonVCSSync as d}from"../../views/3d/layers/Lyr3DWorker.js";import{toWasmModification as u,fromWasmModification as g}from"../../views/3d/layers/SceneLayerWorkerHandle.js";import{writer as S}from"../../core/accessorSupport/decorators/writer.js";var h;let R=h=class extends t{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,r,s){if(this._needWGS84Conversion(s))this._doWGS84Conversion(t,r,s);else if(s.layer?.spatialReference&&!s.layer.spatialReference.equals(this.geometry.spatialReference)){if(!p(e.spatialReference,s.layer.spatialReference))return void(s?.messages&&s.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:s.layer.spatialReference,context:s})));const i=new n;c(e,i,s.layer.spatialReference),t[r]=i.toJSON(s)}else t[r]=e.toJSON(s)}_needWGS84Conversion(e){if("integrated-mesh-3dtiles"===e.layer?.type){const t=e.layer;return!t.esriCrsSpatialReference||!m(t.esriCrsSpatialReference,this.geometry.spatialReference)}return!1}_doWGS84Conversion(e,t,r){let s=!0;if(y()){const o=u(null,[this],l.WGS84);if(o.length>1){const i=d({modifications:o,inVCS:5773});if(i.success&&i.modifications){const o=[this.clone()];g(i.modifications,o),1===o.length&&o[0].geometry&&(o[0].geometry.spatialReference=f,e[t]=o[0].geometry.toJSON(r),s=!1)}}}s&&r?.messages&&r.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:this.geometry.spatialReference,context:r}))}clone(){return new h({geometry:r(this.geometry),type:this.type})}};e([s({type:n}),a()],R.prototype,"geometry",void 0),e([S(["web-scene","portal-item"],"geometry")],R.prototype,"writeGeometry",null),e([s({type:["clip","mask","replace"],nonNullable:!0}),a()],R.prototype,"type",void 0),R=h=e([i("esri.layers.support.SceneModification")],R);export{R as default};
|
|
@@ -27,7 +27,7 @@ export type FieldType = "small-integer" | "integer" | "single" | "double" | "lon
|
|
|
27
27
|
*
|
|
28
28
|
* @since 5.0
|
|
29
29
|
*/
|
|
30
|
-
export type FieldValueType = "binary" | "coordinate" | "count-or-amount" | "currency" | "date-and-time" | "description" | "email-address" | "location-or-place-name" | "measurement" | "name-or-title" | "none" | "ordered-or-ranked" | "percentage-or-ratio" | "phone-number" | "type-or-category" | "unique-identifier";
|
|
30
|
+
export type FieldValueType = "binary" | "coordinate" | "count-or-amount" | "currency" | "date-and-time" | "description" | "email-address" | "location-or-place-name" | "measurement" | "name-or-title" | "none" | "ordered-or-ranked" | "percentage-or-ratio" | "phone-number" | "type-or-category" | "unique-identifier" | "url";
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Supported field formatting types.
|
package/layers/types.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ import type { TimeZone } from "../time/types.js";
|
|
|
33
33
|
* @see [Layer.type](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#type)
|
|
34
34
|
* @since 5.0
|
|
35
35
|
*/
|
|
36
|
-
export type LayerType = "base-dynamic" | "base-elevation" | "base-tile" | "bing-maps" | "building-scene" | "catalog" | "catalog-footprint" | "catalog-dynamic-group" | "csv" | "dimension" | "dimension-feature" | "elevation" | "feature" | "geo-rss" | "geojson" | "parquet" | "gaussian-splat" | "graphics" | "group" | "imagery" | "imagery-tile" | "integrated-mesh" | "integrated-mesh-3dtiles" | "kml" | "knowledge-graph" | "knowledge-graph-sublayer" | "line-of-sight" | "link-chart" | "map-image" | "map-notes" | "media" | "video" | "ogc-feature" | "open-street-map" | "oriented-imagery" | "point-cloud" | "route" | "scene" | "stream" | "subtype-group" | "tile" | "unknown" | "unsupported" | "vector-tile" | "viewshed" | "voxel" | "wcs" | "web-tile" | "wfs" | "wms" | "wmts";
|
|
36
|
+
export type LayerType = "annotation" | "base-dynamic" | "base-elevation" | "base-tile" | "bing-maps" | "building-scene" | "catalog" | "catalog-footprint" | "catalog-dynamic-group" | "csv" | "dimension" | "dimension-feature" | "elevation" | "feature" | "geo-rss" | "geojson" | "parquet" | "gaussian-splat" | "graphics" | "group" | "imagery" | "imagery-tile" | "integrated-mesh" | "integrated-mesh-3dtiles" | "kml" | "knowledge-graph" | "knowledge-graph-sublayer" | "line-of-sight" | "link-chart" | "map-image" | "map-notes" | "media" | "video" | "ogc-feature" | "open-street-map" | "oriented-imagery" | "point-cloud" | "route" | "scene" | "stream" | "subtype-group" | "tile" | "unknown" | "unsupported" | "vector-tile" | "viewshed" | "voxel" | "wcs" | "web-tile" | "wfs" | "wms" | "wmts";
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Indicates how the layer should display in the [Layer List](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-layer-list/) component.
|
|
@@ -398,6 +398,7 @@ export interface QueryCapabilities {
|
|
|
398
398
|
* for the individual features contributing to each [aggregated](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnStatisticsAggregatedIds)
|
|
399
399
|
* statistics query result.
|
|
400
400
|
*
|
|
401
|
+
* @internal
|
|
401
402
|
* @since 5.1
|
|
402
403
|
* @see [Query.returnStatisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnStatisticsAggregatedIds)
|
|
403
404
|
* @see [Graphic.statisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#statisticsAggregatedIds)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
function t(t){const e=t?.fieldsIndex,n="fromnetworksourceid",o="fromglobalid",i="fromterminalid",r="fromfirstunit",a="fromlastunit",s="tonetworksourceid",l="toglobalid",m="toterminalid",g="tofirstunit",u="tolastunit",f="status",d="associationtype",c="iscontentvisible",p="percentalong",y="globalid";return{fromNetworkSourceId:e?.get(n)?.name??n,fromGlobalId:e?.get(o)?.name??o,fromTerminalId:e?.get(i)?.name??i,fromFirstUnit:e?.get(r)?.name??r,fromLastUnit:e?.get(a)?.name??a,toNetworkSourceId:e?.get(s)?.name??s,toGlobalId:e?.get(l)?.name??l,toTerminalId:e?.get(m)?.name??m,toFirstUnit:e?.get(g)?.name??g,toLastUnit:e?.get(u)?.name??u,status:e?.get(f)?.name??f,associationType:e?.get(d)?.name??d,isContentVisible:e?.get(c)?.name??c,percentAlong:e?.get(p)?.name??p,globalId:e?.get(t?.globalIdField??y)?.name??y}}function e(t,e){if("feature"!==e.type&&"subtype-group"!==e.type&&"dimension-feature"!==e.type)return[];if(!e.url)return[];const n="utilityNetworks"in t.map?t.map.utilityNetworks??[]:[];for(const o of n)if(o.isUtilityLayer(e)){const t=e.fieldsIndex.get("assetgroup"),n=e.fieldsIndex.get("assettype");return[t?.name,n?.name].filter(t=>null!=t)}return[]}export{t as getAssociationsTableFields,e as getUtilityNetworkFields};
|
|
2
|
+
function t(t){const e=t?.fieldsIndex,n="fromnetworksourceid",o="fromglobalid",i="fromterminalid",r="fromfirstunit",a="fromlastunit",s="tonetworksourceid",l="toglobalid",m="toterminalid",g="tofirstunit",u="tolastunit",f="status",d="associationtype",c="iscontentvisible",p="percentalong",y="globalid";return{fromNetworkSourceId:e?.get(n)?.name??n,fromGlobalId:e?.get(o)?.name??o,fromTerminalId:e?.get(i)?.name??i,fromFirstUnit:e?.get(r)?.name??r,fromLastUnit:e?.get(a)?.name??a,toNetworkSourceId:e?.get(s)?.name??s,toGlobalId:e?.get(l)?.name??l,toTerminalId:e?.get(m)?.name??m,toFirstUnit:e?.get(g)?.name??g,toLastUnit:e?.get(u)?.name??u,status:e?.get(f)?.name??f,associationType:e?.get(d)?.name??d,isContentVisible:e?.get(c)?.name??c,percentAlong:e?.get(p)?.name??p,globalId:e?.get(t?.globalIdField??y)?.name??y}}function e(t,e){if("feature"!==e.type&&"subtype-group"!==e.type&&"dimension-feature"!==e.type&&"annotation"!==e.type)return[];if(!e.url)return[];const n="utilityNetworks"in t.map?t.map.utilityNetworks??[]:[];for(const o of n)if(o.isUtilityLayer(e)){const t=e.fieldsIndex.get("assetgroup"),n=e.fieldsIndex.get("assettype");return[t?.name,n?.name].filter(t=>null!=t)}return[]}export{t as getAssociationsTableFields,e as getUtilityNetworkFields};
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as t}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{JSONMap as r}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as i,subclass as s}from"../../core/accessorSupport/decorators.js";import{enumeration as n}from"../../core/accessorSupport/decorators/enumeration.js";const c=new r({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let a=class extends(e(o)){constructor(){super(...arguments),this.returnDistance=!0,this.ascendingOrder=!0,this.outDistanceUnit=null}};t([i({json:{write:!0}})],a.prototype,"returnDistance",void 0),t([i({json:{write:!0}})],a.prototype,"ascendingOrder",void 0),t([n(c,{ignoreUnknown:!1}),i({json:{write:{isRequired:!0}}})],a.prototype,"outDistanceUnit",void 0),a=t([s("esri.rest.support.OutDistance")],a);const p=a;export{p as default};
|
package/rest/support/Query.d.ts
CHANGED
|
@@ -801,6 +801,7 @@ export default class Query extends JSONSupport {
|
|
|
801
801
|
* @default false
|
|
802
802
|
* @see [QueryCapabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#QueryCapabilities)
|
|
803
803
|
* @see [Graphic.statisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#statisticsAggregatedIds)
|
|
804
|
+
* @internal
|
|
804
805
|
* @since 5.1
|
|
805
806
|
* @example
|
|
806
807
|
* // query for the count of trees in each park and include the IDs of
|
package/rest/support/Query.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{JSONMap as e}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{property as o,cast as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as u}from"../../geometry/support/jsonUtils.js";import{geometryTypes as d}from"../../geometry/support/typeUtils.js";import m from"../layerSources/DynamicDataLayer.js";import c from"./FullTextSearch.js";import y from"./QuantizationParameters.js";import{spatialRelKebabDict as
|
|
2
|
+
import{__decorate as t}from"tslib";import{JSONMap as e}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{property as o,cast as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as u}from"../../geometry/support/jsonUtils.js";import{geometryTypes as d}from"../../geometry/support/typeUtils.js";import m from"../layerSources/DynamicDataLayer.js";import c from"./FullTextSearch.js";import y from"./OutDistance.js";import h from"./QuantizationParameters.js";import{spatialRelKebabDict as f}from"./spatialRelationships.js";import j from"./StatisticDefinition.js";import g from"../../time/TimeExtent.js";import{writer as v}from"../../core/accessorSupport/decorators/writer.js";import{enumeration as w}from"../../core/accessorSupport/decorators/enumeration.js";var S;const R=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let b=class extends r{static{S=this}static from(t){return a(S,t)}constructor(t){super(t),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnStatisticsAggregatedIds=!1,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnExceededLimitGeometries=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.returnTrueCurves=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.outDistance=null,this.where=null}castDatumTransformation(t){return"number"==typeof t||"object"==typeof t?t:null}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}writeParameterValues(t,e){if(t){const r={};for(const e in t){const i=t[e];Array.isArray(i)?r[e]=i.map(t=>t instanceof Date?t.getTime():t):i instanceof Date?r[e]=i.getTime():r[e]=i}e.parameterValues=r}}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(t,e){e.where=t||"1=1"}clone(){return new S(i({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:null!=this.historicMoment?new Date(this.historicMoment):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnStatisticsAggregatedIds:this.returnStatisticsAggregatedIds,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnExceededLimitGeometries:this.returnExceededLimitGeometries,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,returnTrueCurves:this.returnTrueCurves,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,outDistance:this.outDistance,where:this.where}))}static{this.MAX_MAX_RECORD_COUNT_FACTOR=5}};t([o({json:{write:!0}})],b.prototype,"aggregateIds",void 0),t([o({type:Boolean,json:{write:!0}})],b.prototype,"cacheHint",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"compactGeometryEnabled",void 0),t([o({json:{write:!0}})],b.prototype,"datumTransformation",void 0),t([s("datumTransformation")],b.prototype,"castDatumTransformation",null),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"defaultSpatialReferenceEnabled",void 0),t([o({type:Number,json:{write:!0}})],b.prototype,"distance",void 0),t([o({type:m,json:{write:!0}})],b.prototype,"dynamicDataSource",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"formatOf3DObjects",void 0),t([o({type:[c],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.fullText&&this.fullText.length>0}}}}})],b.prototype,"fullText",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"gdbVersion",void 0),t([o({types:d,json:{read:u,write:!0}})],b.prototype,"geometry",void 0),t([o({type:Number,json:{write:!0}})],b.prototype,"geometryPrecision",void 0),t([o({type:[String],json:{write:!0}})],b.prototype,"groupByFieldsForStatistics",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"having",void 0),t([o({type:Date})],b.prototype,"historicMoment",void 0),t([v("historicMoment")],b.prototype,"writeHistoricMoment",null),t([o({type:Number,json:{write:!0}})],b.prototype,"maxAllowableOffset",void 0),t([o({type:Number,cast:t=>t<1?1:t>b.MAX_MAX_RECORD_COUNT_FACTOR?b.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],b.prototype,"maxRecordCountFactor",void 0),t([o({type:["xyFootprint"],json:{write:!0}})],b.prototype,"multipatchOption",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],b.prototype,"num",void 0),t([o({json:{write:!0}})],b.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],b.prototype,"orderByFields",void 0),t([o({type:[String],json:{write:!0}})],b.prototype,"outFields",void 0),t([o({type:p,json:{name:"outSR",write:!0}})],b.prototype,"outSpatialReference",void 0),t([o({type:[j],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],b.prototype,"outStatistics",void 0),t([o({json:{write:!0}})],b.prototype,"parameterValues",void 0),t([v("parameterValues")],b.prototype,"writeParameterValues",null),t([o({type:l,json:{write:!0}})],b.prototype,"pixelSize",void 0),t([o({type:h,json:{write:!0}})],b.prototype,"quantizationParameters",void 0),t([o({type:[Object],json:{write:!0}})],b.prototype,"rangeValues",void 0),t([o({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:"relation"===this.spatialRelationship}}}}})],b.prototype,"relationParameter",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"resultType",void 0),t([o({type:Boolean,json:{name:"returnAggIds",write:{overridePolicy(t){return{enabled:t&&!!this.groupByFieldsForStatistics?.length&&!!this.outStatistics?.length}}}}})],b.prototype,"returnStatisticsAggregatedIds",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnCentroid",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnDistinctValues",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"returnExceededLimitFeatures",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"returnExceededLimitGeometries",void 0),t([o({type:Boolean,json:{write:!0}})],b.prototype,"returnGeometry",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnQueryGeometry",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnM",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],b.prototype,"returnZ",void 0),t([o({type:Boolean,json:{write:!0}})],b.prototype,"returnTrueCurves",void 0),t([o({type:p,json:{write:!0}})],b.prototype,"sourceSpatialReference",void 0),t([w(f,{ignoreUnknown:!1,name:"spatialRel"})],b.prototype,"spatialRelationship",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],b.prototype,"start",void 0),t([v("start"),v("num")],b.prototype,"writeStart",null),t([o({type:String,json:{write:!0}})],b.prototype,"sqlFormat",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"text",void 0),t([o({type:g,json:{write:!0}})],b.prototype,"timeExtent",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"timeReferenceUnknownClient",void 0),t([w(R,{ignoreUnknown:!1}),o({json:{write:{overridePolicy(t){return{enabled:!!t&&null!=this.distance}}}}})],b.prototype,"units",void 0),t([o({type:y,json:{write:!0}})],b.prototype,"outDistance",void 0),t([o({type:String,json:{write:{overridePolicy(t){return{enabled:null!=t||null!=this.start&&this.start>0}}}}})],b.prototype,"where",void 0),t([v("where")],b.prototype,"writeWhere",null),b=S=t([n("esri.rest.support.Query")],b);export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../Basemap.js";import
|
|
2
|
+
import e from"../Basemap.js";import s from"../core/Collection.js";import r from"../core/Logger.js";import{ensureType as o}from"../core/accessorSupport/ensureType.js";import{hasBasemapStylesApiKey as t}from"./apiKeyUtils.js";import{esriBasemapDefinitions as n}from"./basemapDefinitions.js";import{layerDefinitionEquals as i,layerToDefinition as a}from"./basemapUtils.js";const p=()=>r.getLogger("esri.support.basemapUtils");function f(s){let r;if("string"==typeof s){const o=s in n,i=!o&&s.includes("/");if(!o&&!i){if(t())p().warn(`Unable to find basemap definition for: ${s}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const e=Object.entries(n).filter(([e,s])=>s.classic||s.is3d).map(([e])=>`"${e}"`).sort().join(", ");p().warn(`Unable to find basemap definition for: ${s}. Try one of these: ${e}`)}return null}r=o?e.fromId(s):new e({style:{id:s}})}else r=o(e,s);return r?.destroyed&&(p().warn("The provided basemap is already destroyed",{basemap:r}),r=null),r}function l(e,s=null){const r=f(e);if(!r)return null;const o=r.clone();return s&&(o.baseLayers=c(o.baseLayers,s.baseLayers),o.referenceLayers=c(o.referenceLayers,s.referenceLayers)),o}function c(e,r){const o=new s;return e.forEach(e=>{const s=r.find(s=>"scene"!==s.type&&i(a(e),a(s)))||e;o.includes(s)?o.push(e):o.push(s)}),o}export{f as basemapEnsureType,l as clonePreservingTiledLayers};
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const e="20260530",c="743991c57ed087b0dfa6bdce972e4139ef463c08";export{e as buildDate,c as commitHash};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{EffectAddControlPoints as e}from"./effects/EffectAddControlPoints.js";import{EffectArrow as t}from"./effects/EffectArrow.js";import{EffectBuffer as r}from"./effects/EffectBuffer.js";import{EffectControlMeasureLine as c}from"./effects/EffectControlMeasureLine.js";import{EffectCut as
|
|
2
|
+
import{EffectAddControlPoints as e}from"./effects/EffectAddControlPoints.js";import{EffectArrow as t}from"./effects/EffectArrow.js";import{EffectBuffer as r}from"./effects/EffectBuffer.js";import{EffectControlMeasureLine as c}from"./effects/EffectControlMeasureLine.js";import{EffectCut as o}from"./effects/EffectCut.js";import{EffectDashes as f}from"./effects/EffectDashes.js";import{EffectDonut as s}from"./effects/EffectDonut.js";import{EffectEnclosingPolygon as a}from"./effects/EffectEnclosingPolygon.js";import{EffectJog as n}from"./effects/EffectJog.js";import{EffectMove as l}from"./effects/EffectMove.js";import{EffectOffset as m}from"./effects/EffectOffset.js";import{EffectRadial as i}from"./effects/EffectRadial.js";import{EffectReverse as u}from"./effects/EffectReverse.js";import{EffectRotate as p}from"./effects/EffectRotate.js";import{EffectScale as E}from"./effects/EffectScale.js";import{EffectSuppress as M}from"./effects/EffectSuppress.js";import{EffectTaperedPolygon as C}from"./effects/EffectTaperedPolygon.js";import{EffectWave as P}from"./effects/EffectWave.js";import{PlacementAlongLineSameSize as j}from"./placements/PlacementAlongLineSameSize.js";import{PlacementAtExtremities as I}from"./placements/PlacementAtExtremities.js";import{PlacementAtMeasuredUnits as G}from"./placements/PlacementAtMeasuredUnits.js";import{PlacementAtRatioPositions as d}from"./placements/PlacementAtRatioPositions.js";import{PlacementInsidePolygon as g}from"./placements/PlacementInsidePolygon.js";import{PlacementOnLine as v}from"./placements/PlacementOnLine.js";import{PlacementOnVertices as y}from"./placements/PlacementOnVertices.js";import{PlacementPolygonCenter as A}from"./placements/PlacementPolygonCenter.js";import{PrivateDimensionEffect as k}from"../../views/2d/layers/support/annodime/PrivateDimensionEffect.js";import{PrivatePlacementMultipoint as R}from"../../views/2d/layers/support/annodime/PrivatePlacementMultipoint.js";function S(j){if(!j)return null;switch(j.type){case"CIMGeometricEffectAddControlPoints":return e.local();case"CIMGeometricEffectArrow":return t.local();case"CIMGeometricEffectBuffer":return r.local();case"CIMGeometricEffectControlMeasureLine":return c.local();case"CIMGeometricEffectCut":return o.local();case"CIMGeometricEffectDashes":return f.local();case"CIMGeometricEffectDonut":return s.local();case"CIMGeometricEffectJog":return n.local();case"CIMGeometricEffectMove":return l.local();case"CIMGeometricEffectOffset":return m.local();case"CIMGeometricEffectRadial":return i.local();case"CIMGeometricEffectReverse":return u.local();case"CIMGeometricEffectRotate":return p.local();case"CIMGeometricEffectScale":return E.local();case"CIMGeometricEffectSuppress":return M.local();case"CIMGeometricEffectTaperedPolygon":return C.local();case"CIMGeometricEffectWave":return P.local();case"CIMGeometricEffectEnclosingPolygon":return a.local();case"PrivateDimensionEffect":return k.local()}return null}function w(e){if(!e)return null;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":return j.local();case"CIMMarkerPlacementAtExtremities":return I.local();case"CIMMarkerPlacementAtMeasuredUnits":return G.local();case"CIMMarkerPlacementAtRatioPositions":return d.local();case"CIMMarkerPlacementInsidePolygon":return g.local();case"CIMMarkerPlacementOnLine":return v.local();case"PrivatePlacementMultipoint":return R.local();case"CIMMarkerPlacementOnVertices":return y.local();case"CIMMarkerPlacementPolygonCenter":return A.local()}return null}export{S as getEffectOperator,w as getPlacementOperator};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{bidiText as e}from"../../core/BidiText.js";import{clone as t}from"../../core/lang.js";import r from"../../core/Logger.js";import o from"../../core/RandomLCG.js";import{px2pt as a}from"../../core/screenUtils.js";import{create as s,expandPointInPlace as i}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as n}from"../../geometry/support/boundsUtils.js";import{isCurvedGeometry as l}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as c}from"../../geometry/support/curves/densifyCurvedGeometry.js";import m from"../Font.js";import{loadGeometryOperatorsForEffect as f,loadGeometryOperatorsForPlacement as y}from"./CIMEffects.js";import{Placement as h}from"./CIMPlacements.js";import{EnvDrawHelper as u,CanvasDrawHelper as p,lineGapType2LineHeight as S,Transformation as M}from"./CIMSymbolDrawHelper.js";import{defaultCIMValues as d}from"./defaultCIMValues.js";import{getEffectsInflateSize as g,getNumericValue as b,fromCIMFontStyle as x,fromCIMFontDecoration as C}from"./utils.js";import{defaultPolylineSymbol2D as I}from"../support/defaults.js";import{cInfinity as k}from"../../views/2d/engine/vectorTiles/GeometryUtils.js";import{magicLabelLineHeight as w,glyphSize as P,randomInsidePolygonTextureSize as L}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as z}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as F,getLineWidth as D}from"../../views/2d/layers/graphics/graphicsUtils.js";const T=Math.PI,v=T/2,A=Math.PI/180,G=96/72,j=1.4142135623730951,E=2,R=4,B=()=>r.getLogger("esri.symbols.cim.CIMSymbolHelper");function X(e){let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":{const r=_.fromSimpleMarker(e);if(!r)throw new Error("InternalError: Cannot convert symbol to CIM");t=r;break}case"picture-marker":t=_.fromPictureMarker(e);break;case"simple-line":t=_.fromSimpleLineSymbol(e);break;case"simple-fill":t=_.fromSimpleFillSymbol(e);break;case"picture-fill":t=_.fromPictureFillSymbol(e);break;case"text":t=_.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function V(e,t,r){switch(t.type){case"CIMSymbolReference":return V(e,t.symbol,r);case"CIMPointSymbol":null==r&&(r={x:0,y:0}),e.drawSymbol(t,r);break;case"CIMLineSymbol":null==r&&(r={paths:[[[0,0],[10,0]]]}),e.drawSymbol(t,r);break;case"CIMPolygonSymbol":null==r&&(r={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),e.drawSymbol(t,r);break;case"CIMTextSymbol":{const r={x:0,y:0};e.drawSymbol(t,r);break}case"CIMVectorMarker":{const r=new h;e.drawMarker(t,r);break}}return e.envelope()}function N(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset??0);default:return 0}}class Y{static getSymbolInflateSize(e,t,r,o,a){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,r,o,a):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),r=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+r*r)}static _vectorMarkerBounds(e,t,r,o){let a=!0;const i=s();if(t?.markerGraphics)for(const s of t.markerGraphics){const t=[0,0,0,0];s.geometry&&(n(i,s.geometry),t[0]=0,t[1]=0,t[2]=0,t[3]=0,this.getSymbolInflateSize(t,s.symbol,r,0,o),i[0]+=t[0],i[1]+=t[1],i[2]+=t[2],i[3]+=t[3],a?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],a=!1):(e[0]=Math.min(e[0],i[0]),e[1]=Math.min(e[1],i[1]),e[2]=Math.max(e[2],i[2]),e[3]=Math.max(e[3],i[3])))}return e}static _getInflateSize(e,t,r,o,a){if(ee(t)){const s=this._getLayersInflateSize(e,t.symbolLayers,r,o,a),i=g(t.effects);return i>0&&(s[0]-=i,s[1]-=i,s[2]+=i,s[3]+=i),s}return this._getTextInflatedSize(e,t,a)}static _getLayersInflateSize(e,t,r,o,a){let n=!0;if(!t)return e;for(const l of t){if(!l)continue;let t=[0,0,0,0];switch(l.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=l;let r=e.width;null!=r&&("Square"===e.capStyle||"Miter"===e.joinStyle?r/=j:r/=2,t[0]=-r,t[1]=-r,t[2]=r,t[3]=r);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const e=l;if("CIMVectorMarker"===l.type){const e=l;if(t=this._vectorMarkerBounds(t,e,r,a),e.frame){const r=(e.frame.xmin+e.frame.xmax)/2,o=(e.frame.ymin+e.frame.ymax)/2;if(t[0]-=r,t[1]-=o,t[2]-=r,t[3]-=o,null!=e.size){const r=e.size/(e.frame.ymax-e.frame.ymin);t[0]*=r,t[1]*=r,t[2]*=r,t[3]*=r}}}else if("CIMPictureMarker"===l.type){const o=l,a=r.getResource(o.url);let s=1;if(null!=a&&a.height&&(s=a.width/a.height),null!=e.size){const r=e.size/2,a=e.size*s*(o.scaleX??1)/2;t=[-a,-r,a,r]}}else if(null!=e.size){const r=e.size/2;t=[-r,-r,r,r]}if(e.anchorPoint){let r,o;"Absolute"===e.anchorPointUnits?(r=e.anchorPoint.x,o=e.anchorPoint.y):(r=e.anchorPoint.x*(t[2]-t[0]),o=e.anchorPoint.y*(t[3]-t[1]));const a=1.25*Math.sqrt(r*r+o*o);t[0]-=a,t[1]-=a,t[2]+=a,t[3]+=a}let n=b(e.rotation);if(e.rotateClockwise&&(n=-n),o&&(n-=o),n){const e=A*n,r=Math.cos(e),o=Math.sin(e),a=s([k,k,-k,-k]);i(a,[t[0]*r-t[1]*o,t[0]*o+t[1]*r]),i(a,[t[0]*r-t[3]*o,t[0]*o+t[3]*r]),i(a,[t[2]*r-t[1]*o,t[2]*o+t[1]*r]),i(a,[t[2]*r-t[3]*o,t[2]*o+t[3]*r]),t=a}let c=b(e.offsetX),m=b(e.offsetY);if(o){const e=A*o,t=Math.cos(e),r=Math.sin(e),a=c*r+m*t;c=c*t-m*r,m=a}t[0]+=c,t[1]+=m,t[2]+=c,t[3]+=m;const f=N(e.markerPlacement);f>0&&(t[0]-=f,t[1]-=f,t[2]+=f,t[3]+=f);break}}const c=g(l.effects);c>0&&(t[0]-=c,t[1]-=c,t[2]+=c,t[3]+=c),n?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],n=!1):(e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3]))}return e}static _getTextInflatedSize(e,t,r){const o=F(t.height??d.CIMTextSymbol.height);if(e[0]=-o/2,e[1]=-o/2,e[2]=o/2,e[3]=o/2,!r)return e;const a=r.get(t);if(!a)return e;if(!a.glyphMosaicItems.glyphs.length)return e;const{lineGapType:s,lineGap:i}=t,n=s?S(s,i??0,o):0,l=t.horizontalAlignment??d.CIMTextSymbol.horizontalalignment,c=t.verticalAlignment??d.CIMTextSymbol.verticalalignment,m="CIMBackgroundCallout"===t.callout?.type,f=z(a.glyphMosaicItems,{scale:o/P,angle:b(t.angle),xOffset:b(t.offsetX),yOffset:b(t.offsetY),horizontalAlignment:l,verticalAlignment:c,maxLineWidth:D(t.lineWidth),lineHeight:w*Math.max(.25,Math.min(n||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:m}).boundsT,y=Math.sqrt(f.width*f.width+f.height*f.height);return e[0]-=f.x+y,e[1]-=f.y-y,e[2]+=f.x+y,e[3]+=-f.y+y,e}}class _{static getEnvelope(e,t,r){if(!e)return null;const o=new u(r);if(Array.isArray(e)){let r;for(const a of e)r?r.union(V(o,a,t)):r=V(o,a,t);return r}return V(o,e,t)}static getTextureInfo(e,t,r,o,a){const s=o??this.getEnvelope(e,null,t);if(!s)return[0,0,0,0,1];const i=Math.max(s.width,s.height)*G;let n=null!=a?Math.max(a/i,1):1;n*=G,s.x*=n,s.y*=n,s.width*=n,s.height*=n,s.width=Math.max(Math.ceil(s.x+s.width)-Math.floor(s.x),1)-1,s.height=Math.max(Math.ceil(s.y+s.height)-Math.floor(s.y),1)-1;let l=s.x+.5*s.width,c=s.y+.5*s.height;return l+=s.x-Math.floor(s.x),c+=s.y-Math.floor(s.y),o||(s.width+=r,s.height+=r,l+=r/2,c+=r/2),[s.width,s.height,l,c,n]}static getTextureAnchor(e,t,r){const[o,a,s,i,n]=this.getTextureInfo(e,t,E,null,r);return[-s/o,-i/a,a/n*G]}static rasterize(e,t,r,o,a=!0,s){const[i,n,l,c,m]=this.getTextureInfo(t,o,E,r,s);e.width=i,e.height=n;const f=e.getContext("2d",{willReadFrequently:!0}),y=M.createScale(m,-m);y.translate(.5*i-l,.5*n+c);const u=new p(f,o,y);switch(t.type){case"CIMPointSymbol":{const e={type:"point",x:0,y:0};u.drawSymbol(t,e);break}case"CIMVectorMarker":{const e=new h;u.drawMarker(t,e);break}}const S=f.getImageData(0,0,e.width,e.height),d=new Uint8Array(S.data);if(a){let e;for(let t=0;t<d.length;t+=4)e=d[t+3]/255,d[t]=d[t]*e,d[t+1]=d[t+1]*e,d[t+2]=d[t+2]*e}return[d,e.width,e.height,-l/i,-c/n]}static fromTextSymbol(e){const{text:t}=e;return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:_.createCIMTextSymbolfromTextSymbol(e),textString:t}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(e){const{height:t,outline:r,width:o,xoffset:a,xscale:s,yoffset:i,yscale:n}=e,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(r){const e=oe(r);e&&l.push(e)}let m=e.url;"esriPFS"===e.type&&e.imageData&&(m=e.imageData);const f="angle"in e?e.angle??0:0,y=(o??0)*(s||1),h=(t??0)*(n||1);return l.push({type:"CIMPictureFill",enable:!0,invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:m,height:h,width:y,offsetX:b(a),offsetY:b(i),rotation:b(-f),colorSubstitutions:null}),c}static fromSimpleFillSymbol(e){const{color:r,style:o,outline:s}=e,i=[],n={type:"CIMPolygonSymbol",symbolLayers:i};if(s){const e=oe(s);e&&i.push(e)}if(o&&"solid"!==o&&"none"!==o&&"esriSFSSolid"!==o&&"esriSFSNull"!==o){const e={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:W(r),capStyle:"Butt",joinStyle:"Miter",width:.75}]};let s=0;const n=a(re(o)?8:10);switch(o){case"vertical":case"esriSFSVertical":s=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":s=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":s=45;break;case"cross":case"esriSFSCross":s=0}i.push({type:"CIMHatchFill",lineSymbol:e,offsetX:0,offsetY:0,rotation:s,separation:n}),"cross"===o||"esriSFSCross"===o?i.push({type:"CIMHatchFill",lineSymbol:t(e),offsetX:0,offsetY:0,rotation:90,separation:n}):"diagonal-cross"!==o&&"esriSFSDiagonalCross"!==o||i.push({type:"CIMHatchFill",lineSymbol:t(e),offsetX:0,offsetY:0,rotation:45,separation:n})}else!o||"solid"!==o&&"esriSFSSolid"!==o||i.push({type:"CIMSolidFill",enable:!0,color:W(r)});return n}static fromSimpleLineSymbol(e){const{cap:t,color:r,join:o,marker:a,miterLimit:s,style:i,width:n}=e;let l=null;"solid"!==i&&"none"!==i&&"esriSLSSolid"!==i&&"esriSLSNull"!==i&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:Z(i,t),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(a){let e;switch(a.placement){case"begin-end":e="Both";break;case"begin":e="JustBegin";break;case"end":e="JustEnd";break;default:e="None"}const t=_.fromSimpleMarker(a,n,r).symbolLayers[0];t.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,keepUpright:!1,offset:0,extremityPlacement:e,offsetAlongLine:0},c.push(t)}return c.push({type:"CIMSolidStroke",color:"none"!==i&&"esriSLSNull"!==i?W(r):[0,0,0,0],capStyle:q(t),joinStyle:H(o),miterLimit:s,width:n,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:s}=e;let i=e.url;return"esriPMS"===e.type&&e.imageData&&(i=e.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:i,size:r,width:o,offsetX:b(a),offsetY:b(s),rotation:b(-t)}]}}static createCIMTextSymbolfromTextSymbol(t){const{angle:r,color:o,font:a,haloColor:s,haloSize:i,horizontalAlignment:n,kerning:l,lineWidth:c,text:m,verticalAlignment:f,xoffset:y,yoffset:h,backgroundColor:u,borderLineColor:p,borderLineSize:S}=t;let M,d,g,x,C,I;a&&(M=a.family,d=a.style,g=a.weight,x=a.size,C=a.decoration);let k=!1;if(m){k=e(m)[1]}return(u||S)&&(I={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(u)},{type:"CIMSolidStroke",enable:!0,color:W(p),width:S??0}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:r,blockProgression:2,depth3D:1,extrapolateBaselines:!0,fontEffects:0,fontEncoding:1,fontFamilyName:M||"Arial",fontStyleName:J(d,g),fontType:0,haloSize:i,height:x,hinting:1,horizontalAlignment:O(n??"center"),kerning:l,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:c,offsetX:b(y),offsetY:b(h),strikethrough:"line-through"===C,underline:"underline"===C,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(o)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(s)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:k?1:0,verticalAlignment:$(f??"baseline"),verticalGlyphOrientation:0,wordSpacing:100,billboardMode3D:2,callout:I}}static createPictureMarkerRasterizationParam(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:s}=e,i=e.url??e.source?.url??e.source?.imageData;return i?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureMarker",enable:!0,invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:i,size:r,width:o,offsetX:b(a),offsetY:b(s),rotation:b(-t)}}:null}static createPictureFillRasterizationParam(e){const{width:t,height:r,xoffset:o,yoffset:a,url:s}=e;return s?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",enable:!0,scaleX:1,textureFilter:"Picture",tintColor:null,url:s,width:t,height:r,offsetX:b(o),offsetY:b(a),rotation:0}}:null}static fromSimpleMarker(e,t,r){const{style:o}=e,a=e.color??r;if("path"===o||"esriSMSPath"===o){const t=[];if("outline"in e&&e.outline){const r=e.outline;t.push({type:"CIMSolidStroke",enable:!0,width:r.width,color:W(r.color),path:e.path})}t.push({type:"CIMSolidFill",enable:!0,color:W(a),path:e.path});const[r,o]=te("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-b(e.angle),size:b(e.size||6),offsetX:b(e.xoffset),offsetY:b(e.yoffset),scaleSymbolsProportionally:!1,frame:r,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:{type:"CIMPolygonSymbol",symbolLayers:t}}]}]}}const s=[];let i,n,l=e.size;if("outline"in e&&e.outline&&"none"!==e.outline.style&&"esriSLSNull"!==e.outline.style){const t=e.outline,r="solid"!==t.style&&"esriSLSSolid"!==t.style;[i,n]=r?te(o,e.size):te(o);const a=t.width??I.width;if(r){const t=a/e.size,r=(i.xmax-i.xmin)*t/2,o=(i.ymax-i.ymin)*t/2;i.xmin-=r,i.xmax+=r,i.ymin-=o,i.ymax+=o,l&&(l+=a)}const c="cross"!==e.style&&"x"!==e.style||"dot"===e?.outline.style||"short-dot"===e?.outline.style?"HalfGap":"FullPattern",m=r?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Z(t.style,null).map(e=>t.width&&t.width>0?e*t.width:e),lineDashEnding:c,controlPointEnding:"FullPattern"}]:void 0;s.push({type:"CIMSolidStroke",capStyle:r?"Round":"Butt",enable:!0,width:a,color:W(t.color),effects:m})}else!t||"line-marker"!==e.type||"cross"!==e.style&&"x"!==e.style?[i,n]=te(o):([i,n]=te(o),s.push({type:"CIMSolidStroke",enable:!0,width:t,color:W(a)}));s.push({type:"CIMSolidFill",enable:!0,color:W(a)});const c={type:"CIMPolygonSymbol",symbolLayers:s};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:b(-e.angle),size:b(l||6*t),offsetX:b(e.xoffset),offsetY:b(e.yoffset),scaleSymbolsProportionally:!1,frame:i,markerGraphics:[{type:"CIMMarkerGraphic",geometry:n,symbol:c}]}]}}static fromCIMHatchFill(e,r){const o=r*(e.separation??d.CIMHatchFill.separation),a=o/2,s=t(e.lineSymbol);s.symbolLayers?.forEach(e=>{switch(e.type){case"CIMSolidStroke":null!=e.width&&(e.width*=r),e.effects?.forEach(e=>{if("CIMGeometricEffectDashes"===e.type){const t=e.dashTemplate;e.dashTemplate=t?.map(e=>e*r)}});break;case"CIMVectorMarker":{null!=e.size&&(e.size*=r);const t=e.markerPlacement;null!=t&&"placementTemplate"in t&&(t.placementTemplate=t.placementTemplate.map(e=>e*r));break}}});let i=this._getLineSymbolPeriod(s)||R;for(;i<R;)i*=2;const n=i/2;return{type:"CIMVectorMarker",enable:!0,frame:{xmin:-n,xmax:n,ymin:-a,ymax:a},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-n,0],[n,0]]]},symbol:s}],size:o}}static async normalizeSymbolAndFetchResources(e,t,r=null){if(!e)return;const o=[];if("effects"in e&&e.effects)for(const s of e.effects)o.push(f(s));async function a(e){if("CIMTextSymbol"!==e.type)return;const{fontFamilyName:r,fontStyleName:o}=e;if("calcitewebcoreicons"===r?.toLowerCase())return;const{style:a,weight:s}=x(o),i=C(e),n=new m({family:r,style:a,weight:s,decoration:i});try{await t.loadFont(n)}catch{B().error(`Unsupported font ${r} in CIM symbol`)}}o.push(a(e)),U(e,e=>{if(e.effects)for(const t of e.effects)o.push(f(t));if("CIMVectorMarker"===e.type){for(const t of e.markerGraphics)l(t.geometry)&&(t.geometry=c(t.geometry,{maxDeviation:.01}));e.markerPlacement&&o.push(y(e.markerPlacement))}"url"in e&&e.url&&o.push(t.fetchResource(e.url,{signal:r})),"symbol"in e&&o.push(a(e.symbol))}),await Promise.all(o)}static _getLineSymbolPeriod(e){if(e){const t=this._getEffectsRepeat(e.effects);if(t)return t;if(e.symbolLayers)for(const r of e.symbolLayers)if(r){const e=this._getEffectsRepeat(r.effects);if(e)return e;switch(r.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const e=this._getPlacementRepeat(r.markerPlacement);if(e)return e}}}}return 0}static _getEffectsRepeat(e){if(e)for(const t of e)if(t)switch(t.type){case"CIMGeometricEffectDashes":{const e=t.dashTemplate;if(e&&e.length){let t=0;for(const r of e)t+=r;return 1&e.length&&(t*=2),t}break}case"CIMGeometricEffectWave":return t.period;default:B().error(`unsupported geometric effect type ${t.type}`)}return 0}static _getPlacementRepeat(e){if(e)switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const t=e.placementTemplate;if(t&&t.length){let e=0;for(const r of t)e+=+r;return 1&t.length&&(e*=2),e}break}}return 0}static fromCIMInsidePolygon(e){const t=e.markerPlacement,r={...e};r.markerPlacement=null,r.anchorPoint=null;const s=Math.abs(t.stepX),i=Math.abs(t.stepY),n=(t.randomness??100)/100;let l,c,m,f;if("Random"===t.gridType){const e=a(L),r=Math.max(Math.floor(e/s),1),y=Math.max(Math.floor(e/i),1);l=r*s/2,c=y*i/2,m=2*c;const h=new o(t.seed),u=n*s/1.5,p=n*i/1.5;f=[];for(let t=0;t<r;t++)for(let e=0;e<y;e++){const r=t*s-l+u*(.5-h.getFloat()),o=e*i-c+p*(.5-h.getFloat());f.push({x:r,y:o}),0===t&&f.push({x:r+2*l,y:o}),0===e&&f.push({x:r,y:o+2*c})}}else!0===t.shiftOddRows?(l=s/2,c=i,m=2*i,f=[{x:-l,y:0},{x:l,y:0},{x:0,y:c},{x:0,y:-c}]):(l=s/2,c=i/2,m=i,f=[{x:-s,y:0},{x:0,y:-i},{x:-s,y:-i},{x:0,y:0},{x:s,y:0},{x:0,y:i},{x:s,y:i},{x:-s,y:i},{x:s,y:-i}]);return{type:"CIMVectorMarker",enable:!0,frame:{xmin:-l,xmax:l,ymin:-c,ymax:c},markerGraphics:f.map(e=>({type:"CIMMarkerGraphic",geometry:e,symbol:{type:"CIMPointSymbol",symbolLayers:[r]}})),size:m}}}function U(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const r=e.symbolLayers;if(!r)return;for(const e of r)if(t(e),"CIMVectorMarker"===e.type){const r=e.markerGraphics;if(!r)continue;for(const e of r)if(e){const r=e.symbol;r&&U(r,t)}}break}}}const q=e=>{if(!e)return"Butt";switch(e){case"butt":return"Butt";case"square":return"Square";case"round":return"Round"}},H=e=>{if(!e)return"Miter";switch(e){case"miter":return"Miter";case"round":return"Round";case"bevel":return"Bevel"}},O=e=>{if(null==e)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center";case"justify":return"Justify"}},$=e=>{if(null==e)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},W=e=>{if(!e)return[0,0,0,0];const{r:t,g:r,b:o,a}=e;return[t,r,o,255*a]},J=(e,t)=>{const r=K(t),o=Q(e);return r&&o?`${r}-${o}`:`${r}${o}`},K=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},Q=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Z=(e,t)=>{const r=.001,o="butt"===t;switch(e){case"dash":case"esriSLSDash":return o?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return o?[4,3,1,3]:[3,4,r,4];case"dot":case"esriSLSDot":return o?[1,3]:[r,4];case"long-dash":case"esriSLSLongDash":return o?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return o?[8,3,1,3]:[7,4,r,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return o?[8,3,1,3,1,3]:[7,4,r,4,r,4];case"short-dash":case"esriSLSShortDash":return o?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return o?[4,1,1,1]:[3,2,r,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return o?[4,1,1,1,1,1]:[3,2,r,2,r,2];case"short-dot":case"esriSLSShortDot":return o?[1,1]:[r,2];case"solid":case"esriSLSSolid":case"none":return B().error("Unexpected: style does not require rasterization"),[0,0];default:return B().error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function ee(e){return void 0!==e.symbolLayers}const te=(e,t=100)=>{const r=t/2;let o,a;const s=e;if("circle"===s||"esriSMSCircle"===s){const e=.25;let t=Math.acos(1-e/r),s=Math.ceil(T/t/4);0===s&&(s=1),t=v/s,s*=4;const i=[];i.push([r,0]);for(let o=1;o<s;o++)i.push([r*Math.cos(o*t),-r*Math.sin(o*t)]);i.push([r,0]),o={rings:[i]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("cross"===s||"esriSMSCross"===s){const e=0;o={paths:[[[e,r],[e,-r]],[[r,e],[-r,e]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("diamond"===s||"esriSMSDiamond"===s)o={rings:[[[-r,0],[0,r],[r,0],[0,-r],[-r,0]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("square"===s||"esriSMSSquare"===s)o={rings:[[[-r,-r],[-r,r],[r,r],[r,-r],[-r,-r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("x"===s||"esriSMSX"===s)o={paths:[[[r,r],[-r,-r]],[[r,-r],[-r,r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("triangle"===s||"esriSMSTriangle"===s){const e=t*.5773502691896257,r=-e,s=2/3*t,i=s-t;o={rings:[[[r,i],[0,s],[e,i],[r,i]]]},a={xmin:r,ymin:i,xmax:e,ymax:s}}else"arrow"===s&&(o={rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r});return[a,o]},re=e=>"vertical"===e||"horizontal"===e||"cross"===e||"esriSFSCross"===e||"esriSFSVertical"===e||"esriSFSHorizontal"===e;function oe(e){if(!e)return null;let t=null;const{cap:r,color:o,join:a,miterLimit:s,style:i,width:n}=e;return"solid"!==i&&"none"!==i&&"esriSLSSolid"!==i&&"esriSLSNull"!==i&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Z(i,r),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:"esriSLSNull"!==i&&"none"!==i?W(o):[0,0,0,0],capStyle:q(r),joinStyle:H(a),miterLimit:s,width:n,effects:t}}export{_ as CIMSymbolHelper,Y as CIMSymbolInflatedSizeHelper,q as capTypeToEnum,U as forEachSymbolLayer,Z as slsDashToTemplateArray,X as symbolToCIM};
|
|
2
|
+
import{bidiText as e}from"../../core/BidiText.js";import{clone as t}from"../../core/lang.js";import r from"../../core/Logger.js";import o from"../../core/RandomLCG.js";import{px2pt as a}from"../../core/screenUtils.js";import{create as s,expandPointInPlace as i}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as n}from"../../geometry/support/boundsUtils.js";import{isCurvedGeometry as l}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as c}from"../../geometry/support/curves/densifyCurvedGeometry.js";import m from"../Font.js";import{loadGeometryOperatorsForEffect as f,loadGeometryOperatorsForPlacement as y}from"./CIMEffects.js";import{Placement as h}from"./CIMPlacements.js";import{EnvDrawHelper as u,CanvasDrawHelper as p,lineGapType2LineHeight as S,Transformation as M}from"./CIMSymbolDrawHelper.js";import{defaultCIMValues as d}from"./defaultCIMValues.js";import{getEffectsInflateSize as g,getNumericValue as b,fromCIMFontStyle as x,fromCIMFontDecoration as C}from"./utils.js";import{defaultPolylineSymbol2D as I}from"../support/defaults.js";import{cInfinity as k}from"../../views/2d/engine/vectorTiles/GeometryUtils.js";import{magicLabelLineHeight as w,glyphSize as P,randomInsidePolygonTextureSize as L}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as z}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as F,getLineWidth as D}from"../../views/2d/layers/graphics/graphicsUtils.js";const T=Math.PI,v=T/2,A=Math.PI/180,G=96/72,j=1.4142135623730951,E=2,R=4,B=()=>r.getLogger("esri.symbols.cim.CIMSymbolHelper");function X(e){let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":{const r=_.fromSimpleMarker(e);if(!r)throw new Error("InternalError: Cannot convert symbol to CIM");t=r;break}case"picture-marker":t=_.fromPictureMarker(e);break;case"simple-line":t=_.fromSimpleLineSymbol(e);break;case"simple-fill":t=_.fromSimpleFillSymbol(e);break;case"picture-fill":t=_.fromPictureFillSymbol(e);break;case"text":t=_.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function V(e,t,r){switch(t.type){case"CIMSymbolReference":return V(e,t.symbol,r);case"CIMPointSymbol":null==r&&(r={x:0,y:0}),e.drawSymbol(t,r);break;case"CIMLineSymbol":null==r&&(r={paths:[[[0,0],[10,0]]]}),e.drawSymbol(t,r);break;case"CIMPolygonSymbol":null==r&&(r={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),e.drawSymbol(t,r);break;case"CIMTextSymbol":{const r={x:0,y:0};e.drawSymbol(t,r);break}case"CIMVectorMarker":{const r=new h;e.drawMarker(t,r);break}}return e.envelope()}function N(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset??0);default:return 0}}class Y{static getSymbolInflateSize(e,t,r,o,a){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,r,o,a):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),r=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+r*r)}static _vectorMarkerBounds(e,t,r,o){let a=!0;const i=s();if(t?.markerGraphics)for(const s of t.markerGraphics){const t=[0,0,0,0];s.geometry&&(n(i,s.geometry),t[0]=0,t[1]=0,t[2]=0,t[3]=0,this.getSymbolInflateSize(t,s.symbol,r,0,o),i[0]+=t[0],i[1]+=t[1],i[2]+=t[2],i[3]+=t[3],a?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],a=!1):(e[0]=Math.min(e[0],i[0]),e[1]=Math.min(e[1],i[1]),e[2]=Math.max(e[2],i[2]),e[3]=Math.max(e[3],i[3])))}return e}static _getInflateSize(e,t,r,o,a){if(ee(t)){const s=this._getLayersInflateSize(e,t.symbolLayers,r,o,a),i=g(t.effects);return i>0&&(s[0]-=i,s[1]-=i,s[2]+=i,s[3]+=i),s}return this._getTextInflatedSize(e,t,a)}static _getLayersInflateSize(e,t,r,o,a){let n=!0;if(!t)return e;for(const l of t){if(!l)continue;let t=[0,0,0,0];switch(l.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=l;let r=e.width;null!=r&&("Square"===e.capStyle||"Miter"===e.joinStyle?r/=j:r/=2,t[0]=-r,t[1]=-r,t[2]=r,t[3]=r);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const e=l;if("CIMVectorMarker"===l.type){const e=l;if(t=this._vectorMarkerBounds(t,e,r,a),e.frame){const r=(e.frame.xmin+e.frame.xmax)/2,o=(e.frame.ymin+e.frame.ymax)/2;if(t[0]-=r,t[1]-=o,t[2]-=r,t[3]-=o,null!=e.size){const r=e.size/(e.frame.ymax-e.frame.ymin);t[0]*=r,t[1]*=r,t[2]*=r,t[3]*=r}}}else if("CIMPictureMarker"===l.type){const o=l,a=r.getResource(o.url);let s=1;if(null!=a&&a.height&&(s=a.width/a.height),null!=e.size){const r=e.size/2,a=e.size*s*(o.scaleX??1)/2;t=[-a,-r,a,r]}}else if(null!=e.size){const r=e.size/2;t=[-r,-r,r,r]}if(e.anchorPoint){let r,o;"Absolute"===e.anchorPointUnits?(r=e.anchorPoint.x,o=e.anchorPoint.y):(r=e.anchorPoint.x*(t[2]-t[0]),o=e.anchorPoint.y*(t[3]-t[1]));const a=1.25*Math.sqrt(r*r+o*o);t[0]-=a,t[1]-=a,t[2]+=a,t[3]+=a}let n=b(e.rotation);if(e.rotateClockwise&&(n=-n),o&&(n-=o),n){const e=A*n,r=Math.cos(e),o=Math.sin(e),a=s([k,k,-k,-k]);i(a,[t[0]*r-t[1]*o,t[0]*o+t[1]*r]),i(a,[t[0]*r-t[3]*o,t[0]*o+t[3]*r]),i(a,[t[2]*r-t[1]*o,t[2]*o+t[1]*r]),i(a,[t[2]*r-t[3]*o,t[2]*o+t[3]*r]),t=a}let c=b(e.offsetX),m=b(e.offsetY);if(o){const e=A*o,t=Math.cos(e),r=Math.sin(e),a=c*r+m*t;c=c*t-m*r,m=a}t[0]+=c,t[1]+=m,t[2]+=c,t[3]+=m;const f=N(e.markerPlacement);f>0&&(t[0]-=f,t[1]-=f,t[2]+=f,t[3]+=f);break}}const c=g(l.effects);c>0&&(t[0]-=c,t[1]-=c,t[2]+=c,t[3]+=c),n?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],n=!1):(e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3]))}return e}static _getTextInflatedSize(e,t,r){const o=F(t.height??d.CIMTextSymbol.height);if(e[0]=-o/2,e[1]=-o/2,e[2]=o/2,e[3]=o/2,!r)return e;const a=r.get(t);if(!a)return e;if(!a.glyphMosaicItems.glyphs.length)return e;const{lineGapType:s,lineGap:i}=t,n=s?S(s,i??0,o):0,l=t.horizontalAlignment??d.CIMTextSymbol.horizontalalignment,c=t.verticalAlignment??d.CIMTextSymbol.verticalalignment,m="CIMBackgroundCallout"===t.callout?.type,f=z(a.glyphMosaicItems,{scale:o/P,angle:b(t.angle),xOffset:b(t.offsetX),yOffset:b(t.offsetY),horizontalAlignment:l,verticalAlignment:c,maxLineWidth:D(t.lineWidth),lineHeight:w*Math.max(.25,Math.min(n||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:m}).boundsT,y=Math.sqrt(f.width*f.width+f.height*f.height);return e[0]-=f.x+y,e[1]-=f.y-y,e[2]+=f.x+y,e[3]+=-f.y+y,e}}class _{static getEnvelope(e,t,r,o){if(!e)return null;const a=new u(r,o);if(Array.isArray(e)){let r;for(const o of e)r?r.union(V(a,o,t)):r=V(a,o,t);return r}return V(a,e,t)}static getTextureInfo(e,t,r,o,a){const s=o??this.getEnvelope(e,null,t);if(!s)return[0,0,0,0,1];const i=Math.max(s.width,s.height)*G;let n=null!=a?Math.max(a/i,1):1;n*=G,s.x*=n,s.y*=n,s.width*=n,s.height*=n,s.width=Math.max(Math.ceil(s.x+s.width)-Math.floor(s.x),1)-1,s.height=Math.max(Math.ceil(s.y+s.height)-Math.floor(s.y),1)-1;let l=s.x+.5*s.width,c=s.y+.5*s.height;return l+=s.x-Math.floor(s.x),c+=s.y-Math.floor(s.y),o||(s.width+=r,s.height+=r,l+=r/2,c+=r/2),[s.width,s.height,l,c,n]}static getTextureAnchor(e,t,r){const[o,a,s,i,n]=this.getTextureInfo(e,t,E,null,r);return[-s/o,-i/a,a/n*G]}static rasterize(e,t,r,o,a=!0,s){const[i,n,l,c,m]=this.getTextureInfo(t,o,E,r,s);e.width=i,e.height=n;const f=e.getContext("2d",{willReadFrequently:!0}),y=M.createScale(m,-m);y.translate(.5*i-l,.5*n+c);const u=new p(f,o,y);switch(t.type){case"CIMPointSymbol":{const e={type:"point",x:0,y:0};u.drawSymbol(t,e);break}case"CIMVectorMarker":{const e=new h;u.drawMarker(t,e);break}}const S=f.getImageData(0,0,e.width,e.height),d=new Uint8Array(S.data);if(a){let e;for(let t=0;t<d.length;t+=4)e=d[t+3]/255,d[t]=d[t]*e,d[t+1]=d[t+1]*e,d[t+2]=d[t+2]*e}return[d,e.width,e.height,-l/i,-c/n]}static fromTextSymbol(e){const{text:t}=e;return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:_.createCIMTextSymbolfromTextSymbol(e),textString:t}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(e){const{height:t,outline:r,width:o,xoffset:a,xscale:s,yoffset:i,yscale:n}=e,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(r){const e=oe(r);e&&l.push(e)}let m=e.url;"esriPFS"===e.type&&e.imageData&&(m=e.imageData);const f="angle"in e?e.angle??0:0,y=(o??0)*(s||1),h=(t??0)*(n||1);return l.push({type:"CIMPictureFill",enable:!0,invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:m,height:h,width:y,offsetX:b(a),offsetY:b(i),rotation:b(-f),colorSubstitutions:null}),c}static fromSimpleFillSymbol(e){const{color:r,style:o,outline:s}=e,i=[],n={type:"CIMPolygonSymbol",symbolLayers:i};if(s){const e=oe(s);e&&i.push(e)}if(o&&"solid"!==o&&"none"!==o&&"esriSFSSolid"!==o&&"esriSFSNull"!==o){const e={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:W(r),capStyle:"Butt",joinStyle:"Miter",width:.75}]};let s=0;const n=a(re(o)?8:10);switch(o){case"vertical":case"esriSFSVertical":s=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":s=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":s=45;break;case"cross":case"esriSFSCross":s=0}i.push({type:"CIMHatchFill",lineSymbol:e,offsetX:0,offsetY:0,rotation:s,separation:n}),"cross"===o||"esriSFSCross"===o?i.push({type:"CIMHatchFill",lineSymbol:t(e),offsetX:0,offsetY:0,rotation:90,separation:n}):"diagonal-cross"!==o&&"esriSFSDiagonalCross"!==o||i.push({type:"CIMHatchFill",lineSymbol:t(e),offsetX:0,offsetY:0,rotation:45,separation:n})}else!o||"solid"!==o&&"esriSFSSolid"!==o||i.push({type:"CIMSolidFill",enable:!0,color:W(r)});return n}static fromSimpleLineSymbol(e){const{cap:t,color:r,join:o,marker:a,miterLimit:s,style:i,width:n}=e;let l=null;"solid"!==i&&"none"!==i&&"esriSLSSolid"!==i&&"esriSLSNull"!==i&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:Z(i,t),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(a){let e;switch(a.placement){case"begin-end":e="Both";break;case"begin":e="JustBegin";break;case"end":e="JustEnd";break;default:e="None"}const t=_.fromSimpleMarker(a,n,r).symbolLayers[0];t.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,keepUpright:!1,offset:0,extremityPlacement:e,offsetAlongLine:0},c.push(t)}return c.push({type:"CIMSolidStroke",color:"none"!==i&&"esriSLSNull"!==i?W(r):[0,0,0,0],capStyle:q(t),joinStyle:H(o),miterLimit:s,width:n,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:s}=e;let i=e.url;return"esriPMS"===e.type&&e.imageData&&(i=e.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:i,size:r,width:o,offsetX:b(a),offsetY:b(s),rotation:b(-t)}]}}static createCIMTextSymbolfromTextSymbol(t){const{angle:r,color:o,font:a,haloColor:s,haloSize:i,horizontalAlignment:n,kerning:l,lineWidth:c,text:m,verticalAlignment:f,xoffset:y,yoffset:h,backgroundColor:u,borderLineColor:p,borderLineSize:S}=t;let M,d,g,x,C,I;a&&(M=a.family,d=a.style,g=a.weight,x=a.size,C=a.decoration);let k=!1;if(m){k=e(m)[1]}return(u||S)&&(I={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(u)},{type:"CIMSolidStroke",enable:!0,color:W(p),width:S??0}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:r,blockProgression:2,depth3D:1,extrapolateBaselines:!0,fontEffects:0,fontEncoding:1,fontFamilyName:M||"Arial",fontStyleName:J(d,g),fontType:0,haloSize:i,height:x,hinting:1,horizontalAlignment:O(n??"center"),kerning:l,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:c,offsetX:b(y),offsetY:b(h),strikethrough:"line-through"===C,underline:"underline"===C,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(o)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(s)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:k?1:0,verticalAlignment:$(f??"baseline"),verticalGlyphOrientation:0,wordSpacing:100,billboardMode3D:2,callout:I}}static createPictureMarkerRasterizationParam(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:s}=e,i=e.url??e.source?.url??e.source?.imageData;return i?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureMarker",enable:!0,invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:i,size:r,width:o,offsetX:b(a),offsetY:b(s),rotation:b(-t)}}:null}static createPictureFillRasterizationParam(e){const{width:t,height:r,xoffset:o,yoffset:a,url:s}=e;return s?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",enable:!0,scaleX:1,textureFilter:"Picture",tintColor:null,url:s,width:t,height:r,offsetX:b(o),offsetY:b(a),rotation:0}}:null}static fromSimpleMarker(e,t,r){const{style:o}=e,a=e.color??r;if("path"===o||"esriSMSPath"===o){const t=[];if("outline"in e&&e.outline){const r=e.outline;t.push({type:"CIMSolidStroke",enable:!0,width:r.width,color:W(r.color),path:e.path})}t.push({type:"CIMSolidFill",enable:!0,color:W(a),path:e.path});const[r,o]=te("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-b(e.angle),size:b(e.size||6),offsetX:b(e.xoffset),offsetY:b(e.yoffset),scaleSymbolsProportionally:!1,frame:r,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:{type:"CIMPolygonSymbol",symbolLayers:t}}]}]}}const s=[];let i,n,l=e.size;if("outline"in e&&e.outline&&"none"!==e.outline.style&&"esriSLSNull"!==e.outline.style){const t=e.outline,r="solid"!==t.style&&"esriSLSSolid"!==t.style;[i,n]=r?te(o,e.size):te(o);const a=t.width??I.width;if(r){const t=a/e.size,r=(i.xmax-i.xmin)*t/2,o=(i.ymax-i.ymin)*t/2;i.xmin-=r,i.xmax+=r,i.ymin-=o,i.ymax+=o,l&&(l+=a)}const c="cross"!==e.style&&"x"!==e.style||"dot"===e?.outline.style||"short-dot"===e?.outline.style?"HalfGap":"FullPattern",m=r?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Z(t.style,null).map(e=>t.width&&t.width>0?e*t.width:e),lineDashEnding:c,controlPointEnding:"FullPattern"}]:void 0;s.push({type:"CIMSolidStroke",capStyle:r?"Round":"Butt",enable:!0,width:a,color:W(t.color),effects:m})}else!t||"line-marker"!==e.type||"cross"!==e.style&&"x"!==e.style?[i,n]=te(o):([i,n]=te(o),s.push({type:"CIMSolidStroke",enable:!0,width:t,color:W(a)}));s.push({type:"CIMSolidFill",enable:!0,color:W(a)});const c={type:"CIMPolygonSymbol",symbolLayers:s};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:b(-e.angle),size:b(l||6*t),offsetX:b(e.xoffset),offsetY:b(e.yoffset),scaleSymbolsProportionally:!1,frame:i,markerGraphics:[{type:"CIMMarkerGraphic",geometry:n,symbol:c}]}]}}static fromCIMHatchFill(e,r){const o=r*(e.separation??d.CIMHatchFill.separation),a=o/2,s=t(e.lineSymbol);s.symbolLayers?.forEach(e=>{switch(e.type){case"CIMSolidStroke":null!=e.width&&(e.width*=r),e.effects?.forEach(e=>{if("CIMGeometricEffectDashes"===e.type){const t=e.dashTemplate;e.dashTemplate=t?.map(e=>e*r)}});break;case"CIMVectorMarker":{null!=e.size&&(e.size*=r);const t=e.markerPlacement;null!=t&&"placementTemplate"in t&&(t.placementTemplate=t.placementTemplate.map(e=>e*r));break}}});let i=this._getLineSymbolPeriod(s)||R;for(;i<R;)i*=2;const n=i/2;return{type:"CIMVectorMarker",enable:!0,frame:{xmin:-n,xmax:n,ymin:-a,ymax:a},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-n,0],[n,0]]]},symbol:s}],size:o}}static async normalizeSymbolAndFetchResources(e,t,r=null){if(!e)return;const o=[];if("effects"in e&&e.effects)for(const s of e.effects)o.push(f(s));async function a(e){if("CIMTextSymbol"!==e.type)return;const{fontFamilyName:r,fontStyleName:o}=e;if("calcitewebcoreicons"===r?.toLowerCase())return;const{style:a,weight:s}=x(o),i=C(e),n=new m({family:r,style:a,weight:s,decoration:i});try{await t.loadFont(n)}catch{B().error(`Unsupported font ${r} in CIM symbol`)}}o.push(a(e)),U(e,e=>{if(e.effects)for(const t of e.effects)o.push(f(t));if("CIMVectorMarker"===e.type){for(const t of e.markerGraphics)l(t.geometry)&&(t.geometry=c(t.geometry,{maxDeviation:.01}));e.markerPlacement&&o.push(y(e.markerPlacement))}"url"in e&&e.url&&o.push(t.fetchResource(e.url,{signal:r})),"symbol"in e&&o.push(a(e.symbol))}),await Promise.all(o)}static _getLineSymbolPeriod(e){if(e){const t=this._getEffectsRepeat(e.effects);if(t)return t;if(e.symbolLayers)for(const r of e.symbolLayers)if(r){const e=this._getEffectsRepeat(r.effects);if(e)return e;switch(r.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const e=this._getPlacementRepeat(r.markerPlacement);if(e)return e}}}}return 0}static _getEffectsRepeat(e){if(e)for(const t of e)if(t)switch(t.type){case"CIMGeometricEffectDashes":{const e=t.dashTemplate;if(e&&e.length){let t=0;for(const r of e)t+=r;return 1&e.length&&(t*=2),t}break}case"CIMGeometricEffectWave":return t.period;default:B().error(`unsupported geometric effect type ${t.type}`)}return 0}static _getPlacementRepeat(e){if(e)switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const t=e.placementTemplate;if(t&&t.length){let e=0;for(const r of t)e+=+r;return 1&t.length&&(e*=2),e}break}}return 0}static fromCIMInsidePolygon(e){const t=e.markerPlacement,r={...e};r.markerPlacement=null,r.anchorPoint=null;const s=Math.abs(t.stepX),i=Math.abs(t.stepY),n=(t.randomness??100)/100;let l,c,m,f;if("Random"===t.gridType){const e=a(L),r=Math.max(Math.floor(e/s),1),y=Math.max(Math.floor(e/i),1);l=r*s/2,c=y*i/2,m=2*c;const h=new o(t.seed),u=n*s/1.5,p=n*i/1.5;f=[];for(let t=0;t<r;t++)for(let e=0;e<y;e++){const r=t*s-l+u*(.5-h.getFloat()),o=e*i-c+p*(.5-h.getFloat());f.push({x:r,y:o}),0===t&&f.push({x:r+2*l,y:o}),0===e&&f.push({x:r,y:o+2*c})}}else!0===t.shiftOddRows?(l=s/2,c=i,m=2*i,f=[{x:-l,y:0},{x:l,y:0},{x:0,y:c},{x:0,y:-c}]):(l=s/2,c=i/2,m=i,f=[{x:-s,y:0},{x:0,y:-i},{x:-s,y:-i},{x:0,y:0},{x:s,y:0},{x:0,y:i},{x:s,y:i},{x:-s,y:i},{x:s,y:-i}]);return{type:"CIMVectorMarker",enable:!0,frame:{xmin:-l,xmax:l,ymin:-c,ymax:c},markerGraphics:f.map(e=>({type:"CIMMarkerGraphic",geometry:e,symbol:{type:"CIMPointSymbol",symbolLayers:[r]}})),size:m}}}function U(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const r=e.symbolLayers;if(!r)return;for(const e of r)if(t(e),"CIMVectorMarker"===e.type){const r=e.markerGraphics;if(!r)continue;for(const e of r)if(e){const r=e.symbol;r&&U(r,t)}}break}}}const q=e=>{if(!e)return"Butt";switch(e){case"butt":return"Butt";case"square":return"Square";case"round":return"Round"}},H=e=>{if(!e)return"Miter";switch(e){case"miter":return"Miter";case"round":return"Round";case"bevel":return"Bevel"}},O=e=>{if(null==e)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center";case"justify":return"Justify"}},$=e=>{if(null==e)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},W=e=>{if(!e)return[0,0,0,0];const{r:t,g:r,b:o,a}=e;return[t,r,o,255*a]},J=(e,t)=>{const r=K(t),o=Q(e);return r&&o?`${r}-${o}`:`${r}${o}`},K=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},Q=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Z=(e,t)=>{const r=.001,o="butt"===t;switch(e){case"dash":case"esriSLSDash":return o?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return o?[4,3,1,3]:[3,4,r,4];case"dot":case"esriSLSDot":return o?[1,3]:[r,4];case"long-dash":case"esriSLSLongDash":return o?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return o?[8,3,1,3]:[7,4,r,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return o?[8,3,1,3,1,3]:[7,4,r,4,r,4];case"short-dash":case"esriSLSShortDash":return o?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return o?[4,1,1,1]:[3,2,r,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return o?[4,1,1,1,1,1]:[3,2,r,2,r,2];case"short-dot":case"esriSLSShortDot":return o?[1,1]:[r,2];case"solid":case"esriSLSSolid":case"none":return B().error("Unexpected: style does not require rasterization"),[0,0];default:return B().error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function ee(e){return void 0!==e.symbolLayers}const te=(e,t=100)=>{const r=t/2;let o,a;const s=e;if("circle"===s||"esriSMSCircle"===s){const e=.25;let t=Math.acos(1-e/r),s=Math.ceil(T/t/4);0===s&&(s=1),t=v/s,s*=4;const i=[];i.push([r,0]);for(let o=1;o<s;o++)i.push([r*Math.cos(o*t),-r*Math.sin(o*t)]);i.push([r,0]),o={rings:[i]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("cross"===s||"esriSMSCross"===s){const e=0;o={paths:[[[e,r],[e,-r]],[[r,e],[-r,e]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("diamond"===s||"esriSMSDiamond"===s)o={rings:[[[-r,0],[0,r],[r,0],[0,-r],[-r,0]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("square"===s||"esriSMSSquare"===s)o={rings:[[[-r,-r],[-r,r],[r,r],[r,-r],[-r,-r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("x"===s||"esriSMSX"===s)o={paths:[[[r,r],[-r,-r]],[[r,-r],[-r,r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("triangle"===s||"esriSMSTriangle"===s){const e=t*.5773502691896257,r=-e,s=2/3*t,i=s-t;o={rings:[[[r,i],[0,s],[e,i],[r,i]]]},a={xmin:r,ymin:i,xmax:e,ymax:s}}else"arrow"===s&&(o={rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r});return[a,o]},re=e=>"vertical"===e||"horizontal"===e||"cross"===e||"esriSFSCross"===e||"esriSFSVertical"===e||"esriSFSHorizontal"===e;function oe(e){if(!e)return null;let t=null;const{cap:r,color:o,join:a,miterLimit:s,style:i,width:n}=e;return"solid"!==i&&"none"!==i&&"esriSLSSolid"!==i&&"esriSLSNull"!==i&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Z(i,r),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:"esriSLSNull"!==i&&"none"!==i?W(o):[0,0,0,0],capStyle:q(r),joinStyle:H(a),miterLimit:s,width:n,effects:t}}export{_ as CIMSymbolHelper,Y as CIMSymbolInflatedSizeHelper,q as capTypeToEnum,U as forEachSymbolLayer,Z as slsDashToTemplateArray,X as symbolToCIM};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import t from"../../core/Logger.js";import{animationDebugFlags as
|
|
2
|
+
import t from"../../core/Logger.js";import{animationDebugFlags as e}from"./animationDebugFlags.js";import{defaultCIMValues as n}from"./defaultCIMValues.js";import{getExtent as o}from"./SDFHelper.js";import{getProcessParam as i,getValue as r,hasProcessParam as a,getSize as s}from"./utils.js";function l(t,e,n){return{transform:T(t,e,n.transform),fromColor:b(t,e,n.fromColor),toColor:I(t,e,n.toColor),colorMix:v(t,e,n.colorMix),toOpacity:k(t,e,n.toOpacity),opacityMix:L(t,e,n.opacityMix),shift:w(t,e,n.shift),hasAnimations:n.hasAnimations||m(e),hasShiftAnimation:n.hasShiftAnimation||c(e),hasMotionAnimations:n.hasMotionAnimations||f(e)}}function m(t){return"animations"in t&&!!t.animations&&t.animations.length>0}function c(t){return"animations"in t&&!!t.animations&&t.animations.some(t=>"CIMSymbolAnimationMoveAlongLine"===t.type)}const p=new Set(["CIMSymbolAnimationOffset","CIMSymbolAnimationRotation","CIMSymbolAnimationSize","CIMSymbolAnimationScale"]);function f(t){return"animations"in t&&!!t.animations&&t.animations.some(t=>p.has(t.type))}function y(t){return!e.forceStaticPath&&(e.forceAnimatedPath||t.hasAnimations)}function u(e,n,o){if("CIMCharacterMarker"===n.type)return t.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),o;const r=i(e,n,"OffsetX"),a=i(e,n,"OffsetY");if("CIMPictureMarker"===n.type)return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:V([r,a]),rotation:V(0),scale:V(i(e,n,"Size")),parent:o.transform}};const s=n.frame,l=s.ymax-s.ymin;return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:V([r,a]),rotation:V(0),scale:V({type:"Process",op:"Divide",left:i(e,n,"Size"),right:l}),parent:o.transform}}}function d(t,e){let n=0,o=0;const i="Absolute"!==t.anchorPointUnits;return t.anchorPoint&&(n=-t.anchorPoint.x,o=-t.anchorPoint.y),{...e,transform:{type:"AnimatedTransform",relativeTranslation:i,absoluteScale:!1,translation:V([n,o]),rotation:V(0),scale:V(1),parent:e.transform}}}function S(t,e){return"Absolute"===t.anchorPointUnits?e:d(t,e)}function C(t,e){return"Absolute"!==t.anchorPointUnits?e:d(t,e)}function M(t,e,n){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:V([e,n]),rotation:V(0),scale:V(1),parent:t.transform}}}function h(t,e){const n=e?.5*-(e.xmin+e.xmax):0,i=e?.5*-(e.ymin+e.ymax):0;let r=0,a=0;if("x"in t&&"y"in t)r=t.x+n,a=t.y+i;else{const e=o(t);if(e){r=(e[0]+e[2])/2+n,a=(e[1]+e[3])/2+i}}return[r,a]}function A(t,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,e,"Rotation")}return 0}function g(t,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,e,"RotateClockwise")}return 0}function P(t,e){switch(e.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return i(t,e,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return i(t,e,"TintColor")}return[1,1,1,1]}function T(t,e,n){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:j(t,e),rotation:F(t,e),scale:R(t,e),parent:n}}function b(t,e,n){return{type:"AnimatedColor",color:V(P(t,e)),opacity:V(1),parent:n,applyToChildren:!1}}function I(t,e,n){const o=z(e);let r,a=D(n);if(a)r=[1,1,1,1];else{r=P(t,e);const n=o?.find(t=>"CIMSymbolAnimationColor"===t.type);n&&(r=i(t,n,"ToColor"),a="Override"===n.colorMode)}return{type:"AnimatedColor",color:V(r),opacity:V(1),parent:n,applyToChildren:a}}function v(t,e,n){const o=z(e),i=o?.find(t=>"CIMSymbolAnimationColor"===t.type);return i?{type:"AnimatedColor",color:V([1,1,1,1]),opacity:{from:0,to:1,timing:x(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:n}function D(t){return"object"==typeof t&&"applyToChildren"in t&&t.applyToChildren}function k(t,e,n){const o=z(e);let r=V(1);const a=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);if(a){r=V({type:"Process",op:"Transparency",value:i(t,a,"ToTransparency")})}return{type:"AnimatedColor",color:V([1,1,1,1]),opacity:r,parent:n,applyToChildren:!1}}function L(t,e,n){const o=z(e),i=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);return i?{type:"AnimatedColor",color:V([1,1,1,1]),opacity:{from:0,to:1,timing:x(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:n}const O=120;function w(t,e,o){const s=z(e),l=s?.find(t=>"CIMSymbolAnimationMoveAlongLine"===t.type);if(!l)return o;const m=r(l.movementType,n.CIMSymbolAnimationMoveAlongLine.movementtype);let c,p=!1,f=!1,y=x(t,l.animatedSymbolProperties);const u=a(t,l,"DistanceAlong"),d=a(t,l,"Speed"),S=u&&i(t,l,"DistanceAlong"),C=d&&i(t,l,"Speed"),M=!0===l.continuous;if("Distance"===m){if(!1===S)throw new Error("distanceAlong must be specified when movementType is 'Distance'.");c={type:"Process",op:"Divide",left:S,right:100},p=!0,C&&(f=!0,y={...y,duration:{type:"Process",op:"Divide",left:c,right:C}})}else{if("Speed"!==m)throw new Error("movementType is required; allowed values are 'Distance' and 'Speed'.");if(!1===C)throw new Error("speed must be specified when movementType is 'Speed'.");c={type:"Process",op:"Multiply",left:C,right:y.duration}}return M&&(c={type:"Process",op:"Multiply",left:c,right:O},y={...y,duration:{type:"Process",op:"Multiply",left:y.duration,right:O}}),{type:"AnimatedShift",multiplyToByLineLength:p,multiplyDurationByLineLength:f,shift:{from:0,to:c,timing:y},parent:o}}function x(t,e){if(!e)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0};const o=i(t,e,"Duration");let a;if(i(t,e,"RandomizeStartTime")){a={type:"Process",op:"Random",min:0,max:o,seed:i(t,e,"RandomizeStartSeed")}}else a=i(t,e,"StartTimeOffset");const s=i(t,e,"RepeatDelay"),l=i(t,e,"PlayAnimation"),m=i(t,e,"ReverseAnimation"),c=r(e.repeatType,n.CIMAnimatedSymbolProperties.repeattype);return{duration:o,startTimeOffset:a,repeatDelay:s,timeOriginSelector:"None"===c?"Local":"Global",repeatType:c,easing:r(e.easing,n.CIMAnimatedSymbolProperties.easing),playAnimation:l,reverseAnimation:m}}function R(t,e){const n=z(e);let o;o="CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type?i(t,e,"Size"):"CIMSolidStroke"===e.type||"CIMPictureStroke"===e.type?i(t,e,"Width"):s(e)||10;const r=n?.find(t=>"CIMSymbolAnimationScale"===t.type);if(!r){const e=n?.find(t=>"CIMSymbolAnimationSize"===t.type);if(!e)return V(1);return{from:1,to:{type:"Process",op:"Divide",left:i(t,e,"ToSize"),right:o},timing:x(t,e.animatedSymbolProperties)}}return{from:1,to:i(t,r,"ScaleFactor"),timing:x(t,r.animatedSymbolProperties)}}function z(t){return"animations"in t&&t.animations||[]}function j(t,e){const n=z(e),o=n?.find(t=>"CIMSymbolAnimationOffset"===t.type);if(!o)return V([0,0]);return{from:[0,0],to:[i(t,o,"OffsetX"),i(t,o,"OffsetY")],timing:x(t,o.animatedSymbolProperties)}}function F(t,e){const n=z(e),o=g(t,e),r={type:"Process",op:"Divide",left:A(t,e),right:{type:"Process",op:"Cond",condition:o,ifTrue:-1,ifFalse:1}},a=n?.find(t=>"CIMSymbolAnimationRotation"===t.type);if(!a)return V(r);const s={type:"Process",op:"Add",left:i(t,a,"ToRotation"),right:{type:"Process",op:"Divide",left:r,right:-1}};return{from:r,to:{type:"Process",op:"Add",left:r,right:{type:"Process",op:"Cond",condition:i(t,a,"RotateClockwise"),ifTrue:{type:"Process",op:"MatchWinding",sign:-1,angle:s},ifFalse:{type:"Process",op:"MatchWinding",sign:1,angle:s}}},timing:x(t,a.animatedSymbolProperties)}}function V(t){return{from:t,to:t,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0}}}function U(t){if(null==t)return!1;if("object"!=typeof t)return!1;if(t.animations&&Array.isArray(t.animations)&&t.animations.length>0)return!0;for(const e in t)if(U(t[e]))return!0;return!1}export{U as checkForAnimations,l as getAnimationParams,h as getFrameTranslation,V as getStaticParam,C as handleAbsoluteAnchor,d as handleAnchor,u as handleMarker,S as handleRelativeAnchor,y as shouldUseAnimatedPath,M as translate};
|