@arcgis/core 5.2.0-next.144 → 5.2.0-next.145
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/analysis/AreaMeasurementAnalysis.d.ts +11 -1
- package/analysis/DirectLineMeasurementAnalysis.d.ts +11 -1
- package/analysis/DistanceMeasurementAnalysis.d.ts +8 -0
- package/arcgisGlobal.d.ts +5 -5
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{1ede8666d804c553803e.js → 0b6941781e35ce0f7274.js} +1 -1
- package/assets/esri/core/workers/chunks/{a0d459bdb91ee892d4b6.js → 116293b1ee788a89ce1e.js} +1 -1
- package/assets/esri/core/workers/chunks/18f20fd43ec9ce03cef1.js +1 -0
- package/assets/esri/core/workers/chunks/{8959a825f5e1ce6f38ac.js → 1c65ab9ed611c322ce27.js} +1 -1
- package/assets/esri/core/workers/chunks/257910cca66dc5df465e.js +1 -0
- package/assets/esri/core/workers/chunks/2e096537a3a5555a4a93.js +1 -0
- package/assets/esri/core/workers/chunks/505227797bcf2a1d908d.js +1 -0
- package/assets/esri/core/workers/chunks/56a24061589f4a968818.js +1 -0
- package/assets/esri/core/workers/chunks/{5b3cfe95314a75a735c1.js → 588e677f33df86a595bf.js} +1 -1
- package/assets/esri/core/workers/chunks/{1c0975c2dd1d0e2710bb.js → 6883a5c6883eccaddf64.js} +1 -1
- package/assets/esri/core/workers/chunks/{f74e32d2ffe81778826b.js → 6c1d5577a17a5c8ccf39.js} +1 -1
- package/assets/esri/core/workers/chunks/6c83398cf586ecea0eb1.js +1 -0
- package/assets/esri/core/workers/chunks/{e521bb9ee2030245c3ce.js → 6f358116f79021ff9687.js} +1 -1
- package/assets/esri/core/workers/chunks/76196c414e48834f7b92.js +1 -0
- package/assets/esri/core/workers/chunks/77ebacfdf8e57f2e03f1.js +1118 -0
- package/assets/esri/core/workers/chunks/794e5a67a88cb10c1a19.js +1 -0
- package/assets/esri/core/workers/chunks/943a0f140813ee4ab04a.js +1 -0
- package/assets/esri/core/workers/chunks/aba42885c5d6b2b5fe7f.js +1 -0
- package/assets/esri/core/workers/chunks/{402a82c77420254831bc.js → b7d77dd2abb255fd2e5a.js} +1 -1
- package/assets/esri/core/workers/chunks/ba48045a81acc4cda927.js +1 -0
- package/assets/esri/core/workers/chunks/d21257d2e2a37266c0f7.js +1 -0
- package/assets/esri/core/workers/chunks/d4f038e04c42aed588c1.js +1 -0
- package/assets/esri/core/workers/chunks/d90a3bfd45b5ed4092e0.js +1 -0
- package/{basemaps/BasemapCollection.d.ts → basemapGallery/BasemapGalleryModel.d.ts} +8 -8
- package/{basemaps/BasemapCollection.js → basemapGallery/BasemapGalleryModel.js} +1 -1
- package/{basemaps → basemapGallery}/BasemapsSource.d.ts +1 -1
- package/{basemaps → basemapGallery}/BasemapsSource.js +1 -1
- package/{basemaps → basemapGallery}/LocalBasemapsSource.d.ts +2 -2
- package/{basemaps → basemapGallery}/LocalBasemapsSource.js +1 -1
- package/{basemaps → basemapGallery}/PortalBasemapsSource.d.ts +2 -2
- package/{basemaps → basemapGallery}/PortalBasemapsSource.js +1 -1
- package/{basemaps → basemapGallery}/support/BasemapItem.d.ts +2 -2
- package/{basemaps → basemapGallery}/support/BasemapItem.js +1 -1
- package/{basemaps → basemapGallery}/types.d.ts +2 -2
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/transferFeatures.js +1 -1
- package/package.json +2 -2
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +4 -4
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +4 -4
- package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +3 -0
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +2 -1
- package/views/3d/layers/support/FeatureMemory.js +1 -1
- package/views/3d/layers/support/FeatureTile.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/support/PBFDecoder.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadGlobalIllumination.glsl.js +16 -11
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/SceneView.d.ts +4 -10
- package/views/View.d.ts +4 -12
- package/views/interactive/options/SnappingOptions.d.ts +28 -12
- package/views/interactive/options/TooltipOptions.d.ts +8 -1
- package/views/interactive/options/ValueOptions.d.ts +9 -2
- package/views/interactive/options/ViewOptions.d.ts +81 -6
- package/widgets/BasemapGallery/BasemapGalleryViewModel.d.ts +2 -2
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery/support/BasemapGalleryItem.d.ts +3 -3
- package/widgets/BasemapGallery/support/LocalBasemapsSource.d.ts +2 -2
- package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +2 -2
- package/widgets/BasemapGallery/types.d.ts +3 -3
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +13 -8
- package/widgets/Editor.d.ts +9 -9
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +13 -8
- package/widgets/Sketch.d.ts +9 -9
- package/assets/esri/core/workers/chunks/1b551ef3d84d9c1e93f9.js +0 -1
- package/assets/esri/core/workers/chunks/260dcb79dfd0f981949f.js +0 -1
- package/assets/esri/core/workers/chunks/303676d1b10676c9cab4.js +0 -1
- package/assets/esri/core/workers/chunks/37a636f61cfe89c6bfd1.js +0 -1
- package/assets/esri/core/workers/chunks/4097edb2ad522dff50ce.js +0 -1
- package/assets/esri/core/workers/chunks/4a0216ee6382d9276f1c.js +0 -1
- package/assets/esri/core/workers/chunks/55766692b578e60dd70e.js +0 -1742
- package/assets/esri/core/workers/chunks/57970d43cdcc5cf57a30.js +0 -1
- package/assets/esri/core/workers/chunks/5fd099ca1024707387b2.js +0 -1
- package/assets/esri/core/workers/chunks/68e24fa3f564c2a5c9fd.js +0 -1
- package/assets/esri/core/workers/chunks/8e7a33cc1f83063043f2.js +0 -1
- package/assets/esri/core/workers/chunks/a23272a7a47a95f6ddea.js +0 -1
- package/assets/esri/core/workers/chunks/cbdebdfa5f2cded29d0d.js +0 -1
- package/assets/esri/core/workers/chunks/d56780290e0218d3e9de.js +0 -1
- package/assets/esri/core/workers/chunks/de24fc414a3f243d675e.js +0 -1
- package/assets/esri/core/workers/chunks/e22d45aeef293a5ffb78.js +0 -1
- package/assets/esri/core/workers/chunks/ea746d9bbea170719a1c.js +0 -1
- package/assets/esri/core/workers/chunks/f0c0c02730fe0d948fc1.js +0 -1
- /package/{basemaps → basemapGallery}/support/basemapCompatibilityUtils.js +0 -0
|
@@ -16,6 +16,10 @@ export interface ViewOptionsProperties {
|
|
|
16
16
|
/**
|
|
17
17
|
* Units for displaying measurements, such as lengths, areas, and volumes.
|
|
18
18
|
*
|
|
19
|
+
* Each unit can be configured independently. Unset units use the defaults of the component, view model, or analysis.
|
|
20
|
+
* A display unit set directly on a component, view model, or analysis overrides the corresponding unit on the view,
|
|
21
|
+
* without changing the view's options or the units used by other components, view models, or analyses.
|
|
22
|
+
*
|
|
19
23
|
* @since 5.2
|
|
20
24
|
*/
|
|
21
25
|
displayUnits?: UnitsProperties;
|
|
@@ -23,6 +27,10 @@ export interface ViewOptionsProperties {
|
|
|
23
27
|
* Units for interpreting numeric values entered by the user.
|
|
24
28
|
*
|
|
25
29
|
* Input units may differ from [displayUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#displayUnits).
|
|
30
|
+
* Each unit can be configured independently. Unset units use the defaults of the component, view model, or analysis.
|
|
31
|
+
* An input unit set directly on a component, view model, or analysis overrides the corresponding unit on the view,
|
|
32
|
+
* without changing the view's options or the units used by other components, view models, or analyses.
|
|
33
|
+
* These options control numeric input in the UI, not the spatial reference or stored coordinates of a geometry.
|
|
26
34
|
*
|
|
27
35
|
* @since 5.2
|
|
28
36
|
*/
|
|
@@ -39,7 +47,7 @@ export interface ViewOptionsProperties {
|
|
|
39
47
|
* >
|
|
40
48
|
* > These options currently do not apply to [AreaMeasurementAnalysisView2D](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/AreaMeasurementAnalysisView2D/) or
|
|
41
49
|
* > [DistanceMeasurementAnalysisView2D](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/DistanceMeasurementAnalysisView2D/), including their measurement components.
|
|
42
|
-
* > Configure `snappingOptions` on the analysis view or component instead. Tooltip and unit
|
|
50
|
+
* > Configure `snappingOptions` on the analysis view or component instead. Tooltip and unit options configured through
|
|
43
51
|
* > `view.options` still apply. Support for `view.options.snapping` in these analyses and components is planned for a future release.
|
|
44
52
|
*
|
|
45
53
|
* @since 5.2
|
|
@@ -48,7 +56,15 @@ export interface ViewOptionsProperties {
|
|
|
48
56
|
/**
|
|
49
57
|
* Options for tooltips shown while sketching, editing, or placing analyses.
|
|
50
58
|
*
|
|
51
|
-
* Tooltips are disabled by default.
|
|
59
|
+
* Tooltips are disabled by default in both [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) and [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
|
|
60
|
+
*
|
|
61
|
+
* > [!WARNING]
|
|
62
|
+
* >
|
|
63
|
+
* > **Known Limitations**
|
|
64
|
+
* >
|
|
65
|
+
* > The [Volume Measurement](https://developers.arcgis.com/javascript/latest/references/core/analysis/VolumeMeasurementAnalysis/) cut-fill elevation tooltip remains enabled
|
|
66
|
+
* > independently of these options. Its display and input units can still inherit
|
|
67
|
+
* > [ViewOptions.displayUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#displayUnits) and [ViewOptions.inputUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#inputUnits).
|
|
52
68
|
*
|
|
53
69
|
* @since 5.2
|
|
54
70
|
*/
|
|
@@ -56,13 +72,56 @@ export interface ViewOptionsProperties {
|
|
|
56
72
|
}
|
|
57
73
|
|
|
58
74
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
75
|
+
* Configures snapping, tooltips, display units, and input units for supported components, view models, and analyses through [View.options](https://developers.arcgis.com/javascript/latest/references/core/views/View/#options).
|
|
76
|
+
*
|
|
77
|
+
* Unlike inherited snapping and tooltip options, display and input units can be overridden individually through
|
|
78
|
+
* unit properties exposed by a component, view model, or analysis.
|
|
79
|
+
* For example, setting [DistanceMeasurementAnalysis.unit](https://developers.arcgis.com/javascript/latest/references/core/analysis/DistanceMeasurementAnalysis/#unit) to `feet` overrides
|
|
80
|
+
* [view.options.displayUnits.length](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/support/Units/#length) for that analysis without changing the view's configuration or other analyses.
|
|
81
|
+
* Setting the analysis unit back to `null` restores the unit configured through `view.options.displayUnits.length`.
|
|
61
82
|
*
|
|
62
83
|
* > [!IMPORTANT]
|
|
63
84
|
* >
|
|
64
85
|
* > These options are not saved in a [WebMap](https://developers.arcgis.com/javascript/latest/references/core/WebMap/) or [WebScene](https://developers.arcgis.com/javascript/latest/references/core/WebScene/).
|
|
65
86
|
*
|
|
87
|
+
* The following table shows which components, view models, and analyses inherit each option from `view.options`.
|
|
88
|
+
*
|
|
89
|
+
* - **✓**: The option is inherited, with explicit component, view model, or analysis **units** taking precedence as described above.
|
|
90
|
+
* - `Opt-in`: The option is inherited only when the component's or view model's `useViewOptions` property is `true`.
|
|
91
|
+
* - ✗: The capability exists but does not inherit the option from the view. See the corresponding footnote.
|
|
92
|
+
* - `N/A`: The capability is unavailable for that component or analysis (for example, Area Measurement 3D does not support tooltips at all).
|
|
93
|
+
*
|
|
94
|
+
* | Component or analysis | Inherits `view.options.snapping` | Inherits `view.options.tooltips` | Inherits `view.options.displayUnits` | Inherits `view.options.inputUnits` |
|
|
95
|
+
* | --- | :---: | :---: | :---: | :---: |
|
|
96
|
+
* | Area Measurement 2D | ✗¹ | **✓** | **✓** | **✓** |
|
|
97
|
+
* | Area Measurement 3D | **✓** | N/A | **✓** | N/A |
|
|
98
|
+
* | Distance Measurement 2D | ✗¹ | **✓** | **✓** | **✓** |
|
|
99
|
+
* | Direct Line Measurement 3D | **✓** | N/A | **✓** | N/A |
|
|
100
|
+
* | Elevation Profile | **✓** | N/A | **✓** | N/A |
|
|
101
|
+
* | Line of Sight | **✓** | **✓** | **✓** | **✓** |
|
|
102
|
+
* | Viewshed | **✓** | **✓** | **✓** | **✓** |
|
|
103
|
+
* | Length Dimension | **✓** | N/A | **✓** | N/A |
|
|
104
|
+
* | Volume Measurement | **✓** | ✗² | **✓** | **✓** |
|
|
105
|
+
* | Sketch | Opt-in³ | Opt-in³ | Opt-in³ | Opt-in³ |
|
|
106
|
+
* | Editor | Opt-in³ | Opt-in³ | Opt-in³ | Opt-in³ |
|
|
107
|
+
*
|
|
108
|
+
* 1. For 2D measurements, configure snapping through the component's own `snappingOptions`,
|
|
109
|
+
* [AreaMeasurementAnalysisView2D.snappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/AreaMeasurementAnalysisView2D/#snappingOptions), or
|
|
110
|
+
* [DistanceMeasurementAnalysisView2D.snappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/DistanceMeasurementAnalysisView2D/#snappingOptions).
|
|
111
|
+
* Support for `view.options.snapping` is planned for a future release.
|
|
112
|
+
* 2. The Volume Measurement cut-fill elevation tooltip remains enabled independently of
|
|
113
|
+
* `view.options.tooltips`.
|
|
114
|
+
* 3. For Sketch and Editor, including [SketchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/) and [EditorViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/EditorViewModel/),
|
|
115
|
+
* set the component's or view model's `useViewOptions` property to `true` (default: `false`) to use options on the view.
|
|
116
|
+
* Changes to this property apply to the next create or update operation, not an operation already in progress.
|
|
117
|
+
*
|
|
118
|
+
* When this property is `true`:
|
|
119
|
+
*
|
|
120
|
+
* - Snapping and tooltip options specified on the component or view model are preserved but ignored.
|
|
121
|
+
* - The corresponding controls in the component's Settings menu are hidden.
|
|
122
|
+
* - Where unit properties are exposed, explicit units override those configured through `view.options` per measurement type.
|
|
123
|
+
* - Set an explicit unit to `null` or `undefined` to use the unit from `view.options` for that measurement type again.
|
|
124
|
+
*
|
|
66
125
|
* @beta
|
|
67
126
|
* @since 5.2
|
|
68
127
|
*/
|
|
@@ -72,6 +131,10 @@ export default class ViewOptions extends Accessor {
|
|
|
72
131
|
/**
|
|
73
132
|
* Units for displaying measurements, such as lengths, areas, and volumes.
|
|
74
133
|
*
|
|
134
|
+
* Each unit can be configured independently. Unset units use the defaults of the component, view model, or analysis.
|
|
135
|
+
* A display unit set directly on a component, view model, or analysis overrides the corresponding unit on the view,
|
|
136
|
+
* without changing the view's options or the units used by other components, view models, or analyses.
|
|
137
|
+
*
|
|
75
138
|
* @since 5.2
|
|
76
139
|
*/
|
|
77
140
|
get displayUnits(): Units;
|
|
@@ -80,6 +143,10 @@ export default class ViewOptions extends Accessor {
|
|
|
80
143
|
* Units for interpreting numeric values entered by the user.
|
|
81
144
|
*
|
|
82
145
|
* Input units may differ from [displayUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#displayUnits).
|
|
146
|
+
* Each unit can be configured independently. Unset units use the defaults of the component, view model, or analysis.
|
|
147
|
+
* An input unit set directly on a component, view model, or analysis overrides the corresponding unit on the view,
|
|
148
|
+
* without changing the view's options or the units used by other components, view models, or analyses.
|
|
149
|
+
* These options control numeric input in the UI, not the spatial reference or stored coordinates of a geometry.
|
|
83
150
|
*
|
|
84
151
|
* @since 5.2
|
|
85
152
|
*/
|
|
@@ -97,7 +164,7 @@ export default class ViewOptions extends Accessor {
|
|
|
97
164
|
* >
|
|
98
165
|
* > These options currently do not apply to [AreaMeasurementAnalysisView2D](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/AreaMeasurementAnalysisView2D/) or
|
|
99
166
|
* > [DistanceMeasurementAnalysisView2D](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/DistanceMeasurementAnalysisView2D/), including their measurement components.
|
|
100
|
-
* > Configure `snappingOptions` on the analysis view or component instead. Tooltip and unit
|
|
167
|
+
* > Configure `snappingOptions` on the analysis view or component instead. Tooltip and unit options configured through
|
|
101
168
|
* > `view.options` still apply. Support for `view.options.snapping` in these analyses and components is planned for a future release.
|
|
102
169
|
*
|
|
103
170
|
* @since 5.2
|
|
@@ -107,7 +174,15 @@ export default class ViewOptions extends Accessor {
|
|
|
107
174
|
/**
|
|
108
175
|
* Options for tooltips shown while sketching, editing, or placing analyses.
|
|
109
176
|
*
|
|
110
|
-
* Tooltips are disabled by default.
|
|
177
|
+
* Tooltips are disabled by default in both [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) and [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
|
|
178
|
+
*
|
|
179
|
+
* > [!WARNING]
|
|
180
|
+
* >
|
|
181
|
+
* > **Known Limitations**
|
|
182
|
+
* >
|
|
183
|
+
* > The [Volume Measurement](https://developers.arcgis.com/javascript/latest/references/core/analysis/VolumeMeasurementAnalysis/) cut-fill elevation tooltip remains enabled
|
|
184
|
+
* > independently of these options. Its display and input units can still inherit
|
|
185
|
+
* > [ViewOptions.displayUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#displayUnits) and [ViewOptions.inputUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#inputUnits).
|
|
111
186
|
*
|
|
112
187
|
* @since 5.2
|
|
113
188
|
*/
|
|
@@ -11,7 +11,7 @@ import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
|
|
|
11
11
|
import type { LocalBasemapsSourceProperties } from "./support/LocalBasemapsSource.js";
|
|
12
12
|
import type { PortalBasemapsSourceProperties } from "./support/PortalBasemapsSource.js";
|
|
13
13
|
|
|
14
|
-
/** @deprecated since version 5.2. Use [
|
|
14
|
+
/** @deprecated since version 5.2. Use [BasemapGalleryModelProperties](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/BasemapGalleryModel/#BasemapGalleryModelProperties) instead. */
|
|
15
15
|
export interface BasemapGalleryViewModelProperties extends LoadableMixinProperties, Partial<Pick<BasemapGalleryViewModel, "view">> {
|
|
16
16
|
/** The map's [Map.basemap](https://developers.arcgis.com/javascript/latest/references/core/Map/#basemap). */
|
|
17
17
|
activeBasemap?: BasemapProperties | string | null;
|
|
@@ -31,7 +31,7 @@ export type BasemapGalleryViewModelState = "disabled" | "loading" | "ready" | "u
|
|
|
31
31
|
/**
|
|
32
32
|
* Provides the logic for the [BasemapGallery widget](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/) and [component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-gallery/).
|
|
33
33
|
*
|
|
34
|
-
* @deprecated since version 5.2. Use [
|
|
34
|
+
* @deprecated since version 5.2. Use [BasemapGalleryModel](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/BasemapGalleryModel/) instead.
|
|
35
35
|
* @since 4.3
|
|
36
36
|
* @see [BasemapGallery widget](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/) - _Deprecated since 4.32. Use the [Basemap Gallery component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-gallery/) instead._
|
|
37
37
|
* @see [Programming patterns: Widget viewModel pattern](https://developers.arcgis.com/javascript/latest/programming-patterns/#widget-viewmodel-pattern)
|
|
@@ -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/Collection.js";import{deprecatedModule as n}from"../../core/deprecate.js";import{Loadable as r,isLoadable as i}from"../../core/Loadable.js";import a from"../../core/Logger.js";import{watch as o,on as s,when as c}from"../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../core/accessorSupport/decorators.js";import{canProjectWithoutEngine as d,isLoaded as f,load as p}from"../../geometry/projectionUtils.js";import{equals as m}from"../../geometry/support/spatialReferenceUtils.js";import{isLinkChartView as h}from"../../linkChart/guards.js";import{basemapEnsureType as g}from"../../support/basemapEnsureType.js";import{contentEquals as _}from"../../support/basemapUtils.js";import{default3DCompatibility as v,default2DCompatibility as y}from"./support/basemapCompatibilityUtils.js";import b from"./support/BasemapGalleryItem.js";import x from"./support/LocalBasemapsSource.js";import S from"./support/PortalBasemapsSource.js";const C=t.ofType(b);function w(e){return e&&e.declaredClass===`esri.portal.Portal`}function T(e){return e&&!(e instanceof S)&&(!!e.portal||!!e.query)}function E(e){return e&&`basemaps`in e&&`state`in e&&`refresh`in e}let D=class extends r{constructor(e){super(e),this._loadingProjectionEngine=!1,this.items=new C,this.view=null,e?.suppressDeprecationWarning||n(a.getLogger(this),`esri.widgets.BasemapGallery.BasemapGalleryViewModel`,{version:`5.2`,replacement:`Use the @arcgis/core/
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{deprecatedModule as n}from"../../core/deprecate.js";import{Loadable as r,isLoadable as i}from"../../core/Loadable.js";import a from"../../core/Logger.js";import{watch as o,on as s,when as c}from"../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../core/accessorSupport/decorators.js";import{canProjectWithoutEngine as d,isLoaded as f,load as p}from"../../geometry/projectionUtils.js";import{equals as m}from"../../geometry/support/spatialReferenceUtils.js";import{isLinkChartView as h}from"../../linkChart/guards.js";import{basemapEnsureType as g}from"../../support/basemapEnsureType.js";import{contentEquals as _}from"../../support/basemapUtils.js";import{default3DCompatibility as v,default2DCompatibility as y}from"./support/basemapCompatibilityUtils.js";import b from"./support/BasemapGalleryItem.js";import x from"./support/LocalBasemapsSource.js";import S from"./support/PortalBasemapsSource.js";const C=t.ofType(b);function w(e){return e&&e.declaredClass===`esri.portal.Portal`}function T(e){return e&&!(e instanceof S)&&(!!e.portal||!!e.query)}function E(e){return e&&`basemaps`in e&&`state`in e&&`refresh`in e}let D=class extends r{constructor(e){super(e),this._loadingProjectionEngine=!1,this.items=new C,this.view=null,e?.suppressDeprecationWarning||n(a.getLogger(this),`esri.widgets.BasemapGallery.BasemapGalleryViewModel`,{version:`5.2`,replacement:`Use the @arcgis/core/basemapGallery/BasemapGalleryModel class instead.`,warnOnce:!0}),this.source=new S}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}initialize(){let e=()=>this._recreateItems();this.addHandles([o(()=>this.state===`ready`?this.compatibilityFunction:null,()=>this._updateItems()),s(()=>this.source?.basemaps,`change`,e,{onListenerAdd:e}),c(()=>this.view,()=>{this.source instanceof S&&(this.source.viewType=this.view?.type)},{once:!0})])}destroy(){let e=this.source.basemaps.find(e=>e===this.activeBasemap);e&&this.source.basemaps.remove(e),this.source?.destroy()}get activeBasemap(){return this.view?.map?.basemap??null}set activeBasemap(e){let t=this.view;if(!t?.map)return;if(e=g(e),!e||!t.ready){t.map.basemap=e,this._clearOverride(`activeBasemap`);return}let n=e.spatialReference||this.items?.find(t=>this.basemapEquals(e,t.basemap))?.spatialReference;if(n&&`spatialReferenceLocked`in t&&!t.spatialReferenceLocked){let r=t.spatialReference;if(n!=null&&!m(r,n)&&!d(t.spatialReference,n)&&!f()){this._override(`activeBasemap`,e),this._loadingProjectionEngine=!0,p().then(()=>{this._get(`activeBasemap`)===e&&(t.map.basemap=e,t.spatialReference=n,this._clearOverride(`activeBasemap`))},()=>{}).then(()=>{this._loadingProjectionEngine=!1});return}t.map.basemap=e,this._clearOverride(`activeBasemap`),n!=null&&!m(t.spatialReference,n)&&(t.spatialReference=n)}else t.map.basemap=e,this._clearOverride(`activeBasemap`)}get activeBasemapIndex(){let{state:e,activeBasemap:t}=this;return e===`ready`?this._findBasemapIndex(t):-1}get compatibilityFunction(){return this.view?.type===`3d`?v:y}set compatibilityFunction(e){this._overrideIfSome(`compatibilityFunction`,e)}get source(){return this._get(`source`)}set source(e){(Array.isArray(e)||t.isCollection(e))&&(e=new x({basemaps:Array.isArray(e)?new t(e):e})),w(e)&&(e=new S({portal:e})),T(e)&&(e=new S(e)),E(e)||(e=null),this._set(`source`,e)}get state(){return!this.view?.ready||!this.source?`disabled`:h(this.view)&&!this.view.inGeographicLayout?`unsupported`:this._loadingProjectionEngine?`loading`:`ready`}basemapEquals(e,t){return _(e,t)}refresh(){this._recreateItems()}load(){return this.loadSource()}loadSource(e){return this.addResolvingPromise(i(this.source)?this.source.load(e):null),Promise.resolve(this)}_findBasemapIndex(e){let{items:t}=this,n=t.findIndex(t=>t.basemap===e);return n===-1?t.findIndex(t=>this.basemapEquals(t.basemap,e)):n}_recreateItems(){let e=this.source?.basemaps??[],{view:t,compatibilityFunction:n}=this,r=new Map(this.items.map(e=>[e.basemap,e])),i=e.map(e=>{let i=r.get(e);return i?(r.delete(e),i):new b({basemap:e,compatibilityFunction:n,view:t})});this.items.removeAll(),this.items.addMany(i),r.forEach(e=>e.destroy())}_updateItems(){for(let e of this.items)e.compatibilityFunction=this.compatibilityFunction,e.view=this.view}};e([l()],D.prototype,`_loadingProjectionEngine`,void 0),e([l()],D.prototype,`activeBasemap`,null),e([l({readOnly:!0})],D.prototype,`activeBasemapIndex`,null),e([l()],D.prototype,`compatibilityFunction`,null),e([l({readOnly:!0,type:C})],D.prototype,`items`,void 0),e([l()],D.prototype,`source`,null),e([l({readOnly:!0})],D.prototype,`state`,null),e([l()],D.prototype,`view`,void 0),D=e([u(`esri.widgets.BasemapGallery.BasemapGalleryViewModel`)],D);const O=D;export{O as default};
|
|
@@ -4,17 +4,17 @@ import type EsriError from "../../../core/Error.js";
|
|
|
4
4
|
import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../../core/Identifiable.js";
|
|
5
5
|
import type { MapViewOrSceneView } from "../../../views/MapViewOrSceneView.js";
|
|
6
6
|
|
|
7
|
-
/** @deprecated since version 5.2. Use [BasemapItemProperties](https://developers.arcgis.com/javascript/latest/references/core/
|
|
7
|
+
/** @deprecated since version 5.2. Use [BasemapItemProperties](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/support/BasemapItem/#BasemapItemProperties) instead. */
|
|
8
8
|
export interface BasemapGalleryItemProperties extends IdentifiableMixinProperties, Partial<Pick<BasemapGalleryItem, "basemap" | "view">> {}
|
|
9
9
|
|
|
10
|
-
/** @deprecated since version 5.2. Use [BasemapItemState](https://developers.arcgis.com/javascript/latest/references/core/
|
|
10
|
+
/** @deprecated since version 5.2. Use [BasemapItemState](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/support/BasemapItem/#BasemapItemState) instead. */
|
|
11
11
|
export type BasemapGalleryItemState = "ready" | "loading" | "error";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* The BasemapGalleryItem class represents one of the [BasemapGalleryViewModel.items](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/#items)
|
|
15
15
|
* in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/).
|
|
16
16
|
*
|
|
17
|
-
* @deprecated since version 5.2. Use [BasemapItem](https://developers.arcgis.com/javascript/latest/references/core/
|
|
17
|
+
* @deprecated since version 5.2. Use [BasemapItem](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/support/BasemapItem/) instead.
|
|
18
18
|
* @since 4.3
|
|
19
19
|
* @see [BasemapGalleryViewModel.items](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/#items)
|
|
20
20
|
*/
|
|
@@ -5,7 +5,7 @@ import type { BasemapsSourceState } from "../types.js";
|
|
|
5
5
|
import type { BasemapProperties } from "../../../Basemap.js";
|
|
6
6
|
import type { ReadonlyArrayOrCollection } from "../../../core/Collection.js";
|
|
7
7
|
|
|
8
|
-
/** @deprecated since version 5.2. Use [LocalBasemapsSourceProperties](https://developers.arcgis.com/javascript/latest/references/core/
|
|
8
|
+
/** @deprecated since version 5.2. Use [LocalBasemapsSourceProperties](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/LocalBasemapsSource/#LocalBasemapsSourceProperties) instead. */
|
|
9
9
|
export interface LocalBasemapsSourceProperties {
|
|
10
10
|
/** A collection of [Basemap](https://developers.arcgis.com/javascript/latest/references/core/Basemap/)s. */
|
|
11
11
|
basemaps?: ReadonlyArrayOrCollection<BasemapProperties>;
|
|
@@ -15,7 +15,7 @@ export interface LocalBasemapsSourceProperties {
|
|
|
15
15
|
* The LocalBasemapsSource class is a Collection-driven [Basemap](https://developers.arcgis.com/javascript/latest/references/core/Basemap/) [BasemapGalleryViewModel.source](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/#source)
|
|
16
16
|
* in the [BasemapGalleryViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/) or [BasemapGallery](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/) widget.
|
|
17
17
|
*
|
|
18
|
-
* @deprecated since version 5.2. Use [LocalBasemapsSource](https://developers.arcgis.com/javascript/latest/references/core/
|
|
18
|
+
* @deprecated since version 5.2. Use [LocalBasemapsSource](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/LocalBasemapsSource/) instead.
|
|
19
19
|
* @since 4.3
|
|
20
20
|
* @see [BasemapGalleryViewModel.source](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/#source)
|
|
21
21
|
* @see [BasemapGallery](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/)
|
|
@@ -8,7 +8,7 @@ import type { BasemapFilter, BasemapsSourceState, UpdateBasemapsCallback } from
|
|
|
8
8
|
import type { LocalBasemapsSourceProperties } from "./LocalBasemapsSource.js";
|
|
9
9
|
import type { PortalProperties } from "../../../portal/Portal.js";
|
|
10
10
|
|
|
11
|
-
/** @deprecated since version 5.2. Use [PortalBasemapsSourceProperties](https://developers.arcgis.com/javascript/latest/references/core/
|
|
11
|
+
/** @deprecated since version 5.2. Use [PortalBasemapsSourceProperties](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/PortalBasemapsSource/#PortalBasemapsSourceProperties) instead. */
|
|
12
12
|
export interface PortalBasemapsSourceProperties extends LocalBasemapsSourceProperties, LoadableMixinProperties, Partial<Pick<PortalBasemapsSource, "filterFunction" | "query" | "updateBasemapsCallback">> {
|
|
13
13
|
/** The Portal from which to fetch basemaps. */
|
|
14
14
|
portal?: PortalProperties;
|
|
@@ -18,7 +18,7 @@ export interface PortalBasemapsSourceProperties extends LocalBasemapsSourcePrope
|
|
|
18
18
|
* The PortalBasemapsSource class is a Portal-driven [Basemap](https://developers.arcgis.com/javascript/latest/references/core/Basemap/) [BasemapGalleryViewModel.source](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/#source)
|
|
19
19
|
* in the [BasemapGalleryViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/) or [BasemapGallery](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/) widget.
|
|
20
20
|
*
|
|
21
|
-
* @deprecated since version 5.2. Use [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/references/core/
|
|
21
|
+
* @deprecated since version 5.2. Use [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/PortalBasemapsSource/) instead.
|
|
22
22
|
* @since 4.3
|
|
23
23
|
* @see [BasemapGalleryViewModel.source](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/#source)
|
|
24
24
|
* @see [BasemapGallery](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/)
|
|
@@ -10,7 +10,7 @@ import type Basemap from "../../Basemap.js";
|
|
|
10
10
|
* @param index - The index of the Basemap being assessed.
|
|
11
11
|
* @param array - The array of basemaps being filtered.
|
|
12
12
|
* @returns Returns true if the test passes, false otherwise.
|
|
13
|
-
* @deprecated since version 5.2. Use [BasemapFilter](https://developers.arcgis.com/javascript/latest/references/core/
|
|
13
|
+
* @deprecated since version 5.2. Use [BasemapFilter](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/types/#BasemapFilter) instead.
|
|
14
14
|
* @since 5.0
|
|
15
15
|
*/
|
|
16
16
|
export type BasemapFilter = (item: Basemap, index: number, array: Basemap[]) => boolean | Promise<boolean>;
|
|
@@ -23,7 +23,7 @@ export type BasemapFilter = (item: Basemap, index: number, array: Basemap[]) =>
|
|
|
23
23
|
*
|
|
24
24
|
* @param items - An array of basemaps that have been fetched and filtered from the Portal.
|
|
25
25
|
* @returns The array of basemaps to display in the BasemapGallery widget.
|
|
26
|
-
* @deprecated since version 5.2. Use [UpdateBasemapsCallback](https://developers.arcgis.com/javascript/latest/references/core/
|
|
26
|
+
* @deprecated since version 5.2. Use [UpdateBasemapsCallback](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/types/#UpdateBasemapsCallback) instead.
|
|
27
27
|
* @since 5.0
|
|
28
28
|
* @example
|
|
29
29
|
* // Create custom basemap to be added to the array of portal basemaps
|
|
@@ -71,7 +71,7 @@ export type BasemapFilter = (item: Basemap, index: number, array: Basemap[]) =>
|
|
|
71
71
|
export type UpdateBasemapsCallback = (items: Basemap[]) => Basemap[] | Promise<Basemap[]>;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
* @deprecated since version 5.2. Use [BasemapsSourceState](https://developers.arcgis.com/javascript/latest/references/core/
|
|
74
|
+
* @deprecated since version 5.2. Use [BasemapsSourceState](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/types/#BasemapsSourceState) instead.
|
|
75
75
|
* @since 5.0
|
|
76
76
|
*/
|
|
77
77
|
export type BasemapsSourceState = "ready" | "loading" | "not-loaded";
|