@arcgis/core 5.2.0-next.21 → 5.2.0-next.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Graphic.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0eb0ce43b4813cae968f.js +2 -0
- package/assets/esri/core/workers/chunks/{2dbd88566abac030e965.js → 162dada6a199d1efdf86.js} +2 -2
- package/assets/esri/core/workers/chunks/1a4bec464daa9662ab2a.js +1 -0
- package/assets/esri/core/workers/chunks/{b375abfb2a2d9c63e20a.js → 2255a21c7b959f04d941.js} +1 -1
- package/assets/esri/core/workers/chunks/292498a9c7d462d215c6.js +1 -0
- package/assets/esri/core/workers/chunks/3b4fc67f6cb7393fbd97.js +1 -0
- package/assets/esri/core/workers/chunks/{909e67dee8c30e391d69.js → 44e32ed3a570593a7245.js} +1 -1
- package/assets/esri/core/workers/chunks/{6649acaceab00ad30e7f.js → 50345dfc00380b158c96.js} +1 -1
- package/assets/esri/core/workers/chunks/{da47fdffb5969694a2ae.js → 5b42f8aa0247adc2d065.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7acbc2ddff4cee8a465.js → 5ee887fc6e1e0e70e02f.js} +1 -1
- package/assets/esri/core/workers/chunks/66c2cfe11161d5dc989a.js +1 -0
- package/assets/esri/core/workers/chunks/6c0c77de1934f35dc45f.js +1 -0
- package/assets/esri/core/workers/chunks/{f7f820483e45c05ab9e4.js → 75df436e6e9773bdcfc2.js} +1 -1
- package/assets/esri/core/workers/chunks/780519b60aa674a61a74.js +1 -0
- package/assets/esri/core/workers/chunks/{a2247f4c3116efb16c4f.js → 7e23de8d9b2d938808f6.js} +1 -1
- package/assets/esri/core/workers/chunks/7fc8516111bd869256fc.js +1 -0
- package/assets/esri/core/workers/chunks/8579eba21f40630d073d.js +1 -0
- package/assets/esri/core/workers/chunks/928b18e13e015330d44b.js +1 -0
- package/assets/esri/core/workers/chunks/9434c76ad39c936dba90.js +1 -0
- package/assets/esri/core/workers/chunks/a54773c9bbc751619b3f.js +2 -0
- package/assets/esri/core/workers/chunks/{ac16016964be3b684e98.js → aded4e704e09a28edc8f.js} +1 -1
- package/assets/esri/core/workers/chunks/{eccbddaec4be44c86f79.js → b0b3c67b7d37bd854d95.js} +2 -2
- package/assets/esri/core/workers/chunks/{7175f0c6a6e56b685d20.js → b419fd36337e76e2d4a3.js} +6 -6
- package/assets/esri/core/workers/chunks/{05d597dd117766beadd8.js → b91a15522692781560b4.js} +1 -1
- package/assets/esri/core/workers/chunks/be4275a4b8977ec3eb61.js +1 -0
- package/assets/esri/core/workers/chunks/c86d388d216adbb15a05.js +1 -0
- package/assets/esri/core/workers/chunks/{0b522e05668bef729b1b.js → ceb5bd9f2afaa2ea0808.js} +1 -1
- package/assets/esri/core/workers/chunks/d07068c44d560e4ce02e.js +1 -0
- package/assets/esri/core/workers/chunks/{19493c9c7e1d2ac0f80f.js → d4e0346209fabc58f929.js} +1 -1
- package/assets/esri/core/workers/chunks/{5809e70a8e57e9b05959.js → dd795c95cdc3812b5b49.js} +1 -1
- package/assets/esri/core/workers/chunks/{f0519b06987471456b69.js → e29c8c10331edfa83277.js} +1 -1
- package/assets/esri/core/workers/chunks/{44b30bce8e9a75b9e1b3.js → ef94d25d1cceb25ea9fe.js} +2 -2
- package/assets/esri/core/workers/chunks/f02a9408ba3893484c6c.js +1 -0
- package/assets/esri/core/workers/chunks/f7344d855f1092383abe.js +1 -0
- package/assets/esri/core/workers/chunks/{f1ff33584680d8718400.js → fb9f8b6cc2b4ae5b60df.js} +1 -1
- package/assets/esri/core/workers/chunks/{ecbf84a1f42e6188faab.js → fd629872b5c07853f695.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -1
- 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/chunks/GaussianSplat.glsl.js +4 -4
- package/chunks/GaussianSplatShadow.glsl.js +1 -1
- package/config.js +1 -1
- package/core/date.js +1 -1
- package/form/FormTemplate.d.ts +15 -20
- package/form/elements/AttachmentElement.d.ts +38 -11
- package/form/elements/Element.d.ts +9 -6
- package/form/elements/FieldElement.d.ts +0 -1
- package/form/elements/GroupElement.d.ts +4 -6
- package/form/elements/RelationshipElement.d.ts +8 -8
- package/form/elements/inputs/attachments/AttachmentInput.d.ts +34 -18
- package/form/elements/inputs/attachments/AudioInput.d.ts +4 -3
- package/form/elements/inputs/attachments/DocumentInput.d.ts +2 -6
- package/form/elements/inputs/attachments/ImageInput.d.ts +4 -3
- package/form/elements/inputs/attachments/Input.d.ts +6 -3
- package/form/elements/inputs/attachments/SignatureInput.d.ts +3 -3
- package/form/elements/inputs/attachments/VideoInput.d.ts +4 -3
- package/form/elements.d.ts +6 -12
- package/form/types.d.ts +0 -4
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +2 -1
- package/layers/DimensionFeatureLayer.d.ts +2 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
- package/layers/graphics/sources/parquet/fileProviderChangedError.js +2 -0
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/orientedImagery/core/utils.js +1 -1
- package/layers/support/RasterBandInfo.js +1 -1
- package/layers/types.d.ts +1 -0
- package/package.json +2 -2
- package/rest/support/AttachmentQuery.d.ts +13 -1
- package/rest/support/AttachmentQuery.js +1 -1
- package/rest/support/OutDistance.d.ts +5 -1
- package/rest/support/PrintParameters.d.ts +2 -1
- package/rest/support/Query.d.ts +2 -0
- package/support/basemapUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/SimpleMarkerSymbol.d.ts +2 -2
- package/views/2d/engine/AFeatureContainer.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerViewPerformanceInfo.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatHeaderTexture.js +2 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +13 -12
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatShadowRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
- package/views/View2D.d.ts +2 -2
- package/views/layers/AnnotationFeatureLayerView.d.ts +9 -1
- package/views/layers/DimensionFeatureLayerView.d.ts +9 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/types.d.ts +12 -0
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.d.ts +16 -12
- package/widgets/FeatureForm.d.ts +14 -16
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/types.d.ts +20 -0
- package/widgets/FeatureTable.d.ts +14 -2
- package/widgets/FeatureTable.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
- package/widgets/OrientedImageryViewer/support/panConstraint.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/057d288d795b853295f1.js +0 -2
- package/assets/esri/core/workers/chunks/26aa8190ac439f634c5b.js +0 -1
- package/assets/esri/core/workers/chunks/3192586ec7fc73ed1165.js +0 -1
- package/assets/esri/core/workers/chunks/33866e6e6de1bab64599.js +0 -1
- package/assets/esri/core/workers/chunks/360fd810d70d21c092d9.js +0 -1
- package/assets/esri/core/workers/chunks/3e89f487c5851c954d8b.js +0 -1
- package/assets/esri/core/workers/chunks/5aa375b0c6a205134703.js +0 -1
- package/assets/esri/core/workers/chunks/5f0bc019add4aff3130c.js +0 -1
- package/assets/esri/core/workers/chunks/630ad47857de3cf726d1.js +0 -1
- package/assets/esri/core/workers/chunks/754f7ed62afc4e0a1972.js +0 -2
- package/assets/esri/core/workers/chunks/7ee76504e7fea389a1c9.js +0 -1
- package/assets/esri/core/workers/chunks/8331e04ebe0a54b04ab6.js +0 -1
- package/assets/esri/core/workers/chunks/8c64c6b8d7376a9d1c91.js +0 -1
- package/assets/esri/core/workers/chunks/c30ca771dd3f7198142b.js +0 -1
- package/assets/esri/core/workers/chunks/e5fcd8e7a4a660ef6ad6.js +0 -1
- package/assets/esri/core/workers/chunks/f47319d36f1527277923.js +0 -1
- package/assets/esri/core/workers/chunks/ff00ac01f0baaecaa890.js +0 -1
- /package/assets/esri/core/workers/chunks/{057d288d795b853295f1.js.LICENSE.txt → 0eb0ce43b4813cae968f.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{2dbd88566abac030e965.js.LICENSE.txt → 162dada6a199d1efdf86.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{44b30bce8e9a75b9e1b3.js.LICENSE.txt → a54773c9bbc751619b3f.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{eccbddaec4be44c86f79.js.LICENSE.txt → b0b3c67b7d37bd854d95.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{754f7ed62afc4e0a1972.js.LICENSE.txt → ef94d25d1cceb25ea9fe.js.LICENSE.txt} +0 -0
|
@@ -5,11 +5,12 @@ import type { InputMethod } from "../../../../portal/jsonTypes.js";
|
|
|
5
5
|
export interface AudioInputProperties extends Partial<Pick<AudioInput, "inputMethod" | "maxDuration">> {}
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* The `AudioInput` class defines a user interface for an input to which audio files can be attached.
|
|
8
|
+
* The `AudioInput` class defines a user interface for an input to which audio files can be attached.
|
|
9
9
|
*
|
|
10
10
|
* > [!CAUTION]
|
|
11
11
|
* >
|
|
12
|
-
* >
|
|
12
|
+
* > * Input methods that are configured as only allowing `capture` are not supported.
|
|
13
|
+
* > * Minimum input requirements apply only in mobile editing workflows when the input method is set to only allow capture and the minimum file count is greater than or equal to one.
|
|
13
14
|
*
|
|
14
15
|
* @since 5.1
|
|
15
16
|
* @see [AudioInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/AudioInput/)
|
|
@@ -37,7 +38,7 @@ export default class AudioInput extends Input {
|
|
|
37
38
|
*/
|
|
38
39
|
accessor maxDuration: number | null | undefined;
|
|
39
40
|
/**
|
|
40
|
-
* The input type identifier.
|
|
41
|
+
* The input type identifier.
|
|
41
42
|
*
|
|
42
43
|
* @since 5.1
|
|
43
44
|
*/
|
|
@@ -4,11 +4,7 @@ import type Input from "./Input.js";
|
|
|
4
4
|
export interface DocumentInputProperties extends Partial<Pick<DocumentInput, "maxFileSize">> {}
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* The `DocumentInput` class defines a user interface for an input to which document files can be attached. This [AttachmentElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/#input) is used in [attachment elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/) that are set
|
|
8
|
-
*
|
|
9
|
-
* > [!CAUTION]
|
|
10
|
-
* >
|
|
11
|
-
* > This class is not yet fully supported within the SDK and is not intended for use in development. Support will be added in an upcoming release.
|
|
7
|
+
* The `DocumentInput` class defines a user interface for an input to which document files can be attached. This [AttachmentElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/#input) is used in [attachment elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/) that are set on the [Editor's `layerInfo.formTemplate`](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/#layerInfos/) or a [feature layer's `formTemplate`](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) and displayed within the [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/).
|
|
12
8
|
*
|
|
13
9
|
* @since 5.1
|
|
14
10
|
* @see [DocumentInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/DocumentInput/)
|
|
@@ -28,7 +24,7 @@ export default class DocumentInput extends Input {
|
|
|
28
24
|
*/
|
|
29
25
|
accessor maxFileSize: number | null | undefined;
|
|
30
26
|
/**
|
|
31
|
-
* The input type identifier.
|
|
27
|
+
* The input type identifier.
|
|
32
28
|
*
|
|
33
29
|
* @since 5.1
|
|
34
30
|
*/
|
|
@@ -5,11 +5,12 @@ import type { InputMethod } from "../../../../portal/jsonTypes.js";
|
|
|
5
5
|
export interface ImageInputProperties extends Partial<Pick<ImageInput, "inputMethod" | "maxImageSize">> {}
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* The `ImageInput` class defines a user interface for an input to which image files can be attached. This [AttachmentElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/#input) is used in [attachment elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/) that are set within a [feature layer's](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) or [FeatureForm's](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/#formTemplate) `formTemplate
|
|
8
|
+
* The `ImageInput` class defines a user interface for an input to which image files can be attached. This [AttachmentElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/#input) is used in [attachment elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/) that are set within a [feature layer's](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) or [FeatureForm's](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/#formTemplate) `formTemplate` and is displayed within the [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/).
|
|
9
9
|
*
|
|
10
10
|
* > [!CAUTION]
|
|
11
11
|
* >
|
|
12
|
-
* >
|
|
12
|
+
* > * Input methods that are configured as only allowing `capture` are not supported.
|
|
13
|
+
* > * Minimum input requirements apply only in mobile editing workflows when the input method is set to only allow capture and the minimum file count is greater than or equal to one.
|
|
13
14
|
*
|
|
14
15
|
* @since 5.1
|
|
15
16
|
* @see [ImageInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/ImageInput/)
|
|
@@ -37,7 +38,7 @@ export default class ImageInput extends Input {
|
|
|
37
38
|
*/
|
|
38
39
|
accessor maxImageSize: number | null | undefined;
|
|
39
40
|
/**
|
|
40
|
-
* The input type identifier.
|
|
41
|
+
* The input type identifier.
|
|
41
42
|
*
|
|
42
43
|
* @since 5.1
|
|
43
44
|
*/
|
|
@@ -5,15 +5,18 @@ import type { AttachmentInputType } from "./types.js";
|
|
|
5
5
|
/** @since 5.1 */
|
|
6
6
|
export default abstract class Input extends InputSuperclass {
|
|
7
7
|
/**
|
|
8
|
-
* The type of [input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/#input) used in [attachment elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/).
|
|
8
|
+
* The type of [input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/#input) used in [attachment elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/). This [AttachmentElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/#input) is used in [attachment elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/) that are set on the [Editor's `layerInfo.formTemplate`](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/#layerInfos/) or a [feature layer's `formTemplate`](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) and displayed within the [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/).
|
|
9
|
+
*
|
|
10
|
+
* > [!CAUTION]
|
|
11
|
+
* > * Input methods that are configured as only allowing `capture` are not supported on desktop devices for inputs such as [AudioInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/AudioInput/), [ImageInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/ImageInput/), or [VideoInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/VideoInput/).
|
|
12
|
+
* > * For inputs such as [AudioInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/AudioInput/), [ImageInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/ImageInput/), or [VideoInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/VideoInput/), minimum requirements apply only in mobile editing workflows when the input method is set to only allow capture and the minimum file count is greater than or equal to one.
|
|
9
13
|
*
|
|
10
14
|
* Possible Value | Description
|
|
11
15
|
* ---------------|-------------
|
|
12
|
-
* attachment | The user interface for
|
|
16
|
+
* attachment | The user interface for a general [attachment input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/AttachmentInput/) to attach multiple different types of files.
|
|
13
17
|
* audio | The user interface for an [audio](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/AudioInput/) input.
|
|
14
18
|
* document | The user interface for a [document](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/DocumentInput/) input.
|
|
15
19
|
* image | The user interface for an [image](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/ImageInput/) input.
|
|
16
|
-
* signature | The user interface for a [signature](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/SignatureInput/) input.
|
|
17
20
|
* video | The user interface for a [video](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/VideoInput/) input.
|
|
18
21
|
*
|
|
19
22
|
* @since 5.1
|
|
@@ -5,11 +5,11 @@ import type { InputMethod } from "../../../../portal/jsonTypes.js";
|
|
|
5
5
|
export interface SignatureInputProperties extends Partial<Pick<SignatureInput, "inputMethod">> {}
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* The `SignatureInput` class defines a user interface for an input to which a signature can be attached. This [AttachmentElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/#input) is used in [attachment elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/) that are set within a [feature layer's](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) or [FeatureForm's](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/#formTemplate) `formTemplate
|
|
8
|
+
* The `SignatureInput` class defines a user interface for an input to which a signature can be attached. This [AttachmentElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/#input) is used in [attachment elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/) that are set within a [feature layer's](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) or [FeatureForm's](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/#formTemplate) `formTemplate` and is displayed within the [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/).
|
|
9
9
|
*
|
|
10
10
|
* > [!CAUTION]
|
|
11
11
|
* >
|
|
12
|
-
* > This class is not
|
|
12
|
+
* > This class is not fully supported within the SDK and is not intended for use in development.
|
|
13
13
|
*
|
|
14
14
|
* @since 5.1
|
|
15
15
|
* @see [SignatureInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/SignatureInput/)
|
|
@@ -30,7 +30,7 @@ export default class SignatureInput extends Input {
|
|
|
30
30
|
*/
|
|
31
31
|
accessor inputMethod: InputMethod;
|
|
32
32
|
/**
|
|
33
|
-
* The input type identifier.
|
|
33
|
+
* The input type identifier.
|
|
34
34
|
*
|
|
35
35
|
* @since 5.1
|
|
36
36
|
*/
|
|
@@ -5,11 +5,12 @@ import type { InputMethod } from "../../../../portal/jsonTypes.js";
|
|
|
5
5
|
export interface VideoInputProperties extends Partial<Pick<VideoInput, "inputMethod" | "maxDuration">> {}
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* The `VideoInput` class defines a user interface for an input to which a video file can be attached. This [AttachmentElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/#input) is used in [attachment elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/) that are set within a [feature layer's](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) or [FeatureForm's](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/#formTemplate) `formTemplate
|
|
8
|
+
* The `VideoInput` class defines a user interface for an input to which a video file can be attached. This [AttachmentElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/#input) is used in [attachment elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/) that are set within a [feature layer's](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) or [FeatureForm's](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/#formTemplate) `formTemplate` and is displayed within the [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/).
|
|
9
9
|
*
|
|
10
10
|
* > [!CAUTION]
|
|
11
11
|
* >
|
|
12
|
-
* >
|
|
12
|
+
* > * Input methods that are configured as only allowing `capture` are not supported.
|
|
13
|
+
* > * Minimum input requirements apply only in mobile editing workflows when the input method is set to only allow capture and the minimum file count is greater than or equal to one.
|
|
13
14
|
*
|
|
14
15
|
* @since 5.1
|
|
15
16
|
* @see [VideoInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/VideoInput/)
|
|
@@ -37,7 +38,7 @@ export default class VideoInput extends Input {
|
|
|
37
38
|
*/
|
|
38
39
|
accessor maxDuration: number | null | undefined;
|
|
39
40
|
/**
|
|
40
|
-
* The input type identifier.
|
|
41
|
+
* The input type identifier.
|
|
41
42
|
*
|
|
42
43
|
* @since 5.1
|
|
43
44
|
*/
|
package/form/elements.d.ts
CHANGED
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
* import GroupElement from "@arcgis/core/form/elements/GroupElement.js";
|
|
9
9
|
* import RelationshipElement from "@arcgis/core/form/elements/RelationshipElement.js";
|
|
10
10
|
* import TextElement from "@arcgis/core/form/elements/TextElement.js";
|
|
11
|
+
* import AttachmentElement from "@arcgis/core/form/elements/AttachmentElement.js";
|
|
11
12
|
* ```
|
|
12
13
|
*
|
|
13
14
|
* You can use this module to import them on a single line:
|
|
14
15
|
*
|
|
15
16
|
* ```js
|
|
16
|
-
* import { FieldElement, GroupElement, RelationshipElement, TextElement } from "@arcgis/core/form/elements.js";
|
|
17
|
+
* import { FieldElement, GroupElement, RelationshipElement, TextElement, AttachmentElement } from "@arcgis/core/form/elements.js";
|
|
17
18
|
* ```
|
|
18
19
|
*
|
|
19
20
|
* This module also allows you to implement [type guards](https://basarat.gitbook.io/typescript/type-system/typeguard)
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
* console.log("Form element type is field");
|
|
28
29
|
* }
|
|
29
30
|
* else {
|
|
30
|
-
* // The compiler knows the content element must be `field | group | relationship`
|
|
31
|
+
* // The compiler knows the content element must be `field | group | relationship | attachment | text | utilityNetworkAssociations`
|
|
31
32
|
* console.log("The value is not a valid form element.")
|
|
32
33
|
* }
|
|
33
34
|
* }
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
*
|
|
36
37
|
* @since 4.16
|
|
37
38
|
* @see [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/)
|
|
39
|
+
* @see [AttachmentElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/)
|
|
38
40
|
* @see [FieldElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/)
|
|
39
41
|
* @see [GroupElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/GroupElement/)
|
|
40
42
|
* @see [RelationshipElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/RelationshipElement/)
|
|
@@ -81,22 +83,14 @@ export type TextElement = TextElementClass;
|
|
|
81
83
|
/**
|
|
82
84
|
* `AttachmentElement` defines how one or more attachments can participate in the form. When present in the form, the user has the ability to upload an attachment specific to the form element.
|
|
83
85
|
*
|
|
84
|
-
*
|
|
85
|
-
* >
|
|
86
|
-
* > The `attachment` element is not yet fully supported within the SDK and is not intended for use in development. Support will be added in an upcoming release.
|
|
87
|
-
*
|
|
88
|
-
* @internal
|
|
86
|
+
* @since 5.1
|
|
89
87
|
*/
|
|
90
88
|
export const AttachmentElement: typeof AttachmentElementClass;
|
|
91
89
|
|
|
92
90
|
/**
|
|
93
91
|
* `AttachmentElement` defines how one or more attachments can participate in the form. When present in the form, the user has the ability to upload an attachment specific to the form element.
|
|
94
92
|
*
|
|
95
|
-
*
|
|
96
|
-
* >
|
|
97
|
-
* > The `attachment` element is not yet fully supported within the SDK and is not intended for use in development. Support will be added in an upcoming release.
|
|
98
|
-
*
|
|
99
|
-
* @internal
|
|
93
|
+
* @since 5.1
|
|
100
94
|
*/
|
|
101
95
|
export type AttachmentElement = AttachmentElementClass;
|
|
102
96
|
|
package/form/types.d.ts
CHANGED
|
@@ -8,10 +8,6 @@ import type UtilityNetworkAssociationsElement from "./elements/UtilityNetworkAss
|
|
|
8
8
|
/**
|
|
9
9
|
* Form element types.
|
|
10
10
|
*
|
|
11
|
-
* > [!CAUTION]
|
|
12
|
-
* >
|
|
13
|
-
* > * The `AttachmentElement` is not yet fully supported by the [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/) widget.
|
|
14
|
-
*
|
|
15
11
|
* @since 5.0
|
|
16
12
|
* @see [Web Map Specification - formInfo](https://developers.arcgis.com/web-map-specification/objects/formInfo/)
|
|
17
13
|
*/
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.
|
|
2
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.22",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
|
@@ -107,7 +107,8 @@ export interface AnnotationFeatureLayerEvents extends EditBusLayerEvents, Refres
|
|
|
107
107
|
* > **Known Limitations**
|
|
108
108
|
* > The following features are not currently supported at this release. Future releases will see increased functionality and support for additional features.
|
|
109
109
|
* > * Editing
|
|
110
|
-
* > *
|
|
110
|
+
* > * [AnnotationFeatureLayerView.featureEffect](https://developers.arcgis.com/javascript/latest/references/core/views/layers/AnnotationFeatureLayerView/#featureEffect)
|
|
111
|
+
* > * [AnnotationFeatureLayerView.filter](https://developers.arcgis.com/javascript/latest/references/core/views/layers/AnnotationFeatureLayerView/#filter)
|
|
111
112
|
*
|
|
112
113
|
* @beta
|
|
113
114
|
* @since 5.1
|
|
@@ -76,7 +76,8 @@ export interface DimensionFeatureLayerEvents extends EditBusLayerEvents, Refresh
|
|
|
76
76
|
* > **Known Limitations**
|
|
77
77
|
* > The following features are not currently supported at this release. Future releases will see increased functionality and support for additional features.
|
|
78
78
|
* > * Editing
|
|
79
|
-
* > *
|
|
79
|
+
* > * [DimensionFeatureLayerView.featureEffect](https://developers.arcgis.com/javascript/latest/references/core/views/layers/DimensionFeatureLayerView/#featureEffect)
|
|
80
|
+
* > * [DimensionFeatureLayerView.filter](https://developers.arcgis.com/javascript/latest/references/core/views/layers/DimensionFeatureLayerView/#filter)
|
|
80
81
|
*
|
|
81
82
|
* @beta
|
|
82
83
|
* @since 5.1
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o,subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o,subclass as n}from"../core/accessorSupport/decorators.js";import a from"../geometry/SpatialReference.js";import s from"../graphic/OrientedImageryGraphicOrigin.js";import p from"./FeatureLayer.js";import{useViewTimeProperty as l}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as d,parseSequenceOrderFields as m,orientedImageryTypeMap as y,timeIntervalUnitTypeMap as u,verticalMeasurementTypeMap as c,isOrientationAccuracy as h,padAccuracyArray as f}from"./orientedImagery/core/utils.js";import g from"./support/Field.js";import v from"../tables/AttributeTableTemplate.js";import j from"../time/TimeExtent.js";const S=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","referenceIDField","sequenceOrderField","sequenceOrderFields","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),P=new Set(["elevationSource"]),I=(e,t)=>!S.has(t)&&e,O=(e,t,i)=>{const r=`orientedImageryProperties.${e}`,o={allowNull:P.has(e),ignoreOrigin:!0};return{name:r,write:t?{...o,target:r,writer:t}:o,read:i?{ignoreOrigin:!0,source:r,reader:i}:{ignoreOrigin:!0}}};function b(e){return e.json?(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1},e):e}function x(e,t,i,r){const{name:o,write:n,read:a}=O(e,t,i),s={name:o,write:n,read:a,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:i},"web-scene":{name:o,write:I(n,e),read:I(a,e)},"web-map":{name:o,write:n,read:a}}};return r&&s.origins?(s.type=r,s.origins["web-map"].type=r,s.origins["web-scene"].type=r,s):s}function w(e,t,i){e?.length&&r(i,e,t)}let F=class extends p{constructor(e){super(e),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.graphicOrigin=new s(this),this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.referenceIDField="OBJECTID",this.sequenceOrderField="SequenceOrder",this.sequenceOrderFields=[],this.subtypeField=null,this.subtypes=null,this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.verticalSearchRange=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.virtualCacheDirectory=null,this.dataStoreID=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return d(e,t,i)}get effectiveSequenceOrderField(){const{sequenceOrderField:e,fields:t,sequenceOrderFields:i}=this;return m(e,t,i)}get fieldConfigurations(){return super.fieldConfigurations}set fieldConfigurations(e){super.fieldConfigurations=e}get portalItem(){return super.portalItem}set portalItem(e){super.portalItem=e}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}findFirstValidLayerId(e){return e.layers?.find(({type:e})=>!!e&&this.supportedSourceTypes.has(e))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new t("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};e([o({type:v,json:{write:!1,read:!1}})],F.prototype,"attributeTableTemplate",void 0),e([o({type:Number,json:x("cameraHeading")})],F.prototype,"cameraHeading",void 0),e([o({type:Number,json:x("cameraHeight")})],F.prototype,"cameraHeight",void 0),e([o({type:Number,json:x("cameraPitch")})],F.prototype,"cameraPitch",void 0),e([o({type:Number,json:x("cameraRoll")})],F.prototype,"cameraRoll",void 0),e([o({type:Number,json:x("coveragePercent")})],F.prototype,"coveragePercent",void 0),e([o({type:String,json:x("demPathPrefix")})],F.prototype,"demPathPrefix",void 0),e([o({type:String,json:x("demPathSuffix")})],F.prototype,"demPathSuffix",void 0),e([o({type:String,json:x("depthImagePathPrefix")})],F.prototype,"depthImagePathPrefix",void 0),e([o({type:String,json:x("depthImagePathSuffix")})],F.prototype,"depthImagePathSuffix",void 0),e([o({type:Object,json:x("elevationSource")})],F.prototype,"elevationSource",void 0),e([o({readOnly:!0})],F.prototype,"effectiveElevationSource",null),e([o({readOnly:!0})],F.prototype,"effectiveSequenceOrderField",null),e([o({type:Number,json:x("farDistance")})],F.prototype,"farDistance",void 0),e([o({type:[g]})],F.prototype,"fields",void 0),e([o()],F.prototype,"geometryType",void 0),e([o({readOnly:!0,clonable:!1})],F.prototype,"graphicOrigin",void 0),e([o({type:Number,json:x("horizontalFieldOfView")})],F.prototype,"horizontalFieldOfView",void 0),e([o({type:String,json:x("horizontalMeasurementUnit")})],F.prototype,"horizontalMeasurementUnit",void 0),e([o({type:String,json:{...x("imageGeometryField"),default:"ImageGeometry"}})],F.prototype,"imageGeometryField",void 0),e([o({type:String,json:x("imagePathPrefix")})],F.prototype,"imagePathPrefix",void 0),e([o({type:String,json:x("imagePathSuffix")})],F.prototype,"imagePathSuffix",void 0),e([o({type:String,json:{...x("imageReferenceField"),default:"OIObjectID"}})],F.prototype,"imageReferenceField",void 0),e([o({type:Number,json:x("imageRotation")})],F.prototype,"imageRotation",void 0),e([o({type:Number,json:x("maximumDistance")})],F.prototype,"maximumDistance",void 0),e([o({type:Number,json:x("nearDistance")})],F.prototype,"nearDistance",void 0),e([o({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],F.prototype,"operationalLayerType",void 0),e([o({json:{...x("orientationAccuracy",(e,t,i)=>{r(i,e.join(";"),t)},e=>{const t=e?.split(";")?.map(Number);return h(t)?f(t):[0,0,0,0,0,0,0,0]},String)}})],F.prototype,"orientationAccuracy",void 0),e([o({json:{...x("orientedImageryType",y.write,y.read,y.jsonValues.slice(1))}})],F.prototype,"orientedImageryType",void 0),e([o({type:String,json:{...x("referenceIDField"),default:"OBJECTID"}})],F.prototype,"referenceIDField",void 0),e([o({type:String,json:{...x("sequenceOrderField"),default:"SequenceOrder"}})],F.prototype,"sequenceOrderField",void 0),e([o({json:{...x("sequenceOrderFields",w),default:[]}})],F.prototype,"sequenceOrderFields",void 0),e([o({type:a})],F.prototype,"spatialReference",void 0),e([o({readOnly:!0})],F.prototype,"subtypeField",void 0),e([o({readOnly:!0})],F.prototype,"subtypes",void 0),e([o({json:{read:!1},value:"oriented-imagery",readOnly:!0})],F.prototype,"type",void 0),e([o({type:u.apiValues,json:{...x("timeIntervalUnit",u.write,u.read,u.jsonValues)}})],F.prototype,"timeIntervalUnit",void 0),e([o(b(i(l)))],F.prototype,"useViewTime",void 0),e([o({type:Number,json:x("verticalFieldOfView")})],F.prototype,"verticalFieldOfView",void 0),e([o({type:c.apiValues,json:{...x("verticalMeasurementUnit",c.write,c.read,c.jsonValues)}})],F.prototype,"verticalMeasurementUnit",void 0),e([o({type:Number,json:x("verticalSearchRange")})],F.prototype,"verticalSearchRange",void 0),e([o({type:String,json:x("videoPathPrefix")})],F.prototype,"videoPathPrefix",void 0),e([o({type:String,json:x("videoPathSuffix")})],F.prototype,"videoPathSuffix",void 0),e([o({type:String,json:{read:!1,write:!1,origins:{service:{name:"orientedImageryInfo.orientedImageryProperties.virtualCacheDirectory",read:!0}}}})],F.prototype,"virtualCacheDirectory",void 0),e([o({type:String,json:{read:!1,write:!1,origins:{service:{name:"orientedImageryInfo.dsid",read:!0}}}})],F.prototype,"dataStoreID",void 0),e([o({type:j,json:{origins:{"web-scene":{write:!1,read:!1}}}})],F.prototype,"visibilityTimeExtent",void 0),F=e([n("esri.layers.OrientedImageryLayer")],F);const T=F;export{T as default};
|
package/layers/ParquetLayer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import i from"../core/Collection.js";import{deprecatedProperty as o}from"../core/deprecate.js";import s from"../core/Error.js";import has from"../core/has.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import i from"../core/Collection.js";import{deprecatedProperty as o}from"../core/deprecate.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{MultiOriginJSONSupportMixin as p}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as n}from"../core/object.js";import{on as l}from"../core/reactiveUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import y from"../geometry/Extent.js";import c from"../geometry/SpatialReference.js";import f from"../graphic/ParquetGraphicOrigin.js";import h from"./Layer.js";import{ParquetSource as g}from"./graphics/sources/ParquetSource.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as b}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as v}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as O}from"./mixins/OperationalLayer.js";import{OrderedLayer as x}from"./mixins/OrderedLayer.js";import{ScaleRangeLayer as q}from"./mixins/ScaleRangeLayer.js";import{labelsVisible as E,legendEnabled as I,popupEnabled as P}from"./support/commonProperties.js";import F from"./support/FeatureTemplate.js";import T from"./support/Field.js";import{defineFieldProperties as L}from"./support/fieldProperties.js";import{fixRendererFields as S}from"./support/fieldUtils.js";import _ from"./support/GeometryEncodingLocation.js";import R from"./support/GeometryEncodingWkb.js";import D from"./support/LabelClass.js";import{reader as z}from"./support/labelingInfo.js";import U from"./support/ParquetFilesData.js";import C from"./support/ParquetPortalItemData.js";import{parquetGeometryTypeKebabDict as Q}from"./support/parquetUtils.js";import{rendererTypes as k}from"../renderers/support/typeUtils.js";import G from"../rest/support/Query.js";import{createPopupTemplate as J}from"../support/popupUtils.js";const M=L(),N="__OBJECTID",V={types:{key:"type",base:null,typeMap:{wkb:R,location:_}},json:{name:"layerDefinition.geometryEncoding",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryEncoding"}}}}};let A=class extends(v(b(j(x(q(O(p(w(t(h)))))))))){constructor(e){super(e),this._emptyUrls=new i,this.copyright=null,this.definitionExpression=null,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.geometryEncoding=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new f(this),this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=N,this.operationalLayerType="ParquetLayer",this.outFields=null,this.persistenceEnabled=!!has("parquetlayer-persistence-enabled"),this.popupTemplate=null,this.source=null,this.spatialReference=null,this.templates=null,this.title="Parquet",this.type="parquet",this.data=null}initialize(){this.addHandles(l(()=>this.source,"source-changed",()=>{this.emit("refresh",{dataChanged:!0})}))}destroy(){this.source?.destroy()}async load(e){return this.addResolvingPromise(this._load(e)),this}get capabilities(){return this.source?.capabilities}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,t,i){const o=e.filter(e=>!(e.name===N&&"oid"===e.type)).map(e=>e.toJSON(i));n(t,o,r)}get isTable(){return null==this.geometryEncoding&&null==this.displayOptimization}set renderer(e){S(e,this.fieldsIndex),this._set("renderer",e)}writeData(e,r,t,i){if(!e)return;const o=e.write({},i);"portal-item"!==o.type?o.urls.length&&(r.source=o):i.messages?.push(new s("parquet-layer:unsupported-data","Portal-item-backed Parquet data is not yet supported in web maps",{layer:this}))}get urls(){return"files"===this.data?.type?this.data.urls:this._emptyUrls}set urls(e){o(a.getLogger(this),"urls",{replacement:"data",version:"5.1",warnOnce:!0}),this.data=new U({urls:this._normalizeUrls(e)})}createPopupTemplate(e){return J(this,e)}createQuery(){const e=new G;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}async createSource(e){const r=new g({layer:this});return await r.load(e),r}getFieldDomain(e,r){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,r){await this.load();const t=await this.source.queryFeatures(this._normalizeQuery(e),r),i=this.graphicOrigin;if(t?.features)for(const o of t.features)o.layer=o.sourceLayer=this,o.origin=i;return t}async queryObjectIds(e,r){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),r)}async queryFeatureCount(e,r){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),r)}async queryExtent(e,r){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),r)}_normalizeQuery(e){return G.from(e)??this.createQuery()}_normalizeUrls(e){return Array.isArray(e)?new i(e):e??new i}async _load(e){"portal-item"===this.data?.type&&await this.data.portalItem.load();const r=await this.createSource(e);this._set("source",r),this.read(r.sourceJSON,{origin:"service"}),["fields"].forEach(e=>this.revertToOrigin(e,"service")),S(this.renderer,this.fieldsIndex),null==this.spatialReference&&(this.spatialReference=c.WGS84)}};e([u({readOnly:!0,json:{read:!1,write:!1}})],A.prototype,"capabilities",null),e([u({type:String})],A.prototype,"copyright",void 0),e([u({readOnly:!0})],A.prototype,"defaultPopupTemplate",null),e([u({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],A.prototype,"definitionExpression",void 0),e([u()],A.prototype,"displayOptimization",void 0),e([u({type:[T],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],A.prototype,"fields",void 0),e([m("fields")],A.prototype,"writeFields",null),e([u(M.fieldsIndex)],A.prototype,"fieldsIndex",void 0),e([u(V)],A.prototype,"geometryEncoding",void 0),e([u({type:y,json:{name:"extent"}})],A.prototype,"fullExtent",void 0),e([u({type:Q.apiValues,json:{name:"layerDefinition.geometryType",read:{reader:Q.read},write:{writer:Q.write,ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryType",reader:Q.read}}}}})],A.prototype,"geometryType",void 0),e([u({readOnly:!0,clonable:!1})],A.prototype,"graphicOrigin",void 0),e([u(E)],A.prototype,"labelsVisible",void 0),e([u({type:[D],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:z},write:!0}})],A.prototype,"labelingInfo",void 0),e([u(I)],A.prototype,"legendEnabled",void 0),e([u()],A.prototype,"file",void 0),e([u({type:String,readOnly:!0})],A.prototype,"objectIdField",void 0),e([u({type:["ParquetLayer"]})],A.prototype,"operationalLayerType",void 0),e([u(M.outFields)],A.prototype,"outFields",void 0),e([u(P)],A.prototype,"popupEnabled",void 0),e([u({type:r,json:{name:"popupInfo",write:!0}})],A.prototype,"popupTemplate",void 0),e([u({types:k,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{read:{source:"drawingInfo.renderer"}}}}})],A.prototype,"renderer",null),e([u({type:g,readOnly:!0,cast:null,json:{read:!1}})],A.prototype,"source",void 0),e([u({type:c,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"extent.spatialReference"}}}}})],A.prototype,"spatialReference",void 0),e([u({type:[F]})],A.prototype,"templates",void 0),e([u()],A.prototype,"title",void 0),e([u({json:{read:!1},readOnly:!0})],A.prototype,"type",void 0),e([u({types:{key:"type",base:null,typeMap:{files:U,"portal-item":C}},json:{name:"source",origins:{"web-map":{write:{target:"source",ignoreOrigin:!0}}}}})],A.prototype,"data",void 0),e([m("web-map","data")],A.prototype,"writeData",null),e([u({type:i.ofType(String),json:{read:!1,write:!1}})],A.prototype,"urls",null),A=e([d("esri.layers.ParquetLayer")],A);export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{EventedMixin as r}from"../../../core/Evented.js";import{Loadable as s}from"../../../core/Loadable.js";import o from"../../../core/Logger.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as i}from"../../../core/reactiveUtils.js";import{open as n}from"../../../core/workers.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import y from"../../../geometry/Extent.js";import{createFileProviderSchema as l,toParquetJSONGeometryType as p}from"../../support/parquetUtils.js";import m from"../../../rest/support/FeatureSet.js";let d=class extends(r(s)){constructor(t){super(t),this.type="parquet"}load(t){const e=null!=t?t.signal:null;return this.addResolvingPromise(this._initialize(e)),this.addHandles([i(()=>this.layer.data,async t=>{t&&await this._proxy.updateFileProvider(await l(t))}),i(()=>this.layer.customParameters,t=>this._setCustomParameters(t))]),Promise.resolve(this)}async reload(t){const e=await this._createLoadParameters(t);return this._proxy.reload(e)}destroy(){this._connection?.destroy()}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeaturesJSON(t,e={}){return await this.load(e),this._proxy.queryFeatures(t.toJSON(),{signal:e?.signal})}async queryFeatures(t,e={}){const r=await this.queryFeaturesJSON(t,{signal:e?.signal});return m.fromJSON(r)}async queryObjectIds(t,e){return await this._proxy.queryObjectIds(t.toJSON(),{signal:e?.signal})}async queryFeatureCount(t,e){return this._proxy.queryFeatureCount(t.toJSON(),{signal:e?.signal})}async queryExtent(t,e){if(null==this.layer.geometryEncoding)return o.getLogger(this).warn("Tried to queryExtent, but source does not have a geometry. Returning null extent."),{count:0,extent:null};const r=await this._proxy.queryExtent(t.toJSON(),{signal:e?.signal});return{count:r.count,extent:y.fromJSON(r.extent)}}async _initialize(t){const e={onSourceChange:()=>this.emit("source-changed")};this._connection=await n("ParquetSourceWorker",{strategy:"dedicated",signal:t,registryTarget:this,client:e}),a(t),this._proxy=this._connection.createInvokeProxy();const r=await this._createLoadParameters(t),{layerDefinition:s,capabilities:o}=await this._proxy.load(r);a(t),this.sourceJSON=s,this.capabilities=o}async _createLoadParameters(t){if(!this.layer.data)throw new e("parquet:missing-data","A data source must be specified",this.layer);const r=await l(this.layer.data,{signal:t});return a(t),{provider:r,fields:this.layer.fields?.map(t=>t.toJSON()),geometryType:this.layer.geometryType?p(this.layer.geometryType):null,spatialReference:this.layer.spatialReference?.toJSON(),geometryEncoding:this.layer.geometryEncoding?.toJSON(),displayOptimization:this.layer.displayOptimization,customParameters:this.layer.customParameters}}_setCustomParameters(t){this._proxy.setCustomParameters(t).catch(()=>{o.getLogger(this).warn("Failed to update customParameters")})}_queryStream(t,e){return this._proxy.queryStream(t,e)}_getStreamNextFeatures(t,e){return this._proxy.getStreamNextFeatures(t,e)}};t([c()],d.prototype,"type",void 0),t([c({constructOnly:!0})],d.prototype,"layer",void 0),t([c()],d.prototype,"sourceJSON",void 0),t([c()],d.prototype,"capabilities",void 0),d=t([u("esri.layers.graphics.sources.ParquetSource")],d);export{d as ParquetSource};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import s from"../../../../core/Error.js";import i from"../../../../core/Logger.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{getJsonType as n}from"../../../../geometry/support/jsonTypeUtils.js";import{wgs84 as a,equals as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as u,convertToGeometry as l,convertFromFeatures as d,convertToFeature as p,convertFromFeature as c}from"../../featureConversionUtils.js";import y from"../../data/FeatureStore.js";import{checkProjectionSupport as f,project as m}from"../../data/projectionSupport.js";import{QueryEngine as h}from"../../data/QueryEngine.js";import{inferLayerProperties as g,createOptimizedFeatures as _,validateGeoJSON as I}from"./geojson.js";import{createDefaultTemplate as E,createDefaultAttributesFunction as F,createDrawingInfo as j}from"../support/clientSideDefaults.js";import{queryBinsCapabilities as T,loadGeometryEngineForSimplify as b,mixAttributes as w,createFeatureEditSuccessResult as q,createFeatureEditErrorResult as x,simplify as S}from"../support/sourceUtils.js";import R from"../../../support/FieldsIndex.js";import{kebabDict as C}from"../../../support/fieldType.js";import{getFieldDefaultValue as A,getFieldDefaultLength as O}from"../../../support/fieldUtils.js";import{utc as Q}from"../../../../time/constants.js";const k={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentsCountOnly:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsOutDistance:!1,supportsQueryWithResultType:!0,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:["EnvelopeAggregate","CentroidAggregate","ConvexHullAggregate"],supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0},queryBinsCapabilities:T};class D{constructor(){this._featureIdInfo=null,this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const i=[],[r]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),n=g(r,{geometryType:e.geometryType}),o=e.fields||n.fields||[],u=null!=e.hasZ?e.hasZ:n.hasZ,l=n.geometryType;let d=e.objectIdField||n.objectIdFieldName||"__OBJECTID";const p=e.spatialReference||a;let c=e.timeInfo;o===n.fields&&n.unknownFields.length>0&&i.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:n.unknownFields}});const f=new R(o);let m=f.get(d);m?("esriFieldTypeString"!==m.type&&(m.type="esriFieldTypeOID"),m.editable=!1,m.nullable=!1,d=m.name):(m={alias:d,name:d,type:"string"===n.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(m));const _={};for(const a of o){if(null==a.name&&(a.name=a.alias),null==a.alias&&(a.alias=a.name),!a.name)throw new s("geojson-layer:invalid-field-name","field name is missing",{field:a});if(!C.jsonValues.includes(a.type))throw new s("geojson-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a});if(a.name!==m.name){const e=A(a);void 0!==e&&(_[a.name]=e)}null==a.length&&(a.length=O(a))}if(c){if(c.startTimeField){const e=f.get(c.startTimeField);e?(c.startTimeField=e.name,e.type="esriFieldTypeDate"):c.startTimeField=null}if(c.endTimeField){const e=f.get(c.endTimeField);e?(c.endTimeField=e.name,e.type="esriFieldTypeDate"):c.endTimeField=null}if(c.trackIdField){const e=f.get(c.trackIdField);e?c.trackIdField=e.name:(c.trackIdField=null,i.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:c}}))}c.startTimeField||c.endTimeField||(i.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:c}}),c=null)}const I=l?j(l):void 0,T=f.dateFields.length?{timeZoneIANA:Q}:null,b={warnings:i,featureErrors:[],layerDefinition:{...k,drawingInfo:I??void 0,templates:E(_),extent:void 0,geometryType:l,objectIdField:d,fields:o,hasZ:!!u,timeInfo:c,dateFieldsTimeReference:T}};this._featureIdInfo={type:"object-id",fieldName:d},this._queryEngine=new h({fieldsIndex:R.fromLayerJSON({fields:o,timeInfo:c,dateFieldsTimeReference:T}),geometryType:l,hasM:!1,hasZ:u,featureIdInfo:this._featureIdInfo,spatialReference:p,timeInfo:c,featureStore:new y({geometryType:l,hasM:!1,hasZ:u})});const w=this._queryEngine.fieldsIndex.requiredFields.indexOf(m);w>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(w,1),this._createDefaultAttributes=F(_,d);const q=this._createFeatures(r);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,q);const x=this._normalizeFeatures(q,b.featureErrors);this._queryEngine.featureStore.addMany(x);const{fullExtent:S,timeExtent:D}=await this._queryEngine.fetchRecomputedExtents();if(b.layerDefinition.extent=S,D){const{start:e,end:t}=D;b.layerDefinition.timeInfo.timeExtent=[e,t]}return b}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([b(t,s),f(e.adds,t),f(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),await this._queryEngine.executeQueryForSnapping(e,t.signal)}async queryAttributeBins(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeAttributeBinsQuery(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then(e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)},e=>{this._queryEngine.featureStore.clear(),r(e)||i.getLogger("esri.layers.GeoJSONLayer").error(new s("geojson-layer:refresh","An error occurred during refresh",{error:e}))}),await this._waitSnapshotComplete();const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a}}_createFeatures(e){if(null==e)return[];const{geometryType:t,hasZ:s}=this._queryEngine,i=this._featureIdInfo.fieldName,r=_(e,{geometryType:t,hasZ:s,objectIdField:i});if(!o(this._queryEngine.spatialReference,a))for(const n of r)null!=n.geometry&&(n.geometry=u(m(l(n.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),a,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:s,customParameters:i}=this._loadOptions,r=(await e(s??"",{responseType:"json",query:{...i},signal:t})).data;return I(r),r}_normalizeFeatures(e,t){const{fieldsIndex:s}=this._queryEngine,i=[],r=this._featureIdInfo.fieldName;for(const n of e){const e=this._createDefaultAttributes(),a=w(s,e,n.attributes,!0);a?t?.push(a):(this._assignObjectId(e,n.attributes,!0),n.attributes=e,n.objectId=e[r],i.push(n))}return i}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const e of i)r.deleteResults.push(q(e));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:a,spatialReference:o,featureStore:u,fieldsIndex:l}=this._queryEngine,p=this._featureIdInfo.fieldName,c=[];for(const d of t){if(d.geometry&&i!==n(d.geometry)){s.push(x("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=w(l,t,d.attributes);if(r)s.push(r);else{if(this._assignObjectId(t,d.attributes),d.attributes=t,null!=d.uid){const t=d.attributes[p];e.uidToObjectId[d.uid]=t}if(null!=d.geometry){const e=d.geometry.spatialReference??o;d.geometry=m(S(d.geometry,e),e,o)}c.push(d),s.push(q(d.attributes[p]))}}u.addMany(d([],c,i,a,r,this._featureIdInfo))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,spatialReference:a,featureStore:o,fieldsIndex:u}=this._queryEngine,l=this._featureIdInfo.fieldName;for(const d of t){const{attributes:t,geometry:y}=d,f=t?.[l];if(null==f){e.push(x(`Identifier field ${l} missing`));continue}if(!o.has(f)){e.push(x(`Feature with object id ${f} missing`));continue}const h=p(o.getFeature(f),s,r,i);if(null!=y){if(s!==n(y)){e.push(x("Incorrect geometry type."));continue}const t=y.spatialReference??a;h.geometry=m(S(y,t),t,a)}if(t){const s=w(u,h.attributes,t);if(s){e.push(s);continue}}o.add(c(h,s,r,i,this._featureIdInfo)),e.push(q(f))}}_createObjectIdGenerator(e,t){const s=this._featureIdInfo.fieldName,i=e.fieldsIndex.get(s);if("esriFieldTypeString"===i.type)return()=>i.name+"-"+Date.now().toString(16);let r=Number.NEGATIVE_INFINITY;for(const n of t)n.objectId&&(r=Math.max(r,n.objectId));return r=Math.max(0,r)+1,()=>r++}_assignObjectId(e,t,s=!1){const i=this._featureIdInfo.fieldName;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await f(a,e)}catch{throw new s("geojson-layer","Projection not supported")}}}export{D as default};
|
|
2
|
+
import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import s from"../../../../core/Error.js";import i from"../../../../core/Logger.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{getJsonType as n}from"../../../../geometry/support/jsonTypeUtils.js";import{wgs84 as a,equals as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as u,convertToGeometry as l,convertFromFeatures as d,convertToFeature as p,convertFromFeature as c}from"../../featureConversionUtils.js";import y from"../../data/FeatureStore.js";import{checkProjectionSupport as f,project as m}from"../../data/projectionSupport.js";import{QueryEngine as h}from"../../data/QueryEngine.js";import{inferLayerProperties as g,createOptimizedFeatures as _,validateGeoJSON as I}from"./geojson.js";import{createDefaultTemplate as E,createDefaultAttributesFunction as F,createDrawingInfo as j}from"../support/clientSideDefaults.js";import{queryBinsCapabilities as T,loadGeometryEngineForSimplify as b,mixAttributes as w,createFeatureEditSuccessResult as q,createFeatureEditErrorResult as x,simplify as S}from"../support/sourceUtils.js";import R from"../../../support/FieldsIndex.js";import{kebabDict as C}from"../../../support/fieldType.js";import{getFieldDefaultValue as A,getFieldDefaultLength as O}from"../../../support/fieldUtils.js";import{utc as Q}from"../../../../time/constants.js";const k={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentsCountOnly:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsOutDistance:!1,supportsQueryWithResultType:!0,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:["EnvelopeAggregate","CentroidAggregate","ConvexHullAggregate"],supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0},queryBinsCapabilities:T};class D{constructor(){this._featureIdInfo=null,this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const i=[],[r]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),n=g(r,{geometryType:e.geometryType}),o=e.fields||n.fields||[],u=null!=e.hasZ?e.hasZ:n.hasZ,l=n.geometryType;let d=e.objectIdField||n.objectIdFieldName||"__OBJECTID";const p=e.spatialReference||a;let c=e.timeInfo;o===n.fields&&n.unknownFields.length>0&&i.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:n.unknownFields}});const f=new R(o);let m=f.dateFields.length>0,_=f.get(d);_?("esriFieldTypeString"!==_.type&&(_.type="esriFieldTypeOID"),_.editable=!1,_.nullable=!1,d=_.name):(_={alias:d,name:d,type:"string"===n.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(_));const I={};for(const a of o){if(null==a.name&&(a.name=a.alias),null==a.alias&&(a.alias=a.name),!a.name)throw new s("geojson-layer:invalid-field-name","field name is missing",{field:a});if(!C.jsonValues.includes(a.type))throw new s("geojson-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a});if(a.name!==_.name){const e=A(a);void 0!==e&&(I[a.name]=e)}null==a.length&&(a.length=O(a))}if(c){if(c.startTimeField){const e=f.get(c.startTimeField);e?(c.startTimeField=e.name,e.type="esriFieldTypeDate",m=!0):c.startTimeField=null}if(c.endTimeField){const e=f.get(c.endTimeField);e?(c.endTimeField=e.name,e.type="esriFieldTypeDate",m=!0):c.endTimeField=null}if(c.trackIdField){const e=f.get(c.trackIdField);e?c.trackIdField=e.name:(c.trackIdField=null,i.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:c}}))}c.startTimeField||c.endTimeField||(i.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:c}}),c=null)}const T=l?j(l):void 0,b=m?{timeZoneIANA:Q}:null,w={warnings:i,featureErrors:[],layerDefinition:{...k,drawingInfo:T??void 0,templates:E(I),extent:void 0,geometryType:l,objectIdField:d,fields:o,hasZ:!!u,timeInfo:c,dateFieldsTimeReference:b}};this._featureIdInfo={type:"object-id",fieldName:d},this._queryEngine=new h({fieldsIndex:R.fromLayerJSON({fields:o,timeInfo:c,dateFieldsTimeReference:b}),geometryType:l,hasM:!1,hasZ:u,featureIdInfo:this._featureIdInfo,spatialReference:p,timeInfo:c,featureStore:new y({geometryType:l,hasM:!1,hasZ:u})});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(_);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=F(I,d);const x=this._createFeatures(r);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const S=this._normalizeFeatures(x,w.featureErrors);this._queryEngine.featureStore.addMany(S);const{fullExtent:D,timeExtent:v}=await this._queryEngine.fetchRecomputedExtents();if(w.layerDefinition.extent=D,v){const{start:e,end:t}=v;w.layerDefinition.timeInfo.timeExtent=[e,t]}return w}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([b(t,s),f(e.adds,t),f(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),await this._queryEngine.executeQueryForSnapping(e,t.signal)}async queryAttributeBins(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeAttributeBinsQuery(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then(e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)},e=>{this._queryEngine.featureStore.clear(),r(e)||i.getLogger("esri.layers.GeoJSONLayer").error(new s("geojson-layer:refresh","An error occurred during refresh",{error:e}))}),await this._waitSnapshotComplete();const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a}}_createFeatures(e){if(null==e)return[];const{geometryType:t,hasZ:s}=this._queryEngine,i=this._featureIdInfo.fieldName,r=_(e,{geometryType:t,hasZ:s,objectIdField:i});if(!o(this._queryEngine.spatialReference,a))for(const n of r)null!=n.geometry&&(n.geometry=u(m(l(n.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),a,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:s,customParameters:i}=this._loadOptions,r=(await e(s??"",{responseType:"json",query:{...i},signal:t})).data;return I(r),r}_normalizeFeatures(e,t){const{fieldsIndex:s}=this._queryEngine,i=[],r=this._featureIdInfo.fieldName;for(const n of e){const e=this._createDefaultAttributes(),a=w(s,e,n.attributes,!0);a?t?.push(a):(this._assignObjectId(e,n.attributes,!0),n.attributes=e,n.objectId=e[r],i.push(n))}return i}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const e of i)r.deleteResults.push(q(e));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:a,spatialReference:o,featureStore:u,fieldsIndex:l}=this._queryEngine,p=this._featureIdInfo.fieldName,c=[];for(const d of t){if(d.geometry&&i!==n(d.geometry)){s.push(x("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=w(l,t,d.attributes);if(r)s.push(r);else{if(this._assignObjectId(t,d.attributes),d.attributes=t,null!=d.uid){const t=d.attributes[p];e.uidToObjectId[d.uid]=t}if(null!=d.geometry){const e=d.geometry.spatialReference??o;d.geometry=m(S(d.geometry,e),e,o)}c.push(d),s.push(q(d.attributes[p]))}}u.addMany(d([],c,i,a,r,this._featureIdInfo))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,spatialReference:a,featureStore:o,fieldsIndex:u}=this._queryEngine,l=this._featureIdInfo.fieldName;for(const d of t){const{attributes:t,geometry:y}=d,f=t?.[l];if(null==f){e.push(x(`Identifier field ${l} missing`));continue}if(!o.has(f)){e.push(x(`Feature with object id ${f} missing`));continue}const h=p(o.getFeature(f),s,r,i);if(null!=y){if(s!==n(y)){e.push(x("Incorrect geometry type."));continue}const t=y.spatialReference??a;h.geometry=m(S(y,t),t,a)}if(t){const s=w(u,h.attributes,t);if(s){e.push(s);continue}}o.add(c(h,s,r,i,this._featureIdInfo)),e.push(q(f))}}_createObjectIdGenerator(e,t){const s=this._featureIdInfo.fieldName,i=e.fieldsIndex.get(s);if("esriFieldTypeString"===i.type)return()=>i.name+"-"+Date.now().toString(16);let r=Number.NEGATIVE_INFINITY;for(const n of t)n.objectId&&(r=Math.max(r,n.objectId));return r=Math.max(0,r)+1,()=>r++}_assignObjectId(e,t,s=!1){const i=this._featureIdInfo.fieldName;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await f(a,e)}catch{throw new s("geojson-layer","Projection not supported")}}}export{D as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{isDateString as e}from"../../../../core/date.js";import t from"../../../../core/Error.js";import{isWGS84 as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromMultipoint as n,convertFromPolyline as r}from"../../featureConversionUtils.js";import{OptimizedFeature as i}from"../../OptimizedFeature.js";import s from"../../OptimizedGeometry.js";import{normalizeFieldName as c,isNumericField as l}from"../../../support/fieldUtils.js";const u={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function f(e){return u[e]}function*p(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*a(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function*y(e,t={}){const{geometryType:o,objectIdField:n}=t;for(const r of e){const{geometry:e,properties:s,id:c}=r;if(e&&f(e.type)!==o)continue;const l=s||{};let u;n&&(u=l[n],null==c||u||(l[n]=u=c)),yield new i(e&&P(e,t),l,null,u)}}function d(e){for(const t of e)if(t.length>2)return!0;return!1}function g(e){return!h(e)}function m(e){return h(e)}function h(e){let t=0;for(let o=0;o<e.length;o++){const n=e[o],r=e[(o+1)%e.length];t+=n[0]*r[1]-r[0]*n[1]}return t<=0}function w(e){const t=e[0],o=e[e.length-1];t[0]===o[0]&&t[1]===o[1]&&t[2]===o[2]||e.push(t)}function P(e,t){const{coordinates:o,type:i}=e,c=t.hasZ??!1,l=!0;switch(i){case"Point":return new s([],[...o],c,!1);case"LineString":return r({paths:[o],hasZ:l},c,!1);case"MultiLineString":return r({paths:o,hasZ:l},c,!1);case"MultiPoint":return n({points:o,hasZ:l},c,!1);case"Polygon":case"MultiPolygon":{const e=new s([],[],c,!1);for(const t of"Polygon"===i?[o]:o){j(e,t[0],c);for(let o=1;o<t.length;o++)b(e,t[o],c)}return e}}}function j(e,t,o){w(t),g(t)?F(e,t,o):S(e,t,o)}function b(e,t,o){w(t),m(t)?F(e,t,o):S(e,t,o)}function S(e,t,o){for(const n of t)G(e,n,o);e.lengths.push(t.length)}function F(e,t,o){for(let n=t.length-1;n>=0;n--)G(e,t[n],o);e.lengths.push(t.length)}function G(e,[t,o,n],r){e.coords.push(t,o),r&&e.coords.push(n||0)}function k(t){switch(typeof t){case"string":return e(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function M(e,n=4326){if(!e)throw new t("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new t("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:r}=e;if(!r)return;const i="string"==typeof r?r:"name"===r.type?r.properties.name:"EPSG"===r.type?r.properties.code:null,s=o({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!i||!s.test(i))throw new t("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:r})}function T(e,t={}){const o=[],n=new Set,r=new Set;let i,s=!1,u=null,y=!1,{geometryType:g=null}=t;for(const l of p(e)){const{geometry:e,properties:t,id:p}=l;if(!e||(g||(g=f(e.type)),f(e.type)===g)){if(!s){s=d(a(e))}if(y||(y=null!=p,y&&(i=typeof p,t&&(u=Object.keys(t).filter(e=>t[e]===p)))),t&&u&&y&&null!=p&&(u.length>1?u=u.filter(e=>t[e]===p):1===u.length&&(u=t[u[0]]===p?u:[])),t)for(const e in t){if(n.has(e))continue;const i=k(t[e]);if("unknown"===i){r.add(e);continue}r.delete(e),n.add(e);const s=c(e);s&&o.push({name:s,alias:e,type:i})}}}const m=c(1===u?.length&&u[0]||null)??void 0;if(m)for(const c of o)if(c.name===m&&l(c)){c.type="esriFieldTypeOID";break}return{fields:o,geometryType:g,hasZ:s,objectIdFieldName:m,objectIdFieldType:i,unknownFields:Array.from(r)}}function O(e,t){return Array.from(y(p(e),t))}export{O as createOptimizedFeatures,f as getGeometryType,T as inferLayerProperties,M as validateGeoJSON};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as t,__disposeResources as e}from"tslib";import a from"../../../../request.js";import has from"../../../../core/has.js";import{QueueProcessor as
|
|
2
|
+
import{__addDisposableResource as t,__disposeResources as e}from"tslib";import a from"../../../../request.js";import s from"../../../../core/Error.js";import{EventEmitter as r}from"../../../../core/Evented.js";import has from"../../../../core/has.js";import{QueueProcessor as n}from"../../../../core/QueueProcessor.js";import{isBlobProtocol as i}from"../../../../core/urlUtils.js";import{ParquetFileInfo as o}from"./ParquetFileInfo.js";import{parseFileStatisticsMap as c}from"./ParquetFileStatistics.js";import{createParquetFile as h,readMetadata as u}from"../../../../libs/parquet/parquet.js";const f="parquet.v1",l="_spatial.json",g=new n({concurrency:12,process:async t=>{const{data:e}=await a(t.url,t.options);return e}});class p{constructor(t,e=()=>{}){this._geometryInfo=t,this._getCustomParameters=e,this.events=new r}async destroy(){await this.clear()}async clear(){if(this._infos){const t=await this._infos;for(const e of t.values())e.destroy();t.clear(),this._infos=null}}async getMetadata(){const a={stack:[],error:void 0,hasError:!1};try{const e=(await this._getParquetFileNames()).at(0);if(!e)return null;const s=t(a,await h(e,{provider:this}),!1);return u(s)}catch(s){a.error=s,a.hasError=!0}finally{e(a)}}getGeometryInfo(){return this._geometryInfo}async getFiles(){const t=await this._getInfoMap();return Array.from(t.values())}async updateGeometryInfo(t){if(this._geometryInfo)throw new Error("GeometryInfo already set");await this.clear(),this._geometryInfo=t}async fetchLength(t){const{byteLength:e,cacheTag:a}=await this._fetchLengthAndTag(t);if(!has("parquetlayer-cache-enabled"))return e;try{await this._createOrResetCache(t,a)}catch(s){}return e}async fetchRange(t,e,a,s){if(!has("parquetlayer-cache-enabled"))return this._fetchRange(t,e,a,s);const r=new URL(this._getCacheFileName(t));r.searchParams.append("range",`${e}-${a}`);try{const n=await this._openCache(t),i=await n.match(r);if(i)return await i.arrayBuffer();const o=await this._fetchRange(t,e,a,s);return await n.put(r,new Response(o,{headers:{"Content-Type":"application/octet-stream","Content-Length":o.byteLength.toString()}})),o}catch(n){return this._fetchRange(t,e,a,s)}}_getCacheFileName(t){return t}async _requestStatistics(t){const{data:e}=await a(t,{responseType:"json",query:this._getCustomParameters()});return e}async _fetchRange(t,e,a,r){const n={url:t,options:{responseType:"array-buffer",query:this._getCustomParameters()??{},cacheMode:"no-store",useQueue:!0,headers:{range:`bytes=${e}-${a}`}}},i=await g.push(n),o=a-e+1;if(i.byteLength!==o)throw new s("InvalidRangeRequest",`request returned ${i.byteLength} bytes for range ${e}-${a}, expected ${o}.`);return i}async _fetchLengthAndTag(t){if(i(t)){const{data:e}=await a(t,{responseType:"blob"});return{byteLength:e.size,cacheTag:null}}const e=await this._requestHead(t),s=e.headers.get("Content-Length");if(null==s)throw new Error("Unable to parse content length");const r=e.headers.get("etag")??e.headers.get("Last-Modified");return{byteLength:parseInt(s,10),cacheTag:r}}async _getInfoMap(){return this._infos||(this._infos=this._fetchParquetFiles()),this._infos}async _updateParquetFileInfos(t){const e=await this._getInfoMap(),a=new Set(t);for(const s of a)if(!e.get(s)){const t=e.size,a=await o.create(this.getGeometryInfo(),this,s,t,null);e.set(s,a)}for(const s of e.keys())if(!a.has(s))throw new Error("Deletion not supported")}async _getFileStatistics(t){this._statistics||(this._statistics=this._fetchStatistics());const e=await this._statistics,a=m(t);return e.get(a)}async _fetchParquetFiles(){const t=(await this._getParquetFileNames()).map(async(t,e)=>{const a=e,s=await this._getFileStatistics(t);return o.create(this.getGeometryInfo(),this,t,a,s)}),e=await Promise.all(t),a=new Map;for(const s of e)a.set(s.url,s);return a}async _fetchStatistics(){const t=await this._getStatisticsFileName();if(null==t)return new Map;const e=await this._resolveFileUrl(t),a=await this._requestStatistics(e);return c(a)}async _requestHead(t){const{data:e}=await a(t,{responseType:"native",method:"head",query:this._getCustomParameters()});return e}async _openCache(t){return caches.open(this._getCacheName(t))}_getCacheName(t){return`${f}:${this._getCacheFileName(t)}`}async _createOrResetCache(t,e){const a=this._getCacheName(t),s=new URL(this._getCacheFileName(t));if(s.searchParams.append("metadata","true"),null==e)return void await caches.delete(a);let r=await caches.open(a);const n=await r.match(s),i=await(n?.json());i?.tag!==e&&(await caches.delete(a),r=await caches.open(a));const o=JSON.stringify({tag:e});await r.put(s,new Response(o,{headers:{"Content-Type":"application/json","Content-Length":o.length.toString()}}))}}function y(t){const e=t.split(/[?#]/)[0];return e===l||e.endsWith(l)}function m(t){return t.split(/[?#]/)[0].split("/").at(-1)??t}export{p as FileProvider,y as isStatisticsFileName,l as spatialFileName};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../request.js";import{FileProvider as t,isStatisticsFileName as
|
|
2
|
+
import e from"../../../../request.js";import{FileProvider as t,isStatisticsFileName as r}from"./FileProvider.js";import{createFileProviderChangedError as s}from"./fileProviderChangedError.js";const a=100;class i extends t{constructor(e,t,r){super(t,r),this._schema=e,this._directoryChanged=!1}get _baseUrl(){return this._schema.itemCdnUrl??this._schema.itemUrl}async update(e){throw new Error("Unsupported")}async _getParquetFileNames(){const e=await this._getResources();return Array.from(e.keys()).filter(e=>e.endsWith(".parquet"))}async _getStatisticsFileName(){const e=await this._getResources();return Array.from(e.keys()).find(r)??null}_getCacheFileName(e){return`${this._baseUrl}/resources/${e}`}async _resolveFileUrl(e){const t=await this._getResource(e);return t.signedUrl?t.signedUrl:`${this._baseUrl}/resources/${e}`}async _fetchLengthAndTag(e){const t=await this._getResource(e),r=this._schema.itemMetadata.modified.getTime().toString();return{byteLength:t.size,cacheTag:r}}async _fetchRange(e,t,r,a){if(this._directoryChanged)throw s();try{const s=await this._resolveFileUrl(e);return await super._fetchRange(s,t,r,a)}catch{if("directory-changed"===await this._refetchResources())throw s()}const i=await this._resolveFileUrl(e);return super._fetchRange(i,t,r,a)}_refetchResources(){return this._directoryChanged?Promise.resolve("directory-changed"):(this._updateResourcesPromise||(this._updateResourcesPromise=this._executeRefetchResources().finally(()=>{this._updateResourcesPromise=null})),this._updateResourcesPromise)}async _executeRefetchResources(){return await this._refetchPortalItemMetadata()?(this.events.emit("sourceChanged"),this._directoryChanged=!0,"directory-changed"):(this._resources=this._fetchResources(),"ok")}async _refetchPortalItemMetadata(){const t=this._schema.itemMetadata.url,r=await e(this._schema.itemUrl,{responseType:"json",query:{f:"json"}}),{modified:s,url:a}=r.data;if(null==a)throw new Error("Portal item metadata must have a url defined.");if(null==s)throw new Error("Portal item metadata must have a modified timestamp defined.");return this._schema.itemMetadata={modified:new Date(s),url:a},t!==a}async _getResources(){return this._resources||(this._resources=this._fetchResources()),await this._resources}async _getResource(e){const t=(await this._getResources()).get(e);if(!t)throw new Error(`Resource ${e} not found.`);return t}async _fetchResources(){const t=new Map;let r=1;const s=o(this._schema.itemMetadata.url);for(;-1!==r;){const i=await e(`${this._baseUrl}/resources`,{query:{f:"json",start:r,num:a}});for(const e of i.data.resources)e.resource.startsWith(s)&&t.set(e.resource,e);r=i.data.nextStart}return t}}function o(e){const t=e.split("/").filter(Boolean),r=t.indexOf("resources");if(-1===r||r===t.length-1)throw new Error(`URL does not contain a resources directory name: ${e}`);return`${t.slice(r+1).map(e=>decodeURIComponent(e)).join("/")}/`}export{i as PortalParquetResourcesFileProvider};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import r from"../../../../core/Error.js";function e(r){return null!=r&&"object"==typeof r&&"name"in r&&"FileProviderChangedError"===r.name}function n(e=""){return new r("FileProviderChangedError",e)}export{n as createFileProviderChangedError,e as isFileProviderChangedError};
|