@arcgis/core 5.2.0-next.128 → 5.2.0-next.129
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/applications/Components/imageryUtils.js +1 -1
- package/arcade/batchExec.js +1 -1
- package/arcade/geometry/adapters/dehydrated.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/06da350b4ea25732f52b.js +1 -0
- package/assets/esri/core/workers/chunks/{67dcf9b873cb037b2647.js → 081c9ccaa5884c730a91.js} +1 -1
- package/assets/esri/core/workers/chunks/094102031cc77b20db74.js +1 -0
- package/assets/esri/core/workers/chunks/0b85c844af97b2fb0ba8.js +1 -0
- package/assets/esri/core/workers/chunks/{86d7a3ae672a51b75fcc.js → 0d44f793d3b0d33153ac.js} +1 -1
- package/assets/esri/core/workers/chunks/0de140199161fcd15a0c.js +1 -0
- package/assets/esri/core/workers/chunks/0deceece4b465f653f58.js +1 -0
- package/assets/esri/core/workers/chunks/111dc5653daa7f3e1001.js +1 -0
- package/assets/esri/core/workers/chunks/139e3da8ea081e21539e.js +1 -0
- package/assets/esri/core/workers/chunks/142bedebd37d747f84ba.js +1 -0
- package/assets/esri/core/workers/chunks/15dc28b4fa5b5110472b.js +1 -0
- package/assets/esri/core/workers/chunks/{dd02cc18ebebb90778c6.js → 17e2bfc7468c23e43bef.js} +1 -1
- package/assets/esri/core/workers/chunks/196d33f4d8e3a256ad94.js +1 -0
- package/assets/esri/core/workers/chunks/1a02c68de65a67ab6a67.js +1 -0
- package/assets/esri/core/workers/chunks/{4165eb86471ea3bbf364.js → 1aecf7106a21320e054e.js} +1 -1
- package/assets/esri/core/workers/chunks/1bc03b8065cbbbb06c87.js +1 -0
- package/assets/esri/core/workers/chunks/1beb32170d659bc43977.js +1 -0
- package/assets/esri/core/workers/chunks/20ee32fee219afbcfee3.js +1 -0
- package/assets/esri/core/workers/chunks/{9467744cb7d094a5067a.js → 21d2f5324db0b199060c.js} +1 -1
- package/assets/esri/core/workers/chunks/22abb9a74f6594f9db2a.js +1 -0
- package/assets/esri/core/workers/chunks/237795866c075880531b.js +1 -0
- package/assets/esri/core/workers/chunks/25e4da9c6837ab0fa585.js +1 -0
- package/assets/esri/core/workers/chunks/2a5fde737dc99627142e.js +1 -0
- package/assets/esri/core/workers/chunks/3412050ae63ff7dcaf36.js +1 -0
- package/assets/esri/core/workers/chunks/35316724c8d3cc39cf80.js +1 -0
- package/assets/esri/core/workers/chunks/354cc6cd2a56937f1747.js +1 -0
- package/assets/esri/core/workers/chunks/365ae479765ca9e47de4.js +1 -0
- package/assets/esri/core/workers/chunks/{8190fcb1dd10ad20feed.js → 36ef86701883a20dd6f6.js} +1 -1
- package/assets/esri/core/workers/chunks/3759e272a1d43534a190.js +1 -0
- package/assets/esri/core/workers/chunks/397ddcf0b8e858a17b70.js +1 -0
- package/assets/esri/core/workers/chunks/3a7a558e30b5cb81c801.js +1 -0
- package/assets/esri/core/workers/chunks/3c9405d310a1b08c901e.js +1 -0
- package/assets/esri/core/workers/chunks/{e10fe4c77b8dc4492092.js → 3ce53562926b05e71af5.js} +1 -1
- package/assets/esri/core/workers/chunks/3d174a84b785fc633a5a.js +1 -0
- package/assets/esri/core/workers/chunks/3d67fed3e53993c38b58.js +1 -0
- package/assets/esri/core/workers/chunks/42bdeeff55fb1a3f735f.js +1 -0
- package/assets/esri/core/workers/chunks/48f1532520b76fa7f0c2.js +1 -0
- package/assets/esri/core/workers/chunks/{00d9e41deecf5828975c.js → 4adc3822ed9f498f5653.js} +1 -1
- package/assets/esri/core/workers/chunks/{d5f0fed415b5b155d57c.js → 51741ef8225d470716fe.js} +1 -1
- package/assets/esri/core/workers/chunks/5191e481d0e19a7f3888.js +1 -0
- package/assets/esri/core/workers/chunks/{7fcee3a1b900ddc9a5e3.js → 540acf6abdee9dbd453e.js} +1 -1
- package/assets/esri/core/workers/chunks/{d9b63cf111035b05cd2e.js → 5484b89adc53430226d5.js} +1 -1
- package/assets/esri/core/workers/chunks/55361b50ecfc98db2ffb.js +1 -0
- package/assets/esri/core/workers/chunks/58da7c41c1bcef2f4141.js +1 -0
- package/assets/esri/core/workers/chunks/5979bbefb09d132c008f.js +1 -0
- package/assets/esri/core/workers/chunks/{84db05e872dbf35c80a2.js → 5982c6a8459c1237b298.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a20f84b5f004a77a9f9.js → 5abfc4f447b01d6bf287.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c0dba437de0969a5b63.js → 5b9f88194433410bad5b.js} +1 -1
- package/assets/esri/core/workers/chunks/5f794f4e0113d5dd50ba.js +1 -0
- package/assets/esri/core/workers/chunks/62a30692e2a7612bafc1.js +1 -0
- package/assets/esri/core/workers/chunks/62aa7daad4ca7332854e.js +1 -0
- package/assets/esri/core/workers/chunks/66926c3686d5ef2d4692.js +29 -0
- package/assets/esri/core/workers/chunks/6994ba168465b77a36af.js +1 -0
- package/assets/esri/core/workers/chunks/6d0c6fda9100fe89f3cb.js +1 -0
- package/assets/esri/core/workers/chunks/72a898894438f177cd62.js +1 -0
- package/assets/esri/core/workers/chunks/78d4455237120103f639.js +1 -0
- package/assets/esri/core/workers/chunks/7fccf53aa751cd9dae57.js +1 -0
- package/assets/esri/core/workers/chunks/{6267a1fe1603daa399b4.js → 81327e10200065a0ccef.js} +1 -1
- package/assets/esri/core/workers/chunks/84a3fbe5d85a357f4e82.js +1 -0
- package/assets/esri/core/workers/chunks/862479729f2d036f606b.js +1 -0
- package/assets/esri/core/workers/chunks/8a9aa6db11d0f643961c.js +1 -0
- package/assets/esri/core/workers/chunks/8dfea65341991e13ab71.js +1 -0
- package/assets/esri/core/workers/chunks/8e92925043dc49ed1018.js +1 -0
- package/assets/esri/core/workers/chunks/8f0b2b0ca239b01f44d0.js +1 -0
- package/assets/esri/core/workers/chunks/93a89168c18db88f60e7.js +1 -0
- package/assets/esri/core/workers/chunks/991c854a4459c82d4d93.js +1 -0
- package/assets/esri/core/workers/chunks/{f90cad9f007a11154c0d.js → 9b080d07699b56f06c5f.js} +1 -1
- package/assets/esri/core/workers/chunks/9cd69aa3880838a834f8.js +1 -0
- package/assets/esri/core/workers/chunks/{2ca49fb4590cc34a02bd.js → 9d87f38b16dda1ff7978.js} +1 -1
- package/assets/esri/core/workers/chunks/9fd1e5a2c0a261ed2a33.js +1 -0
- package/assets/esri/core/workers/chunks/a189e520da39919cdcca.js +1 -0
- package/assets/esri/core/workers/chunks/a3a5cb664bdb1db190dd.js +1 -0
- package/assets/esri/core/workers/chunks/a63c456ecf018ec06778.js +1 -0
- package/assets/esri/core/workers/chunks/{842f993fa60b410cb613.js → a8322a978e33c7349fdf.js} +1 -1
- package/assets/esri/core/workers/chunks/{f479b4a4cee4bb2e046c.js → aa96eea0899757ab38c7.js} +1 -1
- package/assets/esri/core/workers/chunks/ab0b2a76247dfd56b92d.js +1 -0
- package/assets/esri/core/workers/chunks/ab7337b076d152a8eb9e.js +1 -0
- package/assets/esri/core/workers/chunks/ac0de274853a42d518a1.js +1 -0
- package/assets/esri/core/workers/chunks/ad372e399e20d5a3262d.js +1 -0
- package/assets/esri/core/workers/chunks/ae75b3e5320d03dff64c.js +1 -0
- package/assets/esri/core/workers/chunks/ae98530d5816306216b3.js +1 -0
- package/assets/esri/core/workers/chunks/afc94c4b9bc007fe310f.js +1 -0
- package/assets/esri/core/workers/chunks/afe54923339e957b71b9.js +1 -0
- package/assets/esri/core/workers/chunks/bbcac00362fef5e3956d.js +1 -0
- package/assets/esri/core/workers/chunks/{1302bf9718747cd9fdd9.js → bcee161dd1c4781d1998.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1f54b0079fb71a15612.js → bd231bc0624eb889ac14.js} +1 -1
- package/assets/esri/core/workers/chunks/c0075715fbe7bec10fc3.js +1 -0
- package/assets/esri/core/workers/chunks/c4e1e864fb8c119b2520.js +1 -0
- package/assets/esri/core/workers/chunks/c93cedf9e53da5aaa35b.js +1 -0
- package/assets/esri/core/workers/chunks/{2d592c935571de80a2e2.js → c9690810b198a97bc16d.js} +1 -1
- package/assets/esri/core/workers/chunks/cada517cc25fa37f778c.js +1 -0
- package/assets/esri/core/workers/chunks/cd1821bf601949674e02.js +1 -0
- package/assets/esri/core/workers/chunks/{1b42d163ef22e3565bb7.js → cf7b7e54cd87422ca62a.js} +1 -1
- package/assets/esri/core/workers/chunks/d195c57fc6de3560653d.js +1 -0
- package/assets/esri/core/workers/chunks/d7f830a06ded11f2fc80.js +1 -0
- package/assets/esri/core/workers/chunks/d877783815afd21dbe98.js +1 -0
- package/assets/esri/core/workers/chunks/db5181fcea96cc2ede3e.js +1 -0
- package/assets/esri/core/workers/chunks/{6e8187a77846239ed112.js → de28a86775235bd5d3c4.js} +2 -2
- package/assets/esri/core/workers/chunks/df6992416cba9539f1ed.js +1 -0
- package/assets/esri/core/workers/chunks/e4005d95a396e1af9ac2.js +1 -0
- package/assets/esri/core/workers/chunks/{668ec0bdfb2095e90c9e.js → e495697860f7207da4c7.js} +1 -1
- package/assets/esri/core/workers/chunks/f163502c513205c892e7.js +1 -0
- package/assets/esri/core/workers/chunks/f287ec0fcb611f82ebb0.js +1 -0
- package/assets/esri/core/workers/chunks/{37ae52c71bf9c70fbb92.js → f2d45d15d0ba2537a4eb.js} +1 -1
- package/assets/esri/core/workers/chunks/{d507d7d7a7282fc38e8d.js → f652d1db26fbdea1a79b.js} +1 -1
- package/assets/esri/core/workers/chunks/f6b38ed75baae198c19b.js +1 -0
- package/assets/esri/core/workers/chunks/{168b45c5d8233f23793e.js → f6cfc901267a229de7a1.js} +2 -2
- package/assets/esri/core/workers/chunks/f6d04d14323b926f1025.js +1 -0
- package/assets/esri/core/workers/chunks/f7ab606be37373312ebe.js +1 -0
- package/assets/esri/core/workers/chunks/{3b7dff15a0058ea29886.js → f92178ac6dc9abff304f.js} +1 -1
- package/assets/esri/core/workers/chunks/fc39593febef74a036f1.js +1 -0
- package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +7 -0
- 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/views/interactive/tooltip/t9n/messages.ar.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.bg.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.bs.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ca.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.cs.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.da.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.de.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.el.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.es.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.et.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.fi.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.fr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.he.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.hr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.hu.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.id.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.it.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ja.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ko.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.lt.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.lv.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.nl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.no.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.pl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ro.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ru.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.sk.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.sl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.sr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.sv.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.th.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.tr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.uk.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.vi.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.zh-TW.json +1 -1
- package/chunks/batchExec.js +2 -0
- package/config.js +1 -1
- package/geometry/support/intersects.js +1 -1
- package/geometry/support/intersectsBase.js +1 -1
- package/kernel.js +1 -1
- package/layers/GeospatialPDFLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/graphics/hydrateGeometryJSON.js +2 -0
- package/layers/graphics/hydratedFeatures.js +1 -1
- package/layers/graphics/hydratedSpatialReference.js +2 -0
- package/layers/raster/datasets/DBFParser.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/formats/JpgPlus.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/Raw.js +1 -1
- package/layers/support/arcadeUtils.js +1 -1
- package/package.json +3 -3
- package/popup/FeatureContent.js +1 -1
- package/popup/FeatureContentCollection.d.ts +2 -0
- package/popup/FeatureContentCollection.js +1 -1
- package/popup/support/featureUtils.js +1 -1
- package/rest/imageService.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/loadArcade.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/engine/vectorTiles/GeometryUtils.js +1 -1
- package/views/2d/engine/vectorTiles/TileManager.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/util.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/schema/processor/MatcherSchema.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/layers/GeospatialPDFLayerView3D.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/DOMContainer.d.ts +18 -8
- package/views/VideoView.d.ts +38 -0
- package/views/VideoView.js +1 -1
- package/views/View.d.ts +20 -2
- package/views/View.js +1 -1
- package/views/input/types.d.ts +19 -6
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/assets/esri/core/workers/chunks/025da54eef112d7e8f66.js +0 -1
- package/assets/esri/core/workers/chunks/02f94f9d704f03ddb5c6.js +0 -1
- package/assets/esri/core/workers/chunks/038d2b80d96237c25b6f.js +0 -1
- package/assets/esri/core/workers/chunks/04d4cd66485b622403d0.js +0 -1
- package/assets/esri/core/workers/chunks/05afa8c2b5929ce0545a.js +0 -1
- package/assets/esri/core/workers/chunks/09676cfa99b90fe0cc63.js +0 -1
- package/assets/esri/core/workers/chunks/0aadee0437fa061e4ff5.js +0 -1
- package/assets/esri/core/workers/chunks/0ccd4200c5a2a5de6e16.js +0 -1
- package/assets/esri/core/workers/chunks/1262918b2161d79851c0.js +0 -1
- package/assets/esri/core/workers/chunks/1406a884241809b62bff.js +0 -1
- package/assets/esri/core/workers/chunks/1c33aa349beea9a3792f.js +0 -1
- package/assets/esri/core/workers/chunks/1f135269aea3931e11b2.js +0 -1
- package/assets/esri/core/workers/chunks/24014f3701c31ee74bc2.js +0 -1
- package/assets/esri/core/workers/chunks/25a2e02677a74834c8b5.js +0 -1
- package/assets/esri/core/workers/chunks/2afce71e8b6ae86e0792.js +0 -1
- package/assets/esri/core/workers/chunks/2c7bb5c9751524687002.js +0 -1
- package/assets/esri/core/workers/chunks/2ebad7e588b26e74cefe.js +0 -1
- package/assets/esri/core/workers/chunks/319434415d2c0561bc59.js +0 -1
- package/assets/esri/core/workers/chunks/39d71e83261bff46f6bf.js +0 -1
- package/assets/esri/core/workers/chunks/3aceedec9abfb2fdfa18.js +0 -1
- package/assets/esri/core/workers/chunks/3c6ee445e49da0076ac1.js +0 -1
- package/assets/esri/core/workers/chunks/3f045f09ac95e7f22a97.js +0 -1
- package/assets/esri/core/workers/chunks/4327d2c39a660bd89da7.js +0 -1
- package/assets/esri/core/workers/chunks/462fd57af8ed7921d6ba.js +0 -1
- package/assets/esri/core/workers/chunks/474d9541d387b31ad275.js +0 -1
- package/assets/esri/core/workers/chunks/48a2f68e06a2e90b77d0.js +0 -1
- package/assets/esri/core/workers/chunks/4a73f73f1698fad2df20.js +0 -1
- package/assets/esri/core/workers/chunks/4f464047c6f6c9486efd.js +0 -1
- package/assets/esri/core/workers/chunks/500f6d6f0ffa235cae85.js +0 -1
- package/assets/esri/core/workers/chunks/526cc64ae46dec3fbeda.js +0 -1
- package/assets/esri/core/workers/chunks/550d4df0732352fa48b5.js +0 -1
- package/assets/esri/core/workers/chunks/581285e4d7bbe1b7c27a.js +0 -1
- package/assets/esri/core/workers/chunks/58fb92775d668cfd295c.js +0 -1
- package/assets/esri/core/workers/chunks/5adf2792416b22cd602f.js +0 -1
- package/assets/esri/core/workers/chunks/5aee7739afb5160d4ace.js +0 -1
- package/assets/esri/core/workers/chunks/6006bd8a5ed945fa2776.js +0 -1
- package/assets/esri/core/workers/chunks/606cca69eaea84bfcdc6.js +0 -1
- package/assets/esri/core/workers/chunks/64ee22134fda2f09c094.js +0 -1
- package/assets/esri/core/workers/chunks/66ef6c034455abd61f39.js +0 -1
- package/assets/esri/core/workers/chunks/67678054342178b601cf.js +0 -1
- package/assets/esri/core/workers/chunks/67fd2cdb2e6834bfa710.js +0 -1
- package/assets/esri/core/workers/chunks/6c82cbcd504c711a7450.js +0 -1
- package/assets/esri/core/workers/chunks/75294f515c7f8393181c.js +0 -1
- package/assets/esri/core/workers/chunks/75879ae88fd87b089a87.js +0 -1
- package/assets/esri/core/workers/chunks/761ea719ec1b4d562db2.js +0 -1
- package/assets/esri/core/workers/chunks/78085f804969c9282700.js +0 -1
- package/assets/esri/core/workers/chunks/7d6da4e89aa951e6523f.js +0 -1
- package/assets/esri/core/workers/chunks/80f16f5f15518013f7d0.js +0 -1
- package/assets/esri/core/workers/chunks/8465e2c7221125fd3cc4.js +0 -1
- package/assets/esri/core/workers/chunks/87aaed3dfa903bdf853c.js +0 -1
- package/assets/esri/core/workers/chunks/892dc038d569cffd26dc.js +0 -1
- package/assets/esri/core/workers/chunks/8a842cde240aef12e417.js +0 -1
- package/assets/esri/core/workers/chunks/8f1c5f5e70d4b33d021d.js +0 -1
- package/assets/esri/core/workers/chunks/9020bd7a0e488d55ef14.js +0 -1
- package/assets/esri/core/workers/chunks/92509dd25996c6390a31.js +0 -1
- package/assets/esri/core/workers/chunks/9ccc2c8f7416943cc373.js +0 -29
- package/assets/esri/core/workers/chunks/9d6a96e4c7ccedcb0c13.js +0 -1
- package/assets/esri/core/workers/chunks/9ec04faad97be55309b8.js +0 -1
- package/assets/esri/core/workers/chunks/a08385ebf1715414c1a6.js +0 -1
- package/assets/esri/core/workers/chunks/a3a33ffa34f4d645ddfe.js +0 -1
- package/assets/esri/core/workers/chunks/b396c4b4bb144200acc7.js +0 -1
- package/assets/esri/core/workers/chunks/b9c834e3c0701e9b14a2.js +0 -1
- package/assets/esri/core/workers/chunks/bbfb80a6983574007ce5.js +0 -1
- package/assets/esri/core/workers/chunks/bcf2e5cf6b9c6d0442bb.js +0 -1
- package/assets/esri/core/workers/chunks/c35e9dee87937f483a3d.js +0 -1
- package/assets/esri/core/workers/chunks/c5b733c3a5b2680042a2.js +0 -1
- package/assets/esri/core/workers/chunks/cbeba973ef5593ffbba3.js +0 -1
- package/assets/esri/core/workers/chunks/ccaeabc3be07f3c96f50.js +0 -1
- package/assets/esri/core/workers/chunks/d25fb32a233d2128afbe.js +0 -1
- package/assets/esri/core/workers/chunks/d5ef269ab0ee3744b05d.js +0 -1
- package/assets/esri/core/workers/chunks/d94a2b3b2ef49af9c2e3.js +0 -1
- package/assets/esri/core/workers/chunks/dc92710a8fdfb9135e55.js +0 -1
- package/assets/esri/core/workers/chunks/dd4ecf81250cc001d040.js +0 -1
- package/assets/esri/core/workers/chunks/e0894a308c84d5c158b0.js +0 -1
- package/assets/esri/core/workers/chunks/e4016ae9cb8f16e3efc3.js +0 -1
- package/assets/esri/core/workers/chunks/e6a4cef0af9be30ffe3d.js +0 -1
- package/assets/esri/core/workers/chunks/eaa7cb3ffa8c11706a09.js +0 -1
- package/assets/esri/core/workers/chunks/ed31ec586b754241474d.js +0 -1
- package/assets/esri/core/workers/chunks/ef6e52f9b656751eebaf.js +0 -1
- package/assets/esri/core/workers/chunks/f2fca9a3a40170996ea2.js +0 -1
- package/assets/esri/core/workers/chunks/f5d06cd6d30a5f742f73.js +0 -1
- package/assets/esri/core/workers/chunks/f71ec8a260405ed07958.js +0 -1
- package/assets/esri/core/workers/chunks/f91cab9904020cf25d50.js +0 -1
- package/assets/esri/core/workers/chunks/fb11ff3f2eae5f072560.js +0 -1
- package/assets/esri/core/workers/chunks/ff0e9f8d323eb1729650.js +0 -1
- /package/assets/esri/core/workers/chunks/{6e8187a77846239ed112.js.LICENSE.txt → de28a86775235bd5d3c4.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{168b45c5d8233f23793e.js.LICENSE.txt → f6cfc901267a229de7a1.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as o}from"../core/promiseUtils.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import n from"../geometry/SpatialReference.js";import{getInfo as l}from"../geometry/support/spatialReferenceUtils.js";import p from"./Layer.js";import{BlendLayer as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as o}from"../core/promiseUtils.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import n from"../geometry/SpatialReference.js";import{getInfo as l}from"../geometry/support/spatialReferenceUtils.js";import p from"./Layer.js";import{BlendLayer as c}from"./mixins/BlendLayer.js";import{PortalLayer as m}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as f}from"./mixins/RasterJobHandlerMixin.js";import{ScaleRangeLayer as h}from"./mixins/ScaleRangeLayer.js";import u from"./raster/datasets/GeospatialPDFRaster.js";import{clip as d}from"./raster/functions/clipUtils.js";import{sanitizeUrl as y}from"./support/arcgisLayerUrl.js";import{interpolationKebab as g}from"./support/rasterEnums.js";import x from"./support/TileInfo.js";import{enumeration as b}from"../core/accessorSupport/decorators/enumeration.js";let R=class extends(c(h(m(f(s(p)))))){constructor(e){super(e),this.interpolation="bilinear",this.serviceRasterInfo=null,this._frame=null,this.clippedToNeatline=!0,this.neatlineVisible=!0,this.raster=null,this.spatialReference=null,this.type="geospatial-pdf"}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["PDF"],supportsData:!1},e).catch(o).then(()=>this._openRaster(e?.signal))),Promise.resolve(this)}destroy(){this._shutdownJobHandler(),this.raster?.destroy()}get fullExtent(){return this.serviceRasterInfo?.extent}set url(e){this._set("url",y(e,r.getLogger(this)))}async fetchImageBitmapTile(){throw new t("geospatial-pdf-layer:fetch-image-bitmap-tile","GeospatialPDFLayer does not expose pre-rendered image tile URLs.")}async fetchPixels(e,t,r,s={}){return _(this),await this._initJobHandler(),this.raster.fetchPixels(e,Math.round(t),Math.round(r),s)}async fetchTile(e,r,s,o={}){if(_(this),o.requestAsImageElement)throw new t("geospatial-pdf-layer:fetch-tile","GeospatialPDFLayer does not support requestAsImageElement.");await this._initJobHandler();const i=await this.raster.fetchTile(e,r,s,o);return this.clippedToNeatline&&i.pixelBlock&&this._frame&&i.srcExtent&&(i.pixelBlock=await d(i.pixelBlock,i.srcExtent,this._frame.sourceNeatlinePolygon)),i}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}getCompatibleTileInfo(e,t,r=!1){if(!this.loaded||null==t)return null;if(r&&e.equals(this.spatialReference))return this.tileInfo;const s=l(e);return x.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getRawDisplayBandIds(){return _(this),[0,1,2]}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(()=>{this._rasterJobHandler&&(_(this),this.raster.rasterJobHandler=this._rasterJobHandler)}).catch(()=>{})}async _openRaster(e){const r=new u({url:this.url});if(await r.open({signal:e}),!r.rasterInfo)throw r.destroy(),new t("geospatialpdf-layer:load","cannot load resources on "+this.url);const{rasterInfo:s}=r;this._set("serviceRasterInfo",s),this.setAtOrigin("spatialReference",s.spatialReference,"service"),this.setAtOrigin("tileInfo",r.rasterInfo.storageInfo.tileInfo,"service"),this._frame=r.frame,this.raster=r}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}};function _(e){if(!e.raster||!e.serviceRasterInfo)throw new t("imagery-tile","no raster")}e([b(g)],R.prototype,"interpolation",void 0),e([i()],R.prototype,"serviceRasterInfo",void 0),e([i({clonable:!1})],R.prototype,"_compatibleFullExtent",void 0),e([i({type:Boolean})],R.prototype,"clippedToNeatline",void 0),e([i({json:{read:!1}})],R.prototype,"fullExtent",null),e([i({type:Boolean})],R.prototype,"neatlineVisible",void 0),e([i()],R.prototype,"raster",void 0),e([i({readOnly:!0,type:n,json:{read:!1}})],R.prototype,"spatialReference",void 0),e([i({type:x})],R.prototype,"tileInfo",void 0),e([i({readOnly:!0,value:"geospatial-pdf"})],R.prototype,"type",void 0),e([i()],R.prototype,"url",null),R=e([a("esri.layers.GeospatialPDFLayer")],R);const j=R;export{j as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import s from"../core/Error.js";import i from"../core/Logger.js";import{removeMaybe as o}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as a}from"../core/MultiOriginJSONSupport.js";import{debounce as n,throwIfAbortError as l}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as c,subclass as m}from"../core/accessorSupport/decorators.js";import{ensureClass as u}from"../core/accessorSupport/ensureType.js";import h from"../graphic/ImageryTileGraphicOrigin.js";import d from"./Layer.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as R}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as S}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as _}from"./mixins/TemporalLayer.js";import{TiledImagery as O}from"./mixins/TiledImagery.js";import{isFunctionRaster as F,getPrimaryRasters as b}from"./raster/datasets/datasetUtils.js";import T from"./raster/datasets/FunctionRaster.js";import P from"./raster/datasets/RasterFactory.js";import{getPrimaryRasterUrls as J,create as N}from"./raster/functions/rasterFunctionHelper.js";import{legendEnabled as x,screenSizePerspectiveEnabled as L}from"./support/commonProperties.js";import C from"./support/Field.js";import{getServicePixelValueField as E,getRawServicePixelValueField as M,getRasterAttributeTableFields as W,getMagnitudeField as U,getDirectionField as H,getMultidimensionalFields as k,commonRasterFieldNames as z,setDefaultRasterFieldFormats as A}from"./support/rasterFieldUtils.js";import B from"./support/RasterFunction.js";import{getRasterJobHandler as D,releaseRasterJobHandler as G}from"./support/rasterJobHelper.js";import V from"./support/TileInfo.js";import{logInvalidElevationInfoWarning as $,elevationModeUnsupportedMessage as Y,featureExpressionUnsupportedMessage as q}from"../support/elevationInfoUtils.js";import{createPopupTemplate as K}from"../support/popupUtils.js";import Q from"../symbols/support/ElevationInfo.js";import{addLayerUnsupportedError as X}from"../webdoc/support/unsupportedErrors.js";let Z=class extends(f(I(v(w(S(g(O(R(_(y(j(a(t(d)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.charts=null,this.graphicOrigin=new h(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=n(async(e,r,t)=>{const{save:s,saveAs:i}=await(import("./save/imageryUtils.js"));switch(e){case 0:return s(this,r);case 1:return i(this,t,r)}})}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(l).then(()=>this._openRaster(r))),Promise.resolve(this)}destroy(){super.destroy(),this._releaseWorkerHandle=o(this._releaseWorkerHandle)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[E("Pixel Value"),M("Raw Pixel Value")],r=this.raster?.rasterInfo??this.serviceRasterInfo,t=r?.attributeTable;if(t){const r=W(t);e.push(...r)}const s=r?.dataType,i=r?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=i){const r=i.variables[0].unit?.trim(),t=U(r),s=H();e.push(t,s)}if(i){const r=k(i);e.push(...r)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:r}=this,t=e?.visibleFieldNames??new Set(r.map(({name:e})=>e).filter(e=>e!==z.rawServicePixelValue)),s=K({fields:r,title:this.title},{...e,visibleFieldNames:t}),{rasterInfo:i}=this.raster;return s?.fieldInfos&&i&&A(s.fieldInfos,i),s}async generateRasterInfo(e,r){const t=u(B,e);if(await this.load(),!t||"none"===t.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:e}=await this._openFunctionRaster(t,r);return e}catch(i){if(i instanceof s)throw i;throw new s("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}supportsExportMapTiles(){const e=this._primaryRasters[0]??this.raster,r="RasterTileServer"===e?.datasetFormat,t=!!this.sourceJSON?.exportTilesAllowed,s=this.sourceJSON?.datasetFormat?.toLowerCase(),i=!/\/tiledimageservices[^.]*\.arcgis\.com/i.test(this.url)&&"Raster"===e?.tileType&&("cache/jpegplus"===s||"cache/jpegpng"===s);return r&&t&&("Map"===e?.tileType||i)}supportsWrite(){const e=this._primaryRasters[0]??this.raster;return!!(this.loaded?"RasterTileServer"===e.datasetFormat&&("Raster"===e.tileType||"Map"===e.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,r){return this.supportsWrite()?super.write(e,r):(X(r,this),null)}async hasDataChanged(){try{const e=this._primaryRasters[0]??this.raster,{dataChanged:r,updates:t}=await e.refresh();return r&&(this.serviceRasterInfo!==e.rasterInfo&&this._set("serviceRasterInfo",e.rasterInfo),e.sourceJSON&&this.sourceJSON!==e.sourceJSON&&(this.sourceJSON=e.sourceJSON),t&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0})),r}catch{return!1}}async _openRaster(e){let r=!1;if(this.raster)await this._openFromRaster(this.raster,e),r=F(this.raster),!r&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:r,rasterFunction:t,source:i}=this;if(!r&&!i)throw new s("imagery-tile-layer:open","missing url or source parameter");i?await this._openFromSource(i,e):t?await this._openFromUrlWithRasterFunction(r,t,e):await this._openFromUrl(r,e)}const t=this.raster.rasterInfo;if(!t)throw new s("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",r?t:this._primaryRasters[0].rasterInfo),this._set("spatialReference",t.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(p(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,r){e.rasterInfo||await e.open({signal:r}),this._primaryRasters=b(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,r,t){const i=[e];let o;r&&J(r.toJSON(),i),i.some(e=>re(e))&&(o=await D(),this._releaseWorkerHandle={remove:()=>G()});const a=await Promise.all(i.map(e=>P.open({url:e,rasterInfo:1===i.length?this.serviceRasterInfo:void 0,sourceJSON:1===i.length?this.sourceJSON:void 0,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:o,signal:t}))),n=a.findIndex(e=>null==e);if(n>-1)throw new s("imagery-tile-layer:open",`cannot open raster: ${i[n]}`);return this._primaryRasters=a,this._initializeWithFunctionRaster(r)}async _openFromUrl(e,r){let t;re(e)&&(t=await D(),this._releaseWorkerHandle={remove:()=>G()});const i=await P.open({url:e,rasterInfo:this.serviceRasterInfo,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:t,signal:r});if(null==i)throw new s("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[i],this.raster=i}async _openFromSource(e,r){const t="the tiled imagery data source is not supported",i="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!i)throw new s("imagery-tile-layer:open",t);"MEMORY"===i&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const o=await P.open({url:"",source:e,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r});if(null==o)throw new s("imagery-tile-layer:open",t);this._primaryRasters=[o],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=o}async _openFunctionRaster(e,r){const t={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>t[e.url]=e);const s=N(e.functionDefinition?.toJSON()??e.toJSON(),t),i=new T({rasterFunction:s});return await i.open(r),i}async _initializeWithFunctionRaster(e,r){try{this.raster=await this._openFunctionRaster(e,r)}catch(t){t instanceof s&&i.getLogger(this).error("imagery-tile-layer:open",t.message),i.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){$(i.getLogger(this),Y("ImageryTile layers","relative-to-scene",e)),$(i.getLogger(this),q("ImageryTile layers",e))}};e([c({clonable:!1})],Z.prototype,"_primaryRasters",void 0),e([c({clonable:!1})],Z.prototype,"_releaseWorkerHandle",void 0),e([c({json:{origins:{"web-scene":{write:!1}},write:!0}})],Z.prototype,"charts",void 0),e([c({type:Q,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],Z.prototype,"elevationInfo",null),e([c({type:V})],Z.prototype,"tileInfo",void 0),e([c({readOnly:!0,clonable:!1})],Z.prototype,"graphicOrigin",void 0),e([c(x)],Z.prototype,"legendEnabled",void 0),e([c({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Z.prototype,"isReference",void 0),e([c({type:["show","hide"]})],Z.prototype,"listMode",void 0),e([c({json:{read:!0,write:!0}})],Z.prototype,"blendMode",void 0),e([c({type:B,json:{name:"renderingRule",write:!0}})],Z.prototype,"rasterFunction",void 0),e([c()],Z.prototype,"sourceJSON",void 0),e([c({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],Z.prototype,"version",void 0),e([c({readOnly:!0,json:{read:!1}})],Z.prototype,"type",void 0),e([c({type:["ArcGISTiledImageServiceLayer"]})],Z.prototype,"operationalLayerType",void 0),e([c({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,r)=>!r.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,r,t){r[t]=!e}}}})],Z.prototype,"popupEnabled",void 0),e([c({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],Z.prototype,"popupTemplate",void 0),e([c({readOnly:!0})],Z.prototype,"defaultPopupTemplate",null),e([c(L)],Z.prototype,"screenSizePerspectiveEnabled",void 0),e([c({readOnly:!0,type:[C]})],Z.prototype,"fields",void 0),e([c({readOnly:!0,type:[C]})],Z.prototype,"rasterFields",null),e([c({constructOnly:!0})],Z.prototype,"source",void 0),Z=e([m("esri.layers.ImageryTileLayer")],Z);const ee=Z;function re(e){return/\.(jpe?g|png)$/i.test(e)}export{ee as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import s from"../core/Error.js";import i from"../core/Logger.js";import{removeMaybe as o}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as a}from"../core/MultiOriginJSONSupport.js";import{debounce as n,throwIfAbortError as l}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as c,subclass as m}from"../core/accessorSupport/decorators.js";import{ensureClass as u}from"../core/accessorSupport/ensureType.js";import h from"../graphic/ImageryTileGraphicOrigin.js";import d from"./Layer.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as R}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as S}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as I}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as _}from"./mixins/TemporalLayer.js";import{TiledImagery as O}from"./mixins/TiledImagery.js";import{isFunctionRaster as F,getPrimaryRasters as b}from"./raster/datasets/datasetUtils.js";import T from"./raster/datasets/FunctionRaster.js";import P from"./raster/datasets/RasterFactory.js";import{getPrimaryRasterUrls as J,create as N}from"./raster/functions/rasterFunctionHelper.js";import{legendEnabled as x,screenSizePerspectiveEnabled as L}from"./support/commonProperties.js";import C from"./support/Field.js";import{getServicePixelValueField as E,getRawServicePixelValueField as M,getRasterAttributeTableFields as W,getMagnitudeField as U,getDirectionField as H,getMultidimensionalFields as k,commonRasterFieldNames as z,setDefaultRasterFieldFormats as A}from"./support/rasterFieldUtils.js";import B from"./support/RasterFunction.js";import{getRasterJobHandler as D,releaseRasterJobHandler as G}from"./support/rasterJobHelper.js";import V from"./support/TileInfo.js";import{logInvalidElevationInfoWarning as $,elevationModeUnsupportedMessage as Y,featureExpressionUnsupportedMessage as q}from"../support/elevationInfoUtils.js";import{createPopupTemplate as K}from"../support/popupUtils.js";import Q from"../symbols/support/ElevationInfo.js";import{addLayerUnsupportedError as X}from"../webdoc/support/unsupportedErrors.js";let Z=class extends(f(j(v(w(S(g(O(R(_(y(I(a(t(d)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.charts=null,this.graphicOrigin=new h(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=n(async(e,r,t)=>{const{save:s,saveAs:i}=await(import("./save/imageryUtils.js"));switch(e){case 0:return s(this,r);case 1:return i(this,t,r)}})}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(l).then(()=>this._openRaster(r))),Promise.resolve(this)}destroy(){super.destroy(),this._releaseWorkerHandle=o(this._releaseWorkerHandle)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[E("Pixel Value"),M("Raw Pixel Value")],r=this.raster?.rasterInfo??this.serviceRasterInfo,t=r?.attributeTable;if(t){const r=W(t);e.push(...r)}const s=r?.dataType,i=r?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=i){const r=i.variables[0].unit?.trim(),t=U(r),s=H();e.push(t,s)}if(i){const r=k(i);e.push(...r)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:r}=this,t=e?.visibleFieldNames??new Set(r.map(({name:e})=>e).filter(e=>e!==z.rawServicePixelValue)),s=K({fields:r,title:this.title},{...e,visibleFieldNames:t}),{rasterInfo:i}=this.raster;return s?.fieldInfos&&i&&A(s.fieldInfos,i),s}async generateRasterInfo(e,r){const t=u(B,e);if(await this.load(),!t||"none"===t.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:e}=await this._openFunctionRaster(t,r);return e}catch(i){if(i instanceof s)throw i;throw new s("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}supportsExportMapTiles(){const e=this._primaryRasters[0]??this.raster,r="RasterTileServer"===e?.datasetFormat,t=!!this.sourceJSON?.exportTilesAllowed,s=this.sourceJSON?.datasetFormat?.toLowerCase(),i=!/\/tiledimageservices[^.]*\.arcgis\.com/i.test(this.url)&&"Raster"===e?.tileType&&("cache/jpegplus"===s||"cache/jpegpng"===s);return r&&t&&("Map"===e?.tileType||i)}supportsWrite(){const e=this._primaryRasters[0]??this.raster;return!!(this.loaded?"RasterTileServer"===e.datasetFormat&&("Raster"===e.tileType||"Map"===e.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,r){return this.supportsWrite()?super.write(e,r):(X(r,this),null)}async hasDataChanged(){try{const e=this._primaryRasters[0]??this.raster,{dataChanged:r,updates:t}=await e.refresh();return r&&(this.serviceRasterInfo!==e.rasterInfo&&this._set("serviceRasterInfo",e.rasterInfo),e.sourceJSON&&this.sourceJSON!==e.sourceJSON&&(this.sourceJSON=e.sourceJSON),t&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0})),r}catch{return!1}}async _openRaster(e){let r=!1;if(this.raster)await this._openFromRaster(this.raster,e),r=F(this.raster),!r&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:r,rasterFunction:t,source:i}=this;if(!r&&!i)throw new s("imagery-tile-layer:open","missing url or source parameter");i?await this._openFromSource(i,e):t?await this._openFromUrlWithRasterFunction(r,t,e):await this._openFromUrl(r,e)}const t=this.raster.rasterInfo;if(!t)throw new s("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",r?t:this._primaryRasters[0].rasterInfo),this._set("spatialReference",t.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(p(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,r){e.rasterInfo||await e.open({signal:r}),this._primaryRasters=b(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,r,t){const i=[e];let o;r&&J(r.toJSON(),i),i.some(e=>re(e))&&(o=await D(),this._releaseWorkerHandle={remove:()=>G()});const a=await Promise.all(i.map(e=>P.open({url:e,rasterInfo:1===i.length?this.serviceRasterInfo:void 0,sourceJSON:1===i.length?this.sourceJSON:void 0,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:o,signal:t}))),n=a.findIndex(e=>null==e);if(n>-1)throw new s("imagery-tile-layer:open",`cannot open raster: ${i[n]}`);return this._primaryRasters=a,this._initializeWithFunctionRaster(r)}async _openFromUrl(e,r){let t;re(e)&&(t=await D(),this._releaseWorkerHandle={remove:()=>G()});const i=await P.open({url:e,rasterInfo:this.serviceRasterInfo,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:t,signal:r});if(null==i)throw new s("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[i],this.raster=i}async _openFromSource(e,r){const t="the tiled imagery data source is not supported",i="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!i)throw new s("imagery-tile-layer:open",t);"MEMORY"===i&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const o=await P.open({url:"",source:e,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r});if(null==o)throw new s("imagery-tile-layer:open",t);this._primaryRasters=[o],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=o}async _openFunctionRaster(e,r){const t={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>t[e.url]=e);const s=N(e.functionDefinition?.toJSON()??e.toJSON(),t),i=new T({rasterFunction:s});return await i.open(r),i}async _initializeWithFunctionRaster(e,r){try{this.raster=await this._openFunctionRaster(e,r)}catch(t){t instanceof s&&i.getLogger(this).error("imagery-tile-layer:open",t.message),i.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){$(i.getLogger(this),Y("ImageryTile layers","relative-to-scene",e)),$(i.getLogger(this),q("ImageryTile layers",e))}};e([c({clonable:!1})],Z.prototype,"_primaryRasters",void 0),e([c({clonable:!1})],Z.prototype,"_releaseWorkerHandle",void 0),e([c({json:{origins:{"web-scene":{write:!1}},write:!0}})],Z.prototype,"charts",void 0),e([c({type:Q,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],Z.prototype,"elevationInfo",null),e([c({type:V})],Z.prototype,"tileInfo",void 0),e([c({readOnly:!0,clonable:!1})],Z.prototype,"graphicOrigin",void 0),e([c(x)],Z.prototype,"legendEnabled",void 0),e([c({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Z.prototype,"isReference",void 0),e([c({type:["show","hide"]})],Z.prototype,"listMode",void 0),e([c({json:{read:!0,write:!0}})],Z.prototype,"blendMode",void 0),e([c({type:B,json:{name:"renderingRule",write:!0}})],Z.prototype,"rasterFunction",void 0),e([c()],Z.prototype,"sourceJSON",void 0),e([c({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],Z.prototype,"version",void 0),e([c({readOnly:!0,json:{read:!1}})],Z.prototype,"type",void 0),e([c({type:["ArcGISTiledImageServiceLayer"]})],Z.prototype,"operationalLayerType",void 0),e([c({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,r)=>!r.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,r,t){r[t]=!e}}}})],Z.prototype,"popupEnabled",void 0),e([c({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],Z.prototype,"popupTemplate",void 0),e([c({readOnly:!0})],Z.prototype,"defaultPopupTemplate",null),e([c(L)],Z.prototype,"screenSizePerspectiveEnabled",void 0),e([c({readOnly:!0,type:[C]})],Z.prototype,"fields",void 0),e([c({readOnly:!0,type:[C]})],Z.prototype,"rasterFields",null),e([c({constructOnly:!0})],Z.prototype,"source",void 0),Z=e([m("esri.layers.ImageryTileLayer")],Z);const ee=Z;function re(e){return/\.(png|gif|bmp)$/i.test(e)}export{ee as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{isFloat32Array as t,isFloat64Array as n}from"../../core/typedArrayUtil.js";function e(t){const{wkid:n,wkt:e,wkt2:r,latestWkid:m}=t.spatialReference,o={wkid:n,wkt:e,wkt2:r,latestWkid:m};switch(t.type){case"point":{const{x:n,y:e,z:a,m:s}=t;return{x:n,y:e,z:a,m:s,spatialReference:o}}case"polygon":{const{rings:n,hasZ:e,hasM:s}=t;return{rings:a(n),hasZ:e,hasM:s,spatialReference:o}}case"polyline":{const{paths:n,hasZ:e,hasM:s}=t;return{paths:a(n),hasZ:e,hasM:s,spatialReference:o}}case"extent":{const{xmin:n,xmax:e,ymin:a,ymax:s,zmin:r,zmax:i,mmin:m,mmax:c,hasZ:h,hasM:p}=t;return{xmin:n,xmax:e,ymin:a,ymax:s,zmin:r,zmax:i,mmin:m,mmax:c,hasZ:h,hasM:p,spatialReference:o}}case"multipoint":{const{points:n,hasZ:e,hasM:a}=t;return{points:i(n)?s(n):n,hasZ:e,hasM:a,spatialReference:o}}default:return}}function a(t){return r(t)?t.map(t=>s(t)):t}function s(t){return t.map(t=>Array.from(t))}function r(t){for(const n of t)if(0!==n.length)return i(n);return!1}function i(e){return e.length>0&&(t(e[0])||n(e[0]))}export{e as hydrateGeometryJSON};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import
|
|
2
|
+
import r from"../../Graphic.js";import{clone as e}from"../../core/lang.js";import{fromJSON as n}from"../../geometry/support/jsonUtils.js";import{makeDehydratedPoint as t}from"./dehydratedPoint.js";import{hydrateGeometryJSON as i}from"./hydrateGeometryJSON.js";function o(r){return"declaredClass"in r}function s(r){return"declaredClass"in r}function l(r){return"declaredClass"in r}function a(n,t,i){return n?l(n)?(n.origin!==i&&(n.origin=i),n):new r({layer:t,sourceLayer:t,origin:i,visible:n.visible,symbol:e(n.symbol),attributes:e(n.attributes),geometry:u(n.geometry)}):null}function u(r){return null==r?null:o(r)?r:n(i(r))}function m(r,e){if(!r)return null;let n;if(s(r)){if(null==e)return r.clone();if(s(e))return e.copy(r)}return null!=e?(n=e,n.x=r.x,n.y=r.y,n.spatialReference=r.spatialReference,r.hasZ?(n.z=r.z,n.hasZ=r.hasZ):(n.z=void 0,n.hasZ=!1),r.hasM?(n.m=r.m,n.hasM=!0):(n.m=void 0,n.hasM=!1)):(n=t(r.x,r.y,r.z,r.spatialReference),r.hasM&&(n.m=r.m,n.hasM=!0)),n}export{m as clonePoint,u as hydrateGeometry,a as hydrateGraphic,o as isHydratedGeometry,l as isHydratedGraphic,s as isHydratedPoint};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import t from"../../geometry/SpatialReference.js";function e(e){if(e instanceof t)return e;const{wkid:r,wkt:i,wkt2:k,latestWkid:n}=e,o={wkid:r,wkt:i,wkt2:k,latestWkid:n};return t.fromJSON(o)}export{e as hydratedSpatialReference};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{bytesToUTF8 as e}from"./byteStreamUtils.js";function t(e){const t=e.fields,
|
|
2
|
+
import{bytesToUTF8 as e}from"./byteStreamUtils.js";function t(e){const t=e.fields,n=e.records,r=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",i=[{name:r,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),a=i.map(e=>e.name),o=[];let s=0,l=0;return n.forEach(e=>{const t={};for(t[r]=s++,l=1;l<a.length;l++)t[a[l]]=e[l-1];o.push({attributes:t})}),{displayFieldName:"",fields:i,features:o}}function n(n){const r=new DataView(n),i=3&r.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const a=r.getUint32(4,!0),o=r.getUint16(8,!0),s=r.getUint16(10,!0),l={version:i,recordCount:a,headerByteCount:o,recordByteCount:s};let p=32;const h=[],g=[];for(;13!==r.getUint8(p);){const t=String.fromCharCode(r.getUint8(p+11)).trim();h.push({name:e(new Uint8Array(n,p,11)),type:t,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(t)],length:r.getUint8(p+16)}),p+=32}if(p+=1,h.length>0)for(;g.length<a&&n.byteLength-p>s;){const t=[];32===r.getUint8(p)?(p+=1,h.forEach(r=>{if("C"===r.type)t.push(e(new Uint8Array(n,p,r.length)).trim());else if("N"===r.type)t.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(n,p,r.length)).trim(),10));else if("F"===r.type)t.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(n,p,r.length)).trim()));else if("D"===r.type){const e=String.fromCharCode.apply(null,new Uint8Array(n,p,r.length)).trim();t.push(new Date(parseInt(e.slice(0,4),10),parseInt(e.slice(4,6),10)-1,parseInt(e.slice(6,8),10)))}p+=r.length}),g.push(t)):p+=s}return{header:l,fields:h,records:g,recordSet:t({fields:h,records:g})}}export{n as parse};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{eachAlways as s,createAbortError as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{eachAlways as s,createAbortError as a}from"../../../core/promiseUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import o from"../../../geometry/Extent.js";import n from"../../../geometry/SpatialReference.js";import l from"./BaseRaster.js";import c from"./InMemoryRaster.js";import{parsePAMInfo as p}from"./pamParser.js";import{parseHeader as m}from"../formats/JpgPlus.js";import{getFormat as f}from"../formats/RasterCodec.js";import{estimateStatisticsFromHistograms as h}from"../functions/stretchUtils.js";import u from"../transforms/PolynomialTransform.js";import d from"../../support/RasterInfo.js";let g=class extends l{set rasterJobHandler(t){this._set("rasterJobHandler",t),this._inMemoryRaster&&(this._inMemoryRaster.rasterJobHandler=t)}fetchRawTile(t,e,s,a={}){if(this._imageBlob){const{blockWidth:a,blockHeight:r}=this.rasterInfo.storageInfo;return this.decodePixelBlock(this._imageBlob,{tileSize:[a,r],tileIndex:[t,e,s],canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0})}return this._inMemoryRaster?this._inMemoryRaster.fetchRawTile(t,e,s,a):Promise.resolve(null)}async _open(t){const s=await this._fetchData(t);if(null==s)throw new e("image-aux-raster:open","the data cannot be decoded");let{spatialReference:a,statistics:r,histograms:i,transform:l}=await this._fetchAuxiliaryData(t);const p=!a;p&&(a=new n({wkid:3857})),i?.length&&null==r&&(r=h(i));const{width:m,height:f,pixelBlock:u}=s;let g=new o({xmin:-.5,ymin:.5-f,xmax:m-.5,ymax:.5,spatialReference:a});const w=l?l.forwardTransform(g):g;let x=!0;if(l){const t=l.forwardCoefficients;x=t&&0===t[1]&&0===t[2],x&&(l=null,g=w)}if(!u){const t=new d({width:m,height:f,bandCount:3,pixelType:"u8",extent:w,nativeExtent:g,transform:l,pixelSize:{x:w.width/m,y:w.height/f},spatialReference:w.spatialReference,keyProperties:{DataType:"Processed"}});return this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(t),this.createRemoteDatasetStorageInfo(t,512,512),this._set("rasterInfo",t),void this.updateTileInfo()}const{rasterJobHandler:y,ioConfig:b}=this,R=new c({preGenerateTiles:!1,rasterJobHandler:y,source:{extent:w,nativeExtent:g,transform:l,pixelBlocks:[u],statistics:r,histograms:i,keyProperties:{DataType:"Processed"},isPseudoSpatialReference:p},ioConfig:{...b,sampling:"closest",skipStatistics:!0}});await R.open(),R.source=null,this._set("rasterInfo",R.rasterInfo),this._inMemoryRaster=R}async _fetchData(t){const{data:s}=await this.request(this.url,{responseType:"array-buffer",signal:t?.signal}),a=f(s);if("jpg"!==a&&"png"!==a&&"gif"!==a&&"bmp"!==a)throw new e("image-aux-raster:open","the data is not a supported format");if(this._set("datasetFormat",a.toUpperCase()),"jpg"===a){const t=m(s);if(null==t)throw new e("image-aux-raster:open","the data is not a supported format");return this._imageBlob=s,t}try{const t=await this.decodePixelBlock(s,{format:a,canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0});return this._imageBlob=s,t?{width:t.width,height:t.height,pixelBlock:t}:null}catch{const t=await this.decodePixelBlock(s,{format:a,canvasUsage:"no-canvas",skipStatistics:!0});return t?{width:t.width,height:t.height,pixelBlock:t}:null}}async _fetchAuxiliaryData(t){const e=t?.signal,{skipExtensions:r=[],skipMapInfo:i}=this.ioConfig,o=i||r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),n=this.datasetFormat,l="JPG"===n?"jgw":"PNG"===n?"pgw":"BMP"===n?"bpw":null,c=l&&r.includes(l)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+l,{responseType:"text",signal:e}),m=await s([o,c]);if(e?.aborted)throw a();const f=p(m[0].value?.data);if(!f.transform){const t=m[1].value?m[1].value.data.split("\n").slice(0,6).map(t=>Number(t)):null;f.transform=6===t?.length?new u({forwardCoefficients:[t[4],t[5],t[0],-t[1],t[2],-t[3]]}):null}return f}};t([r({type:String,json:{write:!0}})],g.prototype,"datasetFormat",void 0),t([r()],g.prototype,"rasterJobHandler",null),g=t([i("esri.layers.raster.datasets.ImageAuxRaster")],g);const w=g;export{w as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import i from"../../../core/Logger.js";import{property as r,subclass as s}from"../../../core/accessorSupport/decorators.js";import a from"../../../geometry/Extent.js";import n from"../../../geometry/Point.js";import o from"../../../geometry/SpatialReference.js";import f from"./BaseRaster.js";import l from"./DBFParser.js";import{parsePAMInfo as u,parseSpatialReference as c}from"./pamParser.js";import{parseSignature as h,getPyramidIFDs as p,getMaskIFDs as d,parseIFD as m,parseFieldValues as y,isBSQConfig as g,getTagNumericValues as x,getTagFirstNumericValue as w,getImageInfo as I}from"../formats/tiffParser.js";import{tiffTags as T,geoKeys as _}from"../formats/tiffTag.js";import{estimateStatisticsFromHistograms as R}from"../functions/stretchUtils.js";import F from"../transforms/PolynomialTransform.js";import S from"../../support/RasterInfo.js";import b from"../../support/RasterStorageInfo.js";import O from"../../../rest/support/FeatureSet.js";let k=class extends f{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this.datasetFormat="TIFF"}async fetchRawTile(e,t,i,r={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const s=await this._fetchRawTiffTile(e,t,i,!1,r);if(null!=s&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(e,t,i,!0,r);null!=a&&a.pixels[0]instanceof Uint8Array&&(s.mask=a.pixels[0])}return s}async _open(e){const r=e?e.signal:null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:r});if(!s)throw new t("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:a,firstIFDPos:n,isBigTiff:o}=h(s),f=[],l={fileChunk:s,posIFD:n,fileOffset:0};await this._readIFDs(f,l,a,o?8:4,r);const{imageInfo:u,rasterInfo:c}=E(f),m=p(f),y=d(f);if(this._headerInfo={littleEndian:a,isBigTiff:o,ifds:f,pyramidIFDs:m,maskIFDs:y,...u},this._set("rasterInfo",c),!u.isSupported)throw new t("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new t("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");c.isPseudoSpatialReference&&i.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const g=f[0].get("PREDICTOR")?.values?.[0],x=f[0].get("SAMPLEFORMAT")?.values?.[0];if(3===x&&2===g)throw new t("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:w,skipExtensions:I=[]}=this.ioConfig;if(!I.includes("aux.xml")&&!w){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&D(t,c)}I.includes("vat.dbf")||1!==c.bandCount||"u8"!==c.pixelType||w||(c.attributeTable=await this._fetchAuxiliaryTable(e),null!=c.attributeTable&&(c.keyProperties.DataType="thematic")),w&&this.updateImageSpaceRasterInfo(c),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:r,posIFD:s}=e;if(s+8>=i.byteLength||s<0){r=s+r;i=(await this.request(this.url,{range:{from:r,to:r+this._bufferSize},responseType:"array-buffer",signal:t})).data,s=0}return{fileChunk:i,fileOffset:r,posIFD:s}}async _readIFDs(e,i,r,s=4,a){if(!i.posIFD)return null;i=await this._validateOrFetchHeaderBuffer(i,a);const n=await this._readIFD(i,r,T,s,a);if(!n?.ifd)throw new t("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(n.ifd),!n.nextIFD)return null;i.posIFD=n.nextIFD-i.fileOffset,await this._readIFDs(e,i,r,s,a)}async _readIFD(e,t,i=T,r=4,s){let{fileChunk:a,posIFD:n,fileOffset:o}=e;if(!e.fileChunk)return null;const f=m(a,t,n,o,i,r);if(f.success){const e=[];if(f.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,f.nextIFD,s),f.ifd?.has("GEOKEYDIRECTORY")){const e=f.ifd.get("GEOKEYDIRECTORY"),i=e?.values;if(i&&i.length>4){const r=i[0]+"."+i[1]+"."+i[2];n=e.valueOffset+6-o;const f=await this._validateOrFetchHeaderBuffer({fileChunk:a,posIFD:n,fileOffset:o},s),l=await this._readIFD(f,t,_,2,s);e.data=l?.ifd,e.data&&e.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[r]})}}return f}if(f.requiredBufferSize){return a=(await this.request(this.url,{range:{from:o,to:o+n+f.requiredBufferSize+8},responseType:"array-buffer",signal:s})).data,a.byteLength<n+f.requiredBufferSize?null:(e.fileChunk=a,e.fileOffset=o,this._readIFD(e,t,i,r,s))}return null}async _fillOffsets(e,t,i,r){const s=e.filter(e=>null!=e.offlineOffsetSize);if(0===s.length)return;const a=s.map(e=>e.offlineOffsetSize),n=Math.min.apply(null,a.map(e=>e[0])),o=Math.max.apply(null,a.map(e=>e[0]+e[1]));let f=1===a.length||o-n<=this._bufferSize;if(!f&&a.length>1){a.sort((e,t)=>e[0]-t[0]);f=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===o}if(f){const e=await this._fetchOffsets(n,Math.max(o,n+this._bufferSize),r);return void s.forEach(i=>y(e,t,i,n))}const l=s.map(async e=>{const i=e.offlineOffsetSize,s=await this._fetchOffsets(i[0],i[1]+i[0],r);y(s,t,e,i[0])});await Promise.all(l)}async _fetchOffsets(e,t,i){const r=[],s=this._chunkSize,a=Math.ceil((t-e)/s);let n=e;for(let l=0;l<a;l++)r.push(this.request(this.url,{range:{from:n,to:l===a-1?t:n+s-1},responseType:"array-buffer",signal:i})),n+=s;const o=await Promise.all(r);if(1===a)return o[0].data;const f=new Uint8Array(t-e+1);for(let l=0;l<a;l++)f.set(new Uint8Array(o[l].data),l*s);return f.buffer}async _fetchRawTiffTile(e,t,i,r,s={}){const a=this._getTileLocation(e,t,i,r);if(!a)return null;const{ranges:n,actualTileWidth:o,actualTileHeight:f,ifd:l}=a,u=n.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:s.signal})),c=await Promise.all(u),h=c.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===c.length?c[0].data:new ArrayBuffer(h),d=[0],m=[0];if(c.length>1){const e=new Uint8Array(p);for(let t=0,i=0;t<c.length;t++){const r=c[t].data;e.set(new Uint8Array(r),i),d[t]=i,i+=r.byteLength,m[t]=r.byteLength}}const{blockWidth:y,blockHeight:g}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:l,offsets:d,sizes:m},width:y,height:g,planes:null,pixelType:null});if(null==x)return null;if(o!==y||f!==g){let e=x.mask;if(e)for(let t=0;t<g;t++){const i=t*y;if(t<f)for(let t=o;t<y;t++)e[i+t]=0;else for(let t=0;t<y;t++)e[i+t]=0}else{e=new Uint8Array(y*g),x.mask=e;for(let t=0;t<f;t++){const i=t*y;for(let t=0;t<o;t++)e[i+t]=1}}}return x}_getTileLocation(e,t,i,r=!1){const{firstPyramidLevel:s,blockBoundary:a}=this.rasterInfo.storageInfo,n=0===e?0:e-(s-1),{_headerInfo:o}=this;if(!o)return null;const f=r?o.maskIFDs[n]:0===n?o.ifds[0]:o.pyramidIFDs[n-1];if(!f)return null;const l=g(f,o),u=x(f,"TILEOFFSETS"),c=x(f,"TILEBYTECOUNTS");if(!u?.length||!c?.length)return null;const{minRow:h,minCol:p,maxRow:d,maxCol:m}=a[n];if(t>d||i>m||t<h||i<p)return null;const y=w(f,"IMAGEWIDTH"),I=w(f,"IMAGELENGTH"),T=w(f,"TILEWIDTH"),_=w(f,"TILELENGTH"),R=[];if(l){const{bandCount:e}=this.rasterInfo;for(let r=0;r<e;r++){const e=r*(d+1)*(m+1)+t*(m+1)+i;R[r]={from:u[e],to:u[e]+c[e]-1}}}else{const e=t*(m+1)+i;R.push({from:u[e],to:u[e]+c[e]-1})}for(let g=0;g<R.length;g++)if(null==R[g].from||!R[g].to||R[g].to<0)return null;return{ranges:R,ifd:f,actualTileWidth:i===m&&y%T||T,actualTileHeight:t===d&&I%_||_}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return u(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=l.parse(t);return i?.recordSet?O.fromJSON(i.recordSet):null}catch{return null}}};function E(e){const t=I(e),{width:i,height:r,tileWidth:s,tileHeight:f,planes:l,pixelType:u,compression:h,firstPyramidLevel:p,maximumPyramidLevel:d,pyramidBlockWidth:m,pyramidBlockHeight:y,pyramidResolutions:g,tileBoundary:x,affine:w,metadata:T,colormap:_}=t,R=t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid;let O=c(R),k=!!t.isPseudoGeographic;null==O&&(k=!0,O=new o({wkid:3857}));const E=new a({...t.extent,spatialReference:O}),D=new n(E?{x:E.xmin,y:E.ymax,spatialReference:O}:{x:0,y:0}),v=new b({blockWidth:s,blockHeight:f,pyramidBlockWidth:m,pyramidBlockHeight:y,compression:h,origin:D,firstPyramidLevel:p,maximumPyramidLevel:d,pyramidResolutions:g,blockBoundary:x}),P=new n({x:(E.xmax-E.xmin)/i,y:(E.ymax-E.ymin)/r,spatialReference:O}),B=T?{BandProperties:T.bandProperties,DataType:T.dataType}:{},z=new S({width:i,height:r,bandCount:l,pixelType:u,pixelSize:P,storageInfo:v,spatialReference:O,isPseudoSpatialReference:k,keyProperties:B,extent:E,colormap:_,statistics:T?T.statistics:null});if(w?.length&&(z.nativeExtent=new a({xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:O}),z.transform=new F({polynomialOrder:1,forwardCoefficients:[w[2]+w[0]/2,w[5]-w[3]/2,w[0],w[3],-w[1],-w[4]]}),z.extent=z.transform.forwardTransform(z.nativeExtent),z.pixelSize=new n({x:(E.xmax-E.xmin)/i,y:(E.ymax-E.ymin)/r,spatialReference:O}),v.origin.x=-.5,v.origin.y=.5),g){const{x:e,y:t}=z.pixelSize;g.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:z}}function D(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=R(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new n({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}e([r()],k.prototype,"_files",void 0),e([r()],k.prototype,"_headerInfo",void 0),e([r()],k.prototype,"_bufferSize",void 0),e([r()],k.prototype,"_chunkSize",void 0),e([r({type:String,json:{write:!0}})],k.prototype,"datasetFormat",void 0),k=e([s("esri.layers.raster.datasets.TIFFRaster")],k);const v=k;export{v as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import i from"../../../core/Logger.js";import{property as r,subclass as s}from"../../../core/accessorSupport/decorators.js";import a from"../../../geometry/Extent.js";import n from"../../../geometry/Point.js";import o from"../../../geometry/SpatialReference.js";import f from"./BaseRaster.js";import{parse as l}from"./DBFParser.js";import{parsePAMInfo as u,parseSpatialReference as c}from"./pamParser.js";import{parseSignature as h,getPyramidIFDs as p,getMaskIFDs as d,parseIFD as m,parseFieldValues as y,isBSQConfig as g,getTagNumericValues as x,getTagFirstNumericValue as w,getImageInfo as I}from"../formats/tiffParser.js";import{tiffTags as T,geoKeys as _}from"../formats/tiffTag.js";import{estimateStatisticsFromHistograms as R}from"../functions/stretchUtils.js";import F from"../transforms/PolynomialTransform.js";import S from"../../support/RasterInfo.js";import b from"../../support/RasterStorageInfo.js";import O from"../../../rest/support/FeatureSet.js";let k=class extends f{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this.datasetFormat="TIFF"}async fetchRawTile(e,t,i,r={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const s=await this._fetchRawTiffTile(e,t,i,!1,r);if(null!=s&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(e,t,i,!0,r);null!=a&&a.pixels[0]instanceof Uint8Array&&(s.mask=a.pixels[0])}return s}async _open(e){const r=e?e.signal:null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:r});if(!s)throw new t("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:a,firstIFDPos:n,isBigTiff:o}=h(s),f=[],l={fileChunk:s,posIFD:n,fileOffset:0};await this._readIFDs(f,l,a,o?8:4,r);const{imageInfo:u,rasterInfo:c}=E(f),m=p(f),y=d(f);if(this._headerInfo={littleEndian:a,isBigTiff:o,ifds:f,pyramidIFDs:m,maskIFDs:y,...u},this._set("rasterInfo",c),!u.isSupported)throw new t("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new t("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");c.isPseudoSpatialReference&&i.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const g=f[0].get("PREDICTOR")?.values?.[0],x=f[0].get("SAMPLEFORMAT")?.values?.[0];if(3===x&&2===g)throw new t("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:w,skipExtensions:I=[]}=this.ioConfig;if(!I.includes("aux.xml")&&!w){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&D(t,c)}I.includes("vat.dbf")||1!==c.bandCount||"u8"!==c.pixelType||w||(c.attributeTable=await this._fetchAuxiliaryTable(e),null!=c.attributeTable&&(c.keyProperties.DataType="thematic")),w&&this.updateImageSpaceRasterInfo(c),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:r,posIFD:s}=e;if(s+8>=i.byteLength||s<0){r=s+r;i=(await this.request(this.url,{range:{from:r,to:r+this._bufferSize},responseType:"array-buffer",signal:t})).data,s=0}return{fileChunk:i,fileOffset:r,posIFD:s}}async _readIFDs(e,i,r,s=4,a){if(!i.posIFD)return null;i=await this._validateOrFetchHeaderBuffer(i,a);const n=await this._readIFD(i,r,T,s,a);if(!n?.ifd)throw new t("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(n.ifd),!n.nextIFD)return null;i.posIFD=n.nextIFD-i.fileOffset,await this._readIFDs(e,i,r,s,a)}async _readIFD(e,t,i=T,r=4,s){let{fileChunk:a,posIFD:n,fileOffset:o}=e;if(!e.fileChunk)return null;const f=m(a,t,n,o,i,r);if(f.success){const e=[];if(f.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,f.nextIFD,s),f.ifd?.has("GEOKEYDIRECTORY")){const e=f.ifd.get("GEOKEYDIRECTORY"),i=e?.values;if(i&&i.length>4){const r=i[0]+"."+i[1]+"."+i[2];n=e.valueOffset+6-o;const f=await this._validateOrFetchHeaderBuffer({fileChunk:a,posIFD:n,fileOffset:o},s),l=await this._readIFD(f,t,_,2,s);e.data=l?.ifd,e.data&&e.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[r]})}}return f}if(f.requiredBufferSize){return a=(await this.request(this.url,{range:{from:o,to:o+n+f.requiredBufferSize+8},responseType:"array-buffer",signal:s})).data,a.byteLength<n+f.requiredBufferSize?null:(e.fileChunk=a,e.fileOffset=o,this._readIFD(e,t,i,r,s))}return null}async _fillOffsets(e,t,i,r){const s=e.filter(e=>null!=e.offlineOffsetSize);if(0===s.length)return;const a=s.map(e=>e.offlineOffsetSize),n=Math.min.apply(null,a.map(e=>e[0])),o=Math.max.apply(null,a.map(e=>e[0]+e[1]));let f=1===a.length||o-n<=this._bufferSize;if(!f&&a.length>1){a.sort((e,t)=>e[0]-t[0]);f=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===o}if(f){const e=await this._fetchOffsets(n,Math.max(o,n+this._bufferSize),r);return void s.forEach(i=>y(e,t,i,n))}const l=s.map(async e=>{const i=e.offlineOffsetSize,s=await this._fetchOffsets(i[0],i[1]+i[0],r);y(s,t,e,i[0])});await Promise.all(l)}async _fetchOffsets(e,t,i){const r=[],s=this._chunkSize,a=Math.ceil((t-e)/s);let n=e;for(let l=0;l<a;l++)r.push(this.request(this.url,{range:{from:n,to:l===a-1?t:n+s-1},responseType:"array-buffer",signal:i})),n+=s;const o=await Promise.all(r);if(1===a)return o[0].data;const f=new Uint8Array(t-e+1);for(let l=0;l<a;l++)f.set(new Uint8Array(o[l].data),l*s);return f.buffer}async _fetchRawTiffTile(e,t,i,r,s={}){const a=this._getTileLocation(e,t,i,r);if(!a)return null;const{ranges:n,actualTileWidth:o,actualTileHeight:f,ifd:l}=a,u=n.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:s.signal})),c=await Promise.all(u),h=c.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===c.length?c[0].data:new ArrayBuffer(h),d=[0],m=[0];if(c.length>1){const e=new Uint8Array(p);for(let t=0,i=0;t<c.length;t++){const r=c[t].data;e.set(new Uint8Array(r),i),d[t]=i,i+=r.byteLength,m[t]=r.byteLength}}const{blockWidth:y,blockHeight:g}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:l,offsets:d,sizes:m},width:y,height:g,planes:null,pixelType:null});if(null==x)return null;if(o!==y||f!==g){let e=x.mask;if(e)for(let t=0;t<g;t++){const i=t*y;if(t<f)for(let t=o;t<y;t++)e[i+t]=0;else for(let t=0;t<y;t++)e[i+t]=0}else{e=new Uint8Array(y*g),x.mask=e;for(let t=0;t<f;t++){const i=t*y;for(let t=0;t<o;t++)e[i+t]=1}}}return x}_getTileLocation(e,t,i,r=!1){const{firstPyramidLevel:s,blockBoundary:a}=this.rasterInfo.storageInfo,n=0===e?0:e-(s-1),{_headerInfo:o}=this;if(!o)return null;const f=r?o.maskIFDs[n]:0===n?o.ifds[0]:o.pyramidIFDs[n-1];if(!f)return null;const l=g(f,o),u=x(f,"TILEOFFSETS"),c=x(f,"TILEBYTECOUNTS");if(!u?.length||!c?.length)return null;const{minRow:h,minCol:p,maxRow:d,maxCol:m}=a[n];if(t>d||i>m||t<h||i<p)return null;const y=w(f,"IMAGEWIDTH"),I=w(f,"IMAGELENGTH"),T=w(f,"TILEWIDTH"),_=w(f,"TILELENGTH"),R=[];if(l){const{bandCount:e}=this.rasterInfo;for(let r=0;r<e;r++){const e=r*(d+1)*(m+1)+t*(m+1)+i;R[r]={from:u[e],to:u[e]+c[e]-1}}}else{const e=t*(m+1)+i;R.push({from:u[e],to:u[e]+c[e]-1})}for(let g=0;g<R.length;g++)if(null==R[g].from||!R[g].to||R[g].to<0)return null;return{ranges:R,ifd:f,actualTileWidth:i===m&&y%T||T,actualTileHeight:t===d&&I%_||_}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return u(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=l(t);return i?.recordSet?O.fromJSON(i.recordSet):null}catch{return null}}};function E(e){const t=I(e),{width:i,height:r,tileWidth:s,tileHeight:f,planes:l,pixelType:u,compression:h,firstPyramidLevel:p,maximumPyramidLevel:d,pyramidBlockWidth:m,pyramidBlockHeight:y,pyramidResolutions:g,tileBoundary:x,affine:w,metadata:T,colormap:_}=t,R=t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid;let O=c(R),k=!!t.isPseudoGeographic;null==O&&(k=!0,O=new o({wkid:3857}));const E=new a({...t.extent,spatialReference:O}),D=new n(E?{x:E.xmin,y:E.ymax,spatialReference:O}:{x:0,y:0}),v=new b({blockWidth:s,blockHeight:f,pyramidBlockWidth:m,pyramidBlockHeight:y,compression:h,origin:D,firstPyramidLevel:p,maximumPyramidLevel:d,pyramidResolutions:g,blockBoundary:x}),P=new n({x:(E.xmax-E.xmin)/i,y:(E.ymax-E.ymin)/r,spatialReference:O}),B=T?{BandProperties:T.bandProperties,DataType:T.dataType}:{},z=new S({width:i,height:r,bandCount:l,pixelType:u,pixelSize:P,storageInfo:v,spatialReference:O,isPseudoSpatialReference:k,keyProperties:B,extent:E,colormap:_,statistics:T?T.statistics:null});if(w?.length&&(z.nativeExtent=new a({xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:O}),z.transform=new F({polynomialOrder:1,forwardCoefficients:[w[2]+w[0]/2,w[5]-w[3]/2,w[0],w[3],-w[1],-w[4]]}),z.extent=z.transform.forwardTransform(z.nativeExtent),z.pixelSize=new n({x:(E.xmax-E.xmin)/i,y:(E.ymax-E.ymin)/r,spatialReference:O}),v.origin.x=-.5,v.origin.y=.5),g){const{x:e,y:t}=z.pixelSize;g.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:z}}function D(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=R(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new n({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}e([r()],k.prototype,"_files",void 0),e([r()],k.prototype,"_headerInfo",void 0),e([r()],k.prototype,"_bufferSize",void 0),e([r()],k.prototype,"_chunkSize",void 0),e([r({type:String,json:{write:!0}})],k.prototype,"datasetFormat",void 0),k=e([s("esri.layers.raster.datasets.TIFFRaster")],k);const v=k;export{v as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{decodeBitMask as
|
|
2
|
+
import{decodeBitMask as t}from"./ImageCanvasDecoder.js";import{J as n}from"../../../chunks/Jpg.js";const e=255;function r(t){const n=new Uint8Array(t),r=n.length;if(n[0]!==e||216!==n[1])return null;let o=2;for(;o<r&&n[o++]===e;){for(;n[o]===e;)o++;if(o>=r)break;const t=n[o++];if(217===t||218===t)break;if(t>=208&&t<=215||1===t)continue;const s=n[o]<<8|n[o+1];if(t>=192&&t<=207&&196!==t&&200!==t&&204!==t&&s>=8){const t=o+2,e=n[t+1]<<8|n[t+2];return{width:n[t+3]<<8|n[t+4],height:e,planes:n[t+5]}}o+=s}return null}async function o(e,r={}){const o=new Uint8Array(e),s=new n;s.parse(o);const{width:i,height:a,numComponents:l,eof:f}=s,c=r.decodeJpegAsRgb??1!==l,u=s.getData(i,a,c),h=i*a;let p=null;const{applyJpegMask:g=!1}=r;let w;g&&f<o.length-1&&(p=await t(o.subarray(f,-4),h));const m=c?3:l;if(1===m&&u.length===i*a){const t=new Uint8Array(u.buffer);w=[t,t,t]}else{w=[];for(let t=0;t<m;t++)w.push(new Uint8Array(h));for(let t=0,n=0;t<h;t++)for(let e=0;e<m;e++)w[e][t]=u[n++]}return{width:i,height:a,pixels:w,mask:p}}export{o as decode,r as parseHeader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/Error.js";import{assertIsSome as t}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{decode as i}from"./ImageCanvasDecoder.js";import r
|
|
2
|
+
import e from"../../../core/Error.js";import{assertIsSome as t}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{decode as i}from"./ImageCanvasDecoder.js";import{decode as r}from"./JpgPlus.js";import{load as s,decode as n}from"./Lerc.js";import{decode as o}from"./Lzw.js";import{convertNoDataToMask as l}from"./pixelRangeUtils.js";import{load as c,decode as p}from"./Qb3.js";import{decode as f}from"./Raw.js";import{decodeTileOrStrip as d,decode as u}from"./TiffDecoder.js";import{isPlatformLittleEndian as h}from"./utils.js";import{inflate as w}from"./Zlib.js";import m from"../../support/PixelBlock.js";import g from"../../support/SimpleBandStatistics.js";async function y(t,a){if(!h)throw new e("rasterCoded:decode","lerc decoder is not supported on big endian platform");await s();const{width:i,height:r,pixelType:o,statistics:l,depthCount:c,noDataValues:p,bandMasks:f,pixels:d,mask:u,validPixelCount:w}=n(t,{inputOffset:a.offset,returnInterleaved:a.returnInterleaved});return new m({width:i,height:r,pixelType:o.toLowerCase(),pixels:d,mask:u,validPixelCount:w,statistics:l.map(({minValue:e,maxValue:t})=>new g(e,t)),bandMasks:f,depthCount:c,noDataValues:p})}async function x(t,a){await c();const i=p(t);if(!i)throw new e("rasterCodec:decode","failed to decode the input data.");const{width:r,height:s,pixels:n,pixelType:o}=i;return new m({width:r,height:s,pixelType:o,pixels:n})}async function k(e,a){const i=await u(e,{...a,noDataValue:a.tiffNoDataValue,matchAllNoData:a.matchAllNoData});t(i);return new m({width:i.width,height:i.height,pixels:i.pixels,pixelType:i.pixelType.toLowerCase(),mask:i.mask,bandMasks:i.bandMasks})}async function b(e,t){const a=await d(e,t.customOptions),i=new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:a.pixelType.toLowerCase(),mask:a.mask});return t.skipStatistics||i.updateStatistics(),i}function C(e,t){const a=t.pixelType||"u8",i=m.getPixelArrayConstructor(a),r="u8"===a?e:new i(e.buffer),s=[],n=t.planes||1;if(1===n)s.push(r);else for(let o=0;o<n;o++){const a=(t.width||1)*(t.height||e.length),l=new i(a);for(let e=0;e<a;e++)l[e]=r[e*n+o];s.push(l)}return new m({width:t.width||1,height:t.height||e.length,pixels:s,pixelType:a})}async function T(e,t){return C(await w(new Uint8Array(e)),t)}function j(e,t){return C(o(e,t.offset,t.eof,!t.isInputBigEndian),t)}function A(e,t){const a=t.format,{pixelTypeCtor:i}=V(t.pixelType),r=f(e,{width:t.width,height:t.height,pixelType:i,format:a});return new m({width:t.width,height:t.height,pixels:r.pixels,pixelType:t.pixelType,mask:r.mask})}async function U(e,t){const a=await r(e,t);return new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:"u8",mask:a.mask})}async function D(e,t,a){const r=await i(e,t,a);return new m(r)}async function v(t,i,r){const s=i.format||I(t),n={...i,format:s},{canvasUsage:o}=i;if("no-canvas"!==o||"png"===s)try{return await D(t,n,r)}catch(l){if(a(l))throw l;if("canvas-only"===o)throw new e("rasterCodec:decode",`failed to decode the input data with canvas for format ${s}`)}return await U(t,n)}function P(t){let a=null;switch(t){case"lerc":a=y;break;case"jpg":case"png":a=v;break;case"bmp":case"gif":a=D;break;case"bsq":case"bip":a=A;break;case"tiff":a=k;break;case"deflate":a=T;break;case"lzw":a=j;break;case"qb3":a=x;break;default:a=()=>{throw new e("rasterCodec:decode",`unsupported raster format ${t}`)}}return a}function V(e){let t=null,a=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":a=255,t=Uint8Array;break;case"u16":a=a||65535,t=Uint16Array;break;case"u32":a=a||2**32-1,t=Uint32Array;break;case"s8":a=a||-128,t=Int8Array;break;case"s16":a=a||-32768,t=Int16Array;break;case"s32":a=a||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:a}}function L(e,t="bilinear"){if(!e)return;const{pixels:a,width:i,height:r,mask:s}=e;if(!a||0===a.length)return;const n=i-1,o=r-1,l=[];let c=null;const p=m.getPixelArrayConstructor(e.pixelType);if("nearest"===t){for(const e of a){const t=new p(n*o);for(let a=0;a<o;a++){const r=a*i;for(let i=0;i<n;i++)t[a*n+i]=e[r+i]}l.push(t)}if(null!=s){c=new Uint8Array(n*o);for(let e=0;e<o;e++){const t=e*i;for(let a=0;a<n;a++)c[e*n+a]=s[t+a]}}}else{for(const e of a){const t=new p(n*o);for(let a=0;a<o;a++){const r=a*i;for(let s=0;s<n;s++)t[a*n+s]=(e[r+s]+e[r+s+1]+e[r+i+s]+e[r+i+s+1])/4}l.push(t)}if(s){c=new Uint8Array(n*o);for(let e=0;e<o;e++){const t=e*i;for(let a=0;a<n;a++)c[e*n+a]=Math.min.apply(null,[s[t+a],s[t+a+1],s[t+i+a],s[t+i+a+1]])}}}e.width=n,e.height=o,e.mask=c,e.pixels=l}function I(e){if(!e)return;const t=new Uint8Array(e,0,10);let a;return 255===t[0]&&216===t[1]?a="jpg":137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]?a="png":67===t[0]&&110===t[1]&&116===t[2]&&90===t[3]&&73===t[4]&&109===t[5]&&97===t[6]&&103===t[7]&&101===t[8]&&32===t[9]||76===t[0]&&101===t[1]&&114===t[2]&&99===t[3]&&50===t[4]&&32===t[5]?a="lerc":73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3]||73===t[0]&&73===t[1]&&43===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&43===t[3]?a="tiff":71===t[0]&&73===t[1]&&70===t[2]?a="gif":66===t[0]&&77===t[1]?a="bmp":81===t[0]&&66===t[1]&&51===t[2]&&(a="qb3"),a}async function M(t,a={},i){if(null==t)throw new e("rasterCodec:decode","missing encodeddata parameter.");let r=a.format?.toLowerCase();if(!("bsq"!==r&&"bip"!==r||null!=a.width&&null!=a.height))throw new e("rasterCodec:decode","requires width and height in options parameter.");if("tiff"===r&&a.customOptions)return b(t,a);if(!r||"bsq"!==r&&"bip"!==r&&"deflate"!==r&&"lzw"!==r){if(r=I(t),!r){throw String.fromCharCode.apply(null,[...new Uint8Array(t,0,10)]).toLowerCase().includes("error")?new e("rasterCodec:decode","input data contains error"):new e("rasterCodec:decode","unsupported raster format")}a={...a,format:r}}const s=P(r);let n;a.isPoint&&(null!=(a={...a}).width&&a.width++,null!=a.height&&a.height++);const{offsets:o}=a;if(o&&o.length>1){const e=o.map((e,r)=>s(t.slice(e,o[r+1]),a,i)),r=await Promise.all(e);n=r[0],n.pixels=r.map(e=>e.pixels[0]);const l=r.map(e=>e.mask);l.some(e=>null!=e)&&(l.forEach((e,t)=>{l[t]??=new Uint8Array(n.width*n.height).fill(255)}),n.bandMasks=l,n.mask=m.combineBandMasks(l))}else n=await s(t,{...a,offset:o?.[0]??a.offset},i);return"jpg"!==r&&null!=a.noDataValue&&1===n.depthCount&&l(n,a.noDataValue,{customFloatTolerance:a.tolerance}),a.isPoint&&L(n),n.statistics?.length||a.skipStatistics||n.updateStatistics(),n}export{M as decode,I as getFormat};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const e=(e,r)=>{const
|
|
2
|
+
const e=(e,r)=>{const n=r.width*r.height,a=r.pixelType;return Math.floor(e.byteLength/(n*t(a)))},t=e=>{let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t},r=(e,t)=>{if(8*e.byteLength<t)return null;const r=new Uint8Array(e,0,Math.ceil(t/8)),n=new Uint8Array(t);let a=0,l=0;for(let i=0;i<r.length-1;i++){l=r[i];for(let e=7;e>=0;e--)n[a++]=l>>e&1}let s=7;for(;a<t-1;)l=r[r.length-1],n[a++]=l>>s&1,s--;return n};function n(n,a){const l=a.pixelType,s=[],i=a.width*a.height,h=e(n,a),{bandIds:o,format:c}=a,y=o?.length||e(n,a),b=n.byteLength-n.byteLength%(i*t(l)),f=new l(n,0,i*h);if("bip"===c)for(let e=0;e<y;e++){const t=new l(i),r=o?o[e]:e;for(let e=0;e<i;e++)t[e]=f[e*h+r];s.push(t)}else if("bsq"===c)for(let e=0;e<y;e++){const t=o?o[e]:e;s.push(f.subarray(t*i,(t+1)*i))}let u=null;return b<n.byteLength-1&&(u=r(n.slice(b),i)),{pixels:s,mask:u}}export{n as decode};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function e(e,n){const r=[];if(!e)return r;if("valueExpression"in e&&e.valueExpression){const t={expression:e.valueExpression,title:e.valueExpressionTitle,profileInfo:{name:"visualization",context:`${e.type}-renderer`,source:n}};r.push(t)}if("visualVariables"in e&&e.visualVariables){const t=e.visualVariables.filter(({valueExpression:e})=>e&&"$view.scale"!==e).map(({valueExpression:e,valueExpressionTitle:r,type:t})=>({expression:e,title:r,profileInfo:{name:"visualization",context:`${t}-variable`,source:n}}));r.push(...t)}if("attributes"in e&&e.attributes){const t=e?.attributes.filter(({valueExpression:e})=>e).map(({valueExpression:r,valueExpressionTitle:t})=>({expression:r,title:t,profileInfo:{name:"visualization",context:`${e.type}-renderer`,source:n}}));r.push(...t)}return r}function n(e,n,r){let t;if("layer"!==e)t="-feature-reduction";else switch(n){case"imagery":case"imagery-tile":t="-imagery";break;case"voxel":t="-voxel";break;default:t=""}return`${r?"popup-element":"popup"}${t}`}function r(e,r,t){const o=[];if(e?.expressionInfos){const s=e?.expressionInfos.map(({title:e,name:o,expression:s,returnType:i})=>({title:e,name:o,expression:s,profileInfo:{name:n(r,t,!1),context:"popup-template",returnType:i,source:r}}));o.push(...s)}if(e?.content&&Array.isArray(e.content)){const s=e?.content.filter(({type:e})=>"expression"===e).map(({expressionInfo:e})=>({title:e.title,expression:e.expression,profileInfo:{name:n(r,t,!0),context:"popup-expression-content",returnType:e.returnType,source:r}}));o.push(...s)}return o}function t(e){const n=[];if(e?.featureExpressionInfo?.expression){const r={expression:e?.featureExpressionInfo?.expression,profileInfo:{name:"feature-z",context:"elevation-info",source:"layer"}};n.push(r)}return n}function o(e){const n=[];if(e){const r=e.filter(({valueExpression:e})=>e).map(({valueExpression:e})=>({expression:e,profileInfo:{name:"feature-z",context:"order-by",source:"layer"}}));n.push(...r)}return n}function s(e){const n=[];if(e?.expressionInfos){const r=e?.expressionInfos.map(({title:e,name:n,expression:r,returnType:t})=>({title:e,name:n,expression:r,profileInfo:{name:
|
|
2
|
+
function e(e,n){const r=[];if(!e)return r;if("valueExpression"in e&&e.valueExpression){const t={expression:e.valueExpression,title:e.valueExpressionTitle,profileInfo:{name:"visualization",context:`${e.type}-renderer`,source:n}};r.push(t)}if("visualVariables"in e&&e.visualVariables){const t=e.visualVariables.filter(({valueExpression:e})=>e&&"$view.scale"!==e).map(({valueExpression:e,valueExpressionTitle:r,type:t})=>({expression:e,title:r,profileInfo:{name:"visualization",context:`${t}-variable`,source:n}}));r.push(...t)}if("attributes"in e&&e.attributes){const t=e?.attributes.filter(({valueExpression:e})=>e).map(({valueExpression:r,valueExpressionTitle:t})=>({expression:r,title:t,profileInfo:{name:"visualization",context:`${e.type}-renderer`,source:n}}));r.push(...t)}return r}function n(e,n,r){let t;if("layer"!==e)t="-feature-reduction";else switch(n){case"imagery":case"imagery-tile":t="-imagery";break;case"voxel":t="-voxel";break;default:t=""}return`${r?"popup-element":"popup"}${t}`}function r(e,r,t){const o=[];if(e?.expressionInfos){const s=e?.expressionInfos.map(({title:e,name:o,expression:s,returnType:i})=>({title:e,name:o,expression:s,profileInfo:{name:n(r,t,!1),context:"popup-template",returnType:i,source:r}}));o.push(...s)}if(e?.content&&Array.isArray(e.content)){const s=e?.content.filter(({type:e})=>"expression"===e).map(({expressionInfo:e})=>({title:e.title,expression:e.expression,profileInfo:{name:n(r,t,!0),context:"popup-expression-content",returnType:e.returnType,source:r}}));o.push(...s)}return o}function t(e){const n=[];if(e?.featureExpressionInfo?.expression){const r={expression:e?.featureExpressionInfo?.expression,profileInfo:{name:"feature-z",context:"elevation-info",source:"layer"}};n.push(r)}return n}function o(e){const n=[];if(e){const r=e.filter(({valueExpression:e})=>e).map(({valueExpression:e})=>({expression:e,profileInfo:{name:"feature-z",context:"order-by",source:"layer"}}));n.push(...r)}return n}function s(e){const n=[];if(e?.expressionInfos){const r=e?.expressionInfos.map(({title:e,name:n,expression:r,returnType:t})=>({title:e,name:n,expression:r,profileInfo:{name:i(t),context:"form-template",returnType:t,source:"layer"}}));n.push(...r)}return n}function i(e){switch(e){case"boolean":return"form-constraint";case"dictionary":return"form-dynamic-choice";default:return"form-calculation"}}function a(n){return[...r(n?.popupTemplate,"feature-reduction"),...u(n?.labelingInfo,"feature-reduction"),...e(n?.renderer,"feature-reduction"),...p(n?.fields)]}function p(e){const n=[];if(e){const r=e.filter(({onStatisticExpression:e,isAutoGenerated:n})=>e&&!n).map(({onStatisticExpression:{expression:e,title:n}})=>({expression:e,title:n,profileInfo:{name:"aggregate-field",context:"aggregate-field",source:"feature-reduction"}}));n.push(...r)}return n}function u(e,n){const r=[];if(e){const t=e.filter(({labelExpressionInfo:e})=>e?.expression).map(({labelExpressionInfo:e})=>({expression:e?.expression,title:e?.title,profileInfo:{name:"labeling",context:"label-class",source:n}}));r.push(...t)}return r}function l(n){const i=[];if("labelingInfo"in n&&i.push(...u(n.labelingInfo,"layer")),i.push(...r(n.popupTemplate,"layer",n.type)),"renderer"in n&&"imagery"!==n.type&&"imagery-tile"!==n.type&&i.push(...e(n.renderer,"layer")),"elevationInfo"in n&&i.push(...t(n.elevationInfo)),"featureReduction"in n&&i.push(...a(n.featureReduction)),"trackInfo"in n){const t=n.trackInfo;i.push(...e(t?.latestObservations.renderer),...e(t?.previousObservations.renderer),...e(t?.trackLines.renderer),...u(t?.latestObservations.labelingInfo),...u(t?.previousObservations.labelingInfo),...u(t?.trackLines.labelingInfo),...r(t?.popupTemplate))}return"orderBy"in n&&i.push(...o(n.orderBy)),"formTemplate"in n&&i.push(...s(n.formTemplate)),i}export{l as getExpressionsFromLayer};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.129",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.20.8",
|
|
23
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
23
|
+
"@arcgis/toolkit": "5.2.0-next.129",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
|
|
25
25
|
"@esri/calcite-components": "^5.2.0-next.80",
|
|
26
26
|
"@vaadin/grid": "~25.3.0",
|
|
27
|
-
"@zip.js/zip.js": "~2.
|
|
27
|
+
"@zip.js/zip.js": "~2.20.0",
|
|
28
28
|
"luxon": "~3.7.2",
|
|
29
29
|
"marked": "~18.0.14",
|
|
30
30
|
"tslib": "^2.8.1"
|
package/popup/FeatureContent.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import r from"../core/Accessor.js";import{isSome as s}from"../core/arrayUtils.js";import{createTask as o}from"../core/asyncUtils.js";import{IdentifiableMixin as a}from"../core/Identifiable.js";import n from"../core/Logger.js";import{abortMaybe as l}from"../core/maybe.js";import{eachAlways as p,isAbortError as h,throwIfAborted as c}from"../core/promiseUtils.js";import{watch as u,initial as d,when as f}from"../core/reactiveUtils.js";import{throttle as m}from"../core/throttle.js";import{property as g,subclass as y}from"../core/accessorSupport/decorators.js";import _ from"../geometry/Point.js";import b from"../geometry/SpatialReference.js";import v from"./content/TextContent.js";import{compileExpressionInfos as T,formatArcadeValue as I}from"./support/arcadeFeatureUtils.js";import A from"./support/FeatureAbilities.js";import{preLayerQueryCallback as x,preRequestCallback as C,createFieldInfoMap as E,getAllFieldInfos as w,getSourceLayer as F,querySourceLayer as k,queryUpdatedFeature as j,isRelatableFeatureSupportedLayer as P,isAssociatedFeatureSupportedLayer as R,formatEditInfo as O,substituteFieldsInLinksAndAttributes as M,graphicCallback as Z,formatAttributes as U,isRelatedField as N}from"./support/featureUtils.js";import{queryLayerInfos as S,queryRelatedFeatures as L,setRelatedFeatures as H,getRelatedFieldInfo as G,createRelatedInfo as q,updateRelatedInfo as z}from"./support/relatedFeatureUtils.js";import{system as B}from"../time/constants.js";var Q;const D=1;let J=class extends(a(r)){static{Q=this}constructor(t){super(t),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._graphicExpressionAttributes=null,this.abilities=new A,this.content=null,this.description=null,this.defaultPopupTemplateEnabled=!1,this.expressionAttributes=null,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.heading="",this.view=null,this._graphicChangedThrottled=m(this._graphicChanged,()=>this.notifyChange("waitingForContent"),D,this),this._isAllowedContentType=t=>{const{abilities:e}=this;return"attachments"===t.type&&!!e.attachmentsContent||"custom"===t.type&&!!e.customContent||"fields"===t.type&&!!e.fieldsContent||"media"===t.type&&!!e.mediaContent||"text"===t.type&&!!e.textContent||"expression"===t.type&&!!e.expressionContent||"relationship"===t.type&&!!e.relationshipContent||"utility-network-associations"===t.type&&!!e.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=m(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),D,this),this.addHandles([u(()=>[this._effectivePopupTemplate,this.abilities.attachmentsContent,this.abilities.chartAnimation,this.abilities.customContent,this.abilities.expressionContent,this.abilities.fieldsContent,this.abilities.mediaContent,this.abilities.relationshipContent,this.abilities.textContent,this.abilities.utilityNetworkAssociationsContent,this.graphic,this.timeZone],()=>this._graphicChangedThrottled(),d),f(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const t=this._graphicChangedTask.value,e=t?.expressionInfos?.dependencies;return[t,e?.has("view-scale")?this.view?.scale:null,e?.has("view-time-extent")?this.view?.timeExtent?.start:null,e?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([t])=>this._evaluateExpressionAttributesThrottled(t))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=l(this._graphicChangedTask),this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new i(x,C)}get _effectivePopupTemplate(){return this.graphic?.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled)??null}get _fieldInfoMap(){return E(w(this._effectivePopupTemplate),this._layer)}get _layer(){return F(this.graphic)}get isFeatureFromTable(){return this._layer?.isTable??!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(t){this._override("spatialReference",t)}get timeZone(){return this.view?.timeZone??B}set timeZone(t){this._overrideIfSome("timeZone",t)}get map(){return this.view?.map||null}set map(t){this._override("map",t)}get waitingForContent(){const{_graphicChangedThrottled:t,_evaluateExpressionAttributesThrottled:e,_graphicChangedTask:i,_evaluateExpressionAttributesTask:r}=this;return t.hasPendingUpdates()||e.hasPendingUpdates()||null!=i&&!i.finished||null!=r&&!r.finished}async updateGeometry(){const{graphic:t,spatialReference:e,_layer:i}=this;await(i?.load());const r=i?.objectIdField;if(!r||!t)return;const s=t.attributes?.[r];if(null==s)return;const o=[s],a=await k({layer:i,graphic:t,outFields:[],objectIds:o,returnGeometry:!0,spatialReference:e}),n=a?.geometry;n&&(t.geometry=n)}_clear(){this._set("heading",""),this._set("content",null),this._set("formattedAttributes",null),this._set("expressionAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._graphicChangedTask=l(this._graphicChangedTask),this._graphicChangedTask=o(async t=>{this._error=null,this._clear();const{graphic:e}=this;try{if(!e)return null;const{_layer:i,_effectivePopupTemplate:r}=this,s=this.spatialReference;await j({graphic:e,popupTemplate:r,layer:i,spatialReference:s},{signal:t});const[{value:o},{value:a}]=await p([this._getContent(),this._getTitle()]),[,{value:n}]=await p([this._checkForRelatedFeatures({signal:t}),T(r?.expressionInfos,e)]);return{expressionInfos:n,content:o,heading:a}}catch(i){throw h(i)||(this._error=i,n.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(t){return"relationship"===t.type?P(this._layer)?t:void 0:"utility-network-associations"===t.type?R(this._layer)?t:void 0:t}_compileContent(t){if(this.graphic)return Array.isArray(t)?t.filter(this._isAllowedContentType).map(t=>this._compileContentElement(t)).filter(s):"string"==typeof t?new v({text:t}).text:t}_compileLastEditInfo(){const{_effectivePopupTemplate:t,_layer:e,graphic:i,timeZone:r}=this;if(!t)return;const{lastEditInfoEnabled:s}=t,o=e?.editFieldsInfo;return s&&o?O(o,i?.attributes,r,e):void 0}_compileHeading(t){const{_fieldInfoMap:e,_layer:i,graphic:r,expressionAttributes:s}=this,o=r?.attributes??{},a=this.formattedAttributes?.global??{};return M({attributes:o,fieldInfoMap:e,globalAttributes:a,expressionAttributes:s,layer:i,text:t})}async _getTitle(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"title",value:t?.title,event:{graphic:e}}):null}async _getContent(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"content",value:t?.content,event:{graphic:e}}):null}_evaluateExpressionAttributes({heading:t,content:e,expressionInfos:i}){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=o(async r=>{const{graphic:s,map:o,view:a,spatialReference:l,location:p}=this;try{if(!s)return;let n;if(null!=i){const t=[];for(const[e,n]of i.expressions.entries())null!=n?t.push(n.evaluate({graphic:s,interceptor:Q.interceptor,location:p,map:o,options:{signal:r},spatialReference:l,view:a}).then(t=>[e,"string"==typeof t?I(t):t]).catch(()=>[e,void 0])):t.push(Promise.resolve([e,void 0]));n=Object.fromEntries(await Promise.all(t)),c(r)}this._set("expressionAttributes",n??null),this._graphicExpressionAttributes={...s.attributes,...n},this._set("formattedAttributes",this._createFormattedAttributes(e)),this._set("heading",this._compileHeading(t)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(e)||null)}catch(u){h(u)||(this._error=u,n.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:u,graphic:s,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){const{_effectivePopupTemplate:r,graphic:s,relatedInfos:o,_layer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[e]=U({attributes:{...l,...t.attributes},fieldInfoMap:n,fieldInfos:r?.fieldInfos,graphic:s,layer:a,relatedInfos:o,timeZone:p})}_createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){if(t.fieldInfos){const{graphic:r,relatedInfos:s,_layer:o,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[e]=U({attributes:{...n,...t.attributes},fieldInfoMap:a,fieldInfos:t.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:o,relatedInfos:s,timeZone:l})}}_createFormattedAttributes(t){const{_effectivePopupTemplate:e,graphic:i,relatedInfos:r,_layer:s,_fieldInfoMap:o,_graphicExpressionAttributes:a,timeZone:n}=this,l=e?.fieldInfos,p={global:U({attributes:a,fieldInfoMap:o,fieldInfos:l,graphic:i,layer:s,relatedInfos:r,timeZone:n}),content:[]};return Array.isArray(t)&&t.forEach((t,e)=>{"fields"===t.type&&this._createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p}),"media"===t.type&&this._createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p})}),p}_checkForRelatedFeatures(t){const{graphic:e,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(e,w(i),t)}async _queryRelatedInfos(t,e,i){const{relatedInfos:r,_layer:s}=this;r.clear();const o=await(s?.associatedLayer?.load(i))??s;if(!o||!t)return;const a=e.filter(t=>!!t.fieldName&&N(t.fieldName));if(!a?.length)return;e.forEach(t=>this._configureRelatedInfo(t,o));const n=await S({relatedInfos:r,layer:o},i);Object.keys(n).forEach(t=>{const e=r.get(t.toString()),i=n[t]?.value;e&&i&&(e.layerInfo=i.data)});const l=await L({graphic:t,relatedInfos:r,layer:o},i);Object.keys(l).forEach(t=>{H(l[t]?.value,r.get(t.toString()))})}_configureRelatedInfo(t,e){const{relatedInfos:i}=this,r=G(t.fieldName||"");if(!r)return;const{layerId:s,fieldName:o}=r;if(!s)return;const a=i.get(s.toString())||q(s,e);a&&(z({relatedInfo:a,fieldName:o,fieldInfo:t}),this.relatedInfos.set(s,a))}};t([g()],J.prototype,"_error",void 0),t([g()],J.prototype,"_graphicChangedTask",void 0),t([g()],J.prototype,"_evaluateExpressionAttributesTask",void 0),t([g({readOnly:!0})],J.prototype,"_effectivePopupTemplate",null),t([g({readOnly:!0})],J.prototype,"_fieldInfoMap",null),t([g({readOnly:!0})],J.prototype,"_layer",null),t([g({type:A})],J.prototype,"abilities",void 0),t([g({readOnly:!0})],J.prototype,"content",void 0),t([g()],J.prototype,"description",void 0),t([g({type:Boolean})],J.prototype,"defaultPopupTemplateEnabled",void 0),t([g({readOnly:!0})],J.prototype,"expressionAttributes",void 0),t([g({readOnly:!0})],J.prototype,"isFeatureFromTable",null),t([g({readOnly:!0})],J.prototype,"state",null),t([g({readOnly:!0})],J.prototype,"formattedAttributes",void 0),t([g({type:e})],J.prototype,"graphic",void 0),t([g({readOnly:!0})],J.prototype,"lastEditInfo",void 0),t([g({type:_})],J.prototype,"location",void 0),t([g({readOnly:!0})],J.prototype,"relatedInfos",void 0),t([g({type:b})],J.prototype,"spatialReference",null),t([g()],J.prototype,"timeZone",null),t([g({readOnly:!0})],J.prototype,"heading",void 0),t([g()],J.prototype,"map",null),t([g({readOnly:!0})],J.prototype,"waitingForContent",null),t([g()],J.prototype,"view",void 0),J=Q=t([y("esri.popup.FeatureContent")],J);const K=J;export{K as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import s from"../core/Accessor.js";import{isSome as r}from"../core/arrayUtils.js";import{createTask as o}from"../core/asyncUtils.js";import{IdentifiableMixin as n}from"../core/Identifiable.js";import a from"../core/Logger.js";import{abortMaybe as l}from"../core/maybe.js";import{eachAlways as p,isAbortError as h,throwIfAborted as c}from"../core/promiseUtils.js";import{watch as u,initial as d,when as f}from"../core/reactiveUtils.js";import{throttle as m}from"../core/throttle.js";import{property as g,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/Point.js";import b from"../geometry/SpatialReference.js";import v from"./content/TextContent.js";import{compileExpressionInfos as T,formatArcadeValue as I}from"./support/arcadeFeatureUtils.js";import A from"./support/FeatureAbilities.js";import{preLayerQueryCallback as x,preRequestCallback as C,getPopupLayer as E,createFieldInfoMap as w,getAllFieldInfos as F,querySourceLayer as k,queryUpdatedFeature as j,isRelatableFeatureSupportedLayer as P,isAssociatedFeatureSupportedLayer as R,formatEditInfo as O,substituteFieldsInLinksAndAttributes as M,graphicCallback as Z,formatAttributes as U,isRelatedField as N}from"./support/featureUtils.js";import{queryLayerInfos as S,queryRelatedFeatures as L,setRelatedFeatures as H,getRelatedFieldInfo as G,createRelatedInfo as q,updateRelatedInfo as z}from"./support/relatedFeatureUtils.js";import{system as B}from"../time/constants.js";var Q;const D=1;let J=class extends(n(s)){static{Q=this}constructor(t){super(t),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._graphicExpressionAttributes=null,this.abilities=new A,this.content=null,this.description=null,this.defaultPopupTemplateEnabled=!1,this.expressionAttributes=null,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.heading="",this.view=null,this._graphicChangedThrottled=m(this._graphicChanged,()=>this.notifyChange("waitingForContent"),D,this),this._isAllowedContentType=t=>{const{abilities:e}=this;return"attachments"===t.type&&!!e.attachmentsContent||"custom"===t.type&&!!e.customContent||"fields"===t.type&&!!e.fieldsContent||"media"===t.type&&!!e.mediaContent||"text"===t.type&&!!e.textContent||"expression"===t.type&&!!e.expressionContent||"relationship"===t.type&&!!e.relationshipContent||"utility-network-associations"===t.type&&!!e.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=m(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),D,this),this.addHandles([u(()=>[this._effectivePopupTemplate,this.abilities.attachmentsContent,this.abilities.chartAnimation,this.abilities.customContent,this.abilities.expressionContent,this.abilities.fieldsContent,this.abilities.mediaContent,this.abilities.relationshipContent,this.abilities.textContent,this.abilities.utilityNetworkAssociationsContent,this.graphic,this.timeZone],()=>this._graphicChangedThrottled(),d),f(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const t=this._graphicChangedTask.value,e=t?.expressionInfos?.dependencies;return[t,e?.has("view-scale")?this.view?.scale:null,e?.has("view-time-extent")?this.view?.timeExtent?.start:null,e?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([t])=>this._evaluateExpressionAttributesThrottled(t))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=l(this._graphicChangedTask),this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new i(x,C)}get _effectivePopupTemplate(){return this.graphic?.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled)??null}get _fieldInfoMap(){const t=E(this.graphic);return w(F(this._effectivePopupTemplate),t)}get isFeatureFromTable(){const t=E(this.graphic);return t?.isTable??!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(t){this._override("spatialReference",t)}get timeZone(){return this.view?.timeZone??B}set timeZone(t){this._overrideIfSome("timeZone",t)}get map(){return this.view?.map||null}set map(t){this._override("map",t)}get waitingForContent(){const{_graphicChangedThrottled:t,_evaluateExpressionAttributesThrottled:e,_graphicChangedTask:i,_evaluateExpressionAttributesTask:s}=this;return t.hasPendingUpdates()||e.hasPendingUpdates()||null!=i&&!i.finished||null!=s&&!s.finished}async updateGeometry(){const{graphic:t,spatialReference:e}=this,i=E(t);await(i?.load());const s=i?.objectIdField;if(!s||!t)return;const r=t.attributes?.[s];if(null==r)return;const o=[r],n=await k({layer:i,graphic:t,outFields:[],objectIds:o,returnGeometry:!0,spatialReference:e}),a=n?.geometry;a&&(t.geometry=a)}_clear(){this._set("heading",""),this._set("content",null),this._set("formattedAttributes",null),this._set("expressionAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._graphicChangedTask=l(this._graphicChangedTask),this._graphicChangedTask=o(async t=>{this._error=null,this._clear();const{graphic:e}=this;try{if(!e)return null;const{_effectivePopupTemplate:i}=this,s=E(e),r=this.spatialReference;await j({graphic:e,popupTemplate:i,layer:s,spatialReference:r},{signal:t});const[{value:o},{value:n}]=await p([this._getContent(),this._getTitle()]),[,{value:a}]=await p([this._checkForRelatedFeatures({signal:t}),T(i?.expressionInfos,e)]);return{expressionInfos:a,content:o,heading:n}}catch(i){throw h(i)||(this._error=i,a.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(t){const e=E(this.graphic);return"relationship"===t.type?P(e)?t:void 0:"utility-network-associations"===t.type?R(e)?t:void 0:t}_compileContent(t){if(this.graphic)return Array.isArray(t)?t.filter(this._isAllowedContentType).map(t=>this._compileContentElement(t)).filter(r):"string"==typeof t?new v({text:t}).text:t}_compileLastEditInfo(){const{_effectivePopupTemplate:t,graphic:e,timeZone:i}=this,s=E(e);if(!t)return;const{lastEditInfoEnabled:r}=t,o=s?.editFieldsInfo;return r&&o?O(o,e?.attributes,i,s):void 0}_compileHeading(t){const{_fieldInfoMap:e,graphic:i,expressionAttributes:s}=this,r=E(i),o=i?.attributes??{},n=this.formattedAttributes?.global??{};return M({attributes:o,fieldInfoMap:e,globalAttributes:n,expressionAttributes:s,layer:r,text:t})}async _getTitle(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"title",value:t?.title,event:{graphic:e}}):null}async _getContent(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"content",value:t?.content,event:{graphic:e}}):null}_evaluateExpressionAttributes({heading:t,content:e,expressionInfos:i}){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=o(async s=>{const{graphic:r,map:o,view:n,spatialReference:l,location:p}=this;try{if(!r)return;let a;if(null!=i){const t=[];for(const[e,a]of i.expressions.entries())null!=a?t.push(a.evaluate({graphic:r,interceptor:Q.interceptor,location:p,map:o,options:{signal:s},spatialReference:l,view:n}).then(t=>[e,"string"==typeof t?I(t):t]).catch(()=>[e,void 0])):t.push(Promise.resolve([e,void 0]));a=Object.fromEntries(await Promise.all(t)),c(s)}this._set("expressionAttributes",a??null),this._graphicExpressionAttributes={...r.attributes,...a},this._set("formattedAttributes",this._createFormattedAttributes(e)),this._set("heading",this._compileHeading(t)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(e)||null)}catch(u){h(u)||(this._error=u,a.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:u,graphic:r,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:r,relatedInfos:o,_fieldInfoMap:n,_graphicExpressionAttributes:a,timeZone:l}=this,p=E(r);i.content[e]=U({attributes:{...a,...t.attributes},fieldInfoMap:n,fieldInfos:s?.fieldInfos,graphic:r,layer:p,relatedInfos:o,timeZone:l})}_createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){if(t.fieldInfos){const{graphic:s,relatedInfos:r,_fieldInfoMap:o,_graphicExpressionAttributes:n,timeZone:a}=this,l=E(s);i.content[e]=U({attributes:{...n,...t.attributes},fieldInfoMap:o,fieldInfos:t.fieldInfos,graphic:s,isContentFieldInfos:!0,layer:l,relatedInfos:r,timeZone:a})}}_createFormattedAttributes(t){const{_effectivePopupTemplate:e,graphic:i,relatedInfos:s,_fieldInfoMap:r,_graphicExpressionAttributes:o,timeZone:n}=this,a=E(i),l=e?.fieldInfos,p={global:U({attributes:o,fieldInfoMap:r,fieldInfos:l,graphic:i,layer:a,relatedInfos:s,timeZone:n}),content:[]};return Array.isArray(t)&&t.forEach((t,e)=>{"fields"===t.type&&this._createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p}),"media"===t.type&&this._createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p})}),p}_checkForRelatedFeatures(t){const{graphic:e,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(e,F(i),t)}async _queryRelatedInfos(t,e,i){const{relatedInfos:s}=this,r=E(t);s.clear();const o=await(r?.associatedLayer?.load(i))??r;if(!o||!t)return;const n=e.filter(t=>!!t.fieldName&&N(t.fieldName));if(!n?.length)return;e.forEach(t=>this._configureRelatedInfo(t,o));const a=await S({relatedInfos:s,layer:o},i);Object.keys(a).forEach(t=>{const e=s.get(t.toString()),i=a[t]?.value;e&&i&&(e.layerInfo=i.data)});const l=await L({graphic:t,relatedInfos:s,layer:o},i);Object.keys(l).forEach(t=>{H(l[t]?.value,s.get(t.toString()))})}_configureRelatedInfo(t,e){const{relatedInfos:i}=this,s=G(t.fieldName||"");if(!s)return;const{layerId:r,fieldName:o}=s;if(!r)return;const n=i.get(r.toString())||q(r,e);n&&(z({relatedInfo:n,fieldName:o,fieldInfo:t}),this.relatedInfos.set(r,n))}};t([g()],J.prototype,"_error",void 0),t([g()],J.prototype,"_graphicChangedTask",void 0),t([g()],J.prototype,"_evaluateExpressionAttributesTask",void 0),t([g({readOnly:!0})],J.prototype,"_effectivePopupTemplate",null),t([g({readOnly:!0})],J.prototype,"_fieldInfoMap",null),t([g({type:A})],J.prototype,"abilities",void 0),t([g({readOnly:!0})],J.prototype,"content",void 0),t([g()],J.prototype,"description",void 0),t([g({type:Boolean})],J.prototype,"defaultPopupTemplateEnabled",void 0),t([g({readOnly:!0})],J.prototype,"expressionAttributes",void 0),t([g({readOnly:!0})],J.prototype,"isFeatureFromTable",null),t([g({readOnly:!0})],J.prototype,"state",null),t([g({readOnly:!0})],J.prototype,"formattedAttributes",void 0),t([g({type:e})],J.prototype,"graphic",void 0),t([g({readOnly:!0})],J.prototype,"lastEditInfo",void 0),t([g({type:y})],J.prototype,"location",void 0),t([g({readOnly:!0})],J.prototype,"relatedInfos",void 0),t([g({type:b})],J.prototype,"spatialReference",null),t([g()],J.prototype,"timeZone",null),t([g({readOnly:!0})],J.prototype,"heading",void 0),t([g()],J.prototype,"map",null),t([g({readOnly:!0})],J.prototype,"waitingForContent",null),t([g()],J.prototype,"view",void 0),J=Q=t([_("esri.popup.FeatureContent")],J);const K=J;export{K as default};
|
|
@@ -325,6 +325,8 @@ export default class FeatureContentCollection extends FeatureContentCollectionSu
|
|
|
325
325
|
* @see [waitingForResult](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#waitingForResult)
|
|
326
326
|
*/
|
|
327
327
|
accessor open: boolean;
|
|
328
|
+
/** The location supplied when opening a feature stream while waiting for the first feature. This is `null` after the first feature arrives or the stream ends. Unlike [location](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#location), it does not change the popup location while waiting. */
|
|
329
|
+
get pendingLocation(): Point | null | undefined;
|
|
328
330
|
/**
|
|
329
331
|
* The selected feature accessed. The [content](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#content) is
|
|
330
332
|
* determined based on the [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) assigned to
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Error.js";import{EventedAccessor as a}from"../core/Evented.js";import r from"../core/Logger.js";import{abortMaybe as s}from"../core/maybe.js";import{debounce as o,logOnError as n,isAbortError as l}from"../core/promiseUtils.js";import{watch as u,when as h,sync as c}from"../core/reactiveUtils.js";import{property as p,subclass as d}from"../core/accessorSupport/decorators.js";import g from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import f from"../geometry/SpatialReference.js";import{geographicToWebMercator as y}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as F}from"../layers/LayerConstants.js";import{ActionsCollection as v,zoomToAggregatedFeatures as w,browseAggregatedFeatures as b,zoomToFeature as I}from"./actions.js";import{getSelectedTarget as C}from"./actionUtils.js";import A from"./FeatureContent.js";import S from"./support/FeatureAbilities.js";import{getDisplayedSymbol as P}from"../symbols/support/symbolUtils.js";import{system as x}from"../time/constants.js";import{highlightsSupported as L}from"../views/support/layerViewUtils.js";import{GoTo as E}from"../widgets/support/GoTo.js";const j=()=>[I.clone()],R=()=>[w.clone(),b.clone()];let O=null;function U(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let T=class extends(E(a)){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new S,this._activeFeatureStream=null,this.actions=new v,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=o(async()=>{this._cancelLocationUpdate();const e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([u(()=>this.view?.scale,()=>{this.open&&n(this._debouncedLocationUpdate(),r.getLogger(this))}),u(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),u(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),u(()=>this.location,e=>this._locationChange(e)),u(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),u(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),u(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),u(()=>this.featureItems,()=>this._featureItemsChange()),u(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),h(()=>!this.waitingForResult,()=>this._waitingForResultChange(),c),h(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new v;e.removeAll();const{actions:i,defaultActions:a,defaultPopupTemplateEnabled:r,includeDefaultActions:s,selectedFeature:o}=this,n=s?a.concat(i):i,l=o&&("function"==typeof o.getEffectivePopupTemplate&&o.getEffectivePopupTemplate(r)||o.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(n)??n;return h?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.featureStream=null,this._set("diagnostics",null),this.features=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new v;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?R():j()),e}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get("featureStream")||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,i){this._set("diagnostics",i??null),this._get("featureStream")!==e&&(this._set("featureStream",e),this._cancelFeatureStream(),e&&(this.features=[],this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionEnabled?"list":"feature")}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){const t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?y(e):e;this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get streamingFeatures(){return null!=this._activeFeatureStream}get selectedFeature(){return-1===this.selectedFeatureIndex?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.view?this.view.ready?"ready":"disabled":this.map?"ready":"disabled"}get timeZone(){return this.view?.timeZone??x}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set("diagnostics",null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,t){const{view:a}=this;if(!a||!e)throw new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screen point/screen area and view.",{screenPoint:e,view:a});const r={},s=a.fetchPopupFeatures(e,{diagnostics:r,pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this._setFeatureStream(s,void 0,r)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){const{selectedFeatureIndex:t}=this,i=null!=this._activeFeatureStream&&e.length>0;"list"!==this.initialDisplayMode?i&&-1===t?this.selectedFeatureIndex=0:i&&-1!==t||(this.selectedFeatureIndex=e.length?0:-1):i||(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=C(this);this._cancelCenterAtLocation();const a=new AbortController,{signal:s}=a;return this._centerAtLocationController=a,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:s}}).catch(e=>{l(e)||r.getLogger(this).error(e)}):Promise.reject(new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:a}=this;a&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){-1!==this.selectedFeatureIndex&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:a,featureItems:r}=this;if(null==i)return;const s=((i-1)*a+t)%t,o=Math.min(s+a,r.length);for(let n=s;n<o;n++){const t=r[n];t&&(t.graphic??=e[n])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:a}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!a)return;const r=_(e)?.type;if("map-image"!==r&&"imagery"!==r&&"imagery-tile"!==r||(e.symbol=await P(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));return void(this.location=t(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=a.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,a=this.view,r=this.spatialReference,s=this.map,o=this.timeZone,n=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const u=[],h=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&h.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,u[p]=d,void c.add(d);const g=h.get(t);if(g&&!c.has(g))return g.abilities=l,u[p]=g,void c.add(g);const m=new A({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:r,graphic:t===e?t:null,location:n,map:s,view:a,timeZone:o});u[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",u)}_cancelCenterAtLocation(){this._centerAtLocationController=s(this._centerAtLocationController)}_cancelFeatureStream(){const e=this._activeFeatureStream;this._activeFeatureStream=null,this._get("featureStream")===e&&this._set("featureStream",null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){const{spatialReference:t}=this,i=this.selectedFeature,a=i?.geometry?.type,s=this.location;if(a&&"mesh"!==a&&t&&s&&i){if("point"===a){const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));if(e?.signal?.aborted||this.selectedFeature!==i||!i.geometry)return;return void(this.location=t(i.geometry))}try{let a=i.geometry;const r=this._getHighlightLayer(i),o=i.getObjectId();if(!r||!this.view)return;if(null!=o){const i=this.view?.allLayerViews.find(e=>e.layer.uid===r.uid);if(!i||!("queryFeatures"in i))return;const s=i.createQuery();s.outSpatialReference=t,s.objectIds=[o],s.returnGeometry=!0;const{features:n}=await i.queryFeatures(s,e);if(e?.signal?.aborted)return;a=n[0]?.geometry}if(!a||"mesh"===a.type)return;a=m(a,t),O??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[{intersectsExecute:n},{proximityGetNearestCoordinate:l}]=O;if(!n(a,s)){const e=l(a,s).coordinate??s;this.selectedFeature===i&&(this.location=e)}}catch(o){l(o)||r.getLogger(this).error(o)}}}_cancelLocationUpdate(){this._locationUpdateController=s(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=_(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(U(t.type,i))return e;const a=e.getObjectId();if(null!=a)return a;const r="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||F:null,s=e.attributes;return s&&r&&s[r]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:a,view:r,open:s}=this;if(!r||!a||!s)return;const o=this._getHighlightLayer(i);if(!o)return;const n=this._getHighlightLayerView(r,o);if(!n)return;this._highlightPromises[e]=n;const l=await n;if(!(l&&L(l)&&this._highlightPromises[e]===n&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,o,r.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}async _consumeFeatureStream(e,t){try{for await(const i of e){if(e!==this._activeFeatureStream)return;void 0!==t&&(this.location=t,t=void 0),this._addFeature(i)}}finally{this._activeFeatureStream===e&&(this._activeFeatureStream=null,this._waitingForResultChange())}}_addFeature(e){const{features:t}=this;t.includes(e)||(this.features=t.concat(e))}};e([p()],T.prototype,"_initialDisplayMode",void 0),e([p()],T.prototype,"_activeFeatureStream",void 0),e([p({type:v})],T.prototype,"actions",void 0),e([p({readOnly:!0})],T.prototype,"active",null),e([p()],T.prototype,"activeFeature",void 0),e([p({readOnly:!0})],T.prototype,"allActions",null),e([p()],T.prototype,"aggregatedFeaturesEnabled",void 0),e([p({value:null})],T.prototype,"content",null),e([p({type:v,readOnly:!0})],T.prototype,"defaultActions",null),e([p({type:Boolean})],T.prototype,"defaultPopupTemplateEnabled",void 0),e([p({readOnly:!0})],T.prototype,"diagnostics",void 0),e([p({readOnly:!0})],T.prototype,"effectiveHeading",null),e([p({readOnly:!0})],T.prototype,"featureCount",null),e([p()],T.prototype,"featurePage",void 0),e([p({value:[]})],T.prototype,"features",null),e([p()],T.prototype,"featureStream",null),e([p()],T.prototype,"featuresPerPage",void 0),e([p()],T.prototype,"featureMenuOpen",void 0),e([p({type:S})],T.prototype,"featureItemAbilities",void 0),e([p({readOnly:!0})],T.prototype,"featureItems",void 0),e([p()],T.prototype,"heading",void 0),e([p()],T.prototype,"highlightEnabled",void 0),e([p()],T.prototype,"includeDefaultActions",void 0),e([p()],T.prototype,"initialDisplayMode",null),e([p({type:g})],T.prototype,"location",null),e([p()],T.prototype,"map",null),e([p()],T.prototype,"open",void 0),e([p({readOnly:!0})],T.prototype,"streamingFeatures",null),e([p({value:null,readOnly:!0})],T.prototype,"selectedFeature",null),e([p({value:-1})],T.prototype,"selectedFeatureIndex",null),e([p({readOnly:!0})],T.prototype,"selectedFeatureItem",null),e([p({type:f})],T.prototype,"spatialReference",null),e([p({readOnly:!0})],T.prototype,"state",null),e([p()],T.prototype,"timeZone",null),e([p()],T.prototype,"updateLocationEnabled",void 0),e([p()],T.prototype,"view",void 0),e([p({readOnly:!0})],T.prototype,"waitingForContents",null),e([p({readOnly:!0})],T.prototype,"waitingForResult",null),e([p()],T.prototype,"zoomFactor",void 0),T=e([d("esri.popup.FeatureContentCollection")],T);const M=T;export{M as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Error.js";import{EventedAccessor as a}from"../core/Evented.js";import r from"../core/Logger.js";import{abortMaybe as s}from"../core/maybe.js";import{debounce as n,logOnError as o,isAbortError as l}from"../core/promiseUtils.js";import{watch as u,when as h,sync as c}from"../core/reactiveUtils.js";import{property as p,subclass as d}from"../core/accessorSupport/decorators.js";import g from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import f from"../geometry/SpatialReference.js";import{geographicToWebMercator as y}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as F}from"../layers/LayerConstants.js";import{ActionsCollection as v,zoomToAggregatedFeatures as w,browseAggregatedFeatures as b,zoomToFeature as I}from"./actions.js";import{getSelectedTarget as C}from"./actionUtils.js";import A from"./FeatureContent.js";import L from"./support/FeatureAbilities.js";import{getDisplayedSymbol as S}from"../symbols/support/symbolUtils.js";import{system as P}from"../time/constants.js";import{highlightsSupported as x}from"../views/support/layerViewUtils.js";import{GoTo as E}from"../widgets/support/GoTo.js";const j=()=>[I.clone()],R=()=>[w.clone(),b.clone()];let O=null;function U(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let T=class extends(E(a)){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new L,this._activeFeatureStream=null,this.actions=new v,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=n(async()=>{this._cancelLocationUpdate();const e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([u(()=>this.view?.scale,()=>{this.open&&o(this._debouncedLocationUpdate(),r.getLogger(this))}),u(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),u(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),u(()=>this.location,e=>this._locationChange(e)),u(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),u(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),u(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),u(()=>this.featureItems,()=>this._featureItemsChange()),u(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),h(()=>!this.waitingForResult,()=>this._waitingForResultChange(),c),h(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new v;e.removeAll();const{actions:i,defaultActions:a,defaultPopupTemplateEnabled:r,includeDefaultActions:s,selectedFeature:n}=this,o=s?a.concat(i):i,l=n&&("function"==typeof n.getEffectivePopupTemplate&&n.getEffectivePopupTemplate(r)||n.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(o)??o;return h?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.featureStream=null,this._set("diagnostics",null),this.features=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new v;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?R():j()),e}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get("featureStream")||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,i){this._set("diagnostics",i??null),this._get("featureStream")!==e&&(this._set("featureStream",e),this._cancelFeatureStream(),e&&(this.features=[],this._set("pendingLocation",t??null),this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionEnabled?"list":"feature")}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){const t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?y(e):e;this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingLocation(){return this._get("pendingLocation")??null}get streamingFeatures(){return null!=this._activeFeatureStream}get selectedFeature(){return-1===this.selectedFeatureIndex?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.view?this.view.ready?"ready":"disabled":this.map?"ready":"disabled"}get timeZone(){return this.view?.timeZone??P}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set("diagnostics",null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,t){const{view:a}=this;if(!a||!e)throw new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screen point/screen area and view.",{screenPoint:e,view:a});const r={},s=a.fetchPopupFeatures(e,{diagnostics:r,pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this._setFeatureStream(s,void 0,r)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){const{selectedFeatureIndex:t}=this,i=null!=this._activeFeatureStream&&e.length>0;"list"!==this.initialDisplayMode?i&&-1===t?this.selectedFeatureIndex=0:i&&-1!==t||(this.selectedFeatureIndex=e.length?0:-1):i||(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=C(this);this._cancelCenterAtLocation();const a=new AbortController,{signal:s}=a;return this._centerAtLocationController=a,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:s}}).catch(e=>{l(e)||r.getLogger(this).error(e)}):Promise.reject(new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:a}=this;a&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){-1!==this.selectedFeatureIndex&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:a,featureItems:r}=this;if(null==i)return;const s=((i-1)*a+t)%t,n=Math.min(s+a,r.length);for(let o=s;o<n;o++){const t=r[o];t&&(t.graphic??=e[o])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:a}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!a)return;const r=_(e)?.type;if("map-image"!==r&&"imagery"!==r&&"imagery-tile"!==r||(e.symbol=await S(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));return void(this.location=t(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=a.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,a=this.view,r=this.spatialReference,s=this.map,n=this.timeZone,o=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const u=[],h=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&h.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,u[p]=d,void c.add(d);const g=h.get(t);if(g&&!c.has(g))return g.abilities=l,u[p]=g,void c.add(g);const m=new A({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:r,graphic:t===e?t:null,location:o,map:s,view:a,timeZone:n});u[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",u)}_cancelCenterAtLocation(){this._centerAtLocationController=s(this._centerAtLocationController)}_cancelFeatureStream(){const e=this._activeFeatureStream;this._activeFeatureStream=null,this._set("pendingLocation",null),this._get("featureStream")===e&&this._set("featureStream",null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){const{spatialReference:t}=this,i=this.selectedFeature,a=i?.geometry?.type,s=this.location;if(a&&"mesh"!==a&&t&&s&&i){if("point"===a){const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));if(e?.signal?.aborted||this.selectedFeature!==i||!i.geometry)return;return void(this.location=t(i.geometry))}try{let a=i.geometry;const r=this._getHighlightLayer(i),n=i.getObjectId();if(!r||!this.view)return;if(null!=n){const i=this.view?.allLayerViews.find(e=>e.layer.uid===r.uid);if(!i||!("queryFeatures"in i))return;const s=i.createQuery();s.outSpatialReference=t,s.objectIds=[n],s.returnGeometry=!0;const{features:o}=await i.queryFeatures(s,e);if(e?.signal?.aborted)return;a=o[0]?.geometry}if(!a||"mesh"===a.type)return;a=m(a,t),O??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[{intersectsExecute:o},{proximityGetNearestCoordinate:l}]=O;if(!o(a,s)){const e=l(a,s).coordinate??s;this.selectedFeature===i&&(this.location=e)}}catch(n){l(n)||r.getLogger(this).error(n)}}}_cancelLocationUpdate(){this._locationUpdateController=s(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=_(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(U(t.type,i))return e;const a=e.getObjectId();if(null!=a)return a;const r="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||F:null,s=e.attributes;return s&&r&&s[r]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:a,view:r,open:s}=this;if(!r||!a||!s)return;const n=this._getHighlightLayer(i);if(!n)return;const o=this._getHighlightLayerView(r,n);if(!o)return;this._highlightPromises[e]=o;const l=await o;if(!(l&&x(l)&&this._highlightPromises[e]===o&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,n,r.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}async _consumeFeatureStream(e,t){try{for await(const i of e){if(e!==this._activeFeatureStream)return;void 0!==t&&(this.location=t,t=void 0),this._set("pendingLocation",null),this._addFeature(i)}}finally{this._activeFeatureStream===e&&(this._activeFeatureStream=null,this._set("pendingLocation",null),this._waitingForResultChange())}}_addFeature(e){const{features:t}=this;t.includes(e)||(this.features=t.concat(e))}};e([p()],T.prototype,"_initialDisplayMode",void 0),e([p()],T.prototype,"_activeFeatureStream",void 0),e([p({type:v})],T.prototype,"actions",void 0),e([p({readOnly:!0})],T.prototype,"active",null),e([p()],T.prototype,"activeFeature",void 0),e([p({readOnly:!0})],T.prototype,"allActions",null),e([p()],T.prototype,"aggregatedFeaturesEnabled",void 0),e([p({value:null})],T.prototype,"content",null),e([p({type:v,readOnly:!0})],T.prototype,"defaultActions",null),e([p({type:Boolean})],T.prototype,"defaultPopupTemplateEnabled",void 0),e([p({readOnly:!0})],T.prototype,"diagnostics",void 0),e([p({readOnly:!0})],T.prototype,"effectiveHeading",null),e([p({readOnly:!0})],T.prototype,"featureCount",null),e([p()],T.prototype,"featurePage",void 0),e([p({value:[]})],T.prototype,"features",null),e([p()],T.prototype,"featureStream",null),e([p()],T.prototype,"featuresPerPage",void 0),e([p()],T.prototype,"featureMenuOpen",void 0),e([p({type:L})],T.prototype,"featureItemAbilities",void 0),e([p({readOnly:!0})],T.prototype,"featureItems",void 0),e([p()],T.prototype,"heading",void 0),e([p()],T.prototype,"highlightEnabled",void 0),e([p()],T.prototype,"includeDefaultActions",void 0),e([p()],T.prototype,"initialDisplayMode",null),e([p({type:g})],T.prototype,"location",null),e([p()],T.prototype,"map",null),e([p()],T.prototype,"open",void 0),e([p({readOnly:!0})],T.prototype,"pendingLocation",null),e([p({readOnly:!0})],T.prototype,"streamingFeatures",null),e([p({value:null,readOnly:!0})],T.prototype,"selectedFeature",null),e([p({value:-1})],T.prototype,"selectedFeatureIndex",null),e([p({readOnly:!0})],T.prototype,"selectedFeatureItem",null),e([p({type:f})],T.prototype,"spatialReference",null),e([p({readOnly:!0})],T.prototype,"state",null),e([p()],T.prototype,"timeZone",null),e([p()],T.prototype,"updateLocationEnabled",void 0),e([p()],T.prototype,"view",void 0),e([p({readOnly:!0})],T.prototype,"waitingForContents",null),e([p({readOnly:!0})],T.prototype,"waitingForResult",null),e([p()],T.prototype,"zoomFactor",void 0),T=e([d("esri.popup.FeatureContentCollection")],T);const M=T;export{M as default};
|