@arcgis/core 4.23.0-next.20220123 → 4.23.0-next.20220128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Graphic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02fbc76dfdc20e628c61.js +1 -0
- package/assets/esri/core/workers/chunks/0453fad5cb819797b4f6.js +1 -0
- package/assets/esri/core/workers/chunks/0463ba46df855a92b9c0.js +1 -0
- package/assets/esri/core/workers/chunks/0cd0a6eef51fc5b9ea61.js +1 -0
- package/assets/esri/core/workers/chunks/{d1454155ee1b8a421cbb.js → 0d02c6ad1f4688bfa374.js} +1 -1
- package/assets/esri/core/workers/chunks/0d684f16f37d5dc385dd.js +1 -0
- package/assets/esri/core/workers/chunks/0e17691520d890d34efb.js +1 -0
- package/assets/esri/core/workers/chunks/16b6d0f8378582c051c3.js +1 -0
- package/assets/esri/core/workers/chunks/{0ce1dc14280d6f188468.js → 17de7a324dfa7f57ad5d.js} +1 -1
- package/assets/esri/core/workers/chunks/{b313ab14a643273e7d09.js → 1877ab1b6a115dbba1c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{c36f84daa7736878418d.js → 197ec52641aed20029c6.js} +1 -1
- package/assets/esri/core/workers/chunks/1b2a961f776a0b57e57a.js +1 -0
- package/assets/esri/core/workers/chunks/1b3fd66577b19aa5f2b6.js +1 -0
- package/assets/esri/core/workers/chunks/1c733b7db092a2a88ef3.js +1 -0
- package/assets/esri/core/workers/chunks/1f8c6a179e39fd4c5e6f.js +1 -0
- package/assets/esri/core/workers/chunks/2076fcbae63f1bfb7143.js +1 -0
- package/assets/esri/core/workers/chunks/{9387db408f496e7dd003.js → 214910032945dd2d86b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2ae5fc4f787ea568b88.js → 2460f3b6ada6ae900dec.js} +1 -1
- package/assets/esri/core/workers/chunks/27474b007988855bea9d.js +1 -0
- package/assets/esri/core/workers/chunks/281b89dbf5574fc642ae.js +1 -0
- package/assets/esri/core/workers/chunks/{4d539878bfbd7c549e60.js → 2c8fe9bc988c3c5760a5.js} +1 -1
- package/assets/esri/core/workers/chunks/2e899ef5881b4ec6fa55.js +1 -0
- package/assets/esri/core/workers/chunks/34b59d7099904dcb28b5.js +1 -0
- package/assets/esri/core/workers/chunks/357033117dfe61eb81ea.js +1 -0
- package/assets/esri/core/workers/chunks/37c03cfc19086ce631c6.js +1 -0
- package/assets/esri/core/workers/chunks/391e96192d1ec4e55ce2.js +1 -0
- package/assets/esri/core/workers/chunks/3c673495e5f507c4a9e5.js +1 -0
- package/assets/esri/core/workers/chunks/422537fc3df707bb62c9.js +1 -0
- package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
- package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
- package/assets/esri/core/workers/chunks/{c959e0d1cf7dce0421b9.js → 48fa8aed6c24877b44c4.js} +1 -1
- package/assets/esri/core/workers/chunks/{44b01d42d4ec72913229.js → 4954fd86b48cc68b737c.js} +1 -1
- package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
- package/assets/esri/core/workers/chunks/4ba6de8aa7e2960bad49.js +1 -0
- package/assets/esri/core/workers/chunks/4be35af7d6babbfe9d84.js +1 -0
- package/assets/esri/core/workers/chunks/5457962a70bd3c557a75.js +1 -0
- package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
- package/assets/esri/core/workers/chunks/{b9c177524b3e7de1ffd1.js → 5790d171072b3c7d108f.js} +1 -1
- package/assets/esri/core/workers/chunks/57b349d1dbc0bed75b79.js +1 -0
- package/assets/esri/core/workers/chunks/5bcb3240b3c005e5fe72.js +1 -0
- package/assets/esri/core/workers/chunks/5d11b97b667921d67ae7.js +1 -0
- package/assets/esri/core/workers/chunks/5dbe555a5a662ff3d9ce.js +1 -0
- package/assets/esri/core/workers/chunks/5ec98f4ddac707d0fbd1.js +1 -0
- package/assets/esri/core/workers/chunks/64b7e8d812ea8fcf269e.js +1 -0
- package/assets/esri/core/workers/chunks/{4c9084a04948b6924749.js → 655b55ac0cd533d7e9d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{b0b036ad3ad3cd956747.js → 69fd99b7c76e9992ccf3.js} +1 -1
- package/assets/esri/core/workers/chunks/{9cdaba126ac7fa5f33f0.js → 6cd5e4380d29b9a3c344.js} +1 -1
- package/assets/esri/core/workers/chunks/75d812955a473d0e8960.js +1 -0
- package/assets/esri/core/workers/chunks/7903a3e2e0faff0f86c0.js +1 -0
- package/assets/esri/core/workers/chunks/{cc146c57bbdac8029fd8.js → 7a5f5acfbd4ca1a5c1f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{64276aacaafa4c8a15bd.js → 7dcf52d3db3903c8eb9f.js} +1 -1
- package/assets/esri/core/workers/chunks/83d00afae4406ec78bc9.js +1 -0
- package/assets/esri/core/workers/chunks/{625d2663daa8e0cf64b0.js → 85b1f36790df95b17659.js} +1 -1
- package/assets/esri/core/workers/chunks/89820b200ee44e678af5.js +1 -0
- package/assets/esri/core/workers/chunks/918bb7a7d901544a7367.js +1 -0
- package/assets/esri/core/workers/chunks/{94b8dbf859df71858d1c.js → 929c9b7cdab7c4ca3d87.js} +1 -1
- package/assets/esri/core/workers/chunks/94515fb3ef38067eeadd.js +1 -0
- package/assets/esri/core/workers/chunks/949b2269457302ffc64b.js +1 -0
- package/assets/esri/core/workers/chunks/952980635afc7ec81804.js +1 -0
- package/assets/esri/core/workers/chunks/9876a1bae350795fab36.js +1 -0
- package/assets/esri/core/workers/chunks/99619fcb772807c74f3b.js +1 -0
- package/assets/esri/core/workers/chunks/{010a71c2aa1b7681e191.js → 9d11f84e6c893b9d0019.js} +1 -1
- package/assets/esri/core/workers/chunks/a1930e4f035bc9aa1ae5.js +1 -0
- package/assets/esri/core/workers/chunks/a8692bffb76444c34760.js +1 -0
- package/assets/esri/core/workers/chunks/aa04b90b82bf70caaae4.js +1 -0
- package/assets/esri/core/workers/chunks/aeaa1667c2d9f1b3366b.js +1 -0
- package/assets/esri/core/workers/chunks/b2d2de935487257c568b.js +1 -0
- package/assets/esri/core/workers/chunks/b3f5e91116112b0b612a.js +1 -0
- package/assets/esri/core/workers/chunks/b97953694f42bfec1b3c.js +1 -0
- package/assets/esri/core/workers/chunks/b9e9cb354822c6d995a4.js +1 -0
- package/assets/esri/core/workers/chunks/ba762bcfd74af0bb8218.js +1 -0
- package/assets/esri/core/workers/chunks/bac9fc90e6756e211160.js +1 -0
- package/assets/esri/core/workers/chunks/be588873c16770ceb9ef.js +1 -0
- package/assets/esri/core/workers/chunks/bf97a933ea3b220115e1.js +1 -0
- package/assets/esri/core/workers/chunks/bfedd6ebff817c9b31c0.js +1 -0
- package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +1 -0
- package/assets/esri/core/workers/chunks/c1135cb02ec46c491459.js +1 -0
- package/assets/esri/core/workers/chunks/c2253a9f29c1aabb2b75.js +1 -0
- package/assets/esri/core/workers/chunks/{d39b7983b68d6e5b404d.js → cdbc005eebec1503b99d.js} +1 -1
- package/assets/esri/core/workers/chunks/d04fca5d46cca02500b7.js +1 -0
- package/assets/esri/core/workers/chunks/d08efbc349dd9f999497.js +1 -0
- package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +1 -0
- package/assets/esri/core/workers/chunks/{a8b13fb804bb775e4967.js → db3c729ce0c0b2690dc9.js} +1 -1
- package/assets/esri/core/workers/chunks/dd13772a5e2eccc6a2bc.js +1 -0
- package/assets/esri/core/workers/chunks/dedc333a61081772ca7b.js +1 -0
- package/assets/esri/core/workers/chunks/{a7b1b75643ed31489495.js → e0c8d61c7a85ce15499a.js} +1 -1
- package/assets/esri/core/workers/chunks/{199670a3a564ebe3bd79.js → e218bde41ffbcc5194f5.js} +1 -1
- package/assets/esri/core/workers/chunks/e21b211913aefde47e30.js +1 -0
- package/assets/esri/core/workers/chunks/e287f49184d076af17e2.js +1 -0
- package/assets/esri/core/workers/chunks/{bde1d5b0a7717350986e.js → e4019b63a1fe74e2c842.js} +1 -1
- package/assets/esri/core/workers/chunks/e8e775758b79c5a084c8.js +1 -0
- package/assets/esri/core/workers/chunks/e93dfdede0532a89ffa5.js +1 -0
- package/assets/esri/core/workers/chunks/e9e5196b44b6923be1a3.js +1 -0
- package/assets/esri/core/workers/chunks/ea595b0df5050eda2a13.js +1 -0
- package/assets/esri/core/workers/chunks/eb82ff10cef2bde6e57f.js +1 -0
- package/assets/esri/core/workers/chunks/ebc6f4764b82d4104c65.js +1 -0
- package/assets/esri/core/workers/chunks/{1305ef8717da6e902a55.js → ec10151a2a95e95a0bb5.js} +1 -1
- package/assets/esri/core/workers/chunks/eccba071ced2d922bb85.js +1 -0
- package/assets/esri/core/workers/chunks/ee6e0db58dc64410e687.js +1 -0
- package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +1 -0
- package/assets/esri/core/workers/chunks/f2124f4d0f2b8a91f0ea.js +1 -0
- package/assets/esri/core/workers/chunks/ff6abdc72076f3994659.js +981 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/base/_mixins.scss +4 -1
- package/assets/esri/themes/base/icons/style.scss +11 -2
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +13 -10
- package/assets/esri/themes/base/widgets/_CoordinateConversion.scss +4 -2
- package/assets/esri/themes/base/widgets/_Directions.scss +5 -3
- package/assets/esri/themes/base/widgets/_Editor.scss +5 -2
- package/assets/esri/themes/base/widgets/_ElevationProfile.scss +6 -4
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +6 -0
- package/assets/esri/themes/base/widgets/_ItemList.scss +1 -1
- package/assets/esri/themes/base/widgets/_LayerList.scss +13 -9
- package/assets/esri/themes/base/widgets/_Popup.scss +4 -2
- package/assets/esri/themes/base/widgets/_Print.scss +24 -11
- package/assets/esri/themes/base/widgets/_Search.scss +4 -2
- package/assets/esri/themes/base/widgets/_TableList.scss +9 -7
- package/assets/esri/themes/base/widgets/_Weather.scss +12 -0
- package/assets/esri/themes/base/widgets/_Widget.scss +18 -9
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/dark-blue/main.css +1 -1
- package/assets/esri/themes/dark-green/main.css +1 -1
- package/assets/esri/themes/dark-purple/main.css +1 -1
- package/assets/esri/themes/dark-red/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/themes/light-blue/main.css +1 -1
- package/assets/esri/themes/light-green/main.css +1 -1
- package/assets/esri/themes/light-purple/main.css +1 -1
- package/assets/esri/themes/light-red/main.css +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
- package/chunks/BlendLayers.glsl.js +2 -2
- package/chunks/ChapmanAtmosphere.glsl.js +17 -17
- package/chunks/CheckerBoard.glsl.js +3 -3
- package/chunks/Clouds.glsl.js +2 -2
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ColorMaterial.glsl.js +12 -12
- package/chunks/ComponentShader.glsl.js +21 -21
- package/chunks/Compositing.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +33 -33
- package/chunks/EdgeShaderProgram.glsl.js +7 -7
- package/chunks/Fog.glsl.js +10 -12
- package/chunks/HUDMaterial.glsl.js +2 -2
- package/chunks/HighlightComposition.glsl.js +5 -5
- package/chunks/ImageMaterial.glsl.js +6 -6
- package/chunks/LaserlinePath.glsl.js +8 -8
- package/chunks/LineCallout.glsl.js +6 -6
- package/chunks/MeasurementArrow.glsl.js +1 -1
- package/chunks/NativeLine.glsl.js +1 -1
- package/chunks/Path.glsl.js +5 -5
- package/chunks/Pattern.glsl.js +9 -9
- package/chunks/PointRenderer.glsl.js +14 -14
- package/chunks/Precipitation.glsl.js +91 -0
- package/chunks/RealisticTree.glsl.js +21 -21
- package/chunks/RibbonLine.glsl.js +11 -11
- package/chunks/SMAA.glsl.js +40 -40
- package/chunks/ShadedColorMaterial.glsl.js +12 -12
- package/chunks/ShadowCast.glsl.js +6 -6
- package/chunks/ShadowHighlight.glsl.js +4 -4
- package/chunks/SimpleAtmosphere.glsl.js +3 -3
- package/chunks/SlicePlaneMaterial.glsl.js +3 -3
- package/chunks/Stars.glsl.js +3 -3
- package/chunks/Terrain.glsl.js +3 -3
- package/chunks/TextureOnly.glsl.js +2 -2
- package/chunks/WaterSurface.glsl.js +22 -22
- package/chunks/boundedPlane.js +1 -1
- package/chunks/pe.js +1 -1
- package/chunks/vec3.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/accessorSupport/read.js +1 -1
- package/core/accessorSupport/set.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/accessorSupport/write.js +1 -1
- package/core/clock.js +1 -1
- package/core/jsonMap.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/loadAll.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/reactiveUtils.js +1 -1
- package/form/ExpressionInfo.js +1 -1
- package/geometry/pe.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +263 -35
- package/layers/VectorTileLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/package.json +2 -2
- package/popup/content/AttachmentsContent.js +1 -1
- package/popup/content/support/mediaInfoTypes.js +1 -1
- package/rest/print.js +1 -1
- package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
- package/support/arcadeOnDemand.js +1 -1
- package/support/featureFlags.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/FillSymbol3DLayer.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/LabelSymbol3D.js +1 -1
- package/symbols/ObjectSymbol3DLayer.js +1 -1
- package/symbols/PointSymbol3D.js +1 -1
- package/symbols/Symbol3D.js +1 -1
- package/symbols/WebStyleSymbol.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/support/IconSymbol3DLayerResource.js +1 -1
- package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
- package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
- package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
- package/symbols/support/Symbol3DFillMaterial.js +1 -1
- package/symbols/support/Symbol3DIconOutline.js +1 -1
- package/symbols/support/Symbol3DOutline.js +1 -1
- package/symbols/support/Symbol3DVerticalOffset.js +1 -1
- package/symbols/support/Thumbnail.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/symbols/support/previewWebStyleSymbol.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/symbols/support/webStyleSymbolUtils.js +1 -1
- package/symbols.js +1 -1
- package/views/2d/MapViewConstraints.js +1 -1
- package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
- package/views/2d/engine/webgl/brushes/raster/BrushRasterBitmap.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsComposition.glsl.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/CloudsPresets.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.glsl.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/Precipitation.glsl.js +5 -0
- package/views/3d/environment/Precipitation.js +5 -0
- package/views/3d/environment/PrecipitationTechnique.js +5 -0
- package/views/3d/environment/RainyWeather.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/SnowyWeather.js +5 -0
- package/views/3d/environment/Stars.glsl.js +1 -1
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/environment/weather.js +1 -1
- package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
- package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/lineUtils.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/graphics/symbolComplexity.js +1 -1
- package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
- package/views/3d/layers/support/overlayImageUtils.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/support/LaserlinePathData.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
- package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +22 -14
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/{layers/graphics/IGraphics3DFeatureProcessor.js → webgl-engine/lib/TextureUniformName.js} +0 -0
- package/views/3d/webgl-engine/lib/UniformName.js +4 -0
- package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
- package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
- package/views/MapView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/input/recognizers/DoubleTapDrag.js +1 -1
- package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
- package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
- package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/WatchUpdatingTracking.js +1 -1
- package/views/support/projectionUtils.js +5 -0
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/InstanceCounter.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/views/webgl/rasterUtils.js +1 -1
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
- package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/FeatureForm/InputField.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/Search/support/locatorUtils.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather/enums.js +5 -0
- package/widgets/Weather.js +1 -1
- package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
- package/widgets/support/InteractiveToolViewModel.js +1 -1
- package/assets/components/assets/calcite-icon/checkSquareF16.json +0 -1
- package/assets/components/assets/calcite-icon/checkSquareF24.json +0 -1
- package/assets/components/assets/calcite-icon/checkSquareF32.json +0 -1
- package/assets/components/assets/calcite-icon/lineSolid4.json +0 -1
- package/assets/components/assets/calcite-icon/squareF16.json +0 -1
- package/assets/components/assets/calcite-icon/squareF24.json +0 -1
- package/assets/components/assets/calcite-icon/squareF32.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon16.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon24.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon32.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF16.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF24.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF32.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF16.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF24.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF32.json +0 -1
- package/assets/esri/core/workers/chunks/09da224052976e290828.js +0 -1
- package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +0 -1
- package/assets/esri/core/workers/chunks/0c3e3a5baf54bd5e210c.js +0 -1
- package/assets/esri/core/workers/chunks/14bef72154b3a19561a7.js +0 -1
- package/assets/esri/core/workers/chunks/18668dc45eb9e35530df.js +0 -1
- package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +0 -1
- package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +0 -1
- package/assets/esri/core/workers/chunks/208a7e24e19fc5633dd7.js +0 -1
- package/assets/esri/core/workers/chunks/22b09e276c9b9f22f0f8.js +0 -1
- package/assets/esri/core/workers/chunks/23745a5ab47c840dc452.js +0 -1
- package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +0 -1
- package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +0 -1
- package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +0 -1
- package/assets/esri/core/workers/chunks/32f8c4af7e70ebdcb19e.js +0 -1
- package/assets/esri/core/workers/chunks/36a3f6fb4d1d18fcb642.js +0 -1
- package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +0 -1
- package/assets/esri/core/workers/chunks/3a9740dccda6a733313c.js +0 -1
- package/assets/esri/core/workers/chunks/3aa4194dc5497c57647f.js +0 -1
- package/assets/esri/core/workers/chunks/40a1e713f63ec77110c0.js +0 -1
- package/assets/esri/core/workers/chunks/43cdff2418325e163420.js +0 -1
- package/assets/esri/core/workers/chunks/4bfbf5a34c9207fdcf44.js +0 -1
- package/assets/esri/core/workers/chunks/5383a8f3e4ec1a8a4fcd.js +0 -1
- package/assets/esri/core/workers/chunks/5538639a49c7cc2eca63.js +0 -1
- package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +0 -1
- package/assets/esri/core/workers/chunks/5d4863a92b03bebc1b54.js +0 -1
- package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +0 -1
- package/assets/esri/core/workers/chunks/634b5ccd7a3ac67f855d.js +0 -1
- package/assets/esri/core/workers/chunks/662d13f68cf3ec92439b.js +0 -1
- package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
- package/assets/esri/core/workers/chunks/67162b3e2cc1b5dc6818.js +0 -1
- package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +0 -1
- package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +0 -1
- package/assets/esri/core/workers/chunks/76eef4799f6c5fff7e2d.js +0 -1
- package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +0 -1
- package/assets/esri/core/workers/chunks/7bc5cc5dbf1b7b70ddac.js +0 -1
- package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +0 -1
- package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +0 -1
- package/assets/esri/core/workers/chunks/8b6ab6202a40fe622833.js +0 -1
- package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +0 -1
- package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
- package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +0 -1
- package/assets/esri/core/workers/chunks/9cb2ae42a8e328b1d98d.js +0 -1
- package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +0 -1
- package/assets/esri/core/workers/chunks/a6ff3db3493543df81bc.js +0 -1
- package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +0 -1
- package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +0 -1
- package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +0 -1
- package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +0 -1
- package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +0 -1
- package/assets/esri/core/workers/chunks/afa6912454f2a5ffadce.js +0 -1
- package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +0 -1
- package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +0 -1
- package/assets/esri/core/workers/chunks/ba6654a885be4b7a43f0.js +0 -1
- package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +0 -1
- package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +0 -1
- package/assets/esri/core/workers/chunks/c080114a69fa95b88d22.js +0 -1
- package/assets/esri/core/workers/chunks/c11474b702dfb94e8e87.js +0 -1
- package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +0 -1
- package/assets/esri/core/workers/chunks/c6bd943fe8fd13bb4806.js +0 -1
- package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +0 -1
- package/assets/esri/core/workers/chunks/ca2f5faa01d99c21ec14.js +0 -1
- package/assets/esri/core/workers/chunks/cd7d83d127e085d52584.js +0 -1
- package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +0 -1
- package/assets/esri/core/workers/chunks/cfbffa429d88e7709c3f.js +0 -1
- package/assets/esri/core/workers/chunks/d24c4fbc567486b1188f.js +0 -1
- package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +0 -1
- package/assets/esri/core/workers/chunks/da1c2873bdbc0956dca0.js +0 -1
- package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +0 -1
- package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
- package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +0 -1
- package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
- package/assets/esri/core/workers/chunks/e6df9839b551569fbc62.js +0 -1
- package/assets/esri/core/workers/chunks/e97e986120aaadad7d4c.js +0 -1
- package/assets/esri/core/workers/chunks/f467c8f1fce22f6f599c.js +0 -1
- package/assets/esri/core/workers/chunks/f678293de9a6d8f5b5db.js +0 -1
- package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +0 -1
- package/assets/esri/core/workers/chunks/fd3e5d823dc7917f4b8f.js +0 -1
- package/assets/esri/core/workers/chunks/ffaf091c6023225cf5aa.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Handles.js";import s from"../../../core/has.js";import a from"../../../core/Logger.js";import{isSome as r,isNone as d}from"../../../core/maybe.js";import o from"../../../core/PooledArray.js";import{EsriPromiseMixin as n}from"../../../core/Promise.js";import{isAbortError as h}from"../../../core/promiseUtils.js";import{init as l}from"../../../core/watchUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingRect as _}from"../../../geometry/projection.js";import{create as p,intersectsSphere as g}from"../../../geometry/support/aaBoundingRect.js";import{makeDehydratedPoint as m}from"../dehydratedFeatures.js";import{PromiseQueue as y}from"../../support/PromiseQueue.js";import{addTask as x}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as f}from"../../../views/3d/layers/i3s/I3SIndex.js";import b from"../../../views/3d/layers/i3s/I3SLodHandling.js";import{NodeState as w,CacheState as N}from"../../../views/3d/layers/i3s/I3SNode.js";import v from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as C}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as D,getIndexCrs as L,findIntersectingNodes as S}from"../../../views/3d/layers/i3s/I3SUtil.js";import V from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{FadeDirection as I}from"../../../views/3d/layers/support/I3SLayerView.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{ClientType as U,maxDownloadSlots as F}from"../../../views/3d/support/index.js";import{extractSafeScaleBounds as P,scaleBoundsPredicate as O}from"../../../views/support/layerViewUtils.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const q=a.getLogger("esri.layers.graphics.controllers.I3SOnDemandController"),G=100,j=2,Q=1e4,T=1e-4,E=1.2,B=500,H=1.5;let k=class extends(n(t)){constructor(e){super(e),this.screenSizeFactor=0,this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.scaleVisibilityEnabled=!0,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._newLoadingNodes=new o({deallocator:null}),this._loadedNodeScales=new Map,this._modificationsNodeFilteringArray=new o,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._handles=new i,this._idleQueue=new y,this._elevationUpdateNodes=new o({deallocator:null}),this._errorCount=0}get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store.lodType}get isGraphics3D(){return"points"===this.layer.profile}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(U.I3S_INDEX);return new C(e,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(U.I3S_DATA);return new C(e,this.layer.apiKey)}get crsVertex(){return D(this.layer)}get crsIndex(){return L(this.layer)}get rootNodeVisible(){if(r(this._index)){const e=this._index.rootNode;if(r(e))return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}initialize(){this._disableMemCache=!this.layerView.loadCachedGPUData||!this.layerView.addCachedGPUData,this._lodHandling=new b(this.layerView);const e=this.layerView.i3slayer;this.layer=e,this._defaultGeometrySchema=e.store.defaultGeometrySchema,this.disableIDBCache=s("disable-feature:idb-cache"),"fields"in e&&(this._fields=e.fields,this._attributeStorageInfo=e.attributeStorageInfo),this.addResolvingPromise(Promise.all([this.layer.indexInfo,this.layer.when(),this.layerView.when()]).then((([t])=>{var i;if(this.destroyed||!this.layerView||this.layerView.destroyed)return;const s=this.layerView.view;this._setClippingArea(s.clippingArea);const a=this.layerView.view.resourceController;this._handles.add([l(s,"pointsOfInterest.focus.renderLocation",(e=>this._pointOfInterestChanged(e))),a.memoryController.events.on("quality-changed",(()=>this._setCameraDirty())),l(this.layerView,"suspended",(e=>{const t=e?()=>this._updateViewData():()=>this._updateIdleState(!0),i=e?()=>{}:()=>this._updateIdleState(!1);this._idleStateCallbacks?(e&&this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=a.scheduler.registerIdleStateCallbacks(t,i)})),x(this.layerView.view.resourceController.scheduler,{update:(e,t)=>this._frame(e,t),needsUpdate:()=>this.updating}),this.watch("uncompressedTextureDownsamplingEnabled",(()=>this.restartNodeLoading())),this.watch(["featureTarget","fixedFeatureTarget"],(()=>{this._setCameraDirty(),this._stableFeatureLOD=!1})),s.state.watch("contentCamera",(()=>this._setCameraDirty())),this.layer.watch("elevationInfo",(()=>this._elevationInfoChanged())),this.layer.watch("effectiveScaleRange",(()=>this._scaleBoundsChanged())),this.layerView.watch("lodFactor",(()=>this._setCameraDirty())),this.layerView.watch("availableFields?",(()=>this._requiredFieldsChange())),this.layerView.watch("holeFilling",(e=>r(this._index)&&(this._index.holeFilling=e)))]),this._updateScaleHandles(),this._viewportQueries=new V(this.crsIndex,s.renderCoordsHelper,s.state.contentCamera,!s.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,s.elevationProvider,this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this.lod,angleDependentLoD:this.lod<.5}),this._index=new f(e,t,this.indexStreamController,this._viewportQueries,q,this.layerView.holeFilling,(e=>this.layerView.isNodeLoaded(e)),(e=>this.layerView.isNodeReloading(e)),(e=>this._shouldLoadNode(e)),(e=>this._enableFromGPUCache(e,w.Leaf)),(e=>this._needsUpdate(e)),(()=>!this.indexStreamController.busy),(e=>this.layerView.computeVisibilityObb?this.layerView.computeVisibilityObb(e):null),null!=(i=this.layerView)&&i.computeNodeFiltering?e=>this.layerView.computeNodeFiltering(e):void 0),this._index.imModificationsChanged(!!this.layerView.hasModifications),this._startNodeLoading()}))),this._tmpPoint=m(0,0,0,this.crsIndex)}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;r(t)&&i&&i.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll((e=>{const i=t.getNode(e);r(i)&&this._modificationsNodeFilteringArray.push(i)})),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._handles.destroy(),this._nodeLoader=null,R.prune(),r(z)&&(z.hide(),z=null)}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map((i=>{const s=X(e,i),a=X(t,i);return s>=0&&a>=0?{index:s,name:t[a].name,field:t[a],attributeStorageInfo:e[s]}:null})).filter((e=>null!=e&&e.name!==i))}_requiredFieldsChange(){const e=this._getRequiredAttributes();K(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=p();A(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){r(this._viewportQueries)&&(this._viewportQueries.setPointOfInterest(e),r(this._index)&&(this._index.progressiveLoadPenalty=$.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),r(this._viewportQueries)&&r(this._index)&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this.notifyChange("rootNodeVisible"),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateElevationChanged(e,t){const i=this._index;if(d(i))return;const s=i.rootNode;if(d(s))return;const a=this._elevationUpdateNodes;a.clear(),S(e,t,s,this.crsIndex,i,(e=>a.push(e.index))),a.forAll((e=>{i.invalidateBoundingVolumeCache(e),e===s.index&&this.notifyChange("rootNodeVisible")})),a.length&&this.restartNodeLoading()}getParentIndex(e){return r(this._index)&&this._index.getParentIndex(e)}_elevationInfoChanged(){r(this._index)&&this._index.updateElevationInfo(this.layer.elevationInfo),this._setCameraDirty()}_updateScaleHandles(){const e="scale-bounds";this._handles.remove(e),this.areScaleBoundsActive&&this._handles.add(this.layerView.view.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),e)}_scaleBoundsChanged(){this.areScaleBoundsActive||this._loadedNodeScales.clear(),this._updateScaleHandles(),this._setCameraDirty()}_scaleUpdateHandler(e){this._updateScaleInBoundingRect(e.extent,e.spatialReference),this._setCameraDirty()}_updateScaleInBoundingRect(e,t){const i=this._index;if(d(i))return;const s=i.rootNode;!d(s)&&_(e,t,J,this.crsIndex)&&this._loadedNodeScales.forEach(((e,t)=>{const s=i.getNode(t);r(s)&&g(J,s.mbs)&&this._loadedNodeScales.set(t,this._computeScale(s))}))}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(e,t){return this._idleQueue.push(e,t)}reschedule(e,t){return this._idleQueue.unshift(e,t)}get isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get areScaleBoundsActive(){const{minScale:e,maxScale:t}=P(this.layer);return this.scaleVisibilityEnabled&&(e>0||t>0)}get unloadedMemoryEstimate(){return d(this._index)||this.layerView.suspended?0:this._index.getUnloadedMemoryEstimate()*this.lodDropFactor}get indexDepth(){return r(this._index)?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData||(this._disableMemCache=!0),this._disableMemCache=e}_frame(e,t){return this.layerView.suspended?(this._updateViewData(),this._evaluateUpdating(),-1/0):!this.layerView.visible||d(this._index)?-1/0:(this._processLogError(e,t),this._index.getPriority())}_processLogError(e,t){try{this._process(e,t)}catch(i){this._errorCount<50?q.error("Error during processing: "+i):50===this._errorCount&&q.error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null==this._nodeLoader||d(this._index)||(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this.isIntegratedMesh&&(e.enabled=!1),e.run((()=>this._processIndex(e))),this._updateFeatureLOD(),e.run((()=>this._processCache(e))),this.isIntegratedMesh&&(e.enabled=!0),e.run((()=>this._processNodes(e,t))),this._idleQueue.runTask(e),e.run((()=>this._prefetchIndex())),t.numIndexLoading+=this._index.getIndexLoading(),t.numNodesLoading+=this._downloadingCount,e.run((()=>this._lodHandling.lodGlobalHandling(e))),this._evaluateUpdating())}_processIndex(e){if(d(this._index))return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update([...this._loadingNodes.keys()],e,(e=>this.updateNodeModificationStatus(e))),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading()||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(d(this._index)||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.isGraphics3D||d(this._index)||d(this._viewportQueries))return;const e=!this._index.isLoading(),t=this.featureTarget*this.baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.getIndexMissing()>B){if(this._featureLOD<=T)return;this._featureLOD/=H,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=Q||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this.lod,a=this._index.checkFeatureTarget(t,s);a!==s&&(this._featureLOD=a/this.baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*E||e&&i.estimate>t))return;if(this._featureLOD<=T)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(Q,Math.max(T,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this.lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(d(t))return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);r(s)&&(!this.layerView.isNodeLoaded(s.index)&&this._isNodeInScaleBounds(s));s=t.getParent(s.index))if(this._enableFromGPUCache(s,w.Hole)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(d(this._index))return!1;let i=(this._isIdle?G:j)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());r(t)&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const a=this._index.getNode(s.add.back());if(d(a)||a.cacheState!==N.Cached&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(a),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach((e=>e.abort())),this._loadingNodes.clear(),this._updatingNodes.forEach((e=>e.abort())),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=j)&&(this._downloadingCount<F&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView.suspended)e=this._cameraDirty,t=e?0:1;else{const i=(r(this._index)?this._index.getIndexMissing():0)+3*(r(this._index)?this._index.updates.add.length:0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.running||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}this.updating=e,this.updatingProgress=t}_updateViewData(){if(!this._cameraDirty||d(this._index)||d(this._viewportQueries))return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this.screenSizeFactor=1/(t.perScreenPixelRatio/2),this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this.lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=$.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.resourceController.memoryController.memoryFactor<1?1:this.layerView.progressiveLoadFactor}get lod(){return this._featureLOD*this.baseLOD}get baseLOD(){const e=this.layerView.lodFactor,t=this.layerView.view.resourceController.memoryController.memoryFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*t}get lodDropFactor(){if(this.fixedFeatureTarget)return 1;const e=this.layerView.view.resourceController.memoryController;return(Math.min(e.memoryFactor,.5)-e.minQuality)/(.5-e.minQuality)}isGeometryVisible(e){return r(this._index)&&this._index.isGeometryVisible(e.index)}updateVisibility(e){r(this._index)&&this._index.invalidateNodeVisibilityCache(e)}updateBoundingVolume(e){r(this._index)&&this._index.invalidateBoundingVolumeCache(e)}invalidateGeometryVisibility(e){r(this._index)&&this._index.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){r(this._index)&&this._index.invalidateVisibilityObbs()}modificationsChanged(){r(this._index)&&this._index.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&(!(!r(this._index)||!this._index.isGeometryVisible(e.index))&&this._isNodeInScaleBounds(e))}_shouldDropNode(e){if(d(this._viewportQueries))return!1;const t=this.lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||d(e)||d(this._viewportQueries))return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,uncompressedTextureDownsamplingEnabled:this.layerView.uncompressedTextureDownsamplingEnabled,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:!this.isMeshPyramid};this._nodeLoader=new v(this.layer,this.dataStreamController,q,this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e=>this._isNodeInScaleBounds(e)),((e,t)=>this._removeNodes(e,t,W.fadeout)),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(e){const t=this._index;if(d(t)||d(this._viewportQueries))return!1;R.clear(),this.layerView.getLoadedNodeIndices(R);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return R.filterInPlace((e=>{const i=t.getNode(e);return d(i)||!t.isGeometryVisible(e)||s(i)||!this._isNodeInScaleBounds(i)})),R.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(R,e,W.pop),!(i&&this.lodDropFactor<1)&&(0===R.length||(R.clear(),!1))}markNodeToRemove(e){R.push(e)}removeMarkedNodes(){this._removeNodes(R,M,W.pop)}_removeNodes(e,t,i){const s=e.length;if(0!==s&&!t.done){for(r(this._index)&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),a=this._index;i===W.fadeout&&this.layerView.nodeFadeoutEnabled&&r(a)&&a.isGeometryVisible(s)?this.layerView.fadeNode(s,I.FadeOut,!0):this.layerView.removeNode(s),t.madeProgress()}if(this._loadedNodeScales.size>0)for(let t=e.length;t<s;t++){const i=e.data[t];this._loadedNodeScales.delete(i)}}}_needsUpdate(e){if(!e.resources.hasFeatureData||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}_updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t);(K(this.layerView.getLoadedAttributes(e.index),this._requiredAttributes)?Promise.resolve(this.layerView.getAttributeData(e.index)):this._nodeLoader.loadAttributes(e,this._requiredAttributes,t.signal)).then((i=>this.schedule((()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:i},t.signal)),t.signal))).catch((i=>{if(!h(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)})).catch((()=>{})).then((()=>{this._updatingNodes.delete(e.index),this._evaluateUpdating()})),this._evaluateUpdating()}_loadNode(e){if(this._loadingNodes.has(e.index))return void q.error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateUpdating(),this._loadAndAddNode(e,t.signal).then((e=>{e&&r(this._index)&&this._index.requestUpdate()})).catch((e=>{if(!h(e))throw e})).finally((()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateUpdating()}))}_loadAndAddNode(e,t){return e.cacheState===N.Uncached?this._loadUncached(e,t).then((()=>!1)):this._loadCached(e,t).then((t=>!t&&(e.cacheState=N.Uncached,!0))).catch((t=>!h(t)&&(e.cacheState=N.Uncached,!0)))}_enableFromGPUCache(e,t){if(this._disableMemCache||d(this._index))return!1;if(t===w.Hole&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e);return r(t)&&r(t.attributeInfo)&&K(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){r(this._index)&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_loadCached(e,t){if(this._enableFromGPUCache(e,w.Leaf))return Promise.resolve(!0);const i=this.layerView;return!this.disableIDBCache&&i.loadCachedNodeData&&i.addCachedNodeData?this.schedule((()=>i.loadCachedNodeData(e,t,((t,i)=>this._nodeLoader.loadTextures(e,t,i)))),t).then((s=>{if(d(s))return!1;const a=this._requiredAttributes;return this.reschedule((()=>this._nodeLoader.loadAttributes(e,a,t)),t).then((r=>this.reschedule((()=>i.addCachedNodeData(e,s,{loadedAttributes:a,attributeData:r},t)),t))).then((()=>(this._nodeAdded(),!0)))})):Promise.resolve(!1)}_loadUncached(e,t){return this._downloadingCount++,this._nodeLoader.loadNodeData(e,t).catch((e=>{throw this._downloadingCount--,e})).then((i=>(this._downloadingCount--,this.schedule((()=>this.layerView.addNode(e,i,t)),t)))).then((()=>{this._nodeAdded(),e.cacheState=N.Cached})).catch((t=>{if(!h(t))throw q.error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,r(this._index)&&this._index.requestUpdate(),t}))}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateUpdating(),e&&this._index&&r(this._index)&&this._index.resetFailedNodes())}_getScale(e){if(this._loadedNodeScales.has(e.index))return this._loadedNodeScales.get(e.index);const t=this._computeScale(e);return this.layerView.isNodeLoaded(e.index)&&this._loadedNodeScales.set(e.index,t),t}_computeScale(e){this._tmpPoint.x=e.mbs[0],this._tmpPoint.y=e.mbs[1],this._tmpPoint.z=e.mbs[2];const t=e.mbs[3];return this.layerView.view.basemapTerrain.getSphereScale(this._tmpPoint,t)}_isNodeInScaleBounds(e){if(!this.areScaleBoundsActive)return!0;const t=this._getScale(e),{minScale:i,maxScale:s}=P(this.layer);return O(t,i,s)}updateStats(e){e.index=r(this._index)?this._index.size:0,this.isGraphics3D&&(e.detail=this._featureLOD,e.target=this.featureTarget*this.baseLOD),r(this._index)&&this._index.updateStats(e)}get test(){const e=this;return{index:this._index,set disableUpdates(t){e._updatesDisabled=t,t?e.cancelNodeLoading():e.requestUpdate()},set disableIDBCache(t){e.disableIDBCache=t},set ignoreServiceObb(t){r(e._index)&&(e._index.ignoreServiceObb=t)},shouldLoadNode:t=>e._shouldLoadNode(t)}}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),r(this._index)&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;r(t)&&t.layerFilterChanged(e),this.requestUpdate()}};e([u({readOnly:!0})],k.prototype,"isMeshPyramid",null),e([u({readOnly:!0})],k.prototype,"isGraphics3D",null),e([u({readOnly:!0})],k.prototype,"indexStreamController",null),e([u({readOnly:!0})],k.prototype,"dataStreamController",null),e([u({readOnly:!0})],k.prototype,"crsVertex",null),e([u({readOnly:!0})],k.prototype,"crsIndex",null),e([u()],k.prototype,"screenSizeFactor",void 0),e([u()],k.prototype,"featureTarget",void 0),e([u()],k.prototype,"fixedFeatureTarget",void 0),e([u()],k.prototype,"layerView",void 0),e([u()],k.prototype,"layer",void 0),e([u({})],k.prototype,"updating",void 0),e([u({})],k.prototype,"updatingProgress",void 0),e([u({readOnly:!0})],k.prototype,"leavesReached",void 0),e([u({constructOnly:!0})],k.prototype,"scaleVisibilityEnabled",void 0),e([u({readOnly:!0,dependsOn:[]})],k.prototype,"rootNodeVisible",null),k=e([c("esri.layers.graphics.controllers.I3SOnDemandController")],k);const R=new o({deallocator:null});let z;function K(e,t){return r(e)&&e.length===t.length&&e.every((e=>X(t,e.name)>=0))}function X(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const $={factorIM:.2,factor3dObject:.05,distancePenalty:10},J=p();var W;!function(e){e[e.pop=0]="pop",e[e.fadeout=1]="fadeout"}(W||(W={}));const Y=k;export{Y as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Handles.js";import s from"../../../core/has.js";import a from"../../../core/Logger.js";import{isSome as r,isNone as d}from"../../../core/maybe.js";import o from"../../../core/PooledArray.js";import{EsriPromiseMixin as n}from"../../../core/Promise.js";import{isAbortError as h}from"../../../core/promiseUtils.js";import{init as l}from"../../../core/watchUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingRect as _}from"../../../geometry/projection.js";import{create as p,intersectsSphere as g}from"../../../geometry/support/aaBoundingRect.js";import{makeDehydratedPoint as m}from"../dehydratedFeatures.js";import{PromiseQueue as y}from"../../support/PromiseQueue.js";import{addTask as x}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as f}from"../../../views/3d/layers/i3s/I3SIndex.js";import b from"../../../views/3d/layers/i3s/I3SLodHandling.js";import{NodeState as w,CacheState as N}from"../../../views/3d/layers/i3s/I3SNode.js";import v from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as C}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as D,getIndexCrs as L,findIntersectingNodes as S}from"../../../views/3d/layers/i3s/I3SUtil.js";import V from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{FadeDirection as I}from"../../../views/3d/layers/support/I3SLayerView.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{ClientType as U,maxDownloadSlots as F}from"../../../views/3d/support/index.js";import{extractSafeScaleBounds as P,scaleBoundsPredicate as O}from"../../../views/support/layerViewUtils.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const q=a.getLogger("esri.layers.graphics.controllers.I3SOnDemandController"),G=100,j=2,Q=1e4,T=1e-4,E=1.2,B=500,H=1.5;let k=class extends(n(t)){constructor(e){super(e),this.screenSizeFactor=0,this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.scaleVisibilityEnabled=!0,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._newLoadingNodes=new o({deallocator:null}),this._loadedNodeScales=new Map,this._modificationsNodeFilteringArray=new o,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._handles=new i,this._idleQueue=new y,this._elevationUpdateNodes=new o({deallocator:null}),this._errorCount=0}get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store.lodType}get isGraphics3D(){return"points"===this.layer.profile}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(U.I3S_INDEX);return new C(e,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(U.I3S_DATA);return new C(e,this.layer.apiKey)}get crsVertex(){return D(this.layer)}get crsIndex(){return L(this.layer)}get rootNodeVisible(){if(r(this._index)){const e=this._index.rootNode;if(r(e))return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}initialize(){this._disableMemCache=!this.layerView.loadCachedGPUData||!this.layerView.addCachedGPUData,this._lodHandling=new b(this.layerView);const e=this.layerView.i3slayer;this.layer=e,this._defaultGeometrySchema=e.store.defaultGeometrySchema,this.disableIDBCache=s("disable-feature:idb-cache"),"fields"in e&&(this._fields=e.fields,this._attributeStorageInfo=e.attributeStorageInfo),this.addResolvingPromise(Promise.all([this.layer.indexInfo,this.layer.when(),this.layerView.when()]).then((([t])=>{var i;if(this.destroyed||!this.layerView||this.layerView.destroyed)return;const s=this.layerView.view;this._setClippingArea(s.clippingArea);const a=this.layerView.view.resourceController;this._handles.add([l(s,"pointsOfInterest.focus.renderLocation",(e=>this._pointOfInterestChanged(e))),a.memoryController.events.on("quality-changed",(()=>this._setCameraDirty())),l(this.layerView,"suspended",(e=>{const t=e?()=>this._updateViewData():()=>this._updateIdleState(!0),i=e?()=>{}:()=>this._updateIdleState(!1);this._idleStateCallbacks?(e&&this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=a.scheduler.registerIdleStateCallbacks(t,i)})),x(this.layerView.view.resourceController.scheduler,{update:(e,t)=>this._frame(e,t),needsUpdate:()=>this.updating}),this.watch("uncompressedTextureDownsamplingEnabled",(()=>this.restartNodeLoading())),this.watch(["featureTarget","fixedFeatureTarget"],(()=>{this._setCameraDirty(),this._stableFeatureLOD=!1})),s.state.watch("contentCamera",(()=>this._setCameraDirty())),this.layer.watch("elevationInfo",(()=>this._elevationInfoChanged())),this.layer.watch("effectiveScaleRange",(()=>this._scaleBoundsChanged())),this.layerView.watch("lodFactor",(()=>this._setCameraDirty())),this.layerView.watch("availableFields?",(()=>this._requiredFieldsChange())),this.layerView.watch("holeFilling",(e=>r(this._index)&&(this._index.holeFilling=e)))]),this._updateScaleHandles(),this._viewportQueries=new V(this.crsIndex,s.renderCoordsHelper,s.state.contentCamera,!s.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,s.elevationProvider,this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this.lod,angleDependentLoD:this.lod<.5}),this._index=new f(e,t,this.indexStreamController,this._viewportQueries,q,this.layerView.holeFilling,(e=>this.layerView.isNodeLoaded(e)),(e=>this.layerView.isNodeReloading(e)),(e=>this._shouldLoadNode(e)),(e=>this._enableFromGPUCache(e,w.Leaf)),(e=>this._needsUpdate(e)),(()=>!this.indexStreamController.busy),(e=>this.layerView.computeVisibilityObb?this.layerView.computeVisibilityObb(e):null),null!=(i=this.layerView)&&i.computeNodeFiltering?e=>this.layerView.computeNodeFiltering(e):void 0),this._index.imModificationsChanged(!!this.layerView.hasModifications),this._startNodeLoading()}))),this._tmpPoint=m(0,0,0,this.crsIndex)}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;r(t)&&i&&i.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll((e=>{const i=t.getNode(e);r(i)&&this._modificationsNodeFilteringArray.push(i)})),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._handles.destroy(),this._nodeLoader=null,R.prune(),r(z)&&(z.hide(),z=null)}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map((i=>{const s=X(e,i),a=X(t,i);return s>=0&&a>=0?{index:s,name:t[a].name,field:t[a],attributeStorageInfo:e[s]}:null})).filter((e=>null!=e&&e.name!==i))}_requiredFieldsChange(){const e=this._getRequiredAttributes();K(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=p();A(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){r(this._viewportQueries)&&(this._viewportQueries.setPointOfInterest(e),r(this._index)&&(this._index.progressiveLoadPenalty=$.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),r(this._viewportQueries)&&r(this._index)&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this.notifyChange("rootNodeVisible"),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateElevationChanged(e,t){const i=this._index;if(d(i))return;const s=i.rootNode;if(d(s))return;const a=this._elevationUpdateNodes;a.clear(),S(e,t,s,this.crsIndex,i,(e=>a.push(e.index))),a.forAll((e=>{i.invalidateBoundingVolumeCache(e),e===s.index&&this.notifyChange("rootNodeVisible")})),a.length&&this.restartNodeLoading()}getParentIndex(e){return r(this._index)&&this._index.getParentIndex(e)}_elevationInfoChanged(){r(this._index)&&this._index.updateElevationInfo(this.layer.elevationInfo),this._setCameraDirty()}_updateScaleHandles(){const e="scale-bounds";this._handles.remove(e),this.areScaleBoundsActive&&this._handles.add(this.layerView.view.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),e)}_scaleBoundsChanged(){this.areScaleBoundsActive||this._loadedNodeScales.clear(),this._updateScaleHandles(),this._setCameraDirty()}_scaleUpdateHandler(e){this._updateScaleInBoundingRect(e.extent,e.spatialReference),this._setCameraDirty()}_updateScaleInBoundingRect(e,t){const i=this._index;if(d(i))return;const s=i.rootNode;!d(s)&&_(e,t,J,this.crsIndex)&&this._loadedNodeScales.forEach(((e,t)=>{const s=i.getNode(t);r(s)&&g(J,s.mbs)&&this._loadedNodeScales.set(t,this._computeScale(s))}))}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(e,t){return this._idleQueue.push(e,t)}reschedule(e,t){return this._idleQueue.unshift(e,t)}get isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get areScaleBoundsActive(){const{minScale:e,maxScale:t}=P(this.layer);return this.scaleVisibilityEnabled&&(e>0||t>0)}get unloadedMemoryEstimate(){return d(this._index)||this.layerView.suspended?0:this._index.getUnloadedMemoryEstimate()*this.lodDropFactor}get indexDepth(){return r(this._index)?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData||(this._disableMemCache=!0),this._disableMemCache=e}_frame(e,t){return this.layerView.suspended?(this._updateViewData(),this._evaluateUpdating(),-1/0):!this.layerView.visible||d(this._index)?-1/0:(this._processLogError(e,t),this._index.getPriority())}_processLogError(e,t){try{this._process(e,t)}catch(i){this._errorCount<50?q.error("Error during processing: "+i):50===this._errorCount&&q.error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null==this._nodeLoader||d(this._index)||(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this.isIntegratedMesh&&(e.enabled=!1),e.run((()=>this._processIndex(e))),this._updateFeatureLOD(),e.run((()=>this._processCache(e))),this.isIntegratedMesh&&(e.enabled=!0),e.run((()=>this._processNodes(e,t))),this._idleQueue.runTask(e),e.run((()=>this._prefetchIndex())),t.numIndexLoading+=this._index.getIndexLoading(),t.numNodesLoading+=this._downloadingCount,e.run((()=>this._lodHandling.lodGlobalHandling(e))),this._evaluateUpdating())}_processIndex(e){if(d(this._index))return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update([...this._loadingNodes.keys()],e,(e=>this.updateNodeModificationStatus(e))),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading()||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(d(this._index)||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.isGraphics3D||d(this._index)||d(this._viewportQueries))return;const e=!this._index.isLoading(),t=this.featureTarget*this.baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.getIndexMissing()>B){if(this._featureLOD<=T)return;this._featureLOD/=H,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=Q||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this.lod,a=this._index.checkFeatureTarget(t,s);a!==s&&(this._featureLOD=a/this.baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*E||e&&i.estimate>t))return;if(this._featureLOD<=T)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(Q,Math.max(T,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this.lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(d(t))return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);r(s)&&(!this.layerView.isNodeLoaded(s.index)&&this._isNodeInScaleBounds(s));s=t.getParent(s.index))if(this._enableFromGPUCache(s,w.Hole)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(d(this._index))return!1;let i=(this._isIdle?G:j)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());r(t)&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const a=this._index.getNode(s.add.back());if(d(a)||a.cacheState!==N.Cached&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(a),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach((e=>e.abort())),this._loadingNodes.clear(),this._updatingNodes.forEach((e=>e.abort())),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=j)&&(this._downloadingCount<F&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView.suspended)e=this._cameraDirty,t=e?0:1;else{const i=(r(this._index)?this._index.getIndexMissing():0)+3*(r(this._index)?this._index.updates.add.length:0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.running||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}this.updating=e,this.updatingProgress=t}_updateViewData(){if(!this._cameraDirty||d(this._index)||d(this._viewportQueries))return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this.screenSizeFactor=1/(t.perScreenPixelRatio/2),this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this.lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=$.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.resourceController.memoryController.memoryFactor<1?1:this.layerView.progressiveLoadFactor}get lod(){return this._featureLOD*this.baseLOD}get baseLOD(){const e=this.layerView.lodFactor,t=this.layerView.view.resourceController.memoryController.memoryFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*t}get lodDropFactor(){if(this.fixedFeatureTarget)return 1;const e=this.layerView.view.resourceController.memoryController;return(Math.min(e.memoryFactor,.5)-e.minQuality)/(.5-e.minQuality)}isGeometryVisible(e){return r(this._index)&&this._index.isGeometryVisible(e.index)}updateVisibility(e){r(this._index)&&this._index.invalidateNodeVisibilityCache(e)}updateBoundingVolume(e){r(this._index)&&this._index.invalidateBoundingVolumeCache(e)}invalidateGeometryVisibility(e){r(this._index)&&this._index.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){r(this._index)&&this._index.invalidateVisibilityObbs()}modificationsChanged(){r(this._index)&&this._index.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&(!(!r(this._index)||!this._index.isGeometryVisible(e.index))&&this._isNodeInScaleBounds(e))}_shouldDropNode(e){if(d(this._viewportQueries))return!1;const t=this.lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||d(e)||d(this._viewportQueries))return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,uncompressedTextureDownsamplingEnabled:this.layerView.uncompressedTextureDownsamplingEnabled,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:!this.isMeshPyramid};this._nodeLoader=new v(this.layer,this.dataStreamController,q,this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e=>this._isNodeInScaleBounds(e)),((e,t)=>this._removeNodes(e,t,W.fadeout)),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(e){const t=this._index;if(d(t)||d(this._viewportQueries))return!1;R.clear(),this.layerView.getLoadedNodeIndices(R);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return R.filterInPlace((e=>{const i=t.getNode(e);return d(i)||!t.isGeometryVisible(e)||s(i)||!this._isNodeInScaleBounds(i)})),R.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(R,e,W.pop),!(i&&this.lodDropFactor<1)&&(0===R.length||(R.clear(),!1))}markNodeToRemove(e){R.push(e)}removeMarkedNodes(){this._removeNodes(R,M,W.pop)}_removeNodes(e,t,i){const s=e.length;if(0!==s&&!t.done){for(r(this._index)&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),a=this._index;i===W.fadeout&&this.layerView.nodeFadeoutEnabled&&r(a)&&a.isGeometryVisible(s)?this.layerView.fadeNode(s,I.FadeOut,!0):this.layerView.removeNode(s),t.madeProgress()}if(this._loadedNodeScales.size>0)for(let t=e.length;t<s;t++){const i=e.data[t];this._loadedNodeScales.delete(i)}}}_needsUpdate(e){if(!e.resources.hasFeatureData||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}_updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t);(K(this.layerView.getLoadedAttributes(e.index),this._requiredAttributes)?Promise.resolve(this.layerView.getAttributeData(e.index)):this._nodeLoader.loadAttributes(e,this._requiredAttributes,t.signal)).then((i=>this.schedule((()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:i},t.signal)),t.signal))).catch((i=>{if(!h(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)})).catch((()=>{})).then((()=>{this._updatingNodes.delete(e.index),this._evaluateUpdating()})),this._evaluateUpdating()}_loadNode(e){if(this._loadingNodes.has(e.index))return void q.error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateUpdating(),this._loadAndAddNode(e,t.signal).then((i=>{i&&r(this._index)&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())})).catch((e=>{if(!h(e))throw e})).finally((()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateUpdating()}))}_loadAndAddNode(e,t){return e.cacheState===N.Uncached?this._loadUncached(e,t).then((()=>!1)):this._loadCached(e,t).then((t=>!t&&(e.cacheState=N.Uncached,!0))).catch((t=>!h(t)&&(e.cacheState=N.Uncached,!0)))}_enableFromGPUCache(e,t){if(this._disableMemCache||d(this._index))return!1;if(t===w.Hole&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e);return r(t)&&r(t.attributeInfo)&&K(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){r(this._index)&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_loadCached(e,t){if(this._enableFromGPUCache(e,w.Leaf))return Promise.resolve(!0);const i=this.layerView;return!this.disableIDBCache&&i.loadCachedNodeData&&i.addCachedNodeData?this.schedule((()=>i.loadCachedNodeData(e,t,((t,i)=>this._nodeLoader.loadTextures(e,t,i)))),t).then((s=>{if(d(s))return!1;const a=this._requiredAttributes;return this.reschedule((()=>this._nodeLoader.loadAttributes(e,a,t)),t).then((r=>this.reschedule((()=>i.addCachedNodeData(e,s,{loadedAttributes:a,attributeData:r},t)),t))).then((()=>(this._nodeAdded(),!0)))})):Promise.resolve(!1)}_loadUncached(e,t){return this._downloadingCount++,this._nodeLoader.loadNodeData(e,t).catch((e=>{throw this._downloadingCount--,e})).then((i=>(this._downloadingCount--,this.schedule((()=>this.layerView.addNode(e,i,t)),t)))).then((()=>{this._nodeAdded(),e.cacheState=N.Cached})).catch((t=>{if(!h(t))throw q.error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,r(this._index)&&this._index.requestUpdate(),t}))}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateUpdating(),e&&this._index&&r(this._index)&&this._index.resetFailedNodes())}_getScale(e){if(this._loadedNodeScales.has(e.index))return this._loadedNodeScales.get(e.index);const t=this._computeScale(e);return this.layerView.isNodeLoaded(e.index)&&this._loadedNodeScales.set(e.index,t),t}_computeScale(e){this._tmpPoint.x=e.mbs[0],this._tmpPoint.y=e.mbs[1],this._tmpPoint.z=e.mbs[2];const t=e.mbs[3];return this.layerView.view.basemapTerrain.getSphereScale(this._tmpPoint,t)}_isNodeInScaleBounds(e){if(!this.areScaleBoundsActive)return!0;const t=this._getScale(e),{minScale:i,maxScale:s}=P(this.layer);return O(t,i,s)}updateStats(e){e.index=r(this._index)?this._index.size:0,this.isGraphics3D&&(e.detail=this._featureLOD,e.target=this.featureTarget*this.baseLOD),r(this._index)&&this._index.updateStats(e)}get test(){const e=this;return{index:this._index,set disableUpdates(t){e._updatesDisabled=t,t?e.cancelNodeLoading():e.requestUpdate()},set disableIDBCache(t){e.disableIDBCache=t},set ignoreServiceObb(t){r(e._index)&&(e._index.ignoreServiceObb=t)},shouldLoadNode:t=>e._shouldLoadNode(t)}}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),r(this._index)&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;r(t)&&t.layerFilterChanged(e),this.requestUpdate()}};e([u({readOnly:!0})],k.prototype,"isMeshPyramid",null),e([u({readOnly:!0})],k.prototype,"isGraphics3D",null),e([u({readOnly:!0})],k.prototype,"indexStreamController",null),e([u({readOnly:!0})],k.prototype,"dataStreamController",null),e([u({readOnly:!0})],k.prototype,"crsVertex",null),e([u({readOnly:!0})],k.prototype,"crsIndex",null),e([u()],k.prototype,"screenSizeFactor",void 0),e([u()],k.prototype,"featureTarget",void 0),e([u()],k.prototype,"fixedFeatureTarget",void 0),e([u()],k.prototype,"layerView",void 0),e([u()],k.prototype,"layer",void 0),e([u({})],k.prototype,"updating",void 0),e([u({})],k.prototype,"updatingProgress",void 0),e([u({readOnly:!0})],k.prototype,"leavesReached",void 0),e([u({constructOnly:!0})],k.prototype,"scaleVisibilityEnabled",void 0),e([u({readOnly:!0,dependsOn:[]})],k.prototype,"rootNodeVisible",null),k=e([c("esri.layers.graphics.controllers.I3SOnDemandController")],k);const R=new o({deallocator:null});let z;function K(e,t){return r(e)&&e.length===t.length&&e.every((e=>X(t,e.name)>=0))}function X(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const $={factorIM:.2,factor3dObject:.05,distancePenalty:10},J=p();var W;!function(e){e[e.pop=0]="pop",e[e.fadeout=1]="fadeout"}(W||(W={}));const Y=k;export{Y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../core/Error.js";import e from"../../core/Logger.js";import{isNone as n,isSome as o}from"../../core/maybe.js";import{isPoint as r,isPolygon as s,isPolyline as c,isMultipoint as l}from"../../geometry/support/jsonUtils.js";import u from"./OptimizedFeature.js";import i from"./OptimizedFeatureSet.js";import f from"./OptimizedGeometry.js";function h(t,e){return t?e?4:3:e?3:2}const a=e.getLogger("esri.tasks.support.optimizedFeatureSet"),g={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0},d=(t,e,n,o,r,s)=>{t[n]=r,t[n+1]=s},m=(t,e,n,o,r,s)=>{t[n]=r,t[n+1]=s,t[n+2]=e[o+2]},y=(t,e,n,o,r,s)=>{t[n]=r,t[n+1]=s,t[n+2]=e[o+3]},p=(t,e,n,o,r,s)=>{t[n]=r,t[n+1]=s,t[n+2]=e[o+2],t[n+3]=e[o+3]};function I(t,e,n,o){if(t){if(n)return e&&o?p:m;if(e&&o)return y}else if(e&&o)return m;return d}function b({scale:t,translate:e},n){return Math.round((n-e[0])/t[0])}function M({scale:t,translate:e},n){return Math.round((e[1]-n)/t[1])}function w({scale:t,translate:e},n){return n*t[0]+e[0]}function N({scale:t,translate:e},n){return e[1]-n*t[1]}function G(t,e,n){return t?e?n?k(t):P(t):n?Z(t):T(t):null}function T(t){const e=t.coords;return{x:e[0],y:e[1]}}function F(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t}function P(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2]}}function x(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t}function Z(t){const e=t.coords;return{x:e[0],y:e[1],m:e[2]}}function j(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.m,t}function k(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2],m:e[3]}}function E(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t.coords[3]=e.m,t}function z(t,e,n,r){let s=T;n&&r?s=k:n?s=P:r&&(s=Z);for(const c of e){const{geometry:e,attributes:n}=c,r=o(e)?s(e):null;t.push({attributes:n,geometry:r})}return t}function S(t,e){return t&&e?E:t?x:e?j:F}function v(t,e,n,o,r){const s=S(n,o);for(const c of e){const{geometry:e,attributes:n}=c;let o;e&&(o=s(new f,e)),t.push(new u(o,n,null,n[r]))}return t}function V(t,e,n=S(null!=e.z,null!=e.m)){return n(t,e)}function Y(t,e,n,o){for(const r of e){const{geometry:e,attributes:s}=r;let c;e&&(c=_(e,n,o)),t.push({attributes:s,geometry:c})}return t}function _(t,e,o){if(n(t))return null;const r=h(e,o),s=[];for(let n=0;n<t.coords.length;n+=r){const e=[];for(let o=0;o<r;o++)e.push(t.coords[n+o]);s.push(e)}return e?o?{points:s,hasZ:e,hasM:o}:{points:s,hasZ:e}:o?{points:s,hasM:o}:{points:s}}function O(t,e,n,o,r){const s=h(n,o);for(const c of e){const e=c.geometry,n=c.attributes;let o;e&&(o=A(new f,e,s)),t.push(new u(o,n,null,n[r]))}return t}function A(t,e,n=h(e.hasZ,e.hasM)){t.lengths[0]=e.points.length;const o=t.coords;let r=0;for(const s of e.points)for(let t=0;t<n;t++)o[r++]=s[t];return t}function L(t,e,n,r){for(const s of e){const{geometry:e,attributes:c}=s;let l;o(e)&&(l=U(e,n,r)),t.push({attributes:c,geometry:l})}return t}function U(t,e,n){if(!t)return null;const o=h(e,n),{coords:r,lengths:s}=t,c=[];let l=0;for(const u of s){const t=[];for(let e=0;e<u;e++){const e=[];for(let t=0;t<o;t++)e.push(r[l++]);t.push(e)}c.push(t)}return e?n?{paths:c,hasZ:e,hasM:n}:{paths:c,hasZ:e}:n?{paths:c,hasM:n}:{paths:c}}function q(t,e,n,o,r){const s=h(n,o);for(const c of e){const e=c.geometry,n=c.attributes;let o;e&&(o=$(new f,e,s)),t.push(new u(o,n,null,n[r]))}return t}function $(t,e,n=h(e.hasZ,e.hasM)){const{lengths:o,coords:r}=t;let s=0;for(const c of e.paths){for(const t of c)for(let e=0;e<n;e++)r[s++]=t[e];o.push(c.length)}return t}function R(t,e,n,r){for(const s of e){const{geometry:e,attributes:c,centroid:l}=s;let u;if(o(e)&&(u=C(e,n,r)),l){const e=T(l);t.push({attributes:c,centroid:e,geometry:u})}else t.push({attributes:c,geometry:u})}return t}function C(t,e,n){if(!t)return null;const o=h(e,n),{coords:r,lengths:s}=t,c=[];let l=0;for(const u of s){const t=[];for(let e=0;e<u;e++){const e=[];for(let t=0;t<o;t++)e.push(r[l++]);t.push(e)}c.push(t)}return e?n?{rings:c,hasZ:e,hasM:n}:{rings:c,hasZ:e}:n?{rings:c,hasM:n}:{rings:c}}function B(t,e,n,r,s){for(const c of e){const e=c.geometry,l=c.centroid,i=c.attributes;let h;e&&(h=D(new f,e,n,r)),o(l)?t.push(new u(h,i,F(new f,l),i[s])):t.push(new u(h,i,null,i[s]))}return t}function D(t,e,n=e.hasZ,o=e.hasM){return H(t,e.rings,n,o),t}function H(t,e,n,o){const r=h(n,o),{lengths:s,coords:c}=t;let l=0;s.length=c.length=0;for(const u of e){for(const t of u)for(let e=0;e<r;e++)c[l++]=t[e];s.push(u.length)}return t}const J=[],K=[];function Q(t,e,n,o,r){J[0]=t;const[s]=W(K,J,e,n,o,r);return J.length=K.length=0,s}function W(e,n,o,r,s,c){if(e.length=0,!o){for(const t of n){const n=t.attributes[c];e.push(new u(null,t.attributes,null,n))}return e}switch(o){case"esriGeometryPoint":return v(e,n,r,s,c);case"esriGeometryMultipoint":return O(e,n,r,s,c);case"esriGeometryPolyline":return q(e,n,r,s,c);case"esriGeometryPolygon":return B(e,n,r,s,c);default:a.error("convertToFeatureSet:unknown-geometry",new t(`Unable to parse unknown geometry type '${o}'`)),e.length=0}return e}function X(e,n,o,r,s,c){const l=e.length;switch(o){case"esriGeometryPoint":v(e,n,r,s,c);break;case"esriGeometryMultipoint":O(e,n,r,s,c);break;case"esriGeometryPolyline":q(e,n,r,s,c);break;case"esriGeometryPolygon":B(e,n,r,s,c);break;default:a.error("convertToFeatureSet:unknown-geometry",new t(`Unable to parse unknown geometry type '${o}'`))}for(let t=0;t<n.length;t++)e[t+l].geometryType=o,e[t+l].insertAfter=n[t].insertAfter,e[t+l].groupId=n[t].groupId;return e}function tt(t,e,n,o){K[0]=t,rt(J,K,e,n,o);const r=J[0];return J.length=K.length=0,r}function et(e,o,u){if(n(e))return null;const i=new f;if("hasZ"in e&&null==o&&(o=e.hasZ),"hasM"in e&&null==u&&(u=e.hasM),r(e)){return S(null!=o?o:null!=e.z,null!=u?u:null!=e.m)(i,e)}return s(e)?D(i,e,o,u):c(e)?$(i,e,h(o,u)):l(e)?A(i,e,h(o,u)):void a.error("convertFromGeometry:unknown-geometry",new t(`Unable to parse unknown geometry type '${e}'`))}function nt(e,o,r,s){const c=e&&("coords"in e?e:e.geometry);if(n(c))return null;switch(o){case"esriGeometryPoint":{let t=T;return r&&s?t=k:r?t=P:s&&(t=Z),t(c)}case"esriGeometryMultipoint":return _(c,r,s);case"esriGeometryPolyline":return U(c,r,s);case"esriGeometryPolygon":return C(c,r,s);default:return void a.error("convertToGeometry:unknown-geometry",new t(`Unable to parse unknown geometry type '${o}'`))}}function ot(t,e){for(const n of e)t.push({attributes:n.attributes});return t}function rt(e,o,r,s,c){if(e.length=0,n(r))return ot(e,o);switch(r){case"esriGeometryPoint":return z(e,o,s,c);case"esriGeometryMultipoint":return Y(e,o,s,c);case"esriGeometryPolyline":return L(e,o,s,c);case"esriGeometryPolygon":return R(e,o,s,c);default:a.error("convertToFeatureSet:unknown-geometry",new t(`Unable to parse unknown geometry type '${r}'`))}return e}function st(t){const{objectIdFieldName:e,spatialReference:n,transform:o,fields:r,hasM:s,hasZ:c,features:l,geometryType:u,exceededTransferLimit:i,uniqueIdField:f,queryGeometry:h,queryGeometryType:a}=t,g={features:rt([],l,u,c,s),fields:r,geometryType:u,objectIdFieldName:e,spatialReference:n,uniqueIdField:f,queryGeometry:nt(h,a,!1,!1)};return o&&(g.transform=o),i&&(g.exceededTransferLimit=i),s&&(g.hasM=s),c&&(g.hasZ=c),g}function ct(e,n){const o=new i,{hasM:r,hasZ:s,features:c,objectIdFieldName:l,spatialReference:u,geometryType:f,exceededTransferLimit:h,transform:g,fields:d}=e;return d&&(o.fields=d),o.geometryType=f,o.objectIdFieldName=l||n,o.spatialReference=u,o.objectIdFieldName?(c&&W(o.features,c,f,s,r,o.objectIdFieldName),h&&(o.exceededTransferLimit=h),r&&(o.hasM=r),s&&(o.hasZ=s),g&&(o.transform=g),o):(a.error(new t("optimized-features:invalid-objectIdFieldName","objectIdFieldName is missing")),o)}function lt(t){const{transform:e,features:n,hasM:r,hasZ:s}=t;if(!e)return t;for(const c of n)o(c.geometry)&&mt(c.geometry,c.geometry,r,s,e),c.centroid&&mt(c.centroid,c.centroid,r,s,e);return t.transform=null,t}function ut(t,e){const{geometryType:n,features:o,hasM:r,hasZ:s}=e;if(!t)return e;for(let c=0;c<o.length;c++){const e=o[c],l=e.weakClone();l.geometry=new f,it(l.geometry,e.geometry,r,s,n,t),e.centroid&&(l.centroid=new f,it(l.centroid,e.centroid,r,s,"esriGeometryPoint",t)),o[c]=l}return e.transform=t,e}function it(t,e,o,r,s,c,l=o,u=r){if(t.lengths.length&&(t.lengths.length=0),t.coords.length&&(t.coords.length=0),n(e)||!e.coords.length)return null;const i=g[s],{coords:f,lengths:a}=e,d=h(o,r),m=h(o&&l,r&&u),y=I(o,r,l,u);if(!a.length)return y(t.coords,f,0,0,b(c,f[0]),M(c,f[1])),t.lengths.length&&(t.lengths.length=0),t.coords.length=d,t;let p,w,N,G,T=0,F=0,P=F;for(const n of a){if(n<i)continue;let e=0;F=P,N=p=b(c,f[T]),G=w=M(c,f[T+1]),y(t.coords,f,F,T,N,G),e++,T+=d,F+=m;for(let o=1;o<n;o++,T+=d)N=b(c,f[T]),G=M(c,f[T+1]),N===p&&G===w||(y(t.coords,f,F,T,N-p,G-w),F+=m,e++,p=N,w=G);e>=i&&(t.lengths.push(e),P=F)}return t.coords.length=P,t.coords.length?t:null}function ft(t,e,n,o,r,s,c=n,l=o){if(t.lengths.length&&(t.lengths.length=0),t.coords.length&&(t.coords.length=0),!e||!e.coords.length)return null;const u=g[r],{coords:i,lengths:f}=e,a=h(n,o),d=h(n&&c,o&&l),m=I(n,o,c,l);if(!f.length)return m(t.coords,i,0,0,i[0],i[1]),t.lengths.length&&(t.lengths.length=0),t.coords.length=a,t;let y=0;const p=s*s;for(const h of f){if(h<u){y+=h*a;continue}const e=t.coords.length/d,n=y,o=y+(h-1)*a;m(t.coords,i,t.coords.length,n,i[n],i[n+1]),at(t.coords,i,a,p,m,n,o),m(t.coords,i,t.coords.length,o,i[o],i[o+1]);const r=t.coords.length/d-e;r>=u?t.lengths.push(r):t.coords.length=e*d,y+=h*a}return t.coords.length?t:null}function ht(t,e,n,o){const r=t[e],s=t[e+1],c=t[n],l=t[n+1],u=t[o],i=t[o+1];let f=c,h=l,a=u-f,g=i-h;if(0!==a||0!==g){const t=((r-f)*a+(s-h)*g)/(a*a+g*g);t>1?(f=u,h=i):t>0&&(f+=a*t,h+=g*t)}return a=r-f,g=s-h,a*a+g*g}function at(t,e,n,o,r,s,c){let l,u=o,i=0;for(let f=s+n;f<c;f+=n)l=ht(e,f,s,c),l>u&&(i=f,u=l);u>o&&(i-s>n&&at(t,e,n,o,r,s,i),r(t,e,t.length,i,e[i],e[i+1]),c-i>n&&at(t,e,n,o,r,i,c))}function gt(t,e,o,r){if(n(e)||!e.coords||!e.coords.length)return null;const s=h(o,r);let c=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;if(e&&e.coords){const t=e.coords;for(let e=0;e<t.length;e+=s){const n=t[e],o=t[e+1];c=Math.min(c,n),u=Math.max(u,n),l=Math.min(l,o),i=Math.max(i,o)}}return t[0]=c,t[1]=l,t[2]=u,t[3]=i,t}function dt(t,e,n,o){const r=h(n,o),{lengths:s,coords:c}=e;let l=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,f=Number.NEGATIVE_INFINITY,a=0;for(const h of s){let t=c[a],e=c[a+1];l=Math.min(t,l),u=Math.min(e,u),i=Math.max(t,i),f=Math.max(e,f),a+=r;for(let n=1;n<h;n++,a+=r){const n=c[a],o=c[a+1];t+=n,e+=o,n<0&&(l=Math.min(l,t)),n>0&&(i=Math.max(i,t)),o<0?u=Math.min(u,e):o>0&&(f=Math.max(f,e))}}return t[0]=l,t[1]=u,t[2]=i,t[3]=f,t}function mt(t,e,n,o,r){const{coords:s,lengths:c}=e,l=n?o?p:m:o?m:d,u=h(n,o);if(!s.length)return t!==e&&(t.lengths.length=0,t.coords.length=0),t;if(!c.length)return l(t.coords,s,0,0,w(r,s[0]),N(r,s[1])),t!==e&&(t.lengths.length=0,t.coords.length=u),t;const[i,f]=r.scale;let a=0;for(let h=0;h<c.length;h++){const e=c[h];t.lengths[h]=e;let n=w(r,s[a]),o=N(r,s[a+1]);l(t.coords,s,a,a,n,o),a+=u;for(let r=1;r<e;r++,a+=u)n+=s[a]*i,o-=s[a+1]*f,l(t.coords,s,a,a,n,o)}return t!==e&&(t.lengths.length=c.length,t.coords.length=s.length),t}function yt(t,e,n,o,r,s){const c=h(n,o),l=I(n,o,r,s),u=e.coords;t.coords.length=0,t.lengths.length=0,t.lengths.push(...e.lengths);for(let i=0;i<u.length;i+=c)l(t.coords,u,t.coords.length,i,u[i],u[i+1]);return t}function pt(t,e,n,o,r){if(!e||!e.coords||!e.coords.length)return null;const s=g[n],{coords:c,lengths:l}=e,u=I(o,r,o,r),i=h(o,r);let f=0,a=0,d=0,m=0;for(const h of l){a=m,u(t.coords,c,a,f,c[f],c[f+1]),f+=i;let e=c[f],n=c[f+1],o=e,r=n,l=n/e;a+=i,u(t.coords,c,a,f,o,r),f+=i;for(let s=2;s<h;s++){e=c[f],n=c[f+1];const s=n/e,h=l===s||!isFinite(l)&&!isFinite(s),g=h&&isFinite(s)?l>=0&&s>=0||l<=0&&s<=0:r>=0&&n>=0||r<=0&&n<=0;h&&g?(o+=e,r+=n):(o=e,r=n,a+=i),u(t.coords,c,a,f,o,r),f+=i,l=s}a+=i;const g=(a-m)/i;g>=s&&(t.lengths[d]=g,m=a,d++)}return t.coords.length>m&&(t.coords.length=m),t.lengths.length>d&&(t.lengths.length=d),t.coords.length&&t.lengths.length?t:null}function It(t,e,n,o){let r=0,s=t[o*e],c=t[o*(e+1)];for(let l=1;l<n;l++){const n=s+t[o*(e+l)],u=c+t[o*(e+l)+1],i=(n-s)*(u+c);s=n,c=u,r+=i}return.5*r}function bt(t,e){const{coords:n,lengths:o}=t;let r=0,s=0;for(let c=0;c<o.length;c++){s+=It(n,r,o[c],e),r+=c}return Math.abs(s)}function Mt(t,e){const n=t.clone(),o=t.coords,r=t.lengths;let s=0;for(let c=0;c<r.length;c++){const t=r[c];let l=o[e*s],u=o[e*s+1];for(let r=1;r<t;r++){const t=o[e*(s+r)],c=o[e*(s+r)+1],i=t-l,f=c-u;n.coords[e*(s+r)]=i,n.coords[e*(s+r)+1]=f,l=t,u=c}s+=t}return n}function wt(t,e){if(n(t))return null;const o=t.clone(),r=t.coords,s=t.lengths;let c=0;for(let n=0;n<s.length;n++){const t=s[n];let l=r[e*c],u=r[e*c+1];for(let n=1;n<t;n++){const t=l+r[e*(c+n)],s=u+r[e*(c+n)+1];o.coords[e*(c+n)]=t,o.coords[e*(c+n)+1]=s,l=t,u=s}c+=t}return o}export{Q as convertFromFeature,ct as convertFromFeatureSet,W as convertFromFeatures,et as convertFromGeometry,X as convertFromGraphics,A as convertFromMultipoint,O as convertFromMultipointFeatures,H as convertFromNestedArray,V as convertFromPoint,v as convertFromPointFeatures,D as convertFromPolygon,$ as convertFromPolyline,q as convertFromPolylineFeatures,tt as convertToFeature,st as convertToFeatureSet,rt as convertToFeatures,nt as convertToGeometry,_ as convertToMultipoint,Y as convertToMultipointFeatures,G as convertToPoint,C as convertToPolygon,U as convertToPolyline,wt as deltaDecodeGeometry,Mt as deltaEncodeGeometry,ft as generalizeOptimizedGeometry,gt as getBoundsOptimizedGeometry,bt as getQuantizedArea,dt as getQuantizedBoundsOptimizedGeometry,It as getSignedQuantizedRingArea,ut as quantizeOptimizedFeatureSet,it as quantizeOptimizedGeometry,b as quantizeX,M as quantizeY,pt as removeCollinearVectices,yt as removeZMValues,lt as unquantizeOptimizedFeatureSet,mt as unquantizeOptimizedGeometry,w as unquantizeX,N as unquantizeY};
|
|
5
|
+
import e from"../../core/Error.js";import t from"../../core/Logger.js";import{isNone as n,isSome as o}from"../../core/maybe.js";import{isPoint as r,isPolygon as s,isPolyline as c,isMultipoint as l}from"../../geometry/support/jsonUtils.js";import u from"./OptimizedFeature.js";import i from"./OptimizedFeatureSet.js";import f from"./OptimizedGeometry.js";function h(e,t){return e?t?4:3:t?3:2}const a=t.getLogger("esri.layers.graphics.featureConversionUtils"),g={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0},d=(e,t,n,o,r,s)=>{e[n]=r,e[n+1]=s},m=(e,t,n,o,r,s)=>{e[n]=r,e[n+1]=s,e[n+2]=t[o+2]},y=(e,t,n,o,r,s)=>{e[n]=r,e[n+1]=s,e[n+2]=t[o+3]},p=(e,t,n,o,r,s)=>{e[n]=r,e[n+1]=s,e[n+2]=t[o+2],e[n+3]=t[o+3]};function I(e,t,n,o){if(e){if(n)return t&&o?p:m;if(t&&o)return y}else if(t&&o)return m;return d}function b({scale:e,translate:t},n){return Math.round((n-t[0])/e[0])}function M({scale:e,translate:t},n){return Math.round((t[1]-n)/e[1])}function w({scale:e,translate:t},n){return n*e[0]+t[0]}function N({scale:e,translate:t},n){return t[1]-n*e[1]}function G(e,t,n){return e?t?n?k(e):P(e):n?Z(e):T(e):null}function T(e){const t=e.coords;return{x:t[0],y:t[1]}}function F(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e}function P(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2]}}function x(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e}function Z(e){const t=e.coords;return{x:t[0],y:t[1],m:t[2]}}function j(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.m,e}function k(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2],m:t[3]}}function E(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e.coords[3]=t.m,e}function z(e,t,n,r){let s=T;n&&r?s=k:n?s=P:r&&(s=Z);for(const c of t){const{geometry:t,attributes:n}=c,r=o(t)?s(t):null;e.push({attributes:n,geometry:r})}return e}function v(e,t){return e&&t?E:e?x:t?j:F}function S(e,t,n,o,r){const s=v(n,o);for(const c of t){const{geometry:t,attributes:n}=c;let o;t&&(o=s(new f,t)),e.push(new u(o,n,null,n[r]))}return e}function V(e,t,n=v(null!=t.z,null!=t.m)){return n(e,t)}function Y(e,t,n,o){for(const r of t){const{geometry:t,attributes:s}=r;let c;t&&(c=_(t,n,o)),e.push({attributes:s,geometry:c})}return e}function _(e,t,o){if(n(e))return null;const r=h(t,o),s=[];for(let n=0;n<e.coords.length;n+=r){const t=[];for(let o=0;o<r;o++)t.push(e.coords[n+o]);s.push(t)}return t?o?{points:s,hasZ:t,hasM:o}:{points:s,hasZ:t}:o?{points:s,hasM:o}:{points:s}}function O(e,t,n,o,r){const s=h(n,o);for(const c of t){const t=c.geometry,n=c.attributes;let o;t&&(o=U(new f,t,s)),e.push(new u(o,n,null,n[r]))}return e}function U(e,t,n=h(t.hasZ,t.hasM)){e.lengths[0]=t.points.length;const o=e.coords;let r=0;for(const s of t.points)for(let e=0;e<n;e++)o[r++]=s[e];return e}function A(e,t,n,r){for(const s of t){const{geometry:t,attributes:c}=s;let l;o(t)&&(l=L(t,n,r)),e.push({attributes:c,geometry:l})}return e}function L(e,t,n){if(!e)return null;const o=h(t,n),{coords:r,lengths:s}=e,c=[];let l=0;for(const u of s){const e=[];for(let t=0;t<u;t++){const t=[];for(let e=0;e<o;e++)t.push(r[l++]);e.push(t)}c.push(e)}return t?n?{paths:c,hasZ:t,hasM:n}:{paths:c,hasZ:t}:n?{paths:c,hasM:n}:{paths:c}}function q(e,t,n,o,r){const s=h(n,o);for(const c of t){const t=c.geometry,n=c.attributes;let o;t&&(o=$(new f,t,s)),e.push(new u(o,n,null,n[r]))}return e}function $(e,t,n=h(t.hasZ,t.hasM)){const{lengths:o,coords:r}=e;let s=0;for(const c of t.paths){for(const e of c)for(let t=0;t<n;t++)r[s++]=e[t];o.push(c.length)}return e}function R(e,t,n,r){for(const s of t){const{geometry:t,attributes:c,centroid:l}=s;let u;if(o(t)&&(u=C(t,n,r)),l){const t=T(l);e.push({attributes:c,centroid:t,geometry:u})}else e.push({attributes:c,geometry:u})}return e}function C(e,t,n){if(!e)return null;const o=h(t,n),{coords:r,lengths:s}=e,c=[];let l=0;for(const u of s){const e=[];for(let t=0;t<u;t++){const t=[];for(let e=0;e<o;e++)t.push(r[l++]);e.push(t)}c.push(e)}return t?n?{rings:c,hasZ:t,hasM:n}:{rings:c,hasZ:t}:n?{rings:c,hasM:n}:{rings:c}}function B(e,t,n,r,s){for(const c of t){const t=c.geometry,l=c.centroid,i=c.attributes;let h;t&&(h=D(new f,t,n,r)),o(l)?e.push(new u(h,i,F(new f,l),i[s])):e.push(new u(h,i,null,i[s]))}return e}function D(e,t,n=t.hasZ,o=t.hasM){return H(e,t.rings,n,o),e}function H(e,t,n,o){const r=h(n,o),{lengths:s,coords:c}=e;let l=0;s.length=c.length=0;for(const u of t){for(const e of u)for(let t=0;t<r;t++)c[l++]=e[t];s.push(u.length)}return e}const J=[],K=[];function Q(e,t,n,o,r){J[0]=e;const[s]=W(K,J,t,n,o,r);return J.length=K.length=0,s}function W(t,n,o,r,s,c){if(t.length=0,!o){for(const e of n){const n=e.attributes[c];t.push(new u(null,e.attributes,null,n))}return t}switch(o){case"esriGeometryPoint":return S(t,n,r,s,c);case"esriGeometryMultipoint":return O(t,n,r,s,c);case"esriGeometryPolyline":return q(t,n,r,s,c);case"esriGeometryPolygon":return B(t,n,r,s,c);default:a.error("convertToFeatureSet:unknown-geometry",new e(`Unable to parse unknown geometry type '${o}'`)),t.length=0}return t}function X(t,n,o,r,s,c){const l=t.length;switch(o){case"esriGeometryPoint":S(t,n,r,s,c);break;case"esriGeometryMultipoint":O(t,n,r,s,c);break;case"esriGeometryPolyline":q(t,n,r,s,c);break;case"esriGeometryPolygon":B(t,n,r,s,c);break;default:a.error("convertToFeatureSet:unknown-geometry",new e(`Unable to parse unknown geometry type '${o}'`))}for(let e=0;e<n.length;e++)t[e+l].geometryType=o,t[e+l].insertAfter=n[e].insertAfter,t[e+l].groupId=n[e].groupId;return t}function ee(e,t,n,o){K[0]=e,re(J,K,t,n,o);const r=J[0];return J.length=K.length=0,r}function te(t,o,u){if(n(t))return null;const i=new f;if("hasZ"in t&&null==o&&(o=t.hasZ),"hasM"in t&&null==u&&(u=t.hasM),r(t)){return v(null!=o?o:null!=t.z,null!=u?u:null!=t.m)(i,t)}return s(t)?D(i,t,o,u):c(t)?$(i,t,h(o,u)):l(t)?U(i,t,h(o,u)):void a.error("convertFromGeometry:unknown-geometry",new e(`Unable to parse unknown geometry type '${t}'`))}function ne(t,o,r,s){const c=t&&("coords"in t?t:t.geometry);if(n(c))return null;switch(o){case"esriGeometryPoint":{let e=T;return r&&s?e=k:r?e=P:s&&(e=Z),e(c)}case"esriGeometryMultipoint":return _(c,r,s);case"esriGeometryPolyline":return L(c,r,s);case"esriGeometryPolygon":return C(c,r,s);default:return void a.error("convertToGeometry:unknown-geometry",new e(`Unable to parse unknown geometry type '${o}'`))}}function oe(e,t){for(const n of t)e.push({attributes:n.attributes});return e}function re(t,o,r,s,c){if(t.length=0,n(r))return oe(t,o);switch(r){case"esriGeometryPoint":return z(t,o,s,c);case"esriGeometryMultipoint":return Y(t,o,s,c);case"esriGeometryPolyline":return A(t,o,s,c);case"esriGeometryPolygon":return R(t,o,s,c);default:a.error("convertToFeatureSet:unknown-geometry",new e(`Unable to parse unknown geometry type '${r}'`))}return t}function se(e){const{objectIdFieldName:t,spatialReference:n,transform:o,fields:r,hasM:s,hasZ:c,features:l,geometryType:u,exceededTransferLimit:i,uniqueIdField:f,queryGeometry:h,queryGeometryType:a}=e,g={features:re([],l,u,c,s),fields:r,geometryType:u,objectIdFieldName:t,spatialReference:n,uniqueIdField:f,queryGeometry:ne(h,a,!1,!1)};return o&&(g.transform=o),i&&(g.exceededTransferLimit=i),s&&(g.hasM=s),c&&(g.hasZ=c),g}function ce(t,n){const o=new i,{hasM:r,hasZ:s,features:c,objectIdFieldName:l,spatialReference:u,geometryType:f,exceededTransferLimit:h,transform:g,fields:d}=t;return d&&(o.fields=d),o.geometryType=f,o.objectIdFieldName=l||n,o.spatialReference=u,o.objectIdFieldName?(c&&W(o.features,c,f,s,r,o.objectIdFieldName),h&&(o.exceededTransferLimit=h),r&&(o.hasM=r),s&&(o.hasZ=s),g&&(o.transform=g),o):(a.error(new e("optimized-features:invalid-objectIdFieldName","objectIdFieldName is missing")),o)}function le(e){const{transform:t,features:n,hasM:r,hasZ:s}=e;if(!t)return e;for(const c of n)o(c.geometry)&&me(c.geometry,c.geometry,r,s,t),c.centroid&&me(c.centroid,c.centroid,r,s,t);return e.transform=null,e}function ue(e,t){const{geometryType:n,features:o,hasM:r,hasZ:s}=t;if(!e)return t;for(let c=0;c<o.length;c++){const t=o[c],l=t.weakClone();l.geometry=new f,ie(l.geometry,t.geometry,r,s,n,e),t.centroid&&(l.centroid=new f,ie(l.centroid,t.centroid,r,s,"esriGeometryPoint",e)),o[c]=l}return t.transform=e,t}function ie(e,t,o,r,s,c,l=o,u=r){if(e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0),n(t)||!t.coords.length)return null;const i=g[s],{coords:f,lengths:a}=t,d=h(o,r),m=h(o&&l,r&&u),y=I(o,r,l,u);if(!a.length)return y(e.coords,f,0,0,b(c,f[0]),M(c,f[1])),e.lengths.length&&(e.lengths.length=0),e.coords.length=d,e;let p,w,N,G,T=0,F=0,P=F;for(const n of a){if(n<i)continue;let t=0;F=P,N=p=b(c,f[T]),G=w=M(c,f[T+1]),y(e.coords,f,F,T,N,G),t++,T+=d,F+=m;for(let o=1;o<n;o++,T+=d)N=b(c,f[T]),G=M(c,f[T+1]),N===p&&G===w||(y(e.coords,f,F,T,N-p,G-w),F+=m,t++,p=N,w=G);t>=i&&(e.lengths.push(t),P=F)}return e.coords.length=P,e.coords.length?e:null}function fe(e,t,n,o,r,s,c=n,l=o){if(e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0),!t||!t.coords.length)return null;const u=g[r],{coords:i,lengths:f}=t,a=h(n,o),d=h(n&&c,o&&l),m=I(n,o,c,l);if(!f.length)return m(e.coords,i,0,0,i[0],i[1]),e.lengths.length&&(e.lengths.length=0),e.coords.length=a,e;let y=0;const p=s*s;for(const h of f){if(h<u){y+=h*a;continue}const t=e.coords.length/d,n=y,o=y+(h-1)*a;m(e.coords,i,e.coords.length,n,i[n],i[n+1]),ae(e.coords,i,a,p,m,n,o),m(e.coords,i,e.coords.length,o,i[o],i[o+1]);const r=e.coords.length/d-t;r>=u?e.lengths.push(r):e.coords.length=t*d,y+=h*a}return e.coords.length?e:null}function he(e,t,n,o){const r=e[t],s=e[t+1],c=e[n],l=e[n+1],u=e[o],i=e[o+1];let f=c,h=l,a=u-f,g=i-h;if(0!==a||0!==g){const e=((r-f)*a+(s-h)*g)/(a*a+g*g);e>1?(f=u,h=i):e>0&&(f+=a*e,h+=g*e)}return a=r-f,g=s-h,a*a+g*g}function ae(e,t,n,o,r,s,c){let l,u=o,i=0;for(let f=s+n;f<c;f+=n)l=he(t,f,s,c),l>u&&(i=f,u=l);u>o&&(i-s>n&&ae(e,t,n,o,r,s,i),r(e,t,e.length,i,t[i],t[i+1]),c-i>n&&ae(e,t,n,o,r,i,c))}function ge(e,t,o,r){if(n(t)||!t.coords||!t.coords.length)return null;const s=h(o,r);let c=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;if(t&&t.coords){const e=t.coords;for(let t=0;t<e.length;t+=s){const n=e[t],o=e[t+1];c=Math.min(c,n),u=Math.max(u,n),l=Math.min(l,o),i=Math.max(i,o)}}return e[0]=c,e[1]=l,e[2]=u,e[3]=i,e}function de(e,t,n,o){const r=h(n,o),{lengths:s,coords:c}=t;let l=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,f=Number.NEGATIVE_INFINITY,a=0;for(const h of s){let e=c[a],t=c[a+1];l=Math.min(e,l),u=Math.min(t,u),i=Math.max(e,i),f=Math.max(t,f),a+=r;for(let n=1;n<h;n++,a+=r){const n=c[a],o=c[a+1];e+=n,t+=o,n<0&&(l=Math.min(l,e)),n>0&&(i=Math.max(i,e)),o<0?u=Math.min(u,t):o>0&&(f=Math.max(f,t))}}return e[0]=l,e[1]=u,e[2]=i,e[3]=f,e}function me(e,t,n,o,r){const{coords:s,lengths:c}=t,l=n?o?p:m:o?m:d,u=h(n,o);if(!s.length)return e!==t&&(e.lengths.length=0,e.coords.length=0),e;if(!c.length)return l(e.coords,s,0,0,w(r,s[0]),N(r,s[1])),e!==t&&(e.lengths.length=0,e.coords.length=u),e;const[i,f]=r.scale;let a=0;for(let h=0;h<c.length;h++){const t=c[h];e.lengths[h]=t;let n=w(r,s[a]),o=N(r,s[a+1]);l(e.coords,s,a,a,n,o),a+=u;for(let r=1;r<t;r++,a+=u)n+=s[a]*i,o-=s[a+1]*f,l(e.coords,s,a,a,n,o)}return e!==t&&(e.lengths.length=c.length,e.coords.length=s.length),e}function ye(e,t,n,o,r,s){const c=h(n,o),l=I(n,o,r,s),u=t.coords;e.coords.length=0,e.lengths.length=0,e.lengths.push(...t.lengths);for(let i=0;i<u.length;i+=c)l(e.coords,u,e.coords.length,i,u[i],u[i+1]);return e}function pe(e,t,n,o,r){if(!t||!t.coords||!t.coords.length)return null;const s=g[n],{coords:c,lengths:l}=t,u=I(o,r,o,r),i=h(o,r);let f=0,a=0,d=0,m=0;for(const h of l){a=m,u(e.coords,c,a,f,c[f],c[f+1]),f+=i;let t=c[f],n=c[f+1],o=t,r=n,l=n/t;a+=i,u(e.coords,c,a,f,o,r),f+=i;for(let s=2;s<h;s++){t=c[f],n=c[f+1];const s=n/t,h=l===s||!isFinite(l)&&!isFinite(s),g=h&&isFinite(s)?l>=0&&s>=0||l<=0&&s<=0:r>=0&&n>=0||r<=0&&n<=0;h&&g?(o+=t,r+=n):(o=t,r=n,a+=i),u(e.coords,c,a,f,o,r),f+=i,l=s}a+=i;const g=(a-m)/i;g>=s&&(e.lengths[d]=g,m=a,d++)}return e.coords.length>m&&(e.coords.length=m),e.lengths.length>d&&(e.lengths.length=d),e.coords.length&&e.lengths.length?e:null}function Ie(e,t,n,o){let r=0,s=e[o*t],c=e[o*(t+1)];for(let l=1;l<n;l++){const n=s+e[o*(t+l)],u=c+e[o*(t+l)+1],i=(n-s)*(u+c);s=n,c=u,r+=i}return.5*r}function be(e,t){const{coords:n,lengths:o}=e;let r=0,s=0;for(let c=0;c<o.length;c++){s+=Ie(n,r,o[c],t),r+=c}return Math.abs(s)}function Me(e,t){const n=e.clone(),o=e.coords,r=e.lengths;let s=0;for(let c=0;c<r.length;c++){const e=r[c];let l=o[t*s],u=o[t*s+1];for(let r=1;r<e;r++){const e=o[t*(s+r)],c=o[t*(s+r)+1],i=e-l,f=c-u;n.coords[t*(s+r)]=i,n.coords[t*(s+r)+1]=f,l=e,u=c}s+=e}return n}function we(e,t){if(n(e))return null;const o=e.clone(),r=e.coords,s=e.lengths;let c=0;for(let n=0;n<s.length;n++){const e=s[n];let l=r[t*c],u=r[t*c+1];for(let n=1;n<e;n++){const e=l+r[t*(c+n)],s=u+r[t*(c+n)+1];o.coords[t*(c+n)]=e,o.coords[t*(c+n)+1]=s,l=e,u=s}c+=e}return o}export{Q as convertFromFeature,ce as convertFromFeatureSet,W as convertFromFeatures,te as convertFromGeometry,X as convertFromGraphics,U as convertFromMultipoint,O as convertFromMultipointFeatures,H as convertFromNestedArray,V as convertFromPoint,S as convertFromPointFeatures,D as convertFromPolygon,$ as convertFromPolyline,q as convertFromPolylineFeatures,ee as convertToFeature,se as convertToFeatureSet,re as convertToFeatures,ne as convertToGeometry,_ as convertToMultipoint,Y as convertToMultipointFeatures,G as convertToPoint,C as convertToPolygon,L as convertToPolyline,we as deltaDecodeGeometry,Me as deltaEncodeGeometry,fe as generalizeOptimizedGeometry,ge as getBoundsOptimizedGeometry,be as getQuantizedArea,de as getQuantizedBoundsOptimizedGeometry,Ie as getSignedQuantizedRingArea,ue as quantizeOptimizedFeatureSet,ie as quantizeOptimizedGeometry,b as quantizeX,M as quantizeY,pe as removeCollinearVectices,ye as removeZMValues,le as unquantizeOptimizedFeatureSet,me as unquantizeOptimizedGeometry,w as unquantizeX,N as unquantizeY};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import i from"../../core/Loadable.js";import{isNone as s,unwrap as r}from"../../core/maybe.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{parse as l}from"./arcgisLayerUrl.js";import u from"./Contingency.js";import c from"./ContingencyConstraintViolation.js";import p from"./ContingentValue.js";import d from"./ContingentValuesResult.js";import f from"./FieldGroup.js";import y from"./Subtype.js";var h;let m=h=class extends(n(i)){constructor(e){super(e),this.request=t,this.fieldGroups=null,this.fieldGroupDefinitions=null}initialize(){}static async createLoadedLayerContingentValuesCache(e){await e.load();const t=e.sourceJSON.hasContingentValuesDefinition;if(t)return new h({layer:e}).load();if(void 0===t){const t=l(e.url);if(s(t))return null;const n=t.url.path;if((await h._staticFetchEnterpriseFeatureRoot(n)).supportsQueryDataElements){const t=e.layerId.toString(),i=await h._staticFetchEnterpriseFieldGroup(n,t);if(i){const t=i.map((e=>({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fieldNames.names})));return new h({layer:e,fieldGroupDefinitions:t}).load()}}}return null}async load(e){const t=this.layer.load(e).then((()=>this._initializeContingentValues(this.fieldGroupDefinitions,e)));return this.addResolvingPromise(t),this}validateContingencyConstraints(e){const t=this.layer.typeIdField,n=[];for(const i of this.fieldGroups){let s=!1;const r=e.attributes[t],o=i.contingencies.filter((e=>!(!e.isRetired&&e.subtype)||e.subtype.code===r));for(const t of o){let n=!0;for(const i in t.values){const s=t.values[i];if("any"!==s.objectType)if("null"===s.objectType){if(null!==e.attributes[i]&&void 0!==e.attributes[i]){n=!1;break}}else if("code"===s.objectType){if(e.attributes[i]!==s.codedValue.code){n=!1;break}}else if("range"===s.objectType){const t=e.attributes[i];if(t<s.minValue||t>s.maxValue){n=!1;break}}}if(n){s=!0;break}}if(!s){const e=i.isEditingRestrictive?"error":"warning";n.push(new c({fieldGroup:i,type:e}))}}return n}getContingentValues(e,t){const n=this.layer.typeIdField,i=e.attributes[n],s={},r=[];for(const o of this.fieldGroups){const n=[],a=o.contingencies.filter((e=>!(!e.isRetired&&e.subtype)||e.subtype.code===i));for(const i of a){let s,o=!0;for(const n in i.values){const r=i.values[n];if(t!==n){if("any"!==r.objectType)if("null"===r.objectType)null!==e.attributes[n]&&void 0!==e.attributes[n]&&(o=!1);else if("code"===r.objectType)e.attributes[n]!==r.codedValue.code&&(o=!1);else if("range"===r.objectType){const t=e.attributes[n];(t<r.minValue||t>r.maxValue)&&(o=!1)}}else s=r}s&&o&&(n.push(s),r.push(s))}s[o.name]=n}return new d({contingentValuesAllGroups:r,contingentValuesByFieldGroup:s})}static async _staticFetchEnterpriseFeatureRoot(e,n){return t(e,{responseType:"json",query:{f:"json"},...n}).then((e=>e.data))}static async _staticFetchEnterpriseFieldGroup(e,n,i){return t(`${e}/queryDataElements`,{responseType:"json",query:{layers:JSON.stringify([n]),f:"json"},...i}).then((e=>{var t;return null==(t=e.data.layerDataElements)?void 0:t[0].dataElement.fieldGroups}))}async _initializeContingentValues(e,t){const n=e||await this._fetchFieldGroupDefs(t);if(0===n.length)return void(this.fieldGroups=[]);const i=await this._fetchContingentValues(n,t);this.fieldGroups=i}async _fetchFieldGroupDefs(e){const t=this.layer.sourceJSON,n=this.layer.layerId.toString(),i=r(l(this.layer.url)).url.path;if(t.hasContingentValuesDefinition){return(await this._fetchAGOLFieldGroup(i,n,e)).map((e=>({name:e.name,isEditingRestrictive:e.restrictive,fields:e.fields})))}return void 0!==t.hasContingentValuesDefinition?[]:this._fetchEnterpriseFeatureRoot(i,e).then((async t=>{if(t.supportsQueryDataElements){return(await this._fetchEnterpriseFieldGroup(i,n,e)).map((e=>({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fieldNames.names})))}return[]}))}async _fetchAGOLFieldGroup(e,n,i){return t(`${e}/${n}/fieldgroups`,{responseType:"json",query:{f:"json"},...i}).then((e=>e.data.fieldGroups))}async _fetchEnterpriseFieldGroup(e,t,n){return h._staticFetchEnterpriseFieldGroup(e,t,n)}async _fetchEnterpriseFeatureRoot(e,t){return h._staticFetchEnterpriseFeatureRoot(e,t)}async _fetchContingentValues(e,t){const n=this.layer.sourceJSON,i=this.layer.layerId.toString(),s=r(l(this.layer.url)).url.path;if(n.hasContingentValuesDefinition){const n=await this._fetchAGOLContingentValues(s,i,t);return this._constructFieldGroupsAGOL(e,n)}const o=await this._fetchEnterpriseContingentValues(s,i,t);return this._constructFieldGroupsEnterprise(e,o)}_constructFieldGroupsAGOL(e,t){return e.map((e=>{const n=t.contingentValuesDefinition.fieldGroups.find((t=>t.name===e.name));if(n){let i=[];return i=t.contingentValuesDefinition.hasSubType?this._parseAGOLFieldGroupSubtype(e,t,n.subTypes):this._parseAGOLFieldGroup(e,t,n.contingentValues),new f({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fields,contingencies:i})}return null})).filter((e=>null!==e))}_parseAGOLFieldGroupSubtype(e,t,n){let i=[];return n.forEach((n=>{const s=this._getSubtypeAGOL(n.name);i=i.concat(this._parseAGOLFieldGroup(e,t,n.contingentValues,s))})),i}_parseAGOLFieldGroup(e,t,n,i){const s=[];for(const r of n){const n=this._parseAGOLContingency(r,e,t,i);s.push(n)}return s}_parseAGOLContingency(e,t,n,i){const s=e.id,r=!!e.retired&&1===e.retired,o={};for(let a=0,l=0;a<t.fields.length;a++){const s=t.fields[a],r=n.typeCodes[e.types[a]];if("Code"===r){let t=e.values[l];l++;const r=this._getDomain(i,s);if("string"===this.layer.getField(s).type){const e=n.stringDicts.find((e=>e.domain===r.name));e&&(t=e.entries[t])}const a=r.codedValues.find((e=>e.code===t)),u=new p({codedValue:a,objectType:"code"});o[s]=u}else if("Range"===r){const t=e.values[l];l++;const n=t.range[0],i=t.range[1],r=new p({minValue:n,maxValue:i,objectType:"range"});o[s]=r}else if("Any"===r){const e=new p({objectType:"any"});o[s]=e}else{const e=new p({objectType:"null"});o[s]=e}}return new u({id:s,isRetired:r,subtype:i,values:o})}_constructFieldGroupsEnterprise(e,t){const n=t.fieldGroups;return e.map((e=>{const i=n.find((t=>t.name===e.name));if(i){const n=i.contingencies.map((n=>{const i=n.id,s=n.isRetired,r=this._getSubtypeEnterprise(n.subtypeCode),o={};for(let a=0;a<e.fields.length;a++){const i=e.fields[a];let s=n.values[a];if("number"==typeof s||"string"==typeof s){const e=this._getDomain(r,i),n=this.layer.getField(i);if("string"===n.type)s=t.stringDictionary[s];else if("date"===n.type){const e=new Date(`${s}+00:00`);s=e.getTime()}const a=e.codedValues.find((e=>e.code===s)),l=new p({codedValue:a,objectType:"code"});o[i]=l}else if("object"==typeof s){const e=s.minValue,t=s.maxValue,n=new p({minValue:e,maxValue:t,objectType:"range"});o[i]=n}else if(s){const e=new p({objectType:"any"});o[i]=e}else{const e=new p({objectType:"null"});o[i]=e}}return new u({id:i,isRetired:s,subtype:r,values:o})}));return new f({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fields,contingencies:n})}return null})).filter((e=>null!==e))}async _fetchEnterpriseContingentValues(e,n,i){return t(`${e}/queryContingentValues`,{responseType:"json",query:{layers:JSON.stringify([n]),f:"json"},...i}).then((e=>{var t;return null==(t=e.data.contingentValueSets)?void 0:t[0]}))}async _fetchAGOLContingentValues(e,n,i){return t(`${e}/${n}/contingentValues`,{responseType:"json",query:{f:"json"},...i}).then((e=>e.data))}_getSubtypeEnterprise(e){const t=this.layer.sourceJSON;if(t.subtypes){const n=t.subtypes.find((t=>t.code===e));return y.fromJSON(n)}return null}_getSubtypeAGOL(e){const t=this.layer.sourceJSON;if(t.subtypes){const n=t.subtypes.find((t=>t.name===e));return y.fromJSON(n)}return null}_getDomain(e,t){const n=e?e.domains[t]:this.layer.getFieldDomain(t);return"inherited"===n.type?this.layer.getFieldDomain(t):n}};e([o({constructOnly:!0})],m.prototype,"layer",void 0),e([o({constructOnly:!0})],m.prototype,"request",void 0),e([o({type:[f]})],m.prototype,"fieldGroups",void 0),e([o()],m.prototype,"fieldGroupDefinitions",void 0),m=h=e([a("esri.layers.support.LayerContingentValuesCache")],m);const g=m;export{g as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{isNone as r}from"../../core/maybe.js";import{getMetersPerUnitForSR as s}from"../../core/unitUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{Integer as l}from"../../core/accessorSupport/ensureType.js";import{reader as n}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import c from"../../geometry/Point.js";import u from"../../geometry/SpatialReference.js";import{create as f}from"../../geometry/support/aaBoundingRect.js";import{isValid as h,getInfo as m,isGeographic as d,equals as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{isNone as r}from"../../core/maybe.js";import{getMetersPerUnitForSR as s}from"../../core/unitUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{Integer as l}from"../../core/accessorSupport/ensureType.js";import{reader as n}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import c from"../../geometry/Point.js";import u from"../../geometry/SpatialReference.js";import{create as f}from"../../geometry/support/aaBoundingRect.js";import{isValid as h,getInfo as m,isGeographic as d,equals as g}from"../../geometry/support/spatialReferenceUtils.js";import{project as y}from"../../geometry/support/webMercatorUtils.js";import v from"./LOD.js";var w;const x=new t({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let O=w=class extends o{constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.minScale=0,this.maxScale=0,this.size=null,this.spatialReference=null}static create(e={}){const{resolutionFactor:t=1,scales:o,size:r=256,spatialReference:i=u.WebMercator,numLODs:l=24}=e;if(!h(i)){const e=[];if(o)for(let t=0;t<o.length;t++){const r=o[t];e.push({level:t,scale:r,resolution:r})}else{let t=5e-4;for(let o=l-1;o>=0;o--)e.unshift({level:o,scale:t,resolution:t}),t*=2}return new w({dpi:96,lods:e,origin:new c(0,0,i),size:[r,r],spatialReference:i})}const n=m(i),a=e.origin?new c({x:e.origin.x,y:e.origin.y,spatialReference:i}):new c(n?{x:n.origin[0],y:n.origin[1],spatialReference:i}:{x:0,y:0,spatialReference:i}),p=96,f=1/(s(i)*39.37*p),g=[];if(o)for(let s=0;s<o.length;s++){const e=o[s],t=e*f;g.push({level:s,scale:e,resolution:t})}else{let e=d(i)?512/r*591657527.5917094:256/r*591657527.591555;const o=Math.ceil(l/t);g.push({level:0,scale:e,resolution:e*f});for(let r=1;r<o;r++){const o=e/2**t,s=o*f;g.push({level:r,scale:o,resolution:s}),e=o}}return new w({dpi:p,lods:g,origin:a,size:[r,r],spatialReference:i})}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const o=m(e);return e.isWrappable&&Math.abs(o.origin[0]-t.x)<=o.dx}return!1}readOrigin(e,t){return c.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,o=0;const r=[];this._levelToLOD={},e&&(t=-1/0,o=1/0,e.forEach((e=>{r.push(e.scale),t=e.scale>t?e.scale:t,o=e.scale<o?e.scale:o,this._levelToLOD[e.level]=e}))),this._set("scales",r),this._set("minScale",t),this._set("maxScale",o),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];{const o=Math.floor(e),r=o+1;return t[o]/(t[o]/t[r])**(e-o)}}scaleToZoom(e){const t=this.scales,o=t.length-1;let r=0;for(;r<o;r++){const o=t[r],s=t[r+1];if(o<=e)return r;if(s===e)return r+1;if(o>e&&s<e)return r+Math.log(o/e)/Math.log(o/s)}return r}snapScale(e,t=.95){const o=this.scaleToZoom(e);return o%Math.floor(o)>=t?this.zoomToScale(Math.ceil(o)):this.zoomToScale(Math.floor(o))}tileAt(e,t,o,s){const i=this.lodAt(e);if(!i)return null;let l,n;if("number"==typeof t)l=t,n=o;else if(g(t.spatialReference,this.spatialReference))l=t.x,n=t.y,s=o;else{const e=y(t,this.spatialReference);if(r(e))return null;l=e.x,n=e.y,s=o}const a=i.resolution*this.size[0],p=i.resolution*this.size[1];return s||(s={id:null,level:0,row:0,col:0,extent:f()}),s.level=e,s.row=Math.floor((this.origin.y-n)/p+.001),s.col=Math.floor((l-this.origin.x)/a+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=w.ExtrapolateOptions.NONE){let o=this.lodAt(e.level);if(!o&&t===w.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(o=t)}if(!o)return;const r=e.level-o.level,s=o.resolution*this.size[0]/2**r,i=o.resolution*this.size[1]/2**r;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=f()),e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*i,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+i}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel)&&(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),!0)}getTileBounds(e,t){const{resolution:o}=this.lodAt(t.level),r=o*this.size[0],s=o*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*s,e[2]=e[0]+r,e[3]=e[1]+s,e}lodAt(e){return this._levelToLOD&&this._levelToLOD[e]||null}clone(){return w.fromJSON(this.write({}))}getOrCreateCompatible(e){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const t=this.spatialReference.isGeographic,o=[],r=this.lods.length;for(let s=0;s<r;s++){const r=this.lods[s],i=512===e?.5*r.resolution:t?r.resolution:2*r.resolution;o.push(new v({level:r.level,scale:r.scale,resolution:i}))}return new w({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:o})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let o=0;o<e.length;o++){const r=e[o];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};e([i({type:Number,json:{write:!0}})],O.prototype,"compressionQuality",void 0),e([i({type:Number,json:{write:!0}})],O.prototype,"dpi",void 0),e([i({type:String,json:{read:x.read,write:x.write,origins:{"web-scene":{read:!1,write:!1}}}})],O.prototype,"format",void 0),e([i({readOnly:!0})],O.prototype,"isWrappable",null),e([i({type:c,json:{write:!0}})],O.prototype,"origin",void 0),e([n("origin")],O.prototype,"readOrigin",null),e([i({type:[v],value:null,json:{write:!0}})],O.prototype,"lods",null),e([i({readOnly:!0})],O.prototype,"minScale",void 0),e([i({readOnly:!0})],O.prototype,"maxScale",void 0),e([i({readOnly:!0})],O.prototype,"scales",void 0),e([i({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],O.prototype,"size",void 0),e([n("size",["rows","cols"])],O.prototype,"readSize",null),e([p("size",{cols:{type:l},rows:{type:l}})],O.prototype,"writeSize",null),e([i({type:u,json:{write:!0}})],O.prototype,"spatialReference",void 0),O=w=e([a("esri.layers.support.TileInfo")],O),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(O||(O={}));const S=O;export{S as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../request.js";import r from"../../../core/Error.js";import{JSONSupport as i}from"../../../core/JSONSupport.js";import o from"../../../core/Logger.js";import{isSome as n,isNone as s,unwrap as a}from"../../../core/maybe.js";import{EsriPromiseMixin as l}from"../../../core/Promise.js";import{onAbort as c}from"../../../core/promiseUtils.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{sanitizeUrl as u}from"../arcgisLayerUrl.js";import{url as m}from"../commonProperties.js";import d from"../RasterStorageInfo.js";import p from"../TileInfo.js";import{getRasterId as x,getBlock as g,putBlock as y,deleteBlock as I,decreaseRefCount as w}from"./RawBlockCache.js";import{decode as R}from"../rasterFormats/RasterCodec.js";import{mosaic as k,approximateTransform as v}from"../rasterFunctions/pixelUtils.js";import{load as b,getWorldWidth as T,projectPoint as M,snapPyramid as S,snapExtent as B,getWorldWrapCount as C,projectExtent as P,getProjectionOffsetGrid as W,getRasterDatasetAlignmentInfo as _,projectResolution as H}from"../rasterFunctions/rasterProjectionHelper.js";import{uvComponentToVector as j}from"../rasterFunctions/vectorFieldUtils.js";import F from"../../../geometry/Extent.js";import E from"../../../geometry/Point.js";const A=8;let L=class extends(l(i)){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=b();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:p.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=T(e.spatialReference);return n(t)&&e.extent.width>=t/2}set url(e){this._set("url",u(e,o.getLogger(this.declaredClass)))}async open(e){throw new r("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,r,i={}){const o=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,n=this.getTileExtentFromTileInfo(e,t,r,o);return this.fetchPixels(n,o.size[0],o.size[1],i)}async identify(e,t={}){t=this._getRequestOptionsWithSliceId(t);const{spatialReference:r,extent:i}=this.rasterInfo,{datumTransformation:o}=t;let a=M(e,r,o);if(!i.intersects(a))return{location:a,value:null};if(n(this.rasterInfo.transform)){const e=this.rasterInfo.transform.inverseTransform(a);if(!this.rasterInfo.nativeExtent.intersects(e))return{location:e,value:null};a=e}let l=0;if(t.srcResolution){l=S(t.srcResolution,this.rasterInfo,this.ioConfig.sampling).pyramidLevel}else if(l=await this.computeBestPyramidLevelForLocation(e,t),null==l)return{location:a,value:null};const c=this.identifyPixelLocation(a,l,null);if(null===c)return{location:a,value:null};const{row:f,col:h,rowOffset:u,colOffset:m}=c,d=x(this.url,t.sliceId),p=`${l}/${f}/${h}`;let I=g(d,null,p);s(I)&&(I=this.fetchRawTile(l,f,h,t),y(d,null,p,I));const w=await I;if(s(w)||!w.pixels||0===w.pixels.length)return{location:a,value:null};const R=u*this.rasterInfo.storageInfo.blockHeight+m,k=!w.mask||w.mask[R]?w.pixels.map((e=>e[R])):null,v=this.rasterInfo.dataType;if(("vector-magdir"===v||"vector-uv"===v)&&(null==k?void 0:k.length)>1){return{location:a,value:k,magdirValue:"vector-magdir"===v?[k[0],k[1]]:j([k[0],k[1]]),pyramidLevel:l}}return{location:a,value:k,pyramidLevel:l}}async fetchPixels(e,t,r,i={}){if(e=B(e),(i=this._getRequestOptionsWithSliceId(i)).requestRawData)return this._fetchPixels(e,t,r,i);const o=T(e.spatialReference),n=C(e);if(s(o)||0===n||1===n&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,r,i);if(n>=3)return{extent:e,pixelBlock:null};const a=[],{xmin:l,xmax:c}=e,f=Math.round(o/(c-l)*t),h=f-Math.round((o/2-l)/(c-l)*t);let u=0;const m=[];for(let s=0;s<=n;s++){const d=new F({xmin:0===s?l:-o/2,xmax:s===n?c-o*s:o/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),p=0===s?f-h:s===n?t-u:f;u+=p,m.push(p);const x=i.disableWrapAround&&s>0?null:this._fetchPixels(d,p,r,i);a.push(x)}const d=(await Promise.all(a)).map((e=>null==e?void 0:e.pixelBlock));let p=null;const x={width:t,height:r};p=this.rasterJobHandler?await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:x,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:m},i):k(d,x,{blockWidths:m});return{extent:e,srcExtent:P(e,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:p}}async fetchRawPixels(e,t,r,i={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const o=await this._fetchRawTiles(e,t,r,i),{nativeExtent:s,nativePixelSize:a,storageInfo:l}=this.rasterInfo,c=2**e,f=a.x*c,h=a.y*c,u=new F({xmin:s.xmin+f*t.x,xmax:s.xmin+f*(t.x+r.width-1),ymin:s.ymax-h*(t.y+r.height-1),ymax:s.ymax-h*t.y,spatialReference:s.spatialReference});if(!o)return{extent:u,srcExtent:u,pixelBlock:null};const{pixelBlocks:m}=o;if(1===m.length&&n(m[0])&&m[0].width===r.width&&m[0].height===r.height)return{extent:u,srcExtent:u,pixelBlock:o.pixelBlocks[0]};const d=e>0?l.pyramidBlockWidth:l.blockWidth,p=e>0?l.pyramidBlockHeight:l.blockHeight,x={width:Math.ceil(r.width/d)*d,height:Math.ceil(r.height/p)*p},g={x:t.x%d,y:t.y%p};let y;return y=this.rasterJobHandler?await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:r,destDimension:r,clipOffset:g,clipSize:r,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i):k(m,x,{clipOffset:g,clipSize:r}),{extent:u,srcExtent:u,pixelBlock:y}}fetchRawTile(e,t,i,o){throw new r("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return P(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?R(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,r,i){var o,n;const{customFetchParameters:s}=this.ioConfig,{range:a,query:l,headers:c}=r;i=null!=(o=null!=(n=i)?n:r.retryCount)?o:this.ioConfig.retryCount;const f=a?{Range:`bytes=${a.from}-${a.to}`}:null;try{return await t(e,{...r,query:{...l,...s},headers:{...c,...f}})}catch(h){if(i>0)return i--,this.request(e,r,i);throw h}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;if(!n(t))return null;if(!n(e)||0===e.length)return null;let r=0;const i=e[0].variableName;for(let o=0;o<t.variables.length;o++){const n=t.variables[o],s=n.dimensions;if(n.name!==i){r+=s.map((e=>this._getDimensionValuesCount(e))).reduce(((e,t)=>e+t));break}const a=s.map((e=>this._getDimensionValuesCount(e))),l=s.length;for(let t=0;t<l;t++){const i=e.filter((e=>e.dimensionName===s[t].name))[0];if(null==i)return null;const o=Array.isArray(i.values[0])?i.values[0][0]:i.values[0],n=this._getIndexFromDimensions(o,s[t]);if(-1===n)return null;a.shift(),r+=t===l-1?n:n*a.reduce(((e,t)=>e+t))}}return r}getTileExtentFromTileInfo(e,t,r,i){const o=i.lodAt(e);return this.getTileExtent({x:o.resolution,y:o.resolution},t,r,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:r,pixelSize:i}=this.rasterInfo;if(!e.tileInfo){const o=[],n=e.maximumPyramidLevel||0;let s=Math.max(i.x,i.y),a=1/.0254*96*s;for(let e=0;e<=n;e++)o.push({level:n-e,resolution:s,scale:a}),s*=2,a*=2;const l=new E({x:r.xmin,y:r.ymax,spatialReference:t});e.tileInfo=new p({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:o}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,r=512,i){const{width:o,height:n,nativeExtent:s,pixelSize:a,spatialReference:l}=e,c=new E({x:s.xmin,y:s.ymax,spatialReference:l});null==i&&(i=Math.max(0,Math.round(Math.log(Math.max(o,n))/Math.LN2-8)));const f=this.computeBlockBoundary(s,512,512,{x:s.xmin,y:s.ymax},[a],i);e.storageInfo=new d({blockWidth:t,blockHeight:r,pyramidBlockWidth:t,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:f})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,r,i,o,n=0,s=2){if(1===o.length&&n>0){o=[...o];let{x:e,y:t}=o[0];for(let r=0;r<n;r++)e*=s,t*=s,o.push({x:e,y:t})}const a=[],{x:l,y:c}=i;for(let f=0;f<o.length;f++){const{x:i,y:n}=o[f];a.push({minCol:Math.floor((e.xmin-l+.1*i)/t/i),maxCol:Math.floor((e.xmax-l-.1*i)/t/i),minRow:Math.floor((c-e.ymax+.1*n)/r/n),maxRow:Math.floor((c-e.ymin-.1*n)/r/n)})}return a}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:r,pyramidScalingFactor:i}=this.rasterInfo.storageInfo;if(0===e)return t;if(n(r)&&r.length)return r[e-1];const o=i**e;return{x:t.x*o,y:t.y*o}}identifyPixelLocation(e,t,r){const{spatialReference:i,nativeExtent:o}=this.rasterInfo,{blockWidth:n,blockHeight:s,maximumPyramidLevel:a,origin:l}=this.rasterInfo.storageInfo,c=M(e,i,r);if(!o.intersects(c))return null;if(t<0||t>a)return null;const f=this.getPyramidPixelSize(t),{x:h,y:u}=f,m=(l.y-c.y)/u/s,d=(c.x-l.x)/h/n,p=Math.min(s-1,Math.floor((m-Math.floor(m))*s)),x=Math.min(n-1,Math.floor((d-Math.floor(d))*n));return{pyramidLevel:t,row:Math.floor(m),col:Math.floor(d),rowOffset:p,colOffset:x,srcLocation:c}}getTileExtent(e,t,r,i,o,n){const[s,a]=n,l=i.x+r*s*e.x,c=l+s*e.x,f=i.y-t*a*e.y,h=f-a*e.y;return new F({xmin:l,xmax:c,ymin:h,ymax:f,spatialReference:o})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,r){const i=this.rasterInfo.storageInfo.blockBoundary[e];return!i||i.maxRow<t||i.maxCol<r||i.minRow>t||i.minCol>r}async _fetchPixels(e,t,r,i={}){let o=C(e);if(o>=2)return{extent:e,pixelBlock:null};const s=this._getSourceDataInfo(e,t,r,i),{pyramidLevel:l,pyramidResolution:c,srcResolution:f,srcExtent:h,srcWidth:u,srcHeight:m}=s;if(0===u||0===m)return{extent:e,srcExtent:h,pixelBlock:null};const d=a(this.rasterInfo.transform);"gcs-shift"===(null==d?void 0:d.type)&&(o=C(s.srcExtent,!0));const p=this.rasterInfo.storageInfo,x={x:Math.floor((h.xmin-p.origin.x)/c.x+.1),y:Math.floor((p.origin.y-h.ymax)/c.y+.1)},g=await this._fetchRawTiles(l,x,{width:u,height:m,wrapCount:o},i);if(!g)return{extent:e,srcExtent:h,pixelBlock:null};const y=l>0?p.pyramidBlockWidth:p.blockWidth,I=l>0?p.pyramidBlockHeight:p.blockHeight,w=y===u&&I===m&&x.x%y==0&&x.y%I==0,R=new E({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference}),b=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:M}=i;if(!b&&w&&1===g.pixelBlocks.length&&y===t&&I===r&&f.x===R.x&&f.y===R.y)return{extent:e,srcExtent:h,pixelBlock:g.pixelBlocks[0]};const S=n(T(e.spatialReference))&&n(T(h.spatialReference)),B=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:R.toJSON(),datumTransformation:M,rasterTransform:d,hasWrapAround:o>0||S,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy},i):W({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:R,datumTransformation:M,rasterTransform:d,hasWrapAround:o>0||S,isAdaptive:!1});let P;const _=!i.requestRawData,H={rows:B.spacing[0],cols:B.spacing[1]},j=a(this._getRasterTileAlignmentInfo(l,g.extent.xmin)),{pixelBlocks:F,mosaicSize:A,isPartiallyFilled:L}=g;if(this.rasterJobHandler)P=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:F,srcMosaicSize:A,destDimension:_?{width:t,height:r}:null,coefs:_?B.coefficients:null,sampleSpacing:_?H:null,interpolation:i.interpolation,alignmentInfo:j,blockWidths:null},i);else{const e=k(F,A,{alignmentInfo:j});P=_?v(e,{width:t,height:r},B.coefficients,H,i.interpolation):e}return i.requestRawData?{srcExtent:h,pixelBlock:P,transformGrid:B,extent:e,isPartiallyFilled:L}:{srcExtent:h,extent:e,pixelBlock:P}}async _fetchRawTiles(e,t,r,i){const{origin:o,blockBoundary:s}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:l}=this.getBlockWidthHeight(e);let{x:c,y:f}=t,{width:h,height:u,wrapCount:m}=r;const d=this._getRasterTileAlignmentInfo(e,0);i.buffer&&(c-=i.buffer.cols,f-=i.buffer.rows,h+=2*i.buffer.cols,u+=2*i.buffer.rows);let p=0,x=0,g=0;if(m&&n(d)){({worldColumnCountFromOrigin:x,originColumnOffset:g,rightPadding:p}=d);x*d.blockWidth-p>=c+h&&(p=0)}const y=Math.floor(c/a),I=Math.floor(f/l),w=Math.floor((c+h+p-1)/a),R=Math.floor((f+u+p-1)/l),k=s[e];if(!k)return null;const{minRow:v,minCol:b,maxCol:T,maxRow:M}=k;if(0===m&&(R<v||w<b||I>M||y>T))return null;const S=new Array;let B=!1;const C=null==this.ioConfig.allowPartialFill?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let F=I;F<=R;F++)for(let t=y;t<=w;t++){let r=t;if(!i.disableWrapAround&&m&&n(d)&&x<=t&&(r=t-x-g),F>=v&&r>=b&&M>=F&&T>=r){const t=this._fetchRawTile(e,F,r,i);C?S.push(new Promise((e=>{t.then((t=>e(t))).catch((()=>{B=!0,e(null)}))}))):S.push(t)}else S.push(null)}if(0===S.length)return null;const P=await Promise.all(S),W={height:(R-I+1)*l,width:(w-y+1)*a},{spatialReference:_}=this.rasterInfo,H=this.getPyramidPixelSize(e),{x:j,y:E}=H;return{extent:new F({xmin:o.x+y*a*j,xmax:o.x+(w+1)*a*j,ymin:o.y-(R+1)*l*E,ymax:o.y-I*l*E,spatialReference:_}),pixelBlocks:P,mosaicSize:W,isPartiallyFilled:B}}_fetchRawTile(e,t,r,i){const o=this.rasterInfo.storageInfo.blockBoundary[e];if(!o)return Promise.resolve(null);const{minRow:n,minCol:a,maxCol:l,maxRow:f}=o;if(t<n||r<a||t>f||r>l)return Promise.resolve(null);const h=x(this.url,i.sliceId),u=`${e}/${t}/${r}`;let m=g(h,i.registryId,u);if(s(m)){const o=new AbortController;m=this.fetchRawTile(e,t,r,{...i,signal:o.signal}),y(h,i.registryId,u,m,o),m.catch((()=>I(h,i.registryId,u)))}return i.signal&&c(i,(()=>{w(h,i.registryId,u)})),m}_getIndexFromDimensions(e,t){const{extent:r,interval:i,unit:o,values:n}=t;if(null!=n&&n.length)return Array.isArray(n[0])?n.findIndex((t=>t[0]<=e&&t[1]>=e)):n.indexOf(e);if(e>r[1])return-1;const s=r[0];let a=-1;if("ISO8601"===o){var l;switch((null==(l=t.intervalUnit)?void 0:l.toLowerCase())||"seconds"){case"seconds":a=Math.round((e-s)/1e3/i);break;case"minutes":a=Math.round((e-s)/6e4/i);break;case"hours":a=Math.round((e-s)/36e5/i);break;case"days":a=Math.round((e-s)/864e5/i);break;case"years":a=Math.round((new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear())/i);break;case"decades":a=Math.round((new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear())/10/i)}return a}return Math.round((e-s)/i)}_getDimensionValuesCount(e){const{extent:t,interval:r,unit:i,values:o}=e;let n=(null==o?void 0:o.length)||0;if(n)return n;const s=t[0];if(0===n&&"ISO8601"===i){var a;switch((null==(a=e.intervalUnit)?void 0:a.toLowerCase())||"seconds"){case"seconds":n=Math.round((t[1]-t[0])/1e3/r);break;case"minutes":n=Math.round((t[1]-t[0])/6e4/r);break;case"hours":n=Math.round((t[1]-t[0])/36e5/r);break;case"days":n=Math.round((t[1]-t[0])/864e5/r);break;case"years":n=Math.round((new Date(t[1]).getUTCFullYear()-new Date(s).getUTCFullYear())/r);break;case"decades":n=Math.round((new Date(t[1]).getUTCFullYear()-new Date(s).getUTCFullYear())/10/r)}return n}return Math.round((t[1]-t[0])/r)}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=_(this.rasterInfo)),n(this._rasterTileAlighmentInfo.pyramidsInfo)?{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}:null}_getSourceDataInfo(e,t,r,i={}){const o={datumTransformation:i.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0};i.srcResolution&&(o.srcResolution=i.srcResolution,this._updateSourceDataInfo(e,o));const n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:s,srcHeight:a,pyramidLevel:l}=o,c=s/t,f=a/r,h=l<n&&c*f>=16;if(h||l===n&&(c>A||f>A)||(0===s||0===a)){const s=new E({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference});let a=H(s,this.rasterInfo.spatialReference,e,o.datumTransformation);const u=!a||i.srcResolution&&a.x+a.y<i.srcResolution.x+i.srcResolution.y;if(h&&i.srcResolution&&u){const e=Math.round(Math.log(Math.max(c,f))/Math.LN2)-1;if(n-l+3>=e){const t=2**e;a={x:i.srcResolution.x*t,y:i.srcResolution.y*t}}}a&&(o.srcResolution=a,this._updateSourceDataInfo(e,o))}return(o.srcWidth/t>A||o.srcHeight/r>A)&&(o.srcWidth=0,o.srcHeight=0),o}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const r=this.rasterInfo.spatialReference,{srcResolution:i,datumTransformation:o}=t,{pyramidLevel:n,pyramidResolution:s,excessiveReading:l}=S(i,this.rasterInfo,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||P(e,r,o);if(null==c)return;const f=a(this.rasterInfo.transform);f&&(c=f.inverseTransform(c)),t.srcExtent=c;const h=Math.ceil((c.xmax-c.xmin)/s.x-.1),u=Math.ceil((c.ymax-c.ymin)/s.y-.1);t.pyramidLevel=n,t.pyramidResolution=s,t.srcWidth=h,t.srcHeight=u}_getRequestOptionsWithSliceId(e){return n(this.rasterInfo.multidimensionalInfo)&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}};e([f()],L.prototype,"_rasterTileAlighmentInfo",void 0),e([f({readOnly:!0})],L.prototype,"_isGlobalWrappableSource",null),e([f(m)],L.prototype,"url",null),e([f({type:String,json:{write:!0}})],L.prototype,"datasetName",void 0),e([f({type:String,json:{write:!0}})],L.prototype,"datasetFormat",void 0),e([f()],L.prototype,"rasterInfo",void 0),e([f()],L.prototype,"ioConfig",void 0),e([f()],L.prototype,"sourceJSON",void 0),L=e([h("esri.layers.support.rasterDatasets.BaseRaster")],L);const D=L;export{D as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../request.js";import r from"../../../core/Error.js";import{JSONSupport as i}from"../../../core/JSONSupport.js";import o from"../../../core/Logger.js";import{isSome as n,isNone as s,unwrap as a}from"../../../core/maybe.js";import{EsriPromiseMixin as l}from"../../../core/Promise.js";import{onAbort as c}from"../../../core/promiseUtils.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{sanitizeUrl as u}from"../arcgisLayerUrl.js";import{url as m}from"../commonProperties.js";import d from"../RasterStorageInfo.js";import p from"../TileInfo.js";import{getRasterId as x,getBlock as g,putBlock as y,deleteBlock as I,decreaseRefCount as w}from"./RawBlockCache.js";import{decode as R}from"../rasterFormats/RasterCodec.js";import{mosaic as k,approximateTransform as v}from"../rasterFunctions/pixelUtils.js";import{load as b,getWorldWidth as T,projectPoint as M,snapPyramid as S,snapExtent as B,getWorldWrapCount as C,projectExtent as P,getProjectionOffsetGrid as W,getRasterDatasetAlignmentInfo as _,projectResolution as H}from"../rasterFunctions/rasterProjectionHelper.js";import{uvComponentToVector as j}from"../rasterFunctions/vectorFieldUtils.js";import F from"../../../geometry/Extent.js";import E from"../../../geometry/Point.js";const A=8;let L=class extends(l(i)){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=b();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:p.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=T(e.spatialReference);return n(t)&&e.extent.width>=t/2}set url(e){this._set("url",u(e,o.getLogger(this.declaredClass)))}async open(e){throw new r("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,r,i={}){const o=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,n=this.getTileExtentFromTileInfo(e,t,r,o);return this.fetchPixels(n,o.size[0],o.size[1],i)}async identify(e,t={}){t=this._getRequestOptionsWithSliceId(t);const{spatialReference:r,extent:i}=this.rasterInfo,{datumTransformation:o}=t;let a=M(e,r,o);if(!i.intersects(a))return{location:a,value:null};if(n(this.rasterInfo.transform)){const e=this.rasterInfo.transform.inverseTransform(a);if(!this.rasterInfo.nativeExtent.intersects(e))return{location:e,value:null};a=e}let l=0;if(t.srcResolution){l=S(t.srcResolution,this.rasterInfo,this.ioConfig.sampling).pyramidLevel}else if(l=await this.computeBestPyramidLevelForLocation(e,t),null==l)return{location:a,value:null};const c=this.identifyPixelLocation(a,l,null);if(null===c)return{location:a,value:null};const{row:f,col:h,rowOffset:u,colOffset:m}=c,d=x(this.url,t.sliceId),p=`${l}/${f}/${h}`;let I=g(d,null,p);s(I)&&(I=this.fetchRawTile(l,f,h,t),y(d,null,p,I));const w=await I;if(s(w)||!w.pixels||0===w.pixels.length)return{location:a,value:null};const R=u*this.rasterInfo.storageInfo.blockHeight+m,k=!w.mask||w.mask[R]?w.pixels.map((e=>e[R])):null,v=this.rasterInfo.dataType;if(("vector-magdir"===v||"vector-uv"===v)&&(null==k?void 0:k.length)>1){return{location:a,value:k,magdirValue:"vector-magdir"===v?[k[0],k[1]]:j([k[0],k[1]]),pyramidLevel:l}}return{location:a,value:k,pyramidLevel:l}}async fetchPixels(e,t,r,i={}){if(e=B(e),(i=this._getRequestOptionsWithSliceId(i)).requestRawData)return this._fetchPixels(e,t,r,i);const o=T(e.spatialReference),n=C(e);if(s(o)||0===n||1===n&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,r,i);if(n>=3)return{extent:e,pixelBlock:null};const a=[],{xmin:l,xmax:c}=e,f=Math.round(o/(c-l)*t),h=f-Math.round((o/2-l)/(c-l)*t);let u=0;const m=[];for(let s=0;s<=n;s++){const d=new F({xmin:0===s?l:-o/2,xmax:s===n?c-o*s:o/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),p=0===s?f-h:s===n?t-u:f;u+=p,m.push(p);const x=i.disableWrapAround&&s>0?null:this._fetchPixels(d,p,r,i);a.push(x)}const d=(await Promise.all(a)).map((e=>null==e?void 0:e.pixelBlock));let p=null;const x={width:t,height:r};p=this.rasterJobHandler?await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:x,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:m},i):k(d,x,{blockWidths:m});return{extent:e,srcExtent:P(e,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:p}}async fetchRawPixels(e,t,r,i={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const o=await this._fetchRawTiles(e,t,r,i),{nativeExtent:s,nativePixelSize:a,storageInfo:l}=this.rasterInfo,c=2**e,f=a.x*c,h=a.y*c,u=new F({xmin:s.xmin+f*t.x,xmax:s.xmin+f*(t.x+r.width-1),ymin:s.ymax-h*(t.y+r.height-1),ymax:s.ymax-h*t.y,spatialReference:s.spatialReference});if(!o)return{extent:u,srcExtent:u,pixelBlock:null};const{pixelBlocks:m}=o;if(1===m.length&&n(m[0])&&m[0].width===r.width&&m[0].height===r.height)return{extent:u,srcExtent:u,pixelBlock:o.pixelBlocks[0]};const d=e>0?l.pyramidBlockWidth:l.blockWidth,p=e>0?l.pyramidBlockHeight:l.blockHeight,x={width:Math.ceil(r.width/d)*d,height:Math.ceil(r.height/p)*p},g={x:t.x%d,y:t.y%p};let y;return y=this.rasterJobHandler?await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:r,destDimension:r,clipOffset:g,clipSize:r,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i):k(m,x,{clipOffset:g,clipSize:r}),{extent:u,srcExtent:u,pixelBlock:y}}fetchRawTile(e,t,i,o){throw new r("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return P(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?R(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,r,i){var o,n;const{customFetchParameters:s}=this.ioConfig,{range:a,query:l,headers:c}=r;i=null!=(o=null!=(n=i)?n:r.retryCount)?o:this.ioConfig.retryCount;const f=a?{Range:`bytes=${a.from}-${a.to}`}:null;try{return await t(e,{...r,query:{...l,...s},headers:{...c,...f}})}catch(h){if(i>0)return i--,this.request(e,r,i);throw h}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;if(!n(t))return null;if(!n(e)||0===e.length)return null;let r=0;const i=e[0].variableName;for(let o=0;o<t.variables.length;o++){const n=t.variables[o],s=n.dimensions;if(n.name!==i){r+=s.map((e=>this._getDimensionValuesCount(e))).reduce(((e,t)=>e+t));break}const a=s.map((e=>this._getDimensionValuesCount(e))),l=s.length;for(let t=0;t<l;t++){const i=e.filter((e=>e.dimensionName===s[t].name))[0];if(null==i)return null;const o=Array.isArray(i.values[0])?i.values[0][0]:i.values[0],n=this._getIndexFromDimensions(o,s[t]);if(-1===n)return null;a.shift(),r+=t===l-1?n:n*a.reduce(((e,t)=>e+t))}}return r}getTileExtentFromTileInfo(e,t,r,i){const o=i.lodAt(e);return this.getTileExtent({x:o.resolution,y:o.resolution},t,r,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:r,pixelSize:i}=this.rasterInfo;if(!e.tileInfo){const o=[],n=e.maximumPyramidLevel||0;let s=Math.max(i.x,i.y),a=1/.0254*96*s;for(let e=0;e<=n;e++)o.push({level:n-e,resolution:s,scale:a}),s*=2,a*=2;const l=new E({x:r.xmin,y:r.ymax,spatialReference:t});e.tileInfo=new p({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:o}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,r=512,i){const{width:o,height:n,nativeExtent:s,pixelSize:a,spatialReference:l}=e,c=new E({x:s.xmin,y:s.ymax,spatialReference:l});null==i&&(i=Math.max(0,Math.round(Math.log(Math.max(o,n))/Math.LN2-8)));const f=this.computeBlockBoundary(s,512,512,{x:s.xmin,y:s.ymax},[a],i);e.storageInfo=new d({blockWidth:t,blockHeight:r,pyramidBlockWidth:t,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:f})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,r,i,o,n=0,s=2){if(1===o.length&&n>0){o=[...o];let{x:e,y:t}=o[0];for(let r=0;r<n;r++)e*=s,t*=s,o.push({x:e,y:t})}const a=[],{x:l,y:c}=i;for(let f=0;f<o.length;f++){const{x:i,y:n}=o[f];a.push({minCol:Math.floor((e.xmin-l+.1*i)/t/i),maxCol:Math.floor((e.xmax-l-.1*i)/t/i),minRow:Math.floor((c-e.ymax+.1*n)/r/n),maxRow:Math.floor((c-e.ymin-.1*n)/r/n)})}return a}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:r,pyramidScalingFactor:i}=this.rasterInfo.storageInfo;if(0===e)return t;if(n(r)&&r.length)return r[e-1];const o=i**e;return{x:t.x*o,y:t.y*o}}identifyPixelLocation(e,t,r){const{spatialReference:i,nativeExtent:o}=this.rasterInfo,{blockWidth:n,blockHeight:s,maximumPyramidLevel:a,origin:l}=this.rasterInfo.storageInfo,c=M(e,i,r);if(!o.intersects(c))return null;if(t<0||t>a)return null;const f=this.getPyramidPixelSize(t),{x:h,y:u}=f,m=(l.y-c.y)/u/s,d=(c.x-l.x)/h/n,p=Math.min(s-1,Math.floor((m-Math.floor(m))*s)),x=Math.min(n-1,Math.floor((d-Math.floor(d))*n));return{pyramidLevel:t,row:Math.floor(m),col:Math.floor(d),rowOffset:p,colOffset:x,srcLocation:c}}getTileExtent(e,t,r,i,o,n){const[s,a]=n,l=i.x+r*s*e.x,c=l+s*e.x,f=i.y-t*a*e.y,h=f-a*e.y;return new F({xmin:l,xmax:c,ymin:h,ymax:f,spatialReference:o})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,r){const i=this.rasterInfo.storageInfo.blockBoundary[e];return!i||i.maxRow<t||i.maxCol<r||i.minRow>t||i.minCol>r}async _fetchPixels(e,t,r,i={}){let o=C(e);if(o>=2)return{extent:e,pixelBlock:null};const s=this._getSourceDataInfo(e,t,r,i),{pyramidLevel:l,pyramidResolution:c,srcResolution:f,srcExtent:h,srcWidth:u,srcHeight:m}=s;if(0===u||0===m)return{extent:e,srcExtent:h,pixelBlock:null};const d=a(this.rasterInfo.transform),p="gcs-shift"===(null==d?void 0:d.type),x=n(T(e.spatialReference));!p&&x||(o=C(s.srcExtent,p));const g=this.rasterInfo.storageInfo,y={x:Math.floor((h.xmin-g.origin.x)/c.x+.1),y:Math.floor((g.origin.y-h.ymax)/c.y+.1)},I=await this._fetchRawTiles(l,y,{width:u,height:m,wrapCount:o},i);if(!I)return{extent:e,srcExtent:h,pixelBlock:null};const w=l>0?g.pyramidBlockWidth:g.blockWidth,R=l>0?g.pyramidBlockHeight:g.blockHeight,b=w===u&&R===m&&y.x%w==0&&y.y%R==0,M=new E({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference}),S=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:B}=i;if(!S&&b&&1===I.pixelBlocks.length&&w===t&&R===r&&f.x===M.x&&f.y===M.y)return{extent:e,srcExtent:h,pixelBlock:I.pixelBlocks[0]};const P=x&&n(T(h.spatialReference)),_=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:I.extent,pixelSize:M.toJSON(),datumTransformation:B,rasterTransform:d,hasWrapAround:o>0||P,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy},i):W({projectedExtent:e,srcBufferExtent:I.extent,pixelSize:M,datumTransformation:B,rasterTransform:d,hasWrapAround:o>0||P,isAdaptive:!1});let H;const j=!i.requestRawData,F={rows:_.spacing[0],cols:_.spacing[1]},A=a(this._getRasterTileAlignmentInfo(l,I.extent.xmin)),{pixelBlocks:L,mosaicSize:D,isPartiallyFilled:z}=I;if(this.rasterJobHandler)H=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:L,srcMosaicSize:D,destDimension:j?{width:t,height:r}:null,coefs:j?_.coefficients:null,sampleSpacing:j?F:null,interpolation:i.interpolation,alignmentInfo:A,blockWidths:null},i);else{const e=k(L,D,{alignmentInfo:A});H=j?v(e,{width:t,height:r},_.coefficients,F,i.interpolation):e}return i.requestRawData?{srcExtent:h,pixelBlock:H,transformGrid:_,extent:e,isPartiallyFilled:z}:{srcExtent:h,extent:e,pixelBlock:H}}async _fetchRawTiles(e,t,r,i){const{origin:o,blockBoundary:s}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:l}=this.getBlockWidthHeight(e);let{x:c,y:f}=t,{width:h,height:u,wrapCount:m}=r;const d=this._getRasterTileAlignmentInfo(e,0);i.buffer&&(c-=i.buffer.cols,f-=i.buffer.rows,h+=2*i.buffer.cols,u+=2*i.buffer.rows);let p=0,x=0,g=0;if(m&&n(d)){({worldColumnCountFromOrigin:x,originColumnOffset:g,rightPadding:p}=d);x*d.blockWidth-p>=c+h&&(p=0)}const y=Math.floor(c/a),I=Math.floor(f/l),w=Math.floor((c+h+p-1)/a),R=Math.floor((f+u+p-1)/l),k=s[e];if(!k)return null;const{minRow:v,minCol:b,maxCol:T,maxRow:M}=k;if(0===m&&(R<v||w<b||I>M||y>T))return null;const S=new Array;let B=!1;const C=null==this.ioConfig.allowPartialFill?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let F=I;F<=R;F++)for(let t=y;t<=w;t++){let r=t;if(!i.disableWrapAround&&m&&n(d)&&x<=t&&(r=t-x-g),F>=v&&r>=b&&M>=F&&T>=r){const t=this._fetchRawTile(e,F,r,i);C?S.push(new Promise((e=>{t.then((t=>e(t))).catch((()=>{B=!0,e(null)}))}))):S.push(t)}else S.push(null)}if(0===S.length)return null;const P=await Promise.all(S),W={height:(R-I+1)*l,width:(w-y+1)*a},{spatialReference:_}=this.rasterInfo,H=this.getPyramidPixelSize(e),{x:j,y:E}=H;return{extent:new F({xmin:o.x+y*a*j,xmax:o.x+(w+1)*a*j,ymin:o.y-(R+1)*l*E,ymax:o.y-I*l*E,spatialReference:_}),pixelBlocks:P,mosaicSize:W,isPartiallyFilled:B}}_fetchRawTile(e,t,r,i){const o=this.rasterInfo.storageInfo.blockBoundary[e];if(!o)return Promise.resolve(null);const{minRow:n,minCol:a,maxCol:l,maxRow:f}=o;if(t<n||r<a||t>f||r>l)return Promise.resolve(null);const h=x(this.url,i.sliceId),u=`${e}/${t}/${r}`;let m=g(h,i.registryId,u);if(s(m)){const o=new AbortController;m=this.fetchRawTile(e,t,r,{...i,signal:o.signal}),y(h,i.registryId,u,m,o),m.catch((()=>I(h,i.registryId,u)))}return i.signal&&c(i,(()=>{w(h,i.registryId,u)})),m}_getIndexFromDimensions(e,t){const{extent:r,interval:i,unit:o,values:n}=t;if(null!=n&&n.length)return Array.isArray(n[0])?n.findIndex((t=>t[0]<=e&&t[1]>=e)):n.indexOf(e);if(e>r[1])return-1;const s=r[0];let a=-1;if("ISO8601"===o){var l;switch((null==(l=t.intervalUnit)?void 0:l.toLowerCase())||"seconds"){case"seconds":a=Math.round((e-s)/1e3/i);break;case"minutes":a=Math.round((e-s)/6e4/i);break;case"hours":a=Math.round((e-s)/36e5/i);break;case"days":a=Math.round((e-s)/864e5/i);break;case"years":a=Math.round((new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear())/i);break;case"decades":a=Math.round((new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear())/10/i)}return a}return Math.round((e-s)/i)}_getDimensionValuesCount(e){const{extent:t,interval:r,unit:i,values:o}=e;let n=(null==o?void 0:o.length)||0;if(n)return n;const s=t[0];if(0===n&&"ISO8601"===i){var a;switch((null==(a=e.intervalUnit)?void 0:a.toLowerCase())||"seconds"){case"seconds":n=Math.round((t[1]-t[0])/1e3/r);break;case"minutes":n=Math.round((t[1]-t[0])/6e4/r);break;case"hours":n=Math.round((t[1]-t[0])/36e5/r);break;case"days":n=Math.round((t[1]-t[0])/864e5/r);break;case"years":n=Math.round((new Date(t[1]).getUTCFullYear()-new Date(s).getUTCFullYear())/r);break;case"decades":n=Math.round((new Date(t[1]).getUTCFullYear()-new Date(s).getUTCFullYear())/10/r)}return n}return Math.round((t[1]-t[0])/r)}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=_(this.rasterInfo)),n(this._rasterTileAlighmentInfo.pyramidsInfo)?{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}:null}_getSourceDataInfo(e,t,r,i={}){const o={datumTransformation:i.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0};i.srcResolution&&(o.srcResolution=i.srcResolution,this._updateSourceDataInfo(e,o));const n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:s,srcHeight:a,pyramidLevel:l}=o,c=s/t,f=a/r,h=l<n&&c*f>=16;if(h||l===n&&(c>A||f>A)||(0===s||0===a)){const s=new E({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference});let a=H(s,this.rasterInfo.spatialReference,e,o.datumTransformation);const u=!a||i.srcResolution&&a.x+a.y<i.srcResolution.x+i.srcResolution.y;if(h&&i.srcResolution&&u){const e=Math.round(Math.log(Math.max(c,f))/Math.LN2)-1;if(n-l+3>=e){const t=2**e;a={x:i.srcResolution.x*t,y:i.srcResolution.y*t}}}a&&(o.srcResolution=a,this._updateSourceDataInfo(e,o))}return(o.srcWidth/t>A||o.srcHeight/r>A)&&(o.srcWidth=0,o.srcHeight=0),o}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const r=this.rasterInfo.spatialReference,{srcResolution:i,datumTransformation:o}=t,{pyramidLevel:n,pyramidResolution:s,excessiveReading:l}=S(i,this.rasterInfo,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||P(e,r,o);if(null==c)return;const f=a(this.rasterInfo.transform);f&&(c=f.inverseTransform(c)),t.srcExtent=c;const h=Math.ceil((c.xmax-c.xmin)/s.x-.1),u=Math.ceil((c.ymax-c.ymin)/s.y-.1);t.pyramidLevel=n,t.pyramidResolution=s,t.srcWidth=h,t.srcHeight=u}_getRequestOptionsWithSliceId(e){return n(this.rasterInfo.multidimensionalInfo)&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}};e([f()],L.prototype,"_rasterTileAlighmentInfo",void 0),e([f({readOnly:!0})],L.prototype,"_isGlobalWrappableSource",null),e([f(m)],L.prototype,"url",null),e([f({type:String,json:{write:!0}})],L.prototype,"datasetName",void 0),e([f({type:String,json:{write:!0}})],L.prototype,"datasetFormat",void 0),e([f()],L.prototype,"rasterInfo",void 0),e([f()],L.prototype,"ioConfig",void 0),e([f()],L.prototype,"sourceJSON",void 0),L=e([h("esri.layers.support.rasterDatasets.BaseRaster")],L);const D=L;export{D as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../geometry.js";import e from"../../../core/Error.js";import{isNone as n,isSome as t}from"../../../core/maybe.js";import{getMetersPerUnitForSR as o}from"../../../core/unitUtils.js";import{canProjectWithoutEngine as i,isLoaded as r,load as a,getTransformation as s,project as l}from"../../../geometry/projection.js";import c from"../../../geometry/Extent.js";import x from"../../../geometry/Point.js";function f(e,n,t){return!i(e,n,t)}function m(n,t,o){const i=f(n,t,o);if(i&&!r())throw new e("rasterprojectionhelper-project","projection engine is not loaded");return i}const u=function(e,n,t){const o=(e[0]+e[4]+e[4*n.cols]+e[4*n.cols+4])/4,i=(e[1]+e[5]+e[4*n.rows+1]+e[4*n.rows+5])/4,r=(e[4*n.cols]-e[0]+e[4*n.cols+4]-e[4])/t[0]*.5,a=(e[4*n.cols+1]-e[1]+e[4*n.cols+5]-e[5])/t[1]*.5;return[0===r||isNaN(r)?0:Math.abs(o-e[2*n.rows+2])/Math.abs(r),0===a||isNaN(a)?0:Math.abs(i-e[2*n.rows+3])/Math.abs(a)]},p={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},h=32,y=4,d=y;async function g(){if(r())return null;await a()}function M(e,n,t){if(!m(e.spatialReference,n))return null;return t?s(n,e.spatialReference,e):s(e.spatialReference,n,e)}function w(e,t,o,i=null){if(e.spatialReference.equals(t))return e;m(e.spatialReference,t,i);const r=o.center,a=new c({xmin:r.x-e.x/2,xmax:r.x+e.x/2,ymin:r.y-e.y/2,ymax:r.y+e.y/2,spatialReference:e.spatialReference}),s=l(a,t,i);if(n(s))return null;return{x:s.xmax-s.xmin,y:s.ymax-s.ymin}}function R(e,n=.01){return o(e)?n/o(e):0}function b(e,n,o=null,i=!0){const r=e.spatialReference;if(r.equals(n))return e;m(r,n,o);const a=l(e,n,o);if(!i||!a)return a;const s=P(r,!0),c=P(n,!0),x=R(r);return x&&t(s)&&t(c)&&(a.x>0&&Math.abs(e.x-s[0])<x?a.x-=c[1]-c[0]:a.x<0&&Math.abs(e.x-s[1])<x&&(a.x+=c[1]-c[0])),a}function v(e,n,t=null){const o=e[0].spatialReference;return o.equals(n)?e:(m(o,n,t),l(e,n,t))}function N(e){const n=S(e[0].spatialReference);if(e.length<2||!t(n))return e[0];let{xmin:o,xmax:i,ymin:r,ymax:a}=e[0];for(let t=1;t<e.length;t++){const o=e[t];i=o.xmax+n*t,r=Math.min(r,o.ymin),a=Math.max(a,o.ymax)}return new c({xmin:o,xmax:i,ymin:r,ymax:a,spatialReference:e[0].spatialReference})}function z(e,t,o=null,i=!0){if(e.spatialReference.equals(t))return e;const r=W(e),a=S(e.spatialReference,!0),s=S(t);if(0===r||n(a)||n(s))return j(e,t,o,i);const l=e.clone().normalize();if(1===l.length&&e.xmax<a&&e.xmax-a/2>R(e.spatialReference)){const{xmin:n,xmax:t}=e;for(let o=0;o<=r;o++){const i=0===o?n:-a/2,s=o===r?t-a*o:a/2;l[o]=new c({xmin:i,xmax:s,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference})}}return N(l.map((e=>j(e,t,o,i))).filter((e=>!!e)))}function j(e,t,o=null,i=!0,r=!0){const a=e.spatialReference;if(a.equals(t))return e;m(a,t,o);const s=l(e,t,o);if(r&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!i||!s)return s;const c=P(a,!0),f=P(t,!0);if(n(c)||n(f))return s;const u=R(a,.001),p=R(a,500),h=R(t,.001);if(Math.abs(s.xmin-f[0])<h&&Math.abs(s.xmax-f[1])<h){const n=Math.abs(e.xmin-c[0]),i=Math.abs(c[1]-e.xmax);if(n<u&&i>p){s.xmin=f[0];const n=[];n.push(new x(e.xmax,e.ymin,a)),n.push(new x(e.xmax,(e.ymin+e.ymax)/2,a)),n.push(new x(e.xmax,e.ymax,a));const i=n.map((e=>b(e,t,o))).filter((e=>!isNaN(null==e?void 0:e.x))).map((e=>e.x));s.xmax=Math.max.apply(null,i)}if(i<u&&n>p){s.xmax=f[1];const n=[];n.push(new x(e.xmin,e.ymin,a)),n.push(new x(e.xmin,(e.ymin+e.ymax)/2,a)),n.push(new x(e.xmin,e.ymax,a));const i=n.map((e=>b(e,t,o))).filter((e=>!isNaN(null==e?void 0:e.x))).map((e=>e.x));s.xmin=Math.min.apply(null,i)}}else{const e=R(t,.001);Math.abs(s.xmin-f[0])<e&&(s.xmin=f[0]),Math.abs(s.xmax-f[1])<e&&(s.xmax=f[1])}return s}function S(e,n=!1){const t=n?20037508.342787:20037508.342788905;return e.isWebMercator?2*t:e.wkid&&e.isGeographic?360:2*p[e.wkid]||null}function P(e,n=!1){if(e.isGeographic)return[-180,180];const o=S(e,n);return t(o)?[-o/2,o/2]:null}function C(e,n,t,o){let i=(e-n)/t;return i-Math.floor(i)!=0?i=Math.floor(i):o&&(i-=1),i}function W(e,n=!1){const o=S(e.spatialReference);if(!t(o))return 0;const i=n?0:-(o/2);return C(e.xmax,i,o,!0)-C(e.xmin,i,o,!1)}function T(e){const n=e.storageInfo.origin.x,o=S(e.spatialReference,!0);if(!t(o))return{originX:n,halfWorldWidth:null,pyramidsInfo:null};const i=o/2,{nativePixelSize:r,storageInfo:a,extent:s}=e,{maximumPyramidLevel:l,blockWidth:c,pyramidScalingFactor:x}=a;let f=r.x;const m=[],u=t(e.transform)&&"gcs-shift"===e.transform.type,p=n+(u?0:i),h=u?o-n:i-n;for(let t=0;t<=l;t++){const e=(s.xmax-n)/f/c,t=e-Math.floor(e)==0?e:Math.ceil(e),o=h/f/c,i=o-Math.floor(o)==0?o:Math.ceil(o),r=Math.floor(p/f/c),a=Math.round(p/f)%c,l=(c-Math.round(h/f)%c)%c;m.push({resolutionX:f,blockWidth:c,datsetColumnCount:t,worldColumnCountFromOrigin:i,leftMargin:a,rightPadding:l,originColumnOffset:r}),f*=x}return{originX:n,halfWorldWidth:i,pyramidsInfo:m,hasGCSSShiftTransform:u}}function G(e){const n=e.isAdaptive&&null==e.spacing,t=e.spacing||[h,h];let o=L(e),i={cols:o.size[0]+1,rows:o.size[1]+1},r=u(o.offsets,i,t);const a=(r[0]+r[1])/2,s=o.outofBoundPointCount>0&&o.outofBoundPointCount<o.offsets.length/2;return n&&(s||a>d)&&(o=L({...e,spacing:[y,y]}),i={cols:o.size[0]+1,rows:o.size[1]+1},r=u(o.offsets,i,t)),o.error=r,o.coefficients=k(o.offsets,i,s),o}function L(e){const{projectedExtent:n,srcBufferExtent:o,pixelSize:i,datumTransformation:r,rasterTransform:a}=e,s=n.spatialReference,l=o.spatialReference;m(s,l);const{xmin:c,ymin:f,xmax:u,ymax:p}=n,y=S(l),d=e.hasWrapAround||"gcs-shift"===(null==a?void 0:a.type),g=e.spacing||[h,h],M={x:g[0]*i.x,y:g[1]*i.y},w={cols:Math.ceil((u-c)/M.x-.1/g[0])+1,rows:Math.ceil((p-f)/M.y-.1/g[1])+1},R=M.x,b=M.y,N=[];let z,j=0;const P=[];for(let t=0;t<w.cols;t++)for(let e=0;e<w.rows;e++)P.push(new x({x:c+R*t,y:p-b*e,spatialReference:s}));const C=v(P,l,r);for(let x=0;x<w.cols;x++){const e=[];for(let n=0;n<w.rows;n++){var W;let i=C[x*w.rows+n];t(y)&&(null==(W=i)?void 0:W.x)>o.xmax&&(i.x-=y),a&&(i=a.inverseTransform(i)),e.push(i),x>0&&d&&i&&z[n]&&t(y)&&i.x<z[n].x&&(i.x+=y),i?(N.push((i.x-o.xmin)/(o.xmax-o.xmin)),N.push((o.ymax-i.y)/(o.ymax-o.ymin))):(N.push(NaN),N.push(NaN),j++)}z=e}return{offsets:N,error:null,coefficients:null,outofBoundPointCount:j,spacing:g,size:[w.cols-1,w.rows-1]}}function k(e,n,t){const{cols:o,rows:i}=n,r=new Float32Array((o-1)*(i-1)*2*6),a=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),s=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<o-1;l++){for(let n=0;n<i-1;n++){let t=l*i*2+2*n;const c=e[t],x=e[t+1],f=e[t+2],m=e[t+3];t+=2*i;const u=e[t],p=e[t+1],h=e[t+2],y=e[t+3];let d=0,g=12*(n*(o-1)+l);for(let e=0;e<3;e++)r[g++]=a[d++]*c+a[d++]*f+a[d++]*h;d=0;for(let e=0;e<3;e++)r[g++]=a[d++]*x+a[d++]*m+a[d++]*y;d=0;for(let e=0;e<3;e++)r[g++]=s[d++]*c+s[d++]*u+s[d++]*h;d=0;for(let e=0;e<3;e++)r[g++]=s[d++]*x+s[d++]*p+s[d++]*y}if(t)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function I(e){const n=e.clone().normalize();return 1===n.length?n[0]:N(n)}function q(e,n,o){const{storageInfo:i,pixelSize:r}=n;let a,s=!1;const{pyramidResolutions:l}=i;if(t(l)&&l.length){const t=(e.x+e.y)/2,i=l[l.length-1],c=(i.x+i.y)/2,f=(r.x+r.y)/2;if(t<=f)a=0;else if(t>=c)a=l.length,s=t/c>8;else{let e,n=f;for(let i=1;i<=l.length;i++){if(e=(l[i-1].x+l[i-1].y)/2,t<=e){t===e?a=i:"down"===o?(a=i-1,s=t/n>8):a="up"===o||t-n>e-t||t/n>2?i:i-1;break}n=e}}const m=0===a?r:l[a-1];return{pyramidLevel:a,pyramidResolution:new x({x:m.x,y:m.y,spatialReference:n.spatialReference}),excessiveReading:s}}const c=Math.log(e.x/r.x)/Math.LN2,f=Math.log(e.y/r.y)/Math.LN2,m=n.storageInfo.maximumPyramidLevel||0;a="down"===o?Math.floor(Math.min(c,f)):"up"===o?Math.ceil(Math.max(c,f)):Math.round((c+f)/2),a<0?a=0:a>m&&(s=a>m+3,a=m);const u=2**a;return{pyramidLevel:a,pyramidResolution:new x({x:u*n.nativePixelSize.x,y:u*n.nativePixelSize.y,spatialReference:n.spatialReference}),excessiveReading:s}}function A(e,n,t=512,i=!0){const{extent:r,spatialReference:a,pixelSize:s}=e,l=w(new x({x:s.x,y:s.y,spatialReference:a}),n,r);if(null==l)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const c=(l.x+l.y)/2,f=o(n),m=c*f*96*39.37,u=n.isGeographic?256/t*295828763.7958547:256/t*591657527.591555;let p="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const h=z(r,n);p||i&&(n.isGeographic||n.isWebMercator)&&(p=h.xmin*h.xmax<0);let y,d=m;const g=1.001;if(p){d=u;const e=n.isGeographic?1341104507446289e-21:.29858214164761665,t=e*(96*f*39.37),o=n.isGeographic?4326:3857;y=w(new x({x:e,y:e,spatialReference:{wkid:o}}),a,h),y.x*=d/t,y.y*=d/t}else{y={x:s.x,y:s.y};const n=Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2);let t=0;for(;d<u*(g/2)&&t<n;)t++,d*=2,y.x*=2,y.y*=2;Math.max(d,u)/Math.min(d,u)<=g&&(d=u)}const M=[d],R=[{x:y.x,y:y.y}],b=70.5310735,v=Math.min(b,m)/g;for(;d>=v;)d/=2,y.x/=2,y.y/=2,M.push(d),R.push({x:y.x,y:y.y});return{projectedPixelSize:l,scales:M,srcResolutions:R,isCustomTilingScheme:!p}}export{A as computeProjectedScales,h as defaultGridSpacing,d as defaultProjectionToleranceInPixels,M as getDefaultDatumTransformationForDataset,G as getProjectionOffsetGrid,T as getRasterDatasetAlignmentInfo,S as getWorldWidth,W as getWorldWrapCount,g as load,y as minimumGridSpacing,z as projectExtent,b as projectPoint,w as projectResolution,f as requirePE,I as snapExtent,q as snapPyramid};
|
|
5
|
+
import"../../../geometry.js";import e from"../../../core/Error.js";import{isNone as t,isSome as n}from"../../../core/maybe.js";import{getMetersPerUnitForSR as o}from"../../../core/unitUtils.js";import{e as i,f as r,g as s,h as a,j as l}from"../../../chunks/pe.js";import{canProjectWithoutEngine as c,isLoaded as f,load as u,getTransformation as m,project as x}from"../../../geometry/projection.js";import h from"../../../geometry/Extent.js";import p from"../../../geometry/Point.js";function g(e,t,n){return!c(e,t,n)}function y(t,n,o){const i=g(t,n,o);if(i&&!f())throw new e("rasterprojectionhelper-project","projection engine is not loaded");return i}const d=function(e,t,n,o=0){if(1===n[0])return[0,0];let i=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(i=i>e[g]?e[g]:i,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-i)/l/n[0],u=(a-s)/c/n[1],m=2*o;let x=0,h=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,o=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,i=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((o-e[n+2*c+2])/f),s=Math.abs((i-e[n+2*c+3])/u);if(r+s>x&&(x=r+s,p=[r,s]),m&&x>m){h=!0;break}}if(h)break}return p},M={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},R=32,w=4,P=w,S=new Map;async function b(){if(f())return null;await u()}function E(e,t,n){if(!y(e.spatialReference,t))return null;return n?m(t,e.spatialReference,e):m(e.spatialReference,t,e)}function N(e,n,o,i=null){if(e.spatialReference.equals(n))return e;y(e.spatialReference,n,i);const r=o.center,s=new h({xmin:r.x-e.x/2,xmax:r.x+e.x/2,ymin:r.y-e.y/2,ymax:r.y+e.y/2,spatialReference:e.spatialReference}),a=x(s,n,i);if(t(a))return null;return{x:a.xmax-a.xmin,y:a.ymax-a.ymin}}function G(e,t=.01){return o(e)?t/o(e):0}function v(e,t,o=null,i=!0){const r=e.spatialReference;if(r.equals(t))return e;y(r,t,o);const s=x(e,t,o);if(!i||!s)return s;const a=Y(r,!0),l=Y(t,!0),c=G(r);return c&&n(a)&&n(l)&&(s.x>0&&Math.abs(e.x-a[0])<c?s.x-=l[1]-l[0]:s.x<0&&Math.abs(e.x-a[1])<c&&(s.x+=l[1]-l[0])),s}function T(e){const{inSR:t,outSR:o,datumTransformation:i,preferPE:r}=e;if(t.equals(o)){const{points:t}=W(e,null);return t}if(t.isWebMercator&&o.isWGS84||t.isWGS84&&o.isWebMercator)return _(e);if(y(t,o,i)&&r){if(t.isGeographic)return C(e);const o=j(t);if(n(o))return C(e)}return k(e)}function k(e){const{points:t}=W(e,null),n=t.map((t=>new p(t[0],t[1],e.inSR)));return x(n,e.outSR,e.datumTransformation).map((e=>e?[e.x,e.y]:[NaN,NaN]))}function C(e){const{inSR:t,outSR:o,datumTransformation:l}=e,c=j(t),{points:f,mask:u}=W(e,c);if(!t.isGeographic){const e=t.wkid?i.coordsys(t.wkid):i.fromString(t.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,t.wkt);s.projToGeog(e,f.length,f)}if(n(l)&&l.steps.length&&l.steps.forEach((e=>{const t=e.wkid?i.geogtran(e.wkid):i.fromString(r.PE_TYPE_GEOGTRAN,e.wkt);a.geogToGeog(t,f.length,f,null,e.isInverse?r.PE_TRANSFORM_2_TO_1:r.PE_TRANSFORM_1_TO_2)})),!o.isGeographic){const e=j(o,!0),t=n(e)&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];O(f,t);const a=o.wkid?i.coordsys(o.wkid):i.fromString(o.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,o.wkt);s.geogToProj(a,f.length,f)}let m=f;if(u&&f.length!==u.length){m=[];for(let e=0,t=0;e<u.length;e++)u[e]?m.push(f[t++]):m.push([NaN,NaN])}return m}function _(e){const{cols:t,rows:n,xres:o,yres:i,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:c}=e;r&&(l+=o/2,c-=i/2);const f=[],u=[],m=Math.max(t,n);for(let g=0;g<m;g++){const e=l+o*Math.min(t,g),r=c-i*Math.min(n,g),m=x(new p({x:e,y:r,spatialReference:s}),a);g<=t&&f.push(m.x),g<=n&&u.push(m.y)}const h=[];for(let x=0;x<t;x++)for(let e=0;e<n;e++)h.push([f[x],u[e]]);return h}function j(e,t=!1){let n=e.wkid||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),S.has(n)){const e=S.get(n);return t?null==e?void 0:e.gcs:null==e?void 0:e.pcs}const o=e.wkid?i.coordsys(e.wkid):i.fromString(e.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,e.wkt),s=z(o,G(e,1e-4)),a=z(o,0,!0);return S.set(n,{pcs:s,gcs:a}),t?a:s}function z(e,t=0,n=!1){const o=l.generate(e),i=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(null==i||!i.length)return null;let r=!1,s=i.find((e=>1===e.getInclusive()&&1===e.getKind()));if(!s){if(s=i.find((e=>1===e.getInclusive()&&0===e.getKind())),!s)return null;r=!0}const a=o.isPannableRectangle(),c=s.getCoord();if(r)return{isEnvelope:r,isPannable:a,vertices:c,coef:null,bbox:[c[0][0]-t,c[0][1]-t,c[1][0]+t,c[1][1]+t]};let f=0;const u=[];let[m,x]=c[0],[h,p]=c[0];for(let l=0,g=c.length;l<g;l++){f++,f===g&&(f=0);const[e,t]=c[l],[n,o]=c[f];if(o===t)u.push([e,n,t,o,2]);else{const i=(n-e)/(o-t||1e-4),r=e-i*t;t<o?u.push([i,r,t,o,0]):u.push([i,r,o,t,1])}m=m<e?m:e,x=x<t?x:t,h=h>e?h:e,p=p>t?p:t}return{isEnvelope:!1,isPannable:a,vertices:c,coef:u,bbox:[m,x,h,p]}}function W(e,t){const o=[],{cols:i,rows:r,xres:s,yres:a,usePixelCenter:l}=e;let{xmin:c,ymax:f}=e;if(l&&(c+=s/2,f-=a/2),!n(t)){for(let e=0;e<i;e++)for(let t=0;t<r;t++)o.push([c+s*e,f-a*t]);return{points:o}}const u=new Uint8Array(i*r);if(t.isEnvelope){const{bbox:[e,n,l,m]}=t;for(let x=0,h=0;x<i;x++){const i=c+s*x,p=t.isPannable||i>=e&&i<=l;for(let e=0;e<r;e++,h++){const t=f-a*e;p&&t>=n&&t<=m&&(o.push([i,t]),u[h]=1)}}return{points:o,mask:u}}const{coef:m}=t,x=[];for(let n=0;n<r;n++){const e=f-a*n,t=[],o=[];for(let n=0;n<m.length;n++){const[i,r,s,a,l]=m[n];if(e===s&&s===a)t.push(i),t.push(r),o.push(2),o.push(2);else if(e>=s&&e<=a){const n=i*e+r;t.push(n),o.push(l)}}let i=t;if(t.length>2){let e=2===o[0]?0:o[0],n=t[0];i=[];for(let r=1;r<o.length;r++)2===o[r]&&r!==o.length-1||(o[r]!==e&&(i.push(0===e?Math.min(n,t[r-1]):Math.max(n,t[r-1])),e=o[r],n=t[r]),r===o.length-1&&i.push(0===o[r]?Math.min(n,t[r]):Math.max(n,t[r])));i.sort(((e,t)=>e-t))}else t[0]>t[1]&&(i=[t[1],t[0]]);x.push(i)}for(let n=0,h=0;n<i;n++){const e=c+s*n;for(let t=0;t<r;t++,h++){const n=f-a*t,i=x[t];if(2===i.length)e>=i[0]&&e<=i[1]&&(o.push([e,n]),u[h]=1);else if(i.length>2){let t=!1;for(let n=0;n<i.length;n+=2)if(e>=i[n]&&e<=i[n+1]){t=!0;break}t&&(o.push([e,n]),u[h]=1)}}}return{points:o,mask:u}}function O(e,t){const[n,o]=t;for(let i=0;i<e.length;i++){const t=e[i][1];(t<n||t>o)&&(e[i]=[NaN,NaN])}}function A(e){const t=L(e[0].spatialReference);if(e.length<2||!n(t))return e[0];let{xmin:o,xmax:i,ymin:r,ymax:s}=e[0];for(let n=1;n<e.length;n++){const o=e[n];i=o.xmax+t*n,r=Math.min(r,o.ymin),s=Math.max(s,o.ymax)}return new h({xmin:o,xmax:i,ymin:r,ymax:s,spatialReference:e[0].spatialReference})}function I(e,n,o=null,i=!0){if(e.spatialReference.equals(n))return e;const r=q(e),s=L(e.spatialReference,!0),a=L(n);if(0===r||t(s)||t(a))return F(e,n,o,i);const l=e.clone().normalize();if(1===l.length&&e.xmax<s&&e.xmax-s/2>G(e.spatialReference)){const{xmin:t,xmax:n}=e;for(let o=0;o<=r;o++){const i=0===o?t:-s/2,a=o===r?n-s*o:s/2;l[o]=new h({xmin:i,xmax:a,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference})}}return A(l.map((e=>F(e,n,o,i))).filter((e=>!!e)))}function F(e,n,o=null,i=!0,r=!0){const s=e.spatialReference;if(s.equals(n))return e;y(s,n,o);const a=x(e,n,o);if(r&&n.isWebMercator&&a&&(a.ymax=Math.min(20037508.342787,a.ymax),a.ymin=Math.max(-20037508.342787,a.ymin),a.ymin>=a.ymax))return null;if(!i||!a)return a;const l=Y(s,!0),c=Y(n,!0);if(t(l)||t(c))return a;const f=G(s,.001),u=G(s,500),m=G(n,.001);if(Math.abs(a.xmin-c[0])<m&&Math.abs(a.xmax-c[1])<m){const t=Math.abs(e.xmin-l[0]),i=Math.abs(l[1]-e.xmax);if(t<f&&i>u){a.xmin=c[0];const t=[];t.push(new p(e.xmax,e.ymin,s)),t.push(new p(e.xmax,(e.ymin+e.ymax)/2,s)),t.push(new p(e.xmax,e.ymax,s));const i=t.map((e=>v(e,n,o))).filter((e=>!isNaN(null==e?void 0:e.x))).map((e=>e.x));a.xmax=Math.max.apply(null,i)}if(i<f&&t>u){a.xmax=c[1];const t=[];t.push(new p(e.xmin,e.ymin,s)),t.push(new p(e.xmin,(e.ymin+e.ymax)/2,s)),t.push(new p(e.xmin,e.ymax,s));const i=t.map((e=>v(e,n,o))).filter((e=>!isNaN(null==e?void 0:e.x))).map((e=>e.x));a.xmin=Math.min.apply(null,i)}}else{const e=G(n,.001);Math.abs(a.xmin-c[0])<e&&(a.xmin=c[0]),Math.abs(a.xmax-c[1])<e&&(a.xmax=c[1])}return a}function L(e,t=!1){const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*M[e.wkid]||null}function Y(e,t=!1){if(e.isGeographic)return[-180,180];const o=L(e,t);return n(o)?[-o/2,o/2]:null}function B(e,t,n,o){let i=(e-t)/n;return i-Math.floor(i)!=0?i=Math.floor(i):o&&(i-=1),i}function q(e,t=!1){const o=L(e.spatialReference);if(!n(o))return 0;const i=t?0:-(o/2),r=G(e.spatialReference),s=!t&&Math.abs(e.xmax-o/2)<r?o/2:e.xmax,a=!t&&Math.abs(e.xmin+o/2)<r?-o/2:e.xmin;return B(s,i,o,!0)-B(a,i,o,!1)}function J(e){const t=e.storageInfo.origin.x,o=L(e.spatialReference,!0);if(!n(o))return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const i=o/2,{nativePixelSize:r,storageInfo:s,extent:a}=e,{maximumPyramidLevel:l,blockWidth:c,pyramidScalingFactor:f}=s;let u=r.x;const m=[],x=n(e.transform)&&"gcs-shift"===e.transform.type,h=t+(x?0:i),p=x?o-t:i-t;for(let n=0;n<=l;n++){const e=(a.xmax-t)/u/c,n=e-Math.floor(e)==0?e:Math.ceil(e),o=p/u/c,i=o-Math.floor(o)==0?o:Math.ceil(o),r=Math.floor(h/u/c),s=Math.round(h/u)%c,l=(c-Math.round(p/u)%c)%c;m.push({resolutionX:u,blockWidth:c,datsetColumnCount:n,worldColumnCountFromOrigin:i,leftMargin:s,rightPadding:l,originColumnOffset:r}),u*=f}return{originX:t,halfWorldWidth:i,pyramidsInfo:m,hasGCSSShiftTransform:x}}function X(e){const t=e.isAdaptive&&null==e.spacing;let o=e.spacing||[R,R],i=K(e),r={cols:i.size[0]+1,rows:i.size[1]+1};const s=i.outofBoundPointCount>0&&i.outofBoundPointCount<i.offsets.length/2;let a=i.outofBoundPointCount===i.offsets.length/2||t&&s?[0,0]:d(i.offsets,r,o,P);const l=(a[0]+a[1])/2;if(t&&(s||l>P)){const t=e.projectedExtent.spatialReference;g(t,e.srcBufferExtent.spatialReference,e.datumTransformation)&&(t.isGeographic||n(j(t))),o=[w,w],i=K({...e,spacing:o}),r={cols:i.size[0]+1,rows:i.size[1]+1},a=d(i.offsets,r,o,P)}return i.error=a,o[0]>1&&(i.coefficients=U(i.offsets,r,s)),i}function K(e){const{projectedExtent:t,srcBufferExtent:o,pixelSize:i,datumTransformation:r,rasterTransform:s}=e,a=t.spatialReference,l=o.spatialReference;y(a,l);const{xmin:c,ymin:f,xmax:u,ymax:m}=t,x=L(l),h=n(x)&&(e.hasWrapAround||"gcs-shift"===(null==s?void 0:s.type)),g=e.spacing||[R,R],d=g[0]*i.x,M=g[1]*i.y,P=1===g[0],S=Math.ceil((u-c)/d-.1/g[0])+(P?0:1),b=Math.ceil((m-f)/M-.1/g[1])+(P?0:1),E=T({cols:S,rows:b,xmin:c,ymax:m,xres:d,yres:M,inSR:a,outSR:l,datumTransformation:r,preferPE:g[0]<=w,usePixelCenter:P}),N=[];let v,k=0;const C=P?-1:NaN,{xmin:_,xmax:j,ymax:z,width:W,height:O}=o,A=G(l,500);for(let n=0;n<S;n++){const e=[];for(let t=0;t<b;t++){let o=E[n*b+t];if(h&&o[0]>j&&o[0]>x/2-A&&(o[0]-=x),!o||isNaN(o[0])||isNaN(o[1]))N.push(C),N.push(C),e.push(null),k++;else{if(s){const e=s.inverseTransform(new p({x:o[0],y:o[1],spatialReference:l}));o=[e.x,e.y]}e.push(o),n>0&&h&&v[t]&&o[0]<v[t][0]&&(o[0]+=x),N.push((o[0]-_)/W),N.push((z-o[1])/O)}}v=e}return{offsets:N,error:null,coefficients:null,outofBoundPointCount:k,spacing:g,size:P?[S,b]:[S-1,b-1]}}function U(e,t,n){const{cols:o,rows:i}=t,r=new Float32Array((o-1)*(i-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<o-1;l++){for(let t=0;t<i-1;t++){let n=l*i*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],m=e[n+3];n+=2*i;const x=e[n],h=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(o-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*m+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*x+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*h+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function D(e){const t=e.clone().normalize();return 1===t.length?t[0]:A(t)}function H(e,t,o){const{storageInfo:i,pixelSize:r}=t;let s,a=!1;const{pyramidResolutions:l}=i;if(n(l)&&l.length){const n=(e.x+e.y)/2,i=l[l.length-1],c=(i.x+i.y)/2,f=(r.x+r.y)/2;if(n<=f)s=0;else if(n>=c)s=l.length,a=n/c>8;else{let e,t=f;for(let i=1;i<=l.length;i++){if(e=(l[i-1].x+l[i-1].y)/2,n<=e){n===e?s=i:"down"===o?(s=i-1,a=n/t>8):s="up"===o||n-t>e-n||n/t>2?i:i-1;break}t=e}}const u=0===s?r:l[s-1];return{pyramidLevel:s,pyramidResolution:new p({x:u.x,y:u.y,spatialReference:t.spatialReference}),excessiveReading:a}}const c=Math.log(e.x/r.x)/Math.LN2,f=Math.log(e.y/r.y)/Math.LN2,u=t.storageInfo.maximumPyramidLevel||0;s="down"===o?Math.floor(Math.min(c,f)):"up"===o?Math.ceil(Math.max(c,f)):Math.round((c+f)/2),s<0?s=0:s>u&&(a=s>u+3,s=u);const m=2**s;return{pyramidLevel:s,pyramidResolution:new p({x:m*t.nativePixelSize.x,y:m*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function Q(e,t,n=512,i=!0){const{extent:r,spatialReference:s,pixelSize:a}=e,l=N(new p({x:a.x,y:a.y,spatialReference:s}),t,r);if(null==l)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const c=(l.x+l.y)/2,f=o(t),u=c*f*96*39.37,m=t.isGeographic?256/n*295828763.7958547:256/n*591657527.591555;let x="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const h=I(r,t);x||i&&(t.isGeographic||t.isWebMercator)&&(x=h.xmin*h.xmax<0);let g,y=u;const d=1.001;if(x){y=m;const e=t.isGeographic?1341104507446289e-21:.29858214164761665,n=e*(96*f*39.37),o=t.isGeographic?4326:3857;g=N(new p({x:e,y:e,spatialReference:{wkid:o}}),s,h),g.x*=y/n,g.y*=y/n}else{g={x:a.x,y:a.y};const t=Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2);let n=0;for(;y<m*(d/2)&&n<t;)n++,y*=2,g.x*=2,g.y*=2;Math.max(y,m)/Math.min(y,m)<=d&&(y=m)}const M=[y],R=[{x:g.x,y:g.y}],w=70.5310735,P=Math.min(w,u)/d;for(;y>=P;)y/=2,g.x/=2,g.y/=2,M.push(y),R.push({x:g.x,y:g.y});return{projectedPixelSize:l,scales:M,srcResolutions:R,isCustomTilingScheme:!x}}export{Q as computeProjectedScales,R as defaultGridSpacing,P as defaultProjectionToleranceInPixels,E as getDefaultDatumTransformationForDataset,T as getProjectedGridPoints,X as getProjectionOffsetGrid,J as getRasterDatasetAlignmentInfo,L as getWorldWidth,q as getWorldWrapCount,b as load,w as minimumGridSpacing,I as projectExtent,v as projectPoint,N as projectResolution,g as requirePE,D as snapExtent,H as snapPyramid};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "4.23.0-next.
|
|
3
|
+
"version": "4.23.0-next.20220128",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS API for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@esri/arcgis-html-sanitizer": "~2.9.0",
|
|
29
29
|
"@esri/calcite-colors": "~6.0.1",
|
|
30
|
-
"@esri/calcite-components": "1.0.0-beta.
|
|
30
|
+
"@esri/calcite-components": "1.0.0-beta.75",
|
|
31
31
|
"@popperjs/core": "~2.11.2",
|
|
32
32
|
"focus-trap": "~6.7.2",
|
|
33
33
|
"luxon": "~2.3.0",
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import r from"./Content.js";var s;let p=s=class extends r{constructor(t){super(t),this.description=null,this.displayType=
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import r from"./Content.js";var s;let p=s=class extends r{constructor(t){super(t),this.description=null,this.displayType="auto",this.title=null,this.type="attachments"}clone(){return new s({description:this.description,displayType:this.displayType,title:this.title})}};t([e({type:String,json:{write:!0}})],p.prototype,"description",void 0),t([e({type:["auto","preview","list"],json:{write:!0}})],p.prototype,"displayType",void 0),t([e({type:String,json:{write:!0}})],p.prototype,"title",void 0),t([e({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],p.prototype,"type",void 0),p=s=t([o("esri.popup.content.AttachmentsContent")],p);const i=p;export{i as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import a from"../BarChartMediaInfo.js";import r from"../ColumnChartMediaInfo.js";import
|
|
5
|
+
import a from"../BarChartMediaInfo.js";import r from"../ColumnChartMediaInfo.js";import o from"../ImageMediaInfo.js";import e from"../LineChartMediaInfo.js";import i from"../PieChartMediaInfo.js";import t from"../mixins/MediaInfo.js";const m={base:t,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":a,"column-chart":r,"line-chart":e,"pie-chart":i,image:o}};export{m as types};
|