@arcgis/core 4.26.0-next.20230111 → 4.26.0-next.20230113
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/arcade/ArcadeDate.js +5 -0
- package/arcade/Dictionary.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/arcadeTimeUtils.js +5 -0
- package/arcade/executionError.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
- package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/maths.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{c9477250a5d5ebdef00c.js → 01cd5a9cd4cb1f13691c.js} +1 -1
- package/assets/esri/core/workers/chunks/028f9a133104e78e60d2.js +1 -0
- package/assets/esri/core/workers/chunks/033e6ae5da6afebd993c.js +1 -0
- package/assets/esri/core/workers/chunks/05ab092987251d4a1242.js +1 -0
- package/assets/esri/core/workers/chunks/1186a56dacaf269d5271.js +1 -0
- package/assets/esri/core/workers/chunks/264e1c00936bcafb9a36.js +1 -0
- package/assets/esri/core/workers/chunks/2680392cef77d98ad097.js +1 -0
- package/assets/esri/core/workers/chunks/27ba1889fe9f1812389a.js +1165 -0
- package/assets/esri/core/workers/chunks/2dfb17fa5b6a5d239942.js +1 -0
- package/assets/esri/core/workers/chunks/2e3962506c353b562a88.js +1 -0
- package/assets/esri/core/workers/chunks/30ae4c22f6b8aab9f841.js +1 -0
- package/assets/esri/core/workers/chunks/329e512f210cb3e904f1.js +1 -0
- package/assets/esri/core/workers/chunks/3878efe67f43962b46f8.js +1 -0
- package/assets/esri/core/workers/chunks/3b6748f414437cc6cfde.js +1 -0
- package/assets/esri/core/workers/chunks/41d25407888326c91566.js +1 -0
- package/assets/esri/core/workers/chunks/493e2b00133682748e62.js +1 -0
- package/assets/esri/core/workers/chunks/4b2edcb8ef7fae4f7d28.js +1 -0
- package/assets/esri/core/workers/chunks/{c11d857dca43de2229fc.js → 4c085cee22ff64ce6d1f.js} +1 -1
- package/assets/esri/core/workers/chunks/4d8c53e961275b6a4ee1.js +1 -0
- package/assets/esri/core/workers/chunks/5049771eeffe208a9cb8.js +1 -0
- package/assets/esri/core/workers/chunks/{58d219ffd9dcc45bb0d1.js → 5191f80f2413ee92c875.js} +1 -1
- package/assets/esri/core/workers/chunks/5dfed65b615b33588488.js +1 -0
- package/assets/esri/core/workers/chunks/5e9869849d999aac5756.js +1 -0
- package/assets/esri/core/workers/chunks/6216cd8134703fd9d9b4.js +1 -0
- package/assets/esri/core/workers/chunks/62c8e43741f2d6141f00.js +1 -0
- package/assets/esri/core/workers/chunks/64f137358100a1c818f0.js +1 -0
- package/assets/esri/core/workers/chunks/6f5f81855985db7c1936.js +1 -0
- package/assets/esri/core/workers/chunks/6fba07833345b2d8d373.js +1 -0
- package/assets/esri/core/workers/chunks/{80c7726743baf9f54079.js → 7747ee359d357f6e5858.js} +1 -1
- package/assets/esri/core/workers/chunks/78fd609f334a29ef39dc.js +1 -0
- package/assets/esri/core/workers/chunks/798cd875d64182741364.js +1 -0
- package/assets/esri/core/workers/chunks/{9d247a46e0cfdad26273.js → 8176286f8dd055c8ae05.js} +1 -1
- package/assets/esri/core/workers/chunks/8530ac02c840c89cc1df.js +1 -0
- package/assets/esri/core/workers/chunks/8a69a9b5a04e7321740d.js +1 -0
- package/assets/esri/core/workers/chunks/8bd26c71e78698c16778.js +1 -0
- package/assets/esri/core/workers/chunks/8c12b82612f050492fef.js +1 -0
- package/assets/esri/core/workers/chunks/90653ef5e718bafd6960.js +1 -0
- package/assets/esri/core/workers/chunks/{418922fd99e733df023f.js → 9070aa0a94a9204ded1c.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ac0d2164a1b49e6f057.js → 94633a9bb5fa4f4ba4de.js} +1 -1
- package/assets/esri/core/workers/chunks/969bb94d5bdc9da114e2.js +1 -0
- package/assets/esri/core/workers/chunks/9785dba81a6af339e35a.js +1 -0
- package/assets/esri/core/workers/chunks/99e16173584702577b80.js +1 -0
- package/assets/esri/core/workers/chunks/9aee6f171d4fbac941d9.js +1 -0
- package/assets/esri/core/workers/chunks/a194f90ffe13b3d448b0.js +1 -0
- package/assets/esri/core/workers/chunks/a53d194e3eede703a6df.js +1 -0
- package/assets/esri/core/workers/chunks/a605bf8bc29099ae1b1a.js +1 -0
- package/assets/esri/core/workers/chunks/ba7239089a04098e3619.js +1 -0
- package/assets/esri/core/workers/chunks/bd2fe663a2b090b134e9.js +1 -0
- package/assets/esri/core/workers/chunks/c16003307aad2f84ac51.js +1 -0
- package/assets/esri/core/workers/chunks/c6eb6a97ecc6ed9ce713.js +1 -0
- package/assets/esri/core/workers/chunks/c81d898f4aef6ecacdb5.js +1 -0
- package/assets/esri/core/workers/chunks/cb83480d7074f6185e21.js +1 -0
- package/assets/esri/core/workers/chunks/cd0fa942d57a278b0a44.js +1 -0
- package/assets/esri/core/workers/chunks/d55332e4d7b8184fd718.js +1 -0
- package/assets/esri/core/workers/chunks/d6842acbfa7a39f3ca30.js +1 -0
- package/assets/esri/core/workers/chunks/d798bd544433e932f772.js +1 -0
- package/assets/esri/core/workers/chunks/e18851e915cb69f53032.js +1 -0
- package/assets/esri/core/workers/chunks/{54899827baea77776fc7.js → ea1054116ec842a4f813.js} +1 -1
- package/assets/esri/core/workers/chunks/ed1312c2627c0d7e654d.js +1 -0
- package/assets/esri/core/workers/chunks/f2750a7b44e8bc8b1e4c.js +1 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +1 -11
- package/assets/esri/themes/base/widgets/_ItemList.scss +0 -13
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_nb.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
- package/chunks/ComponentShader.glsl.js +1 -1
- package/chunks/Path.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/geometry/support/MeshTexture.js +1 -1
- package/geometry/support/aaBoundingBox.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/interfaces.d.ts +1400 -1314
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/graphics/data/FeatureStore.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/timeSupport.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/graphics/sources/WFSSourceWorker.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/support/layerOriginUtils.js +1 -1
- package/layers/support/rasterFormats/JpgPlus.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/rasterFunctions/ConvolutionFunction.js +1 -1
- package/layers/support/rasterFunctions/ConvolutionFunctionArguments.js +1 -1
- package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
- package/layers/support/rasterFunctions/ExtractBandFunctionArguments.js +1 -1
- package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
- package/layers/support/rasterFunctions/NDVIFunctionArguments.js +1 -1
- package/layers/support/rasterFunctions/SlopeFunctionArguments.js +1 -1
- package/layers/support/rasterFunctions/StatisticsHistogramFunction.js +5 -0
- package/layers/support/rasterFunctions/{StatisticsHistogramsFunctionArguments.js → StatisticsHistogramFunctionArguments.js} +1 -1
- package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
- package/package.json +1 -1
- package/rest/imageService.js +1 -1
- package/rest/support/BaseImageMeasureResult.d.ts +4 -0
- package/rest/support/ImageAreaParameters.d.ts +4 -0
- package/rest/support/{ImageMeasureAreaAndPerimeterParameters.js → ImageAreaParameters.js} +1 -1
- package/rest/support/ImageAreaResult.d.ts +4 -0
- package/rest/support/{ImageMeasureAreaAndPerimeterResult.js → ImageAreaResult.js} +1 -1
- package/rest/support/ImageDistanceParameters.d.ts +4 -0
- package/rest/support/{ImageMeasureDistanceAndAngleParameters.js → ImageDistanceParameters.js} +1 -1
- package/rest/support/ImageDistanceResult.d.ts +4 -0
- package/rest/support/ImageDistanceResult.js +5 -0
- package/rest/support/ImageHeightParameters.d.ts +4 -0
- package/rest/support/{ImageMeasureHeightParameters.js → ImageHeightParameters.js} +1 -1
- package/rest/support/ImageHeightResult.d.ts +4 -0
- package/rest/support/{ImageMeasureHeightResult.js → ImageHeightResult.js} +1 -1
- package/rest/support/ImagePointParameters.d.ts +4 -0
- package/rest/support/{ImageMeasurePointParameters.js → ImagePointParameters.js} +1 -1
- package/rest/support/ImagePointResult.d.ts +4 -0
- package/rest/support/{ImageMeasurePointResult.js → ImagePointResult.js} +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/time/timeReferenceUtils.js +1 -1
- package/views/2d/engine/webgl/Overlay.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureStore2D.js +1 -1
- package/views/2d/layers/features/Pipeline.js +1 -1
- package/views/2d/layers/features/support/BinStore.js +1 -1
- package/views/2d/layers/features/support/ClusterStore.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/glTF/internal/resourceUtils.js +5 -0
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SQueryFeatureStore.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/terrain/Overlay.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/AnimationTimeStep.js +5 -0
- package/views/3d/webgl-engine/lib/AnimationTimer.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +5 -0
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/draw/support/layerUtils.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/FeatureTemplates/ItemList.js +1 -1
- package/widgets/FeatureTemplates/TemplateItem.js +1 -1
- package/widgets/FeatureTemplates/TemplateItemGroup.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/support/decorators/accessibleHandler.js +1 -1
- package/assets/esri/core/workers/chunks/038dc3f9ef06ef3c960c.js +0 -1
- package/assets/esri/core/workers/chunks/078a0b134210167b629d.js +0 -1
- package/assets/esri/core/workers/chunks/080a4be417be4943f6a0.js +0 -1
- package/assets/esri/core/workers/chunks/0877bab7c03a1de2e713.js +0 -1
- package/assets/esri/core/workers/chunks/0c9200ab19fd2f56f87f.js +0 -1
- package/assets/esri/core/workers/chunks/1cbffa96ea6683e5f3ec.js +0 -1
- package/assets/esri/core/workers/chunks/1f742c3b11c76814fa4d.js +0 -1
- package/assets/esri/core/workers/chunks/2eb2d49c549e53934b8b.js +0 -1
- package/assets/esri/core/workers/chunks/332494b96a47b378f4e0.js +0 -1
- package/assets/esri/core/workers/chunks/3326536d183a858a2a4d.js +0 -1
- package/assets/esri/core/workers/chunks/3f4fc8379fc11bc293cc.js +0 -1
- package/assets/esri/core/workers/chunks/43fecd621cd043f64828.js +0 -1165
- package/assets/esri/core/workers/chunks/47b0b660f5412097fe26.js +0 -1
- package/assets/esri/core/workers/chunks/4c0d7a074083aa9614bb.js +0 -1
- package/assets/esri/core/workers/chunks/594d7e871b648d5c9662.js +0 -1
- package/assets/esri/core/workers/chunks/680b90ac98e8d1ac0e33.js +0 -1
- package/assets/esri/core/workers/chunks/6b589f47cb4731df1639.js +0 -1
- package/assets/esri/core/workers/chunks/72557c4b1582aa18ad4d.js +0 -1
- package/assets/esri/core/workers/chunks/72b490ad371e0c2264f6.js +0 -1
- package/assets/esri/core/workers/chunks/75ce17cf13aab0440572.js +0 -1
- package/assets/esri/core/workers/chunks/75f4e884a1a0aedc0afd.js +0 -1
- package/assets/esri/core/workers/chunks/7b9ab3fb378172831c14.js +0 -1
- package/assets/esri/core/workers/chunks/7bef95b168303bdc4bf1.js +0 -1
- package/assets/esri/core/workers/chunks/803492088780e18de801.js +0 -1
- package/assets/esri/core/workers/chunks/89003e387684af5ebeac.js +0 -1
- package/assets/esri/core/workers/chunks/8f93026764a0cce0901b.js +0 -1
- package/assets/esri/core/workers/chunks/98350b6b95da62ef5f12.js +0 -1
- package/assets/esri/core/workers/chunks/a9cae0d386aa9c00f744.js +0 -1
- package/assets/esri/core/workers/chunks/ad65c24558098f21bbf3.js +0 -1
- package/assets/esri/core/workers/chunks/aef90ee3f0979a7acb38.js +0 -1
- package/assets/esri/core/workers/chunks/b68c7754b0220b194ecf.js +0 -1
- package/assets/esri/core/workers/chunks/c012317f045a74fdd79d.js +0 -1
- package/assets/esri/core/workers/chunks/cb42675e5b1c41634c63.js +0 -1
- package/assets/esri/core/workers/chunks/cb901033dd15b3b72025.js +0 -1
- package/assets/esri/core/workers/chunks/d398b6b8a6b0a95247de.js +0 -1
- package/assets/esri/core/workers/chunks/d447ebc944a9867f5a99.js +0 -1
- package/assets/esri/core/workers/chunks/daaabed988b6ea866350.js +0 -1
- package/assets/esri/core/workers/chunks/e048641971aef9dd4da9.js +0 -1
- package/assets/esri/core/workers/chunks/e3fd383aee378cbb0dae.js +0 -1
- package/assets/esri/core/workers/chunks/e967ffca641947212992.js +0 -1
- package/assets/esri/core/workers/chunks/e9c81eee503c1b112bad.js +0 -1
- package/assets/esri/core/workers/chunks/ea6cf948fe2de0242308.js +0 -1
- package/assets/esri/core/workers/chunks/ed5e71b45dfefcbb2da4.js +0 -1
- package/assets/esri/core/workers/chunks/ee50d5d0afe9bdccc84d.js +0 -1
- package/assets/esri/core/workers/chunks/ee91401507833875facc.js +0 -1
- package/assets/esri/core/workers/chunks/f7d40dd78ef116f5793b.js +0 -1
- package/assets/esri/core/workers/chunks/f8ab6e354834b9c0e857.js +0 -1
- package/assets/esri/core/workers/chunks/faea681c279486b7a5e7.js +0 -1
- package/layers/support/rasterFunctions/StatisticsHistogramsFunction.js +0 -5
- package/rest/support/ImageMeasureDistanceAndAngleResult.js +0 -5
- package/views/3d/support/animationUtils.js +0 -5
- package/views/3d/webgl-engine/lib/RenderStateFeature.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../core/Error.js";import
|
|
5
|
+
import{toRGB as t}from"../../../core/colorUtils.js";import r from"../../../core/Error.js";import e from"./AspectFunction.js";import n from"./BandArithmeticFunction.js";import o from"./ColormapFunction.js";import s from"./CompositeBandFunction.js";import a from"./ConvolutionFunction.js";import i from"./ExtractBandFunction.js";import u from"./LocalFunction.js";import c from"./MaskFunction.js";import m from"./NDVIFunction.js";import l from"./RemapFunction.js";import p from"./SlopeFunction.js";import f from"./StatisticsHistogramFunction.js";import d from"./StretchFunction.js";const g=new Map;function A(t,r,e=["raster"],n=""){g.set(t,{desc:n,ctor:r,rasterArgumentNames:e})}function F(){const t=new Set;return g.forEach(((r,e)=>t.add(e))),t}function y(t,e){if(e=e??{},"function"in t&&"arguments"in t&&t.arguments&&(t=j(t,e)),"rasterFunction"in t)return N(t=C(t),e);throw new r("raster-function-helper","unsupported raster function json.")}function h(t,r){return"rasters"===r[0]&&Array.isArray(t.rasters)?t.rasters:r.map((r=>t[r]))}function C(t){const{rasterFunctionArguments:r}=t,e={};for(const n in r){let t=r[n];t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments&&(t=C(t));switch(n.toLowerCase()){case"dra":e.dra=t;break;case"pspower":e.psPower=t;break;case"pszfactor":e.psZFactor=t;break;case"bandids":e.bandIds=t;break;default:e[n[0].toLowerCase()+n.slice(1)]=t}}return{...t,rasterFunctionArguments:e}}function N(t,e){const{rasterFunction:n,rasterFunctionArguments:o}=t,s=t.outputPixelType?.toLowerCase();if(null==n||!g.has(n))throw new r("raster-function-helper",`unsupported raster function: ${n}`);const a=g.get(n),i=("function"==typeof a.ctor?a.ctor:a.ctor.default).fromJSON({...t,outputPixelType:s}),{rasterArgumentNames:u}=i,c=[],m=h(o,u),l="rasters"===u[0],p=[];for(let r=0;r<m.length;r++){const t=m[r];let n;null==t||"string"==typeof t&&t.startsWith("$")?c.push(e?.raster):"string"==typeof t?e[t]&&c.push(e[t]):"number"!=typeof t&&"rasterFunction"in t&&(n=N(t,e),l||(i.functionArguments[u[r]]=n),c.push(n)),l&&p.push(n??t)}if(l&&(i.functionArguments.rasters=p),e){i.sourceRasters=c;const t=e.raster?.url;t&&(i.mainPrimaryRasterId=t)}return i}function b(t,r){if(t&&r)for(const e in t){const n=t[e];n&&"object"==typeof n&&(n.function&&n.arguments?b(n.arguments,r):"RasterFunctionVariable"===n.type&&null!=r[n.name]&&(n.value=r[n.name]))}}function S(t){if(!t||"object"!=typeof t)return t;if(Array.isArray(t)&&0===t.length)return 0===t.length?null:["number","string"].includes(typeof t[0])?t:t.map((t=>S(t)));if("value"in t&&["number","string","boolean"].includes(typeof t.value))return t.value;if(!("type"in t))return t;switch(t.type){case"Scalar":return t.value;case"AlgorithmicColorRamp":return v(t);case"MultiPartColorRamp":return{type:"multipart",colorRamps:t.ArrayOfColorRamp.map(v)};case"ArgumentArray":return t.elements?.length?"RasterStatistics"===t.elements[0].type?t.elements:"RasterFunctionVariable"===t.elements[0].type?t.elements.map((t=>null!=t.value?S(t.value):t.name.toLowerCase().includes("raster")?"$$":null)):t:t.elements;default:return t}}function v(r){const e=r.algorithm??"esriHSVAlgorithm";let{FromColor:n,ToColor:o}=r;if(!Array.isArray(n)){const{r,g:e,b:o}=t({h:n.Hue,s:n.Saturation,v:n.Value});n=[r,e,o,n.AlphaValue]}if(!Array.isArray(o)){const{r,g:e,b:n}=t({h:o.Hue,s:o.Saturation,v:o.Value});o=[r,e,n,o.AlphaValue]}return{type:"algorithmic",algorithm:e,fromColor:n,toColor:o}}function j(t,r){r&&b(t,r);const e={};return R(t,e),e}function R(t,r){if(!t||!r)return;const{function:e,arguments:n}=t;if(!e||!n)return;r.rasterFunction=e.type.replace("Function",""),r.outputPixelType=e.pixelType;const o={};r.rasterFunctionArguments=o;for(const s in n){const t=n[s];"object"==typeof t&&("function"in t&&t.function&&t.arguments?(r.rasterFunctionArguments[s]={},R(t,r.rasterFunctionArguments[s])):"value"in t&&(o[s]=S(t.value)))}switch(o.DEM&&!o.Raster&&(o.Raster=o.DEM,delete o.DEM),r.rasterFunction){case"Stretch":w(o);break;case"Colormap":D(o);break;case"Convolution":V(o);break;case"Mask":k(o)}}function w(t){t.Statistics?.length&&"object"==typeof t.Statistics&&(t.Statistics=t.Statistics.map((t=>[t.min,t.max,t.mean,t.standardDeviation]))),null!=t.NumberOfStandardDeviation&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function D(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}function V(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function k(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter((t=>""!==t)).map((t=>Number(t))))}g.set("Aspect",{desc:"Aspect Function",ctor:e,rasterArgumentNames:["raster"]}),g.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:n,rasterArgumentNames:["raster"]}),g.set("Colormap",{desc:"Colormap Function",ctor:o,rasterArgumentNames:["raster"]}),g.set("CompositeBand",{desc:"CompositeBand Function",ctor:s,rasterArgumentNames:["rasters"]}),g.set("Convolution",{desc:"Convolution Function",ctor:a,rasterArgumentNames:["raster"]}),g.set("ExtractBand",{desc:"ExtractBand Function",ctor:i,rasterArgumentNames:["raster"]}),g.set("Local",{desc:"Local Function",ctor:u,rasterArgumentNames:["rasters"]}),g.set("Mask",{desc:"Mask Function",ctor:c,rasterArgumentNames:["raster"]}),g.set("NDVI",{desc:"NDVI Function",ctor:m,rasterArgumentNames:["raster"]}),g.set("Remap",{desc:"Remap Function",ctor:l,rasterArgumentNames:["raster"]}),g.set("Slope",{desc:"Slope Function",ctor:p,rasterArgumentNames:["raster"]}),g.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:f,rasterArgumentNames:["raster"]}),g.set("Stretch",{desc:"Stretch Function",ctor:d,rasterArgumentNames:["raster"]});export{y as create,h as getRasterValues,F as getSupportedFunctions,A as register};
|
package/package.json
CHANGED
package/rest/imageService.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../geometry.js";import t from"../request.js";import{isSome as e}from"../core/maybe.js";import{normalizeCentralMeridian as o}from"../geometry/support/normalizeUtils.js";import{parseUrl as n,encode as r,asValidOptions as a}from"./utils.js";import s from"./support/ImageAngleResult.js";import i from"./support/
|
|
5
|
+
import"../geometry.js";import t from"../request.js";import{isSome as e}from"../core/maybe.js";import{normalizeCentralMeridian as o}from"../geometry/support/normalizeUtils.js";import{parseUrl as n,encode as r,asValidOptions as a}from"./utils.js";import s from"./support/ImageAngleResult.js";import i from"./support/ImageAreaResult.js";import m from"./support/ImageDistanceResult.js";import c from"./support/ImageHeightResult.js";import u from"./support/ImageIdentifyResult.js";import l from"./support/ImagePixelLocationResult.js";import p from"./support/ImagePointResult.js";import f from"./support/ImageSampleResult.js";import g from"../geometry/SpatialReference.js";function y(t){const e=t?.time;if(e&&(null!=e.start||null!=e.end)){const o=[];null!=e.start&&o.push(e.start),null==e.end||o.includes(e.end)||o.push(e.end),t.time=o.join(",")}}async function N(t,s,i){const m=n(t),c=s.geometry?[s.geometry]:[],u=await o(c),l=s.toJSON();y(l);const p=u&&u[0];e(p)&&(l.geometry=p.toJSON());const f=r({...m.query,f:"json",...l});return a(f,i)}async function S(o,i,m){const c=i.toJSON();e(c.angleName)&&(c.angleName=c.angleName.join(",")),e(i.point)&&i.point.spatialReference?.imageCoordinateSystem&&(c.point.spatialReference=C(i.point.spatialReference)),e(i.spatialReference)&&i.spatialReference.imageCoordinateSystem&&(c.spatialReference=G(i.spatialReference));const u=n(o),l=r({...u.query,f:"json",...c}),p=a(l,m),{data:f}=await t(`${u.path}/computeAngles`,p);return f.spatialReference=f.spatialReference?null!=f.spatialReference.geodataXform?new g({wkid:0,imageCoordinateSystem:f.spatialReference}):g.fromJSON(f.spatialReference):null,"NaN"===f.north&&(f.north=null),"NaN"===f.up&&(f.up=null),new s(f)}async function d(e,o,s){const i=o.toJSON(),{geometries:m}=o;if(m)for(let t=0;t<m.length;t++)m[t].spatialReference?.imageCoordinateSystem&&(i.geometries.geometries[t].spatialReference=C(m[t].spatialReference));const c=n(e),u=r({...c.query,f:"json",...i}),p=a(u,s),{data:f}=await t(`${c.path}/computePixelLocation`,p);return l.fromJSON(f)}async function J(e,o,r){const a=await N(e,o,r),s=n(e),{data:i}=await t(`${s.path}/computeStatisticsHistograms`,a),{statistics:m}=i;return m?.length&&m.forEach((t=>{t.avg=t.mean,t.stddev=t.standardDeviation})),{statistics:m,histograms:i.histograms}}async function O(e,o,r){const a=await N(e,o,r),s=n(e),{data:i}=await t(`${s.path}/computeHistograms`,a);return{histograms:i.histograms}}async function R(s,i,m){const c=i.toJSON();y(c),c.outFields?.length&&(c.outFields=c.outFields.join(","));const u=(await o(i.geometry))?.[0];e(u)&&(c.geometry=u.toJSON());const l=n(s),p=r({...l.query,f:"json",...c}),g=a(p,m),{data:N}=await t(`${l.path}/getSamples`,g),S=N?.samples?.map((t=>{const e="NaN"===t.value||""===t.value?null:t.value.split(" ").map((t=>Number(t)));return{...t,pixelValue:e}}));return f.fromJSON({samples:S})}async function j(s,i,m){const c=n(s),l=i.geometry?[i.geometry]:[];return o(l).then((o=>{const n=i.toJSON(),s=o&&o[0];e(s)&&(n.geometry=JSON.stringify(s.toJSON()));const u=r({...c.query,f:"json",...n}),l=a(u,m);return t(c.path+"/identify",l)})).then((t=>u.fromJSON(t.data)))}async function h(t,e,o){const n=await v(t,e,[e.fromGeometry,e.toGeometry],o);return c.fromJSON(n)}async function w(t,e,o){const n=await v(t,e,[e.geometry],o);return i.fromJSON(n)}async function I(t,e,o){const n=await v(t,e,[e.geometry],o);return p.fromJSON(n)}async function q(t,e,o){const n=await v(t,e,[e.fromGeometry,e.toGeometry],o);return m.fromJSON(n)}async function v(s,i,m,c){const u=n(s),l=await o(m),p=i.toJSON();e(l[0])&&(p.fromGeometry=JSON.stringify(l[0].toJSON())),e(l[1])&&(p.toGeometry=JSON.stringify(l[1].toJSON()));const f=r({...u.query,f:"json",...p}),g=a(f,c),{data:y}=await t(u.path+"/measure",g);return y}function C(t){const{imageCoordinateSystem:e}=t;if(e){const{id:t,referenceServiceName:o}=e;return null!=t?o?{icsid:t,icsns:o}:{icsid:t}:{ics:e}}return t.toJSON()}function G(t,e){const o=C(t),{icsid:n,icsns:r,wkid:a}=o;return null!=n?null==r||e?.toLowerCase().includes("/"+r.toLowerCase()+"/")?`0:${n}`:JSON.stringify(o):a?a.toString():JSON.stringify(o)}export{S as computeAngles,O as computeHistograms,d as computePixelSpaceLocations,J as computeStatisticsHistograms,C as getImageSpatialReferenceJSON,G as getImageSpatialReferenceQueryParameter,R as getSamples,j as identify,w as measureAreaAndPerimeter,q as measureDistanceAndAngle,h as measureHeight,I as measurePointOrCentroid};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{geometryTypes as r}from"../../geometry.js";import{clone as t}from"../../core/lang.js";import{lengthUnitsJSONMap as o,areaUnitsJSONMap as s}from"../../core/unitUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import{getJsonType as m}from"../../geometry/support/jsonUtils.js";import{measureOperationJSONMap as n,BaseImageMeasureParameters as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{geometryTypes as r}from"../../geometry.js";import{clone as t}from"../../core/lang.js";import{lengthUnitsJSONMap as o,areaUnitsJSONMap as s}from"../../core/unitUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import{getJsonType as m}from"../../geometry/support/jsonUtils.js";import{measureOperationJSONMap as n,BaseImageMeasureParameters as l}from"./BaseImageMeasureParameters.js";var u;let c=u=class extends l{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(e,r,t){null!=e&&(r.geometryType=m(e),r[t]=e.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new u(t({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};e([i({types:r,json:{name:"fromGeometry",read:!0,write:!0}})],c.prototype,"geometry",void 0),e([p("geometry")],c.prototype,"writeGeometry",null),e([i({type:n.apiValues,json:{write:n.write}})],c.prototype,"measureOperation",null),e([i({json:{read:!0}})],c.prototype,"is3D",void 0),e([i({type:String,json:{read:o.read,write:o.write}})],c.prototype,"linearUnit",void 0),e([i({type:String,json:{read:s.read,write:s.write}})],c.prototype,"areaUnit",void 0),c=u=e([a("esri.rest.support.ImageAreaParameters")],c);const y=c;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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as r}from"../../chunks/tslib.es6.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{BaseImageMeasureResult as o,ImageMeasureResultAreaValue as t,ImageMeasureResultLengthValue as p}from"./BaseImageMeasureResult.js";let a=class extends o{constructor(){super(...arguments),this.area=null,this.perimeter=null}};r([e({type:t,json:{read:!0,write:!0}})],a.prototype,"area",void 0),r([e({type:p,json:{read:!0,write:!0}})],a.prototype,"perimeter",void 0),a=r([s("esri.rest.support.
|
|
5
|
+
import{_ as r}from"../../chunks/tslib.es6.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{BaseImageMeasureResult as o,ImageMeasureResultAreaValue as t,ImageMeasureResultLengthValue as p}from"./BaseImageMeasureResult.js";let a=class extends o{constructor(){super(...arguments),this.area=null,this.perimeter=null}};r([e({type:t,json:{read:!0,write:!0}})],a.prototype,"area",void 0),r([e({type:p,json:{read:!0,write:!0}})],a.prototype,"perimeter",void 0),a=r([s("esri.rest.support.ImageAreaResult")],a);const c=a;export{c as default};
|
package/rest/support/{ImageMeasureDistanceAndAngleParameters.js → ImageDistanceParameters.js}
RENAMED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import{clone as r}from"../../core/lang.js";import{lengthUnitsJSONMap as t,angleUnitsJSONMap as o}from"../../core/unitUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{getJsonType as n}from"../../geometry/support/jsonUtils.js";import{measureOperationJSONMap as p,BaseImageMeasureParameters as m}from"./BaseImageMeasureParameters.js";import l from"../../geometry/Point.js";var u;let y=u=class extends m{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(e,r,t){null!=e&&(r.geometryType=n(e),r[t]=e.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new u(r({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};e([s({type:l,json:{read:!0,write:!0}})],y.prototype,"fromGeometry",void 0),e([a("fromGeometry")],y.prototype,"writeFromGeometry",null),e([s({type:l,json:{read:!0,write:!0}})],y.prototype,"toGeometry",void 0),e([s({type:p.apiValues,json:{write:p.write}})],y.prototype,"measureOperation",null),e([s({json:{read:!0}})],y.prototype,"is3D",void 0),e([s({type:String,json:{read:t.read,write:t.write}})],y.prototype,"linearUnit",void 0),e([s({type:String,json:{read:o.read,write:o.write}})],y.prototype,"angularUnit",void 0),y=u=e([i("esri.rest.support.
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import{clone as r}from"../../core/lang.js";import{lengthUnitsJSONMap as t,angleUnitsJSONMap as o}from"../../core/unitUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{getJsonType as n}from"../../geometry/support/jsonUtils.js";import{measureOperationJSONMap as p,BaseImageMeasureParameters as m}from"./BaseImageMeasureParameters.js";import l from"../../geometry/Point.js";var u;let y=u=class extends m{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(e,r,t){null!=e&&(r.geometryType=n(e),r[t]=e.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new u(r({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};e([s({type:l,json:{read:!0,write:!0}})],y.prototype,"fromGeometry",void 0),e([a("fromGeometry")],y.prototype,"writeFromGeometry",null),e([s({type:l,json:{read:!0,write:!0}})],y.prototype,"toGeometry",void 0),e([s({type:p.apiValues,json:{write:p.write}})],y.prototype,"measureOperation",null),e([s({json:{read:!0}})],y.prototype,"is3D",void 0),e([s({type:String,json:{read:t.read,write:t.write}})],y.prototype,"linearUnit",void 0),e([s({type:String,json:{read:o.read,write:o.write}})],y.prototype,"angularUnit",void 0),y=u=e([i("esri.rest.support.ImageDistanceParameters")],y);const c=y;export{c as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{BaseImageMeasureResult as s,ImageMeasureResultLengthValue as o,ImageMeasureResultAngleValue as p}from"./BaseImageMeasureResult.js";let a=class extends s{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};e([t({type:o,json:{read:!0,write:!0}})],a.prototype,"distance",void 0),e([t({type:p,json:{read:!0,write:!0}})],a.prototype,"azimuthAngle",void 0),e([t({type:p,json:{read:!0,write:!0}})],a.prototype,"elevationAngle",void 0),a=e([r("esri.rest.support.ImageDistanceResult")],a);const i=a;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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import{clone as r}from"../../core/lang.js";import{lengthUnitsJSONMap as t}from"../../core/unitUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as i}from"../../core/accessorSupport/decorators/writer.js";import{getJsonType as p}from"../../geometry/support/jsonUtils.js";import{measureOperationJSONMap as m,BaseImageMeasureParameters as a}from"./BaseImageMeasureParameters.js";import n from"../../geometry/Point.js";var y;let l=y=class extends a{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(e,r,t){null!=e&&(r.geometryType=p(e),r[t]=e.toJSON())}get measureOperation(){return this.operationType}clone(){return new y(r({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};e([o({type:n,json:{read:!0}})],l.prototype,"fromGeometry",void 0),e([i("fromGeometry")],l.prototype,"writeFromGeometry",null),e([o({type:n,json:{read:!0,write:!0}})],l.prototype,"toGeometry",void 0),e([o({type:m.apiValues,json:{write:m.write}})],l.prototype,"measureOperation",null),e([o({json:{read:!0}})],l.prototype,"operationType",void 0),e([o({type:String,json:{read:t.read,write:t.write}})],l.prototype,"linearUnit",void 0),l=y=e([s("esri.rest.support.
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import{clone as r}from"../../core/lang.js";import{lengthUnitsJSONMap as t}from"../../core/unitUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as i}from"../../core/accessorSupport/decorators/writer.js";import{getJsonType as p}from"../../geometry/support/jsonUtils.js";import{measureOperationJSONMap as m,BaseImageMeasureParameters as a}from"./BaseImageMeasureParameters.js";import n from"../../geometry/Point.js";var y;let l=y=class extends a{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(e,r,t){null!=e&&(r.geometryType=p(e),r[t]=e.toJSON())}get measureOperation(){return this.operationType}clone(){return new y(r({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};e([o({type:n,json:{read:!0}})],l.prototype,"fromGeometry",void 0),e([i("fromGeometry")],l.prototype,"writeFromGeometry",null),e([o({type:n,json:{read:!0,write:!0}})],l.prototype,"toGeometry",void 0),e([o({type:m.apiValues,json:{write:m.write}})],l.prototype,"measureOperation",null),e([o({json:{read:!0}})],l.prototype,"operationType",void 0),e([o({type:String,json:{read:t.read,write:t.write}})],l.prototype,"linearUnit",void 0),l=y=e([s("esri.rest.support.ImageHeightParameters")],l);const u=l;export{u 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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as r}from"../../chunks/tslib.es6.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import{BaseImageMeasureResult as o,ImageMeasureResultLengthValue as t}from"./BaseImageMeasureResult.js";let p=class extends o{constructor(){super(...arguments),this.height=null}};r([s({type:t,json:{read:!0,write:!0}})],p.prototype,"height",void 0),p=r([e("esri.rest.support.
|
|
5
|
+
import{_ as r}from"../../chunks/tslib.es6.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import{BaseImageMeasureResult as o,ImageMeasureResultLengthValue as t}from"./BaseImageMeasureResult.js";let p=class extends o{constructor(){super(...arguments),this.height=null}};r([s({type:t,json:{read:!0,write:!0}})],p.prototype,"height",void 0),p=r([e("esri.rest.support.ImageHeightResult")],p);const c=p;export{c 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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{geometryTypes as r}from"../../geometry.js";import{clone as t}from"../../core/lang.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as i}from"../../core/accessorSupport/decorators/writer.js";import{getJsonType as p,fromJSON as m}from"../../geometry/support/jsonUtils.js";import{measureOperationJSONMap as a,BaseImageMeasureParameters as n}from"./BaseImageMeasureParameters.js";var c;let u=c=class extends n{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(e,r,t){null!=e&&(r.geometryType=p(e),r[t]=e.toJSON())}get measureOperation(){const{is3D:e,geometry:r}=this;return"point"===r.type?e?"point-3D":"point":e?"centroid-3D":"centroid"}clone(){return new c(t({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};e([o({types:r,json:{name:"fromGeometry",read:m}})],u.prototype,"geometry",void 0),e([i("geometry")],u.prototype,"writeGeometry",null),e([o({type:a.apiValues,json:{read:a.read,write:a.write}})],u.prototype,"measureOperation",null),e([o({json:{read:!0}})],u.prototype,"is3D",void 0),u=c=e([s("esri.rest.support.
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{geometryTypes as r}from"../../geometry.js";import{clone as t}from"../../core/lang.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as i}from"../../core/accessorSupport/decorators/writer.js";import{getJsonType as p,fromJSON as m}from"../../geometry/support/jsonUtils.js";import{measureOperationJSONMap as a,BaseImageMeasureParameters as n}from"./BaseImageMeasureParameters.js";var c;let u=c=class extends n{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(e,r,t){null!=e&&(r.geometryType=p(e),r[t]=e.toJSON())}get measureOperation(){const{is3D:e,geometry:r}=this;return"point"===r.type?e?"point-3D":"point":e?"centroid-3D":"centroid"}clone(){return new c(t({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};e([o({types:r,json:{name:"fromGeometry",read:m}})],u.prototype,"geometry",void 0),e([i("geometry")],u.prototype,"writeGeometry",null),e([o({type:a.apiValues,json:{read:a.read,write:a.write}})],u.prototype,"measureOperation",null),e([o({json:{read:!0}})],u.prototype,"is3D",void 0),u=c=e([s("esri.rest.support.ImagePointParameters")],u);const l=u;export{l 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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as r}from"../../chunks/tslib.es6.js";import"../../geometry.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{BaseImageMeasureResult as e}from"./BaseImageMeasureResult.js";import t from"../../geometry/Point.js";let p=class extends e{constructor(){super(...arguments),this.point=null}};r([o({type:t,json:{name:"point.value",read:!0,write:!0}})],p.prototype,"point",void 0),p=r([s("esri.rest.support.
|
|
5
|
+
import{_ as r}from"../../chunks/tslib.es6.js";import"../../geometry.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{BaseImageMeasureResult as e}from"./BaseImageMeasureResult.js";import t from"../../geometry/Point.js";let p=class extends e{constructor(){super(...arguments),this.point=null}};r([o({type:t,json:{name:"point.value",read:!0,write:!0}})],p.prototype,"point",void 0),p=r([s("esri.rest.support.ImagePointResult")],p);const a=p;export{a as default};
|
package/support/arcadeUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../geometry.js";import{p as e,c as r,e as n,a as t,r as o,l as s,b as i,d as a,f as u,s as l,g as c}from"../chunks/arcade.js";export{h as arcade}from"../chunks/arcade.js";import f from"../arcade/Dictionary.js";import p from"../arcade/Feature.js";import{m,x as y,k as d,c as v,a as g,b as x,w as j,T as w,U as b}from"../chunks/languageUtils.js";import{clone as E}from"../core/lang.js";import{isSizeVariable as F}from"../renderers/visualVariables/support/sizeVariableUtils.js";import S from"../geometry/Point.js";import $ from"../geometry/Polygon.js";import R from"../geometry/Polyline.js";import k from"../geometry/Multipoint.js";import z from"../geometry/Extent.js";const C=/^\$(feature|aggregatedFeatures)\./i,M={vars:{$feature:"any",$view:"any"},spatialReference:null};function P(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function I(e){return null==e?null:m(e)||y(e)?"array":d(e)?"date":v(e)?"text":g(e)?"boolean":x(e)?"number":e instanceof f?"dictionary":j(e)?"feature":e instanceof S?"point":e instanceof $?"polygon":e instanceof R?"polyline":e instanceof k?"multipoint":e instanceof z?"extent":w(e)?"featureSet":b(e)?"featureSetCollection":null}function A(r){if(!r)return null;try{return e(r)}catch(n){}return null}function G(e,n){const t="string"==typeof e?A(e):e;if(!t)return null;try{return n=n||E(M),r(t,n)}catch(o){}return null}function T(e,r){return{vars:{$feature:null==e?new p:p.createFromGraphic(e),$view:r&&r.view},spatialReference:r&&r.sr}}function U(e,r,n){return p.createFromGraphicLikeObject(r,e,n)}function V(e,r){null!=e.vars&&(e.vars.$feature=r)}function L(e,r){let t;try{t=n(e,r)}catch(o){t=null}return t}function q(e,r){let n;try{n=e?e(r):null}catch(t){n=null}return n}function D(e,r){try{return e?e(r):Promise.resolve(null)}catch(n){return Promise.resolve(null)}}function J(e,r){if(!e)return[];const n="string"==typeof e?A(e):e;if(!n)return[];const o=t(n);let s=new Array;o.forEach((e=>{C.test(e)&&(e=e.replace(C,""),s.push(e))}));const i=s.filter((e=>e.includes("*")));return s=s.filter((e=>!i.includes(e))),r&&i.forEach((e=>{const n=new RegExp(`^${e.split(/\*+/).map(P).join(".*")}$`,"i");r.forEach((e=>n.test(e)?s.push(e):null))})),[...new Set(s.sort())]}function O(e){return o(e,"$view")}function B(e,r){return!!e&&o(e,r)}function H(e){if(!e||null==e.spatialReference&&(null==e.scale||null==e.viewingMode))return;return{view:e.viewingMode&&null!=e.scale?new f({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function K({url:e,spatialReference:r,lrucache:n,interceptor:t}){const o=u();return o?o.createFeatureSetCollectionFromService(e,r,n,t):null}function N({layer:e,spatialReference:r,outFields:n,returnGeometry:t,lrucache:o,interceptor:s}){if(null===e)return null;const i=u();return i?i.constructFeatureSet(e,r,n,t??!0,o,s):null}function Q(e){if(null===e?.map)return null;const r=u();return r?r.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function W(e){return f.convertJsonToArcade(e)}function X(e,r,n=[]){return s(e,r,n)}function Y(){return i()}function Z(){return a()}function _(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type||"dot-density"===e.type||"dictionary"===e.type||"pie-chart"===e.type}function ee(e){return"esri.layers.support.LabelClass"===e.declaredClass}function re(e){return"esri.PopupTemplate"===e.declaredClass}function ne(e,r){if(!e)return!1;if("string"==typeof e)return r(e);const n=e;if(_(n)){if("dot-density"===n.type){const e=n.attributes?.some((e=>r(e.valueExpression)));if(e)return e}const e=n.visualVariables,t=!!e&&e.some((e=>{let n=r(e.valueExpression);return"size"===e.type&&(F(e.minSize)&&(n=n||r(e.minSize.valueExpression)),F(e.maxSize)&&(n=n||r(e.maxSize.valueExpression))),n}));return!(!("valueExpression"in n)||!r(n.valueExpression))||t}if(ee(n)){const e=n.labelExpressionInfo&&n.labelExpressionInfo.expression;return!(!e||!r(e))||!1}return!!re(n)&&(!!n.expressionInfos&&n.expressionInfos.some((e=>r(e.expression)))||Array.isArray(n.content)&&n.content.some((e=>"expression"===e.type&&r(e.expressionInfo?.expression))))}function te(e){const r=A(e);return!!r&&l(r)}function oe(e){return ne(e,te)}function se(e){const r=A(e);return!!r&&c(r)}function ie(e){return ne(e,se)}export{f as Dictionary,p as arcadeFeature,N as convertFeatureLayerToFeatureSet,W as convertJsonToArcade,Q as convertMapToFeatureSetCollection,K as convertServiceUrlToWorkspace,T as createExecContext,U as createFeature,G as createFunction,A as createSyntaxTree,O as dependsOnView,Z as enableFeatureSetOperations,Y as enableGeometryOperations,L as evalSyntaxTree,D as executeAsyncFunction,q as executeFunction,J as extractFieldNames,I as getArcadeType,H as getViewInfo,oe as hasGeometryFunctions,ie as hasGeometryOperations,B as hasVariable,X as loadScriptDependencies,V as updateExecContext};
|
|
5
|
+
import"../geometry.js";import{p as e,c as r,e as n,a as t,r as o,l as s,b as i,d as a,f as u,s as l,g as c}from"../chunks/arcade.js";export{h as arcade}from"../chunks/arcade.js";import f from"../arcade/Dictionary.js";import p from"../arcade/Feature.js";import{m,x as y,k as d,c as v,a as g,b as x,w as j,T as w,U as b}from"../chunks/languageUtils.js";import{clone as E}from"../core/lang.js";import{isSizeVariable as F}from"../renderers/visualVariables/support/sizeVariableUtils.js";import S from"../geometry/Point.js";import $ from"../geometry/Polygon.js";import R from"../geometry/Polyline.js";import k from"../geometry/Multipoint.js";import z from"../geometry/Extent.js";const C=/^\$(feature|aggregatedFeatures)\./i,M={vars:{$feature:"any",$view:"any"},spatialReference:null};function P(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function I(e){return null==e?null:m(e)||y(e)?"array":d(e)?"date":v(e)?"text":g(e)?"boolean":x(e)?"number":e instanceof f?"dictionary":j(e)?"feature":e instanceof S?"point":e instanceof $?"polygon":e instanceof R?"polyline":e instanceof k?"multipoint":e instanceof z?"extent":w(e)?"featureSet":b(e)?"featureSetCollection":null}function A(r){if(!r)return null;try{return e(r)}catch(n){}return null}function G(e,n){const t="string"==typeof e?A(e):e;if(!t)return null;try{return n=n||E(M),r(t,n)}catch(o){}return null}function T(e,r){return{vars:{$feature:null==e?new p:p.createFromGraphic(e),$view:r&&r.view},spatialReference:r&&r.sr}}function U(e,r,n){return p.createFromGraphicLikeObject(r,e,n)}function V(e,r){null!=e.vars&&(e.vars.$feature=r)}function L(e,r){let t;try{t=n(e,r)}catch(o){t=null}return t}function q(e,r){let n;try{n=e?e(r):null}catch(t){n=null}return n}function D(e,r){try{return e?e(r):Promise.resolve(null)}catch(n){return Promise.resolve(null)}}function J(e,r){if(!e)return[];const n="string"==typeof e?A(e):e;if(!n)return[];const o=t(n);let s=new Array;o.forEach((e=>{C.test(e)&&(e=e.replace(C,""),s.push(e))}));const i=s.filter((e=>e.includes("*")));return s=s.filter((e=>!i.includes(e))),r&&i.forEach((e=>{const n=new RegExp(`^${e.split(/\*+/).map(P).join(".*")}$`,"i");r.forEach((e=>n.test(e)?s.push(e):null))})),[...new Set(s.sort())]}function O(e){return o(e,"$view")}function B(e,r){return!!e&&o(e,r)}function H(e){if(!e||null==e.spatialReference&&(null==e.scale||null==e.viewingMode))return;return{view:e.viewingMode&&null!=e.scale?new f({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function K({url:e,spatialReference:r,lrucache:n,interceptor:t}){const o=u();return o?o.createFeatureSetCollectionFromService(e,r,n,t):null}function N({layer:e,spatialReference:r,outFields:n,returnGeometry:t,lrucache:o,interceptor:s}){if(null===e)return null;const i=u();return i?i.constructFeatureSet(e,r,n,t??!0,o,s):null}function Q(e){if(null===e?.map)return null;const r=u();return r?r.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function W(e,r){return f.convertJsonToArcade(e,r)}function X(e,r,n=[]){return s(e,r,n)}function Y(){return i()}function Z(){return a()}function _(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type||"dot-density"===e.type||"dictionary"===e.type||"pie-chart"===e.type}function ee(e){return"esri.layers.support.LabelClass"===e.declaredClass}function re(e){return"esri.PopupTemplate"===e.declaredClass}function ne(e,r){if(!e)return!1;if("string"==typeof e)return r(e);const n=e;if(_(n)){if("dot-density"===n.type){const e=n.attributes?.some((e=>r(e.valueExpression)));if(e)return e}const e=n.visualVariables,t=!!e&&e.some((e=>{let n=r(e.valueExpression);return"size"===e.type&&(F(e.minSize)&&(n=n||r(e.minSize.valueExpression)),F(e.maxSize)&&(n=n||r(e.maxSize.valueExpression))),n}));return!(!("valueExpression"in n)||!r(n.valueExpression))||t}if(ee(n)){const e=n.labelExpressionInfo&&n.labelExpressionInfo.expression;return!(!e||!r(e))||!1}return!!re(n)&&(!!n.expressionInfos&&n.expressionInfos.some((e=>r(e.expression)))||Array.isArray(n.content)&&n.content.some((e=>"expression"===e.type&&r(e.expressionInfo?.expression))))}function te(e){const r=A(e);return!!r&&l(r)}function oe(e){return ne(e,te)}function se(e){const r=A(e);return!!r&&c(r)}function ie(e){return ne(e,se)}export{f as Dictionary,p as arcadeFeature,N as convertFeatureLayerToFeatureSet,W as convertJsonToArcade,Q as convertMapToFeatureSetCollection,K as convertServiceUrlToWorkspace,T as createExecContext,U as createFeature,G as createFunction,A as createSyntaxTree,O as dependsOnView,Z as enableFeatureSetOperations,Y as enableGeometryOperations,L as evalSyntaxTree,D as executeAsyncFunction,q as executeFunction,J as extractFieldNames,I as getArcadeType,H as getViewInfo,oe as hasGeometryFunctions,ie as hasGeometryOperations,B as hasVariable,X as loadScriptDependencies,V as updateExecContext};
|
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const a="20230113",c="8559a9366e4f2245dac1f05db0ab22559c700ae6";export{a as buildDate,c as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{legacyTimeZoneMap as t}from"./legacyTimeZoneMap.js";import{DateTime as e,FixedOffsetZone as n}from"luxon";function o(e){if(!e||!t.has(e.timeZone))return
|
|
5
|
+
import{legacyTimeZoneMap as t}from"./legacyTimeZoneMap.js";import{DateTime as e,FixedOffsetZone as n}from"luxon";function o(e,n="system"){if(!e||!t.has(e.timeZone))return n;const o=t.get(e.timeZone);return s(e.timeZone)||e.respectsDaylightSaving?o:r(o)}function r(t){const o=e.local().setZone(t),r=Math.min(o.set({month:1,day:1}).offset,o.set({month:5}).offset);if(0===r)return"Etc/UTC";return`Etc/GMT${n.instance(-r).formatOffset(0,"narrow")}`}function s(t){return t.startsWith("UTC")}export{o as convertLegacyTimeZone};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Logger.js";import{isPowerOfTwo as s}from"../../../../core/mathUtils.js";import{disposeMaybe as i,isSome as o,isNone as n}from"../../../../core/maybe.js";import{getProjectiveTransform as a}from"../../../../core/perspectiveUtils.js";import{watch as m,when as h,initial as c}from"../../../../core/reactiveUtils.js";import{c as
|
|
5
|
+
import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Logger.js";import{isPowerOfTwo as s}from"../../../../core/mathUtils.js";import{disposeMaybe as i,isSome as o,isNone as n}from"../../../../core/maybe.js";import{getProjectiveTransform as a}from"../../../../core/perspectiveUtils.js";import{watch as m,when as h,initial as c}from"../../../../core/reactiveUtils.js";import{c as p}from"../../../../chunks/mat3f64.js";import{s as l}from"../../../../chunks/vec2.js";import{a as d}from"../../../../chunks/vec2f64.js";import{DisplayObject as u}from"../DisplayObject.js";import{BufferObject as f}from"../../../webgl/BufferObject.js";import{ContextType as g}from"../../../webgl/context-util.js";import{PixelFormat as w,PixelType as y,TextureSamplingMode as v,TextureWrapMode as _,Usage as j}from"../../../webgl/enums.js";import{Texture as x}from"../../../webgl/Texture.js";import{VertexArrayObject as V}from"../../../webgl/VertexArrayObject.js";const b=p();class A extends u{constructor(s){super(),this.elementView=s,this.isWrapAround=!1,this.perspectiveTransform=d(),this._vertices=new Float32Array(20),this._handles=[],this._handles.push(m((()=>this.elementView.element.opacity),(e=>this.opacity=e),c),m((()=>[this.elementView.coords]),(()=>{this.requestRender()}),c),h((()=>this.elementView.element.loaded),(()=>{const e=this.elementView.element;this.ready(),"video"===e.type&&o(e.content)&&this._handles.push(t(e.content,"play",(()=>this.requestRender())))}),c)),s.element.load().catch((t=>{r.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new e("element-load-error","Element cannot be displayed",{element:s,error:t}))}))}destroy(){this._handles.forEach((e=>e.remove())),this.texture=i(this.texture)}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(o(r)){const e=r instanceof HTMLImageElement,i=r instanceof HTMLVideoElement,o=e?r.naturalWidth:i?r.videoWidth:r.width,n=e?r.naturalHeight:i?r.videoHeight:r.height;this._updatePerspectiveTransform(o,n),this.texture?i&&!r.paused&&(this.texture.setData(r),this.requestRender(),(t.type===g.WEBGL2||s(o)&&s(n))&&this.texture.generateMipmap()):(this.texture=new x(t,{pixelFormat:w.RGBA,dataType:y.UNSIGNED_BYTE,samplingMode:v.LINEAR,wrapMode:_.CLAMP_TO_EDGE,width:o,height:n,preMultiplyAlpha:!0},r),(t.type===g.WEBGL2||s(o)&&s(n))&&this.texture.generateMipmap(),i&&!r.paused&&this.requestRender())}super.beforeRender(e)}_createTransforms(){return null}updateDrawCoords(e,t){const r=this.elementView.coords;if(n(r))return;const[s,i,o,a]=r.rings[0],m=this._vertices,{x:h,y:c}=e,p=0!==t;p?m.set([i[0]-h,i[1]-c,s[0]-h,s[1]-c,o[0]-h,o[1]-c,a[0]-h,a[1]-c,a[0]-h,a[1]-c,i[0]+t-h,i[1]-c,i[0]+t-h,i[1]-c,s[0]+t-h,s[1]-c,o[0]+t-h,o[1]-c,a[0]+t-h,a[1]-c]):m.set([i[0]-h,i[1]-c,s[0]-h,s[1]-c,o[0]-h,o[1]-c,a[0]-h,a[1]-c]),this.isWrapAround=p}getVAO(e,t,r){if(n(this.elementView.coords))return null;const s=this._vertices;if(this._vao)this._geometryVbo.setData(s);else{this._geometryVbo=f.createVertex(e,j.DYNAMIC_DRAW,s);const i=f.createVertex(e,j.STATIC_DRAW,new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]));this._vao=new V(e,r,t,{geometry:this._geometryVbo,tex:i})}return this._vao}_updatePerspectiveTransform(e,t){const r=this._vertices;a(b,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),l(this.perspectiveTransform,b[6]/b[8]*e,b[7]/b[8]*t)}}export{A 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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import r from"../../../Graphic.js";import i from"../../../core/Collection.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{clone as a}from"../../../core/lang.js";import n from"../../../core/Logger.js";import{applySome as o,isSome as l,destroyMaybe as u,unwrap as h,removeMaybe as d,isNone as c}from"../../../core/maybe.js";import{debounce as p,isAbortError as y}from"../../../core/promiseUtils.js";import{watch as g,whenOnce as f,syncAndInitial as m,initial as _}from"../../../core/reactiveUtils.js";import{property as v}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import R from"../../../layers/effects/FeatureEffectView.js";import S from"../../../layers/support/FeatureFilter.js";import w from"../../../rest/support/AggregateFeatureSet.js";import x from"../../../rest/support/FeatureSet.js";import U from"../../../rest/support/Query.js";import{MAX_FILTERS as C}from"../engine/webgl/definitions.js";import{LayerView2DMixin as F}from"./LayerView2D.js";import{createSchema as q}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as I}from"./features/tileRenderers.js";import{isRendererSupported as E}from"./features/support/rendererUtils.js";import{findSizeVV as O,createClusterCountSizeVariable as T,injectDynamicLevelDependentSizeVisualVariable as V,isClusterCompatibleRenderer as j,createClusterRenderer as A}from"./support/clusterUtils.js";import Q from"./support/FeatureCommandQueue.js";import L from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as N}from"./support/util.js";import{TileManager as k}from"../tiling/TileManager.js";import P from"../../layers/FeatureLayerView.js";import H from"../../layers/LayerView.js";import z from"../../layers/RefreshableLayerView.js";import{getWebGLCapabilities as J}from"../../webgl/capabilities.js";import M from"../../../geometry/Extent.js";function B(e){return e&&"openPorts"in e}let $=class extends(P(z(F(H)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new Q({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=p((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new R,this._lastDefinitionExpression=null}destroy(){o(this._updateClusterSizeTask,(e=>e.remove())),this._proxy?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.handles.add([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),g((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),m)]),this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new s("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});const t="feature"===e.type||"subtype-group"===e.type,r="capabilities"in e&&e.capabilities.operations.supportsQuery;if(t&&!r)throw new s("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const i=this._createClientOptions();return this._set("_proxy",new L({client:i})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get orderByFields(){return"stream"!==this._serviceOptions?.type?this._serviceOptions?.orderByFields:void 0}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions?.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,r=this.view.floors,{definitionExpression:i}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="gdbVersion"in t?t.gdbVersion:void 0,o="historicMoment"in t?t.historicMoment?.getTime():void 0,{timeExtent:u}=this,h="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,c="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,p=JSON.stringify(this.clips),y="featureReduction"in t?t.featureReduction?.toJSON():null,g="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),f="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),m="subtypeCode"in this.layer&&this.layer.subtypeCode;return JSON.stringify({orderBy:g,sublayerHash:f,subtypeCode:m,filterHash:l(this.filter)&&this.filter.toJSON(),effectHash:l(this.featureEffect)&&this.featureEffect.toJSON(),streamFilter:c,gdbVersion:n,definitionExpression:i,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:u,floors:r,clipsHash:p,featureReduction:y,customParameters:h,apiKey:d})}highlight(e){let t;e instanceof r?t=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?t=[e]:i.isCollection(e)&&e.length>0?t=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(t="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const s=t?.filter(l);return s&&s.length?(this._addHighlight(s),{remove:()=>this._removeHighlight(s)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,i){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(i);if(0===s.length)return null;const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((r=>this._createGraphicHit(e,t.fromJSON(r)))),...a.map((t=>this._createGraphicHit(e,r.fromJSON(t))))]}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),i,r)}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateSummaryStatistics(this._cleanUpAggregateQuery(e),i,r)}async queryUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),i,r)}async queryAggregateUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateUniqueValues(this._cleanUpAggregateQuery(e),i,r)}async queryClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),i,r)}async queryAggregateClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateClassBreaks(this._cleanUpAggregateQuery(e),i,r)}async queryHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),i,r)}async queryAggregateHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateHistogram(this._cleanUpAggregateQuery(e),i,r)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=x.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=x.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryAggregates(e,t){const r=await this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t),i=w.fromJSON(r);return i.features.forEach((e=>this._setLayersForFeature(e))),i}queryAggregateIds(e,t){return this._proxy.queryAggregateIds(this._cleanUpAggregateQuery(e),t)}queryAggregateCount(e,t){return this._proxy.queryAggregateCount(this._cleanUpAggregateQuery(e),t)}queryAggregateJSON(e,t){return this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t)}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:M.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:r,removed:i}=this._tileStrategy.update(e);(r.length||i.length)&&this._proxy.updateTiles({added:r,removed:i}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new k({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.handles.add(g((()=>this.renderingConfigHash),(()=>this._update()),_),"attach"),"stream"!==this.layer.type&&this.handles.add(this.layer.on("edits",(e=>this._edit(e))),"attach")}detach(){this._commandsQueue.clear(),this._proxy?.stop(),this.container.removeAllChildren(),this.handles.remove("attach"),this.tileRenderer?.uninstall(this.container),this.tileRenderer=null,this._tileStrategy=u(this._tileStrategy),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updating,r=null!=this._updatingRequiredFieldsPromise,i=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,a=null==this.tileRenderer||this.tileRenderer?.updating,n=e&&(t||r||i||s||a);return has("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${n}\n -> hasRenderer ${e}\n -> hasPendingCommand ${t}\n -> updatingRequiredFields ${r}\n -> updatingProxy ${i}\n -> updatingPipeline ${s}\n -> updatingTileRenderer ${a}\n`),n}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){const t="path"in e,r="editingInfo"in this.layer&&this.layer.editingInfo?.lastEditDate,i="refreshInterval"in this.layer&&!!this.layer.refreshInterval,s=!r&&i;if(t&&("feature"===this.layer.type||"subtype-group"===this.layer.type)&&"point"===this.layer.geometryType&&this.layer.capabilities.query.supportsPagination&&!this.layer.capabilities.operations.supportsEditing&&!s&&has("featurelayer-snapshot-enabled"))try{const e=await this.layer.queryFeatureCount();if(e<=has("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=has("featurelayer-snapshot-point-max-threshold"),r=has("featurelayer-snapshot-point-coverage"),i=this.view.extent,s=h(this.layer.fullExtent),a=s?.clone().intersection(i),n=l(a)?a.width*a.height:0,o=s?.width*s?.height;if(e<=t&&(0===o?0:n/o)>=r)return{mode:"snapshot",featureCount:e}}catch(a){n.getLogger(this.declaredClass).warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:a})}return{mode:"on-demand"}}async _createServiceOptions(){const e=this.layer;if("stream"===e.type)return null;const{capabilities:t,objectIdField:r}=e,i=e.fields.map((e=>e.toJSON())),s=l(e.fullExtent)?e.fullExtent.toJSON():null,n=N(e.geometryType),o="timeInfo"in e&&e.timeInfo&&e.timeInfo.toJSON()||null,u=e.spatialReference?e.spatialReference.toJSON():null,h="feature"===e.type?e.globalIdField:null;let d;"ogc-feature"===e.type?d=e.source.getSource():B(e.source)?d=await e.source.openPorts():e.parsedUrl&&(d=a(e.parsedUrl),"dynamicDataSource"in e&&e.dynamicDataSource&&(d.query={layer:JSON.stringify({source:e.dynamicDataSource})}));const c="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,p=("subtypeField"in this.layer?this.layer.subtypeField:null)??null,{mode:y,featureCount:g}=await this._detectQueryMode(d);let f=this.layer.objectIdField;if("feature"===this.layer.type&&l(this.layer.orderBy)&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(f=e)}return{type:y,timeReferenceUnknownClient:c,subtypeField:p,featureCount:g,globalIdField:h,maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,capabilities:t,fields:i,fullExtent:s,geometryType:n,objectIdField:r,source:d,timeInfo:o,spatialReference:u,orderByFields:f}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=U.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_cleanUpAggregateQuery(e){const t=U.from(e)||this.createAggregateQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._clearTiles();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this.attached&&this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),i=t&&this.availableFields.includes(t);return r&&!i?(n.getLogger(this.declaredClass).error(new s("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:r}=this;if(await this._updateRequiredFields(),this.destroyed)return;const{renderer:i}=this._getEffectiveRenderer();this._set("_effectiveRenderer",i);const s=this._createSchemaConfig(),a=this._createConfiguration(s,r,t.filter),o=this._lastDefinitionExpression!==a.schema.source.definitionExpression;this._lastDefinitionExpression=a.schema.source.definitionExpression;const l=a.schema.tileRenderer,u=this._createTileRendererHash(l);if("snapshot"===this._serviceOptions.type&&(a.schema.source.initialFeatureCount=this._serviceOptions.featureCount),u!==this._tileRendererHash){await this._initTileRenderer(l,i);const e=this.layer,t="stream"===e.type?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(i),"stream"!==e.type&&B(e.source)&&(t.source=await e.source.openPorts());const r={added:this._tileStrategy.tileKeys(),removed:[]};await this._proxy.startup(this.view.featuresTilingScheme,a,t,r),this.hasHighlight()&&await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),await this._onceTilesUpdated(),this.tileRenderer.onConfigUpdate(i)}else{"snapshot"===this._serviceOptions.type&&o&&(a.schema.source.changedFeatureCount=await this.layer.queryFeatureCount());const t=await this._proxy.update(a);(t.mesh||t.targets?.aggregate)&&this._lockGPUUploads();try{await this._proxy.applyUpdate(t)}catch(e){y(e)||n.getLogger(this.declaredClass).error(e)}(t.mesh||t.targets?.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(i),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=u,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){y(t),0}}async _doRefresh(e){this._lockGPUUploads();try{let t;e&&"snapshot"===this.queryMode&&"queryFeatureCount"in this.layer&&(t=await this.layer.queryFeatureCount()),await this._proxy.refresh({dataChanged:e,featureCount:t})}catch(r){y(r),0}this._unlockGPUUploads();const t=this.layer;t&&"featureReduction"in t&&t.featureReduction&&this._updateClusterSizeVariable()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return g((()=>this._aggregateValueRanges),(r=>{this._updateClusterEffectiveRendererSizeVariable(e,t,r),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,r){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const i=O(e.visualVariables);if(l(i)&&"cluster_count"===i.field){const s=e.visualVariables.indexOf(i);e.visualVariables[s]=T(t,r);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e=this.layer,t="renderer"in e?e.renderer:null,r="featureReduction"in e?e.featureReduction:null;if(this._updateClusterSizeTask=d(this._updateClusterSizeTask),r&&"renderer"in r&&r.renderer&&!r.renderer.authoringInfo?.isAutoGenerated){const e=r.fields;if("cluster"===r.type){const{renderer:t,didInject:i}=V(r.renderer,r,this._aggregateValueRanges);return i&&(this._updateClusterSizeTask=this._createUpdateClusterSizeTask(t,r)),{renderer:t,aggregateFields:e,featureReduction:r}}return{renderer:r.renderer,aggregateFields:e,featureReduction:r}}if(r&&"cluster"===r.type&&t&&j(t)){const e=r,i=[],s=A(i,t,e,this._aggregateValueRanges,!0);return this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,e),{renderer:s,aggregateFields:i,featureReduction:r}}return{renderer:t,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}async _initTileRenderer(e,t){const r=await I(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer=u(this.tileRenderer)),this.destroyed?null:(this._proxy.tileRenderer=r,this._set("tileRenderer",r),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(t),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=l(e)?e.timeExtent:null,r=l(this.timeExtent)&&l(t)?this.timeExtent.intersection(t):this.timeExtent||t;let i=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=l(e)?e.where:null;i=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!r&&!s)return l(e)?e.toJSON():null;(e=l(e)&&e.clone()||new S).timeExtent=r,i&&(e.where=i);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let r=e||"";if("floorInfo"in t&&t.floorInfo){let e=this.view.floors;if(!e||!e.length)return r;t.floorInfo.viewAllLevelIds?.length&&(e=t.floorInfo.viewAllLevelIds);const i=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));i.push("''");const s=t.floorInfo.floorField;let a="("+s+" IN ({ids}) OR "+s+" IS NULL)";if(a=a.replace("{ids}",i.join(", ")),l(r)&&r.includes(s)){let e=new RegExp("AND \\("+s+".*NULL\\)","g");r=r.replace(e,""),e=new RegExp("\\("+s+".*NULL\\)","g"),r=r.replace(e,""),r=r.replace(/\s+/g," ").trim()}r=""!==r?"("+r+") AND "+a:a}return""!==r?r:null}_createConfiguration(e,t,r){const i="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion??void 0:void 0,a=new Array(C),n=this._injectOverrides(t);a[0]=n,a[1]=l(r)?r.toJSON():null;const o=q(e);if(c(o))return null;const u=J("2d");return{availableFields:this.availableFields,gdbVersion:s,historicMoment:i,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:o,supportsTextureFloat:u.supportsTextureFloat,maxTextureSize:u.maxTextureSize}}_hasRequiredSupport(e){return!("renderer"in e)||E(e.renderer)}_onceTilesUpdated(){return this.requestUpdate(),f((()=>!this._pipelineIsUpdating))}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e=this.layer;return{renderer:"renderer"in e?e.renderer:null,spatialReference:e.spatialReference,timeExtent:"timeExtent"in e?e.timeExtent:null,definitionExpression:e.definitionExpression,featureReduction:"featureReduction"in e?e.featureReduction:null,fields:e.fields,geometryType:e.geometryType,historicMoment:"historicMoment"in e?e.historicMoment:null,labelsVisible:"labelsVisible"in e&&e.labelsVisible,labelingInfo:"labelingInfo"in e?e.labelingInfo:null,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:"gdbVersion"in e?e.gdbVersion:null,pixelBuffer:0,orderBy:"orderBy"in e&&e.orderBy?e.orderBy:null,customParameters:{..."customParameters"in e?e.customParameters:void 0,token:"apiKey"in e?e.apiKey??void 0:void 0},subtypeCode:"subtypeCode"in e?e.subtypeCode:void 0,subtypeField:"subtypeField"in e?e.subtypeField:void 0}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{y(e)||n.getLogger(this.declaredClass).error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{y(e)||n.getLogger(this.declaredClass).error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createGraphicHit(e,t){return this._setLayersForFeature(t),l(t.geometry)&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};e([v()],$.prototype,"_serviceOptions",void 0),e([v()],$.prototype,"_proxy",void 0),e([v()],$.prototype,"_pipelineIsUpdating",void 0),e([v()],$.prototype,"_effectiveRenderer",void 0),e([v()],$.prototype,"_aggregateValueRanges",void 0),e([v()],$.prototype,"_commandsQueue",void 0),e([v()],$.prototype,"featureEffectView",void 0),e([v()],$.prototype,"labelsVisible",null),e([v({readOnly:!0})],$.prototype,"queryMode",null),e([v()],$.prototype,"renderingConfigHash",null),e([v()],$.prototype,"tileRenderer",void 0),e([v()],$.prototype,"updating",void 0),$=e([b("esri.views.2d.layers.FeatureLayerView2D")],$);const G=$;export{G as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import i from"../../../Graphic.js";import r from"../../../core/Collection.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{clone as a}from"../../../core/lang.js";import n from"../../../core/Logger.js";import{applySome as o,isSome as l,destroyMaybe as u,unwrap as h,removeMaybe as d,isNone as c}from"../../../core/maybe.js";import{debounce as p,isAbortError as y}from"../../../core/promiseUtils.js";import{watch as g,whenOnce as f,syncAndInitial as m,initial as _}from"../../../core/reactiveUtils.js";import{property as v}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import R from"../../../layers/effects/FeatureEffectView.js";import S from"../../../layers/support/FeatureFilter.js";import w from"../../../rest/support/AggregateFeatureSet.js";import x from"../../../rest/support/FeatureSet.js";import U from"../../../rest/support/Query.js";import{MAX_FILTERS as C}from"../engine/webgl/definitions.js";import{LayerView2DMixin as F}from"./LayerView2D.js";import{createSchema as q}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as I}from"./features/tileRenderers.js";import{isRendererSupported as O}from"./features/support/rendererUtils.js";import{findSizeVV as E,createClusterCountSizeVariable as T,injectDynamicLevelDependentSizeVisualVariable as V,isClusterCompatibleRenderer as j,createClusterRenderer as A}from"./support/clusterUtils.js";import N from"./support/FeatureCommandQueue.js";import Q from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as L}from"./support/util.js";import{TileManager as k}from"../tiling/TileManager.js";import P from"../../layers/FeatureLayerView.js";import H from"../../layers/LayerView.js";import J from"../../layers/RefreshableLayerView.js";import{getWebGLCapabilities as z}from"../../webgl/capabilities.js";import M from"../../../geometry/Extent.js";function B(e){return e&&"openPorts"in e}let $=class extends(P(J(F(H)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new N({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=p((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new R,this._lastDefinitionExpression=null}destroy(){o(this._updateClusterSizeTask,(e=>e.remove())),this._proxy?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.handles.add([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),g((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),m)]),this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new s("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});const t="feature"===e.type||"subtype-group"===e.type,i="capabilities"in e&&e.capabilities.operations.supportsQuery;if(t&&!i)throw new s("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const r=this._createClientOptions();return this._set("_proxy",new Q({client:r})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get orderByFields(){return"stream"!==this._serviceOptions?.type?this._serviceOptions?.orderByFields:void 0}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions?.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,i=this.view.floors,{definitionExpression:r}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="gdbVersion"in t?t.gdbVersion:void 0,o="historicMoment"in t?t.historicMoment?.getTime():void 0,{timeExtent:u}=this,h="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,c="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,p=JSON.stringify(this.clips),y="featureReduction"in t?t.featureReduction?.toJSON():null,g="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),f="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),m="subtypeCode"in this.layer&&this.layer.subtypeCode;return JSON.stringify({orderBy:g,sublayerHash:f,subtypeCode:m,filterHash:l(this.filter)&&this.filter.toJSON(),effectHash:l(this.featureEffect)&&this.featureEffect.toJSON(),streamFilter:c,gdbVersion:n,definitionExpression:r,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:u,floors:i,clipsHash:p,featureReduction:y,customParameters:h,apiKey:d})}highlight(e){let t;e instanceof i?t=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?t=[e]:r.isCollection(e)&&e.length>0?t=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(t="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const s=t?.filter(l);return s&&s.length?(this._addHighlight(s),{remove:()=>this._removeHighlight(s)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,r){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(r);if(0===s.length)return null;const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((i=>this._createGraphicHit(e,t.fromJSON(i)))),...a.map((t=>this._createGraphicHit(e,i.fromJSON(t))))]}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),r,i)}async queryAggregateSummaryStatistics(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryAggregateSummaryStatistics(this._cleanUpAggregateQuery(e),r,i)}async queryUniqueValues(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),r,i)}async queryAggregateUniqueValues(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryAggregateUniqueValues(this._cleanUpAggregateQuery(e),r,i)}async queryClassBreaks(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),r,i)}async queryAggregateClassBreaks(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryAggregateClassBreaks(this._cleanUpAggregateQuery(e),r,i)}async queryHistogram(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),r,i)}async queryAggregateHistogram(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryAggregateHistogram(this._cleanUpAggregateQuery(e),r,i)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=x.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=x.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryAggregates(e,t){const i=await this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t),r=w.fromJSON(i);return r.features.forEach((e=>this._setLayersForFeature(e))),r}queryAggregateIds(e,t){return this._proxy.queryAggregateIds(this._cleanUpAggregateQuery(e),t)}queryAggregateCount(e,t){return this._proxy.queryAggregateCount(this._cleanUpAggregateQuery(e),t)}queryAggregateJSON(e,t){return this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t)}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:M.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:i,removed:r}=this._tileStrategy.update(e);(i.length||r.length)&&this._proxy.updateTiles({added:i,removed:r}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new k({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.handles.add(g((()=>this.renderingConfigHash),(()=>this._update()),_),"attach"),"stream"!==this.layer.type&&this.handles.add(this.layer.on("edits",(e=>this._edit(e))),"attach")}detach(){this._commandsQueue.clear(),this._proxy?.stop(),this.container.removeAllChildren(),this.handles.remove("attach"),this.tileRenderer?.uninstall(this.container),this.tileRenderer=null,this._tileStrategy=u(this._tileStrategy),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updating,i=null!=this._updatingRequiredFieldsPromise,r=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,a=null==this.tileRenderer||this.tileRenderer?.updating,n=e&&(t||i||r||s||a);return has("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${n}\n -> hasRenderer ${e}\n -> hasPendingCommand ${t}\n -> updatingRequiredFields ${i}\n -> updatingProxy ${r}\n -> updatingPipeline ${s}\n -> updatingTileRenderer ${a}\n`),n}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){const t="path"in e,i="editingInfo"in this.layer&&this.layer.editingInfo?.lastEditDate,r="refreshInterval"in this.layer&&!!this.layer.refreshInterval,s=!i&&r;if(t&&("feature"===this.layer.type||"subtype-group"===this.layer.type)&&"point"===this.layer.geometryType&&this.layer.capabilities.query.supportsPagination&&!this.layer.capabilities.operations.supportsEditing&&!s&&has("featurelayer-snapshot-enabled"))try{const e=await this.layer.queryFeatureCount();if(e<=has("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=has("featurelayer-snapshot-point-max-threshold"),i=has("featurelayer-snapshot-point-coverage"),r=this.view.extent,s=h(this.layer.fullExtent),a=s?.clone().intersection(r),n=l(a)?a.width*a.height:0,o=s?.width*s?.height;if(e<=t&&(0===o?0:n/o)>=i)return{mode:"snapshot",featureCount:e}}catch(a){n.getLogger(this.declaredClass).warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:a})}return{mode:"on-demand"}}async _createServiceOptions(){const e=this.layer;if("stream"===e.type)return null;const{capabilities:t,objectIdField:i}=e,r=e.fields.map((e=>e.toJSON())),s=l(e.fullExtent)?e.fullExtent.toJSON():null,n=L(e.geometryType),o="timeInfo"in e&&e.timeInfo&&e.timeInfo.toJSON()||null,u=e.spatialReference?e.spatialReference.toJSON():null,h="feature"===e.type?e.globalIdField:null;let d;"ogc-feature"===e.type?d=e.source.getSource():B(e.source)?d=await e.source.openPorts():e.parsedUrl&&(d=a(e.parsedUrl),"dynamicDataSource"in e&&e.dynamicDataSource&&(d.query={layer:JSON.stringify({source:e.dynamicDataSource})}));const c="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,p=("subtypeField"in this.layer?this.layer.subtypeField:null)??null,{mode:y,featureCount:g}=await this._detectQueryMode(d);let f=this.layer.objectIdField;if("feature"===this.layer.type&&l(this.layer.orderBy)&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(f=e)}return{type:y,timeReferenceUnknownClient:c,subtypeField:p,featureCount:g,globalIdField:h,maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,capabilities:t,fields:r,fullExtent:s,geometryType:n,objectIdField:i,source:d,timeInfo:o,spatialReference:u,orderByFields:f,datesInUnknownTimezone:c,dateFieldsTimeReference:("dateFieldsTimeReference"in this.layer?this.layer.dateFieldsTimeReference?.toJSON():null)||null,preferredTimeReference:("preferredTimeReference"in this.layer?this.layer.preferredTimeReference?.toJSON():null)||null,editFieldsInfo:"editFieldsInfo"in this.layer?this.layer.editFieldsInfo?.toJSON():null}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=U.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_cleanUpAggregateQuery(e){const t=U.from(e)||this.createAggregateQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._clearTiles();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this.attached&&this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,i=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),r=t&&this.availableFields.includes(t);return i&&!r?(n.getLogger(this.declaredClass).error(new s("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:i}=this;if(await this._updateRequiredFields(),this.destroyed)return;const{renderer:r}=this._getEffectiveRenderer();this._set("_effectiveRenderer",r);const s=this._createSchemaConfig(),a=this._createConfiguration(s,i,t.filter),o=this._lastDefinitionExpression!==a.schema.source.definitionExpression;this._lastDefinitionExpression=a.schema.source.definitionExpression;const l=a.schema.tileRenderer,u=this._createTileRendererHash(l);if("snapshot"===this._serviceOptions.type&&(a.schema.source.initialFeatureCount=this._serviceOptions.featureCount),u!==this._tileRendererHash){await this._initTileRenderer(l,r);const e=this.layer,t="stream"===e.type?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(r),"stream"!==e.type&&B(e.source)&&(t.source=await e.source.openPorts());const i={added:this._tileStrategy.tileKeys(),removed:[]};await this._proxy.startup(this.view.featuresTilingScheme,a,t,i),this.hasHighlight()&&await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),await this._onceTilesUpdated(),this.tileRenderer.onConfigUpdate(r)}else{"snapshot"===this._serviceOptions.type&&o&&(a.schema.source.changedFeatureCount=await this.layer.queryFeatureCount());const t=await this._proxy.update(a);(t.mesh||t.targets?.aggregate)&&this._lockGPUUploads();try{await this._proxy.applyUpdate(t)}catch(e){y(e)||n.getLogger(this.declaredClass).error(e)}(t.mesh||t.targets?.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(r),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=u,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){y(t),0}}async _doRefresh(e){this._lockGPUUploads();try{let t;e&&"snapshot"===this.queryMode&&"queryFeatureCount"in this.layer&&(t=await this.layer.queryFeatureCount()),await this._proxy.refresh({dataChanged:e,featureCount:t})}catch(i){y(i),0}this._unlockGPUUploads();const t=this.layer;t&&"featureReduction"in t&&t.featureReduction&&this._updateClusterSizeVariable()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return g((()=>this._aggregateValueRanges),(i=>{this._updateClusterEffectiveRendererSizeVariable(e,t,i),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,i){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const r=E(e.visualVariables);if(l(r)&&"cluster_count"===r.field){const s=e.visualVariables.indexOf(r);e.visualVariables[s]=T(t,i);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e=this.layer,t="renderer"in e?e.renderer:null,i="featureReduction"in e?e.featureReduction:null;if(this._updateClusterSizeTask=d(this._updateClusterSizeTask),i&&"renderer"in i&&i.renderer&&!i.renderer.authoringInfo?.isAutoGenerated){const e=i.fields;if("cluster"===i.type){const{renderer:t,didInject:r}=V(i.renderer,i,this._aggregateValueRanges);return r&&(this._updateClusterSizeTask=this._createUpdateClusterSizeTask(t,i)),{renderer:t,aggregateFields:e,featureReduction:i}}return{renderer:i.renderer,aggregateFields:e,featureReduction:i}}if(i&&"cluster"===i.type&&t&&j(t)){const e=i,r=[],s=A(r,t,e,this._aggregateValueRanges,!0);return this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,e),{renderer:s,aggregateFields:r,featureReduction:i}}return{renderer:t,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}async _initTileRenderer(e,t){const i=await I(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer=u(this.tileRenderer)),this.destroyed?null:(this._proxy.tileRenderer=i,this._set("tileRenderer",i),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(t),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=l(e)?e.timeExtent:null,i=l(this.timeExtent)&&l(t)?this.timeExtent.intersection(t):this.timeExtent||t;let r=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=l(e)?e.where:null;r=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!i&&!s)return l(e)?e.toJSON():null;(e=l(e)&&e.clone()||new S).timeExtent=i,r&&(e.where=r);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let i=e||"";if("floorInfo"in t&&t.floorInfo){let e=this.view.floors;if(!e||!e.length)return i;t.floorInfo.viewAllLevelIds?.length&&(e=t.floorInfo.viewAllLevelIds);const r=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));r.push("''");const s=t.floorInfo.floorField;let a="("+s+" IN ({ids}) OR "+s+" IS NULL)";if(a=a.replace("{ids}",r.join(", ")),l(i)&&i.includes(s)){let e=new RegExp("AND \\("+s+".*NULL\\)","g");i=i.replace(e,""),e=new RegExp("\\("+s+".*NULL\\)","g"),i=i.replace(e,""),i=i.replace(/\s+/g," ").trim()}i=""!==i?"("+i+") AND "+a:a}return""!==i?i:null}_createConfiguration(e,t,i){const r="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion??void 0:void 0,a=new Array(C),n=this._injectOverrides(t);a[0]=n,a[1]=l(i)?i.toJSON():null;const o=q(e);if(c(o))return null;const u=z("2d");return{availableFields:this.availableFields,gdbVersion:s,historicMoment:r,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:o,supportsTextureFloat:u.supportsTextureFloat,maxTextureSize:u.maxTextureSize}}_hasRequiredSupport(e){return!("renderer"in e)||O(e.renderer)}_onceTilesUpdated(){return this.requestUpdate(),f((()=>!this._pipelineIsUpdating))}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e=this.layer;return{renderer:"renderer"in e?e.renderer:null,spatialReference:e.spatialReference,timeExtent:"timeExtent"in e?e.timeExtent:null,definitionExpression:e.definitionExpression,featureReduction:"featureReduction"in e?e.featureReduction:null,fields:e.fields,geometryType:e.geometryType,historicMoment:"historicMoment"in e?e.historicMoment:null,labelsVisible:"labelsVisible"in e&&e.labelsVisible,labelingInfo:"labelingInfo"in e?e.labelingInfo:null,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:"gdbVersion"in e?e.gdbVersion:null,pixelBuffer:0,orderBy:"orderBy"in e&&e.orderBy?e.orderBy:null,customParameters:{..."customParameters"in e?e.customParameters:void 0,token:"apiKey"in e?e.apiKey??void 0:void 0},subtypeCode:"subtypeCode"in e?e.subtypeCode:void 0,subtypeField:"subtypeField"in e?e.subtypeField:void 0}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{y(e)||n.getLogger(this.declaredClass).error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{y(e)||n.getLogger(this.declaredClass).error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createGraphicHit(e,t){return this._setLayersForFeature(t),l(t.geometry)&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};e([v()],$.prototype,"_serviceOptions",void 0),e([v()],$.prototype,"_proxy",void 0),e([v()],$.prototype,"_pipelineIsUpdating",void 0),e([v()],$.prototype,"_effectiveRenderer",void 0),e([v()],$.prototype,"_aggregateValueRanges",void 0),e([v()],$.prototype,"_commandsQueue",void 0),e([v()],$.prototype,"featureEffectView",void 0),e([v()],$.prototype,"labelsVisible",null),e([v({readOnly:!0})],$.prototype,"queryMode",null),e([v()],$.prototype,"renderingConfigHash",null),e([v()],$.prototype,"tileRenderer",void 0),e([v()],$.prototype,"updating",void 0),$=e([b("esri.views.2d.layers.FeatureLayerView2D")],$);const G=$;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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../core/CircularArray.js";import e from"../../../../core/Evented.js";import"../../../../core/has.js";import{isNone as s,isSome as a,unwrap as r}from"../../../../core/maybe.js";import{r as n}from"../../../../chunks/rbush.js";import{
|
|
5
|
+
import t from"../../../../core/CircularArray.js";import e from"../../../../core/Evented.js";import"../../../../core/has.js";import{isNone as s,isSome as a,unwrap as r}from"../../../../core/maybe.js";import{r as n}from"../../../../chunks/rbush.js";import{create as i,fromRectValues as o}from"../../../../geometry/support/aaBoundingBox.js";import{Store2D as d}from"./Store2D.js";import{FeatureSetReaderIndirect as h}from"./support/FeatureSetReaderPBFIndirect.js";const c=i();function I(t,e){return t<<16|e}function u(t){return(4294901760&t)>>>16}function l(t){return 65535&t}const p={getObjectId:t=>t.getObjectId(),getAttributes:t=>t.readAttributes(),getAttribute:(t,e)=>t.readAttribute(e),cloneWithGeometry:(t,e)=>t,getGeometry:t=>t.readHydratedGeometry(),getCentroid:(t,e)=>t.readCentroid()};class g extends d{constructor(s,a,r){super(s,a),this.featureAdapter=p,this.events=new e,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new t(50),this._index=n(9,(t=>({minX:this._storage.getXMin(t),minY:this._storage.getYMin(t),maxX:this._storage.getXMax(t),maxY:this._storage.getYMax(t)}))),this.mode=r}get storeStatistics(){let t=0,e=0,s=0;return this.forEach((a=>{const r=a.readGeometry();r&&(e+=r.isPoint?1:r.lengths.reduce(((t,e)=>t+e),0),s+=r.isPoint?1:r.lengths.length,t+=1)})),{featureCount:t,vertexCount:e,ringCount:s}}hasInstance(t){return this._featureSetsByInstance.has(t)}onTileData(t,e){if(s(e.addOrUpdate))return e;if(e.addOrUpdate.attachStorage(this._storage),"snapshot"===this.mode){const s=e.addOrUpdate.getCursor();for(;s.next();){const e=s.getDisplayId();this.setComputedAttributes(this._storage,s,e,t.scale)}return e}this._featureSetsByInstance.set(e.addOrUpdate.instance,e.addOrUpdate);const a=e.addOrUpdate.getCursor();for(;a.next();)this._insertFeature(a,t.scale);return this._spatialIndexInvalid=!0,this.events.emit("changed"),e}search(t){this._rebuildIndex();const e=t.id,s=this._indexSearchCache.find((t=>t.tileId===e));if(a(s))return s.readers;const r=new Map,n=this._searchIndex(t.bounds),i=[];for(const a of n){const t=this._storage.getInstanceId(a),e=u(t),s=l(t);r.has(e)||r.set(e,[]);r.get(e).push(s)}return r.forEach(((t,e)=>{const s=this._featureSetsByInstance.get(e);i.push(h.from(s,t))})),this._indexSearchCache.enqueue({tileId:e,readers:i}),i}insert(t){const e=t.getCursor(),s=this._storage;for(;e.next();){const t=I(e.instance,e.getIndex()),a=e.getObjectId(),r=this._objectIdToDisplayId.get(a)??this._storage.createDisplayId();e.setDisplayId(r),s.setInstanceId(r,t),this._objectIdToDisplayId.set(a,r)}this._featureSetsByInstance.set(t.instance,t),this._spatialIndexInvalid=!0}remove(t){const e=this._objectIdToDisplayId.get(t);if(!e)return;const s=this._storage.getInstanceId(e),a=l(s),r=u(s),n=this._featureSetsByInstance.get(r);this._objectIdToDisplayId.delete(t),this._storage.releaseDisplayId(e),n.removeAtIndex(a),n.isEmpty&&this._featureSetsByInstance.delete(r),this._spatialIndexInvalid=!0}forEach(t){this._objectIdToDisplayId.forEach((e=>{const s=this._storage.getInstanceId(e),a=this._lookupFeature(s);t(a)}))}forEachUnsafe(t){this._objectIdToDisplayId.forEach((e=>{const s=this._storage.getInstanceId(e),a=u(s),r=l(s),n=this._getFeatureSet(a);n.setIndex(r),t(n)}))}forEachInBounds(t,e){const s=this._searchIndex(t);for(const a of s){const t=this.lookupFeatureByDisplayId(a,this._storage);e(r(t))}}forEachBounds(t,e){this._rebuildIndex();for(const s of t){if(!s.readGeometry())continue;const t=s.getDisplayId();o(c,this._storage.getXMin(t),this._storage.getYMin(t),this._storage.getXMax(t),this._storage.getYMax(t)),e(c)}}sweepFeatures(t,e,s){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach(((a,r)=>{t.has(a)||(e.releaseDisplayId(a),s&&s.unsetAttributeData(a),this._objectIdToDisplayId.delete(r))})),this.events.emit("changed")}sweepFeatureSets(t){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach(((e,s)=>{t.has(s)||this._featureSetsByInstance.delete(s)}))}lookupObjectId(t,e){const a=this.lookupFeatureByDisplayId(t,e);return s(a)?null:a.getObjectId()}lookupDisplayId(t){return this._objectIdToDisplayId.get(t)}lookupFeatureByDisplayId(t,e){const s=e.getInstanceId(t);return this._lookupFeature(s)}lookupByDisplayIdUnsafe(t){const e=this._storage.getInstanceId(t),s=u(e),a=l(e),r=this._getFeatureSet(s);return r?(r.setIndex(a),r):null}_insertFeature(t,e){const s=this._storage,a=t.getObjectId(),r=I(t.instance,t.getIndex());s.getInstanceId(t.getDisplayId());let n=this._objectIdToDisplayId.get(a);n||(n=s.createDisplayId(),this._objectIdToDisplayId.set(a,n),this._spatialIndexInvalid=!0),t.setDisplayId(n),s.setInstanceId(n,r),this.setComputedAttributes(s,t,n,e)}_searchIndex(t){this._rebuildIndex();const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this._index.search(e)}_rebuildIndex(){if(!this._spatialIndexInvalid)return;const t=[];"snapshot"===this.mode?this._featureSetsByInstance.forEach((e=>{const s=e.getCursor();for(;s.next();){const e=s.getDisplayId();this._storage.setBounds(e,s)&&t.push(e)}})):this._objectIdToDisplayId.forEach((e=>{const s=this._storage.getInstanceId(e);this._storage.setBounds(e,this._lookupFeature(s))&&t.push(e)})),this._index.clear(),this._index.load(t),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(t){const e=u(t),s=this._getFeatureSet(e);if(!s)return;const a=s.getCursor(),r=l(t);return a.setIndex(r),a}_getFeatureSet(t){return this._featureSetsByInstance.get(t)}}export{g as FeatureStore2D,p as featureAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../core/HandleOwner.js";import"../../../../core/has.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as i}from"../../../../geometry/support/spatialReferenceUtils.js";import l from"../../../../layers/support/TileInfo.js";import{loadProcessorModule as n}from"./processors.js";import a from"./controllers/FeatureController2D.js";import c from"./support/TileStore.js";import{UpdateToken as p}from"./support/UpdateToken.js";import h from"../../tiling/TileInfoView.js";let d=class extends t{constructor(){super(...arguments),this.controller=null,this.processor=null,this.remoteClient=null,this.tileStore=null,this.service=null,this.viewState=null,this._paused=!1,this._pendingTileUpdates=[]}initialize(){this.handles.add(r((()=>this.updating),(e=>{this.remoteClient.invoke("setUpdating",e).catch((e=>{}))})))}destroy(){this.stop(),this.controller?.destroy(),this.processor?.destroy(),this.controller=this.processor=this.tileStore=this.remoteClient=null}get updating(){return!this.controller||this.controller.updating}stop(){this._paused=!0,Array.isArray(this.service?.source)&&(this.service.source.forEach((e=>e.close())),this.service.source.length=0),this.tileStore?.updateTiles({added:[],removed:this.tileStore.tiles.map((e=>e.id))}),this.tileStore?.destroy(),this.tileStore=null,this._pendingTileUpdates.length=0}async startup({service:e,config:t,tileInfo:r,tiles:s}){if(this._paused=!0,Array.isArray(this.service?.source)&&(this.service.source.forEach((e=>e.close())),this.service.source.length=0),this.service=e,!this.tileStore||!i(this.tileStore.tileScheme.spatialReference,r.spatialReference)){const e=new h(l.fromJSON(r));s.added.length=s.removed.length=0,this.tileStore?.updateTiles({added:[],removed:this.tileStore.tiles.map((e=>e.id))}),this.tileStore?.destroy(),this.tileStore=new c(e),this._pendingTileUpdates.length=0}for(await this._createProcessorAndController(t),await this.update({config:t}),this.controller.resume(),this.tileStore.clear(),this.tileStore.updateTiles(s),this._paused=!1;this._pendingTileUpdates.length;)this.tileStore.updateTiles(this._pendingTileUpdates.pop())}async updateTiles(e){this._paused?this._pendingTileUpdates.push(e):this.tileStore
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../core/HandleOwner.js";import"../../../../core/has.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as i}from"../../../../geometry/support/spatialReferenceUtils.js";import l from"../../../../layers/support/TileInfo.js";import{loadProcessorModule as n}from"./processors.js";import a from"./controllers/FeatureController2D.js";import c from"./support/TileStore.js";import{UpdateToken as p}from"./support/UpdateToken.js";import h from"../../tiling/TileInfoView.js";let d=class extends t{constructor(){super(...arguments),this.controller=null,this.processor=null,this.remoteClient=null,this.tileStore=null,this.service=null,this.viewState=null,this._paused=!1,this._pendingTileUpdates=[]}initialize(){this.handles.add(r((()=>this.updating),(e=>{this.remoteClient.invoke("setUpdating",e).catch((e=>{}))})))}destroy(){this.stop(),this.controller?.destroy(),this.processor?.destroy(),this.controller=this.processor=this.tileStore=this.remoteClient=null}get updating(){return!this.controller||this.controller.updating}stop(){this._paused=!0,Array.isArray(this.service?.source)&&(this.service.source.forEach((e=>e.close())),this.service.source.length=0),this.tileStore?.updateTiles({added:[],removed:this.tileStore.tiles.map((e=>e.id))}),this.tileStore?.destroy(),this.tileStore=null,this._pendingTileUpdates.length=0}async startup({service:e,config:t,tileInfo:r,tiles:s}){if(this._paused=!0,Array.isArray(this.service?.source)&&(this.service.source.forEach((e=>e.close())),this.service.source.length=0),this.service=e,!this.tileStore||!i(this.tileStore.tileScheme.spatialReference,r.spatialReference)){const e=new h(l.fromJSON(r));s.added.length=s.removed.length=0,this.tileStore?.updateTiles({added:[],removed:this.tileStore.tiles.map((e=>e.id))}),this.tileStore?.destroy(),this.tileStore=new c(e),this._pendingTileUpdates.length=0}for(await this._createProcessorAndController(t),await this.update({config:t}),this.controller.resume(),this.tileStore.clear(),this.tileStore.updateTiles(s),this._paused=!1;this._pendingTileUpdates.length;)this.tileStore.updateTiles(this._pendingTileUpdates.pop())}async updateTiles(e){this._paused?this._pendingTileUpdates.push(e):this.tileStore?.updateTiles(e)}async update({config:e}){const t=p.empty();return await Promise.all([this.processor.update(t,e),this.controller.update(t,e)]),t.toJSON()}async applyUpdate(e){return this.controller.applyUpdate(p.create(e))}async _createProcessorAndController(e){await Promise.all([this._handleControllerConfig(e),this._handleProcessorConfig(e)]),this.controller.processor=this.processor}async _handleControllerConfig(e){return this._createController(this.service,e)}async _handleProcessorConfig(e){return this._createProcessor(this.service,e)}async _createController(e,t){this.controller&&this.controller.destroy();const{tileStore:r,remoteClient:s}=this,o=new a({service:e,tileStore:r,remoteClient:s});return this.controller=o,o}async _createProcessor(e,t){const r=t.schema.processors[0].type,s=(await n(r)).default,{remoteClient:o,tileStore:i}=this,l=new s({service:e,config:t,tileStore:i,remoteClient:o});return this.processor&&this.processor.destroy(),this.processor=l,l}};e([s()],d.prototype,"controller",void 0),e([s()],d.prototype,"processor",void 0),e([s()],d.prototype,"updating",null),e([s()],d.prototype,"viewState",void 0),d=e([o("esri.views.2d.layers.features.Pipeline")],d);const u=d;export{u 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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../../geometry.js";import e from"../../../../../core/Evented.js";import has from"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{isNone as s,applySome as r,mapOr as i}from"../../../../../core/maybe.js";import{diff as o,hasDiff as a}from"../../../../../core/accessorSupport/diffUtils.js";import{GeohashTree as h}from"../../../../../geohash/GeohashTree.js";import{setGeohashBuf as n,setGeohashXY as d}from"../../../../../geohash/geohashUtils.js";import{
|
|
5
|
+
import"../../../../../geometry.js";import e from"../../../../../core/Evented.js";import has from"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{isNone as s,applySome as r,mapOr as i}from"../../../../../core/maybe.js";import{diff as o,hasDiff as a}from"../../../../../core/accessorSupport/diffUtils.js";import{GeohashTree as h}from"../../../../../geohash/GeohashTree.js";import{setGeohashBuf as n,setGeohashXY as d}from"../../../../../geohash/geohashUtils.js";import{create as l}from"../../../../../geometry/support/aaBoundingBox.js";import{earth as g}from"../../../../../geometry/support/Ellipsoid.js";import{getInfo as p}from"../../../../../geometry/support/spatialReferenceUtils.js";import{getBoundsOptimizedGeometry as c,convertToGeometry as f,convertFromPolygon as u}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as m}from"../../../../../layers/graphics/OptimizedFeature.js";import _ from"../../../../../layers/graphics/OptimizedGeometry.js";import{checkProjectionSupport as y,project as I}from"../../../../../layers/graphics/data/projectionSupport.js";import{createDisplayId as b}from"../../../engine/webgl/DisplayId.js";import{featureAdapter as j}from"../FeatureStore2D.js";import{Store2D as v}from"../Store2D.js";import{FeatureSetReaderJSON as B}from"./FeatureSetReaderJSON.js";import x from"../../../../../geometry/SpatialReference.js";import S from"../../../../../geometry/Polygon.js";import F from"../../../../../geometry/Extent.js";const G=t.getLogger("esri.view.2d.layers.features.support.BinStore"),R=12,L=64,T=l(),A=5;function D(e){return 57.29577951308232*e}class O extends v{constructor(t,s,r,i){super(t,r),this.type="bin",this.events=new e,this.objectIdField="aggregateId",this.featureAdapter=j,this._geohashLevel=A,this._geohashBuf=[],this._serviceInfo=i,this.geometryInfo=t.geometryInfo,this._spatialReference=s,this._projectionSupportCheck=y(s,x.WGS84),this._bitsets.geohash=r.getBitset(r.createBitset()),this._bitsets.inserted=r.getBitset(r.createBitset())}destroy(){this._tree&&this._tree.destroy()}get featureSpatialReference(){return this._spatialReference}get fields(){return this._fields}async updateSchema(e,t){const r=this._schema;try{await super.updateSchema(e,t),await this._projectionSupportCheck}catch(n){}this._fields=this._schema.params.fields;const i=o(r,t);t&&(!s(i)||e.source||e.storage.filters)?((a(i,"params.fields")||a(i,"params")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new h(this._statisticFields,this._serviceInfo),this._tree.onRelease=e=>e.displayId&&this._storage.releaseDisplayId(e.displayId),this._geohashLevel=this._schema.params.fixedBinLevel,this._rebuildTree(),has("esri-2d-update-debug")&&G.info("Aggregate mesh needs update due to tree changing")),has("esri-2d-update-debug")&&G.info("Aggregate mesh needs update due to tree changing"),e.targets[t.name]=!0,e.mesh=!1):r&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet((s=>{if(!e.has(s)){const e=t.lookupByDisplayIdUnsafe(s);this._remove(e)}}))}sweepAggregates(e,t,s){}onTileData(e,t,r,i,o=!0){if(!this._schema||s(t.addOrUpdate))return t;this.events.emit("changed");const a=this._getTransforms(e,this._spatialReference);{const e=t.addOrUpdate.getCursor();for(;e.next();)this._update(e,i)}if(t.status.mesh||!o)return t;const h=new Array;this._getBinsForTile(h,e,a,r),t.addOrUpdate=B.fromOptimizedFeatures(h,{...this._serviceInfo,geometryType:"esriGeometryPolygon"}),t.addOrUpdate.attachStorage(r),t.end=!0,t.isRepush||(t.clear=!0);{const s=t.addOrUpdate.getCursor();for(;s.next();){const t=s.getDisplayId();this._bitsets.computed.unset(t),this.setComputedAttributes(r,s,t,e.scale)}}return t}forEachBin(e){this._tree.forEach(e)}forEach(e){this._tree.forEach((t=>{if(t.depth!==this._geohashLevel)return;const s=this._toFeatureJSON(t),r=B.fromFeatures([s],{objectIdField:this.objectIdField,globalIdField:null,geometryType:this.geometryInfo.geometryType,fields:this.fields}).getCursor();r.next(),e(r)}))}forEachInBounds(e,t){}forEachBounds(e,t){const{hasM:r,hasZ:i}=this.geometryInfo;for(const o of e){const e=c(T,o.readGeometry(),i,r);s(e)||t(e)}}onTileUpdate(e){}getAggregate(e){const t=b(e,!0),s=this._tree.findIf((e=>e.displayId===t));return r(s,(e=>this._toFeatureJSON(e)))}getAggregates(){return this._tree.findAllIf((e=>e.depth===this._geohashLevel)).map(this._toFeatureJSON.bind(this))}getDisplayId(e){const t=this._tree.findIf((t=>t.id===e));return r(t,(e=>e.displayId))}getFeatureDisplayIdsForAggregate(e){const t=this._tree.findIf((t=>t.id===e));return i(t,[],(e=>Array.from(e.displayIds)))}getDisplayIdForReferenceId(e){const t=this._tree.findIf((t=>1===t.displayIds.size&&t.displayIds.has(e)));return r(t,(e=>e.displayId))}_toFeatureJSON(e){const t=this._spatialReference;return{displayId:e.displayId,attributes:e.getAttributes(),geometry:f(e.getGeometry(t),"esriGeometryPolygon",!1,!1),centroid:null}}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),i=this._geohashBuf[2*t],o=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,i,o,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,i=t.isVisible(s);if(i===r.has(s))return;if(!i)return void this._remove(e);const o=e.getXHydrated(),a=e.getYHydrated();if(!this._setGeohash(s,o,a))return;const h=this._geohashBuf[2*s],n=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,o,a,h,n,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const i=D(t/g.radius),o=i-360*Math.floor((i+180)/360),a=D(Math.PI/2-2*Math.atan(Math.exp(-s/g.radius)));n(r,e,a,o,R)}else{const i=I({x:t,y:s},this._spatialReference,x.WGS84);if(!i)return!1;n(r,e,i.y,i.x,R)}return this._bitsets.geohash.set(e),!0}_getBinsForTile(e,t,s,r){try{const i=this._getGeohashBounds(t),o=this._tree.getBins(i);for(const t of o){t.displayId||(t.displayId=r.createDisplayId(!0));let i=null;const o=t.getGeometry(this._spatialReference,s.tile);o||(i=t.getGeometryCentroid(this._spatialReference,s.tile));const a=new m(o,t.getAttributes(),i);a.objectId=t.id,a.displayId=t.displayId,e.push(a)}}catch(i){return void G.error("Unable to get bins for tile",t.key.id)}}_getGeohash(e,t,s){const r={geohashX:0,geohashY:0};return d(r,t,e,s),r}_getGeohashBounds(e){const t=this._getGeohashLevel(e.key.level),s=[e.extent.xmin,e.extent.ymin,e.extent.xmax,e.extent.ymax],r=S.fromExtent(F.fromBounds(s,this._spatialReference)),i=I(r,this._spatialReference,x.WGS84,{densificationStep:e.resolution*L}),o=u(new _,i,!1,!1),a=o.coords.filter(((e,t)=>!(t%2))),h=o.coords.filter(((e,t)=>t%2)),n=Math.min(...a),d=Math.min(...h),l=Math.max(...a),g=Math.max(...h),p=this._getGeohash(n,d,t),c=this._getGeohash(l,g,t);return{bounds:s,geohashBounds:{xLL:p.geohashX,yLL:p.geohashY,xTR:c.geohashX,yTR:c.geohashY},level:t}}_getGeohashLevel(e){return this._schema.params.fixedBinLevel}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=p(t);if(!r)return{tile:s,left:null,right:null};const[i,o]=r.valid;return{tile:s,left:{...s,translate:[o,e.bounds[3]]},right:{...s,translate:[i-o+e.bounds[0],e.bounds[3]]}}}}export{O as BinStore};
|