@esri/solutions-components 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/buffer-tools_4.cjs.entry.js +1 -1
- package/dist/cjs/calcite-combobox_6.cjs.entry.js +74 -52
- package/dist/cjs/calcite-input-text_4.cjs.entry.js +9 -9
- package/dist/cjs/card-manager_3.cjs.entry.js +36 -29
- package/dist/cjs/crowdsource-manager.cjs.entry.js +2 -2
- package/dist/cjs/{downloadUtils-6d4e269f.js → downloadUtils-4aadf4b0.js} +4 -3
- package/dist/cjs/edit-card_2.cjs.entry.js +11 -6
- package/dist/cjs/{index.es-fc923796.js → index.es-17db3b89.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{mapViewUtils-efc49df7.js → mapViewUtils-77a1ff88.js} +48 -6
- package/dist/cjs/public-notification.cjs.entry.js +3 -3
- package/dist/cjs/{publicNotificationStore-cd1a32c3.js → publicNotificationStore-ec1bdd2d.js} +5 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/card-manager/card-manager.js +8 -8
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +2 -2
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +1 -1
- package/dist/collection/components/edit-card/edit-card.css +1 -1
- package/dist/collection/components/edit-card/edit-card.js +7 -1
- package/dist/collection/components/info-card/info-card.js +4 -5
- package/dist/collection/components/layer-table/layer-table.js +34 -27
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +110 -54
- package/dist/collection/components/map-select-tools/map-select-tools.js +5 -5
- package/dist/collection/components/refine-selection/refine-selection.js +3 -3
- package/dist/collection/demos/crowdsource-manager.html +31 -16
- package/dist/collection/utils/downloadUtils.js +2 -1
- package/dist/collection/utils/downloadUtils.ts +1 -1
- package/dist/collection/utils/interfaces.ts +6 -5
- package/dist/collection/utils/mapViewUtils.js +44 -5
- package/dist/collection/utils/mapViewUtils.ts +52 -7
- package/dist/collection/utils/publicNotificationStore.js +5 -1
- package/dist/collection/utils/publicNotificationStore.ts +5 -1
- package/dist/components/card-manager2.js +5 -5
- package/dist/components/crowdsource-manager.js +2 -2
- package/dist/components/downloadUtils.js +2 -1
- package/dist/components/edit-card2.js +7 -1
- package/dist/components/info-card2.js +4 -5
- package/dist/components/layer-table2.js +33 -26
- package/dist/components/map-layer-picker2.js +78 -54
- package/dist/components/map-select-tools2.js +5 -5
- package/dist/components/mapViewUtils.js +45 -6
- package/dist/components/publicNotificationStore.js +5 -1
- package/dist/components/refine-selection2.js +3 -3
- package/dist/esm/buffer-tools_4.entry.js +1 -1
- package/dist/esm/calcite-combobox_6.entry.js +74 -52
- package/dist/esm/calcite-input-text_4.entry.js +9 -9
- package/dist/esm/card-manager_3.entry.js +36 -29
- package/dist/esm/crowdsource-manager.entry.js +2 -2
- package/dist/esm/{downloadUtils-1092cb0f.js → downloadUtils-3b5f85d9.js} +4 -3
- package/dist/esm/edit-card_2.entry.js +11 -6
- package/dist/esm/{index.es-08a48fdd.js → index.es-bb9196f6.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mapViewUtils-a787c6a8.js → mapViewUtils-55ea1e10.js} +45 -6
- package/dist/esm/public-notification.entry.js +3 -3
- package/dist/esm/{publicNotificationStore-c36d95bf.js → publicNotificationStore-6ef555f3.js} +5 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/crowdsource-manager.html +31 -16
- package/dist/solutions-components/{p-841a5f97.entry.js → p-03179924.entry.js} +1 -1
- package/dist/solutions-components/{p-a29ba58a.js → p-477ae127.js} +2 -2
- package/dist/solutions-components/p-4af3f843.js +36 -0
- package/dist/solutions-components/{p-5b260e5f.js → p-6015e2ee.js} +1 -1
- package/dist/solutions-components/{p-ad60a547.js → p-9807924d.js} +3 -3
- package/dist/solutions-components/{p-781480c2.entry.js → p-a56f965e.entry.js} +1 -1
- package/dist/solutions-components/{p-5a6ca63b.entry.js → p-cdc0bb97.entry.js} +6 -6
- package/dist/solutions-components/{p-6305f474.entry.js → p-d3fd28e9.entry.js} +1 -1
- package/dist/solutions-components/p-d83da8a0.entry.js +11 -0
- package/dist/solutions-components/p-d875f38c.entry.js +6 -0
- package/dist/solutions-components/p-ef235c88.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +1 -1
- package/dist/solutions-components/utils/interfaces.ts +6 -5
- package/dist/solutions-components/utils/mapViewUtils.ts +52 -7
- package/dist/solutions-components/utils/publicNotificationStore.ts +5 -1
- package/dist/types/components/card-manager/card-manager.d.ts +2 -2
- package/dist/types/components/edit-card/edit-card.d.ts +6 -2
- package/dist/types/components/layer-table/layer-table.d.ts +4 -4
- package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +34 -19
- package/dist/types/components.d.ts +22 -6
- package/dist/types/utils/interfaces.d.ts +4 -3
- package/dist/types/utils/mapViewUtils.d.ts +22 -5
- package/dist/types/utils/publicNotificationStore.d.ts +2 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-0641aa9b.js +0 -36
- package/dist/solutions-components/p-74a2d025.entry.js +0 -6
- package/dist/solutions-components/p-a62c1b3c.entry.js +0 -6
- package/dist/solutions-components/p-ccf5c0ff.entry.js +0 -11
@@ -4,7 +4,7 @@
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
7
|
-
import { b as getMapLayerIds, c as getMapLayerHash } from './mapViewUtils.js';
|
7
|
+
import { b as getMapLayerIds, c as getMapTableIds, d as getMapLayerHash, e as getMapTableHash } from './mapViewUtils.js';
|
8
8
|
import { s as state } from './publicNotificationStore.js';
|
9
9
|
import { d as defineCustomElement$c } from './action.js';
|
10
10
|
import { d as defineCustomElement$b } from './button.js';
|
@@ -28,13 +28,15 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
28
28
|
this.layerSelectionChange = createEvent(this, "layerSelectionChange", 7);
|
29
29
|
this.appearance = "transparent";
|
30
30
|
this.enabledLayerIds = [];
|
31
|
+
this.enabledTableIds = [];
|
31
32
|
this.mapView = undefined;
|
32
33
|
this.placeholderIcon = "";
|
33
|
-
this.
|
34
|
+
this.selectedIds = [];
|
34
35
|
this.scale = "m";
|
36
|
+
this.showTables = true;
|
35
37
|
this.type = "select";
|
36
|
-
this.
|
37
|
-
this.
|
38
|
+
this.ids = [];
|
39
|
+
this.selectedName = "";
|
38
40
|
}
|
39
41
|
//--------------------------------------------------------------------------
|
40
42
|
//
|
@@ -47,7 +49,11 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
47
49
|
*/
|
48
50
|
async mapViewWatchHandler() {
|
49
51
|
await this._setLayers();
|
50
|
-
|
52
|
+
const hasLayers = Object.keys(state.layerNameHash).length > 0;
|
53
|
+
const hasTables = Object.keys(state.tableNameHash).length > 0 && this.showTables;
|
54
|
+
if (hasLayers || hasTables) {
|
55
|
+
this._setSelectedLayer(this.ids[0], hasLayers ? "layer" : "table");
|
56
|
+
}
|
51
57
|
}
|
52
58
|
//--------------------------------------------------------------------------
|
53
59
|
//
|
@@ -59,8 +65,8 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
59
65
|
*/
|
60
66
|
async componentWillLoad() {
|
61
67
|
await this._setLayers();
|
62
|
-
if (this.
|
63
|
-
this.layerSelectionChange.emit(this.
|
68
|
+
if (this.ids.length > 0 || this.selectedIds.length === 1) {
|
69
|
+
this.layerSelectionChange.emit(this.selectedIds.length === 1 ? [this.selectedIds[0]] : [this.ids[0]]);
|
64
70
|
}
|
65
71
|
}
|
66
72
|
/**
|
@@ -74,13 +80,15 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
74
80
|
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
75
81
|
*/
|
76
82
|
async componentDidLoad() {
|
77
|
-
if (this.
|
78
|
-
const id = this.
|
83
|
+
if (this.ids.length > 0 || this.selectedIds.length === 1) {
|
84
|
+
const id = this.selectedIds.length === 1 ? this.selectedIds[0] : this.ids[0];
|
79
85
|
if (this.type === "select") {
|
80
86
|
this._layerElement.value = id;
|
81
87
|
}
|
82
88
|
else if (this.type === "dropdown") {
|
83
|
-
this.
|
89
|
+
this.selectedName = Object.keys(state.layerNameHash).indexOf(id) > -1 ?
|
90
|
+
state.layerNameHash[id] : Object.keys(state.tableNameHash).indexOf(id) > -1 ?
|
91
|
+
state.tableNameHash[id] : "";
|
84
92
|
}
|
85
93
|
}
|
86
94
|
}
|
@@ -97,7 +105,7 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
97
105
|
* @returns Calcite Select component with the ids of the layers from the map
|
98
106
|
*/
|
99
107
|
_getSelect() {
|
100
|
-
return (h("calcite-select", { label: "", onCalciteSelectChange: () => this._layerSelectionChange(), ref: (el) => { this._layerElement = el; }, scale: this.scale }, this.
|
108
|
+
return (h("calcite-select", { label: "", onCalciteSelectChange: () => this._layerSelectionChange(), ref: (el) => { this._layerElement = el; }, scale: this.scale }, this._getMapLayerOptions()));
|
101
109
|
}
|
102
110
|
/**
|
103
111
|
* Create a list of layer ids from the map
|
@@ -107,7 +115,7 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
107
115
|
* @returns Calcite ComboBox component with the ids of the layers from the map
|
108
116
|
*/
|
109
117
|
_getCombobox() {
|
110
|
-
return (h("calcite-combobox", { clearDisabled: true, label: "", onCalciteComboboxChange: () => this._layerSelectionChange(), "placeholder-icon": this.placeholderIcon, ref: (el) => { this._layerElement = el; }, scale: this.scale, "selection-mode": "single" }, this.
|
118
|
+
return (h("calcite-combobox", { clearDisabled: true, label: "", onCalciteComboboxChange: () => this._layerSelectionChange(), "placeholder-icon": this.placeholderIcon, ref: (el) => { this._layerElement = el; }, scale: this.scale, "selection-mode": "single" }, this._getMapLayerOptions()));
|
111
119
|
}
|
112
120
|
/**
|
113
121
|
* Hydrate a dropdown component with items to display the layer names
|
@@ -115,54 +123,42 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
115
123
|
* @returns Array of Dropdown items with layer names
|
116
124
|
*/
|
117
125
|
_getDropdown() {
|
118
|
-
return (h("calcite-dropdown", { class: "layer-picker-dropdown" }, h("calcite-action", { slot: "trigger", text: "" }, h("calcite-button", { alignment: "icon-end-space-between", appearance: this.appearance, class: "max-width-350", iconEnd: "chevron-down", iconStart: "layers", kind: "neutral", width: "full" }, h("div", null, this.
|
126
|
+
return (h("calcite-dropdown", { class: "layer-picker-dropdown" }, h("calcite-action", { slot: "trigger", text: "" }, h("calcite-button", { alignment: "icon-end-space-between", appearance: this.appearance, class: "max-width-350", iconEnd: "chevron-down", iconStart: "layers", kind: "neutral", width: "full" }, h("div", null, this.selectedName))), h("calcite-dropdown-group", { "selection-mode": "single" }, this._getMapLayerOptions())));
|
119
127
|
}
|
120
128
|
/**
|
121
|
-
*
|
129
|
+
* Get the appropriate type of dom nodes for each valid layer or table
|
122
130
|
*
|
123
|
-
* @returns Array of
|
131
|
+
* @returns Array of dom nodes with the names of the layers and optionally of the tables
|
124
132
|
*/
|
125
|
-
|
126
|
-
return this.
|
127
|
-
if (
|
128
|
-
prev.push(
|
133
|
+
_getMapLayerOptions() {
|
134
|
+
return this.ids.reduce((prev, cur) => {
|
135
|
+
if (this._validLayer(cur)) {
|
136
|
+
prev.push(this._getItem(cur, "layer"));
|
137
|
+
}
|
138
|
+
else if (this._validTable(cur)) {
|
139
|
+
prev.push(this._getItem(cur, "table"));
|
129
140
|
}
|
130
141
|
return prev;
|
131
142
|
}, []);
|
132
143
|
}
|
133
144
|
/**
|
134
|
-
*
|
135
|
-
*/
|
136
|
-
_setSelectedLayer(id) {
|
137
|
-
this.selectedLayerName = state.layerNameHash[id];
|
138
|
-
this.selectedLayerIds = [id];
|
139
|
-
this.layerSelectionChange.emit(this.selectedLayerIds);
|
140
|
-
}
|
141
|
-
/**
|
142
|
-
* Hydrate a select component with the ids of the layers in the map
|
145
|
+
* Get the appropriate type of dom node for the current layer or table id
|
143
146
|
*
|
144
|
-
* @returns
|
147
|
+
* @returns A dom node with the name of the layer or table
|
145
148
|
*/
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
return prev;
|
152
|
-
}, []);
|
149
|
+
_getItem(id, itemType) {
|
150
|
+
const name = itemType === "layer" ? state.layerNameHash[id] : state.tableNameHash[id];
|
151
|
+
return this.type === "combobox" ? (h("calcite-combobox-item", { textLabel: name, value: id })) :
|
152
|
+
this.type === "select" ? (h("calcite-option", { label: name, value: id })) :
|
153
|
+
(h("calcite-dropdown-item", { onClick: () => void this._setSelectedLayer(id, itemType) }, name));
|
153
154
|
}
|
154
155
|
/**
|
155
|
-
*
|
156
|
-
*
|
157
|
-
* @returns Array of ComboBox items for the ids of the layers
|
156
|
+
* Store the layer name based on the user selection
|
158
157
|
*/
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
}
|
164
|
-
return prev;
|
165
|
-
}, []);
|
158
|
+
_setSelectedLayer(id, type) {
|
159
|
+
this.selectedName = type === "layer" ? state.layerNameHash[id] : state.tableNameHash[id];
|
160
|
+
this.selectedIds = [id];
|
161
|
+
this.layerSelectionChange.emit(this.selectedIds);
|
166
162
|
}
|
167
163
|
/**
|
168
164
|
* Fetch the ids of the layers from the map
|
@@ -172,8 +168,12 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
172
168
|
async _setLayers() {
|
173
169
|
if (this.mapView) {
|
174
170
|
const mapLayerIds = await getMapLayerIds(this.mapView);
|
175
|
-
|
176
|
-
|
171
|
+
const mapTableIds = this.showTables ? await getMapTableIds(this.mapView) : [];
|
172
|
+
this.ids = [
|
173
|
+
...mapLayerIds.filter(n => { var _a; return ((_a = this.enabledLayerIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledLayerIds.indexOf(n) > -1 : true; }),
|
174
|
+
...mapTableIds.filter(n => { var _a; return ((_a = this.enabledTableIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledTableIds.indexOf(n) > -1 : true; }),
|
175
|
+
];
|
176
|
+
await this._initStateHash();
|
177
177
|
}
|
178
178
|
}
|
179
179
|
/**
|
@@ -181,11 +181,33 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
181
181
|
*
|
182
182
|
* @returns Promise when the operation has completed
|
183
183
|
*/
|
184
|
-
async
|
184
|
+
async _initStateHash() {
|
185
185
|
if (this.mapView) {
|
186
186
|
state.layerNameHash = await getMapLayerHash(this.mapView);
|
187
|
+
state.tableNameHash = this.showTables ? await getMapTableHash(this.mapView) : {};
|
187
188
|
}
|
188
189
|
}
|
190
|
+
/**
|
191
|
+
* Evaluate if the id exists in the current hash and verify if it should be excluded
|
192
|
+
*
|
193
|
+
* @returns boolean when true the layer will be used in the current layer picker type
|
194
|
+
*/
|
195
|
+
_validLayer(id) {
|
196
|
+
const name = state.layerNameHash[id];
|
197
|
+
return name && state.managedLayers.indexOf(name) < 0 && (this.enabledLayerIds.length > 0 ?
|
198
|
+
this.enabledLayerIds.indexOf(id) > -1 : name);
|
199
|
+
}
|
200
|
+
/**
|
201
|
+
* Evaluate if the id exists in the current hash and verify if it should be excluded
|
202
|
+
*
|
203
|
+
* @returns boolean when true the table will be used in the current layer picker type
|
204
|
+
*/
|
205
|
+
_validTable(id) {
|
206
|
+
const name = state.tableNameHash[id];
|
207
|
+
const validName = name && this.showTables;
|
208
|
+
return validName ? state.managedTables.indexOf(name) < 0 &&
|
209
|
+
(this.enabledTableIds.length > 0 ? this.enabledTableIds.indexOf(id) > -1 : true) : validName;
|
210
|
+
}
|
189
211
|
/**
|
190
212
|
* Fetch the ids of the layers from the map
|
191
213
|
*
|
@@ -194,8 +216,8 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
194
216
|
_layerSelectionChange() {
|
195
217
|
const ids = Array.isArray(this._layerElement.value) ? this._layerElement.value : [this._layerElement.value];
|
196
218
|
if (JSON.stringify(ids) !== JSON.stringify([""])) {
|
197
|
-
this.
|
198
|
-
this.layerSelectionChange.emit(this.
|
219
|
+
this.selectedIds = ids;
|
220
|
+
this.layerSelectionChange.emit(this.selectedIds);
|
199
221
|
}
|
200
222
|
}
|
201
223
|
get el() { return this; }
|
@@ -206,13 +228,15 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
206
228
|
}, [0, "map-layer-picker", {
|
207
229
|
"appearance": [1],
|
208
230
|
"enabledLayerIds": [16],
|
231
|
+
"enabledTableIds": [16],
|
209
232
|
"mapView": [16],
|
210
233
|
"placeholderIcon": [1, "placeholder-icon"],
|
211
|
-
"
|
234
|
+
"selectedIds": [1040],
|
212
235
|
"scale": [1],
|
236
|
+
"showTables": [4, "show-tables"],
|
213
237
|
"type": [1],
|
214
|
-
"
|
215
|
-
"
|
238
|
+
"ids": [32],
|
239
|
+
"selectedName": [32]
|
216
240
|
}]);
|
217
241
|
function defineCustomElement() {
|
218
242
|
if (typeof customElements === "undefined") {
|
@@ -5,7 +5,7 @@
|
|
5
5
|
*/
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
7
7
|
import { l as loadModules } from './loadModules.js';
|
8
|
-
import { g as goToSelection, h as highlightFeatures,
|
8
|
+
import { g as goToSelection, h as highlightFeatures, f as getFeatureLayerView } from './mapViewUtils.js';
|
9
9
|
import { b as queryObjectIds, g as getQueryGeoms, c as queryFeaturesByGeometry } from './queryUtils.js';
|
10
10
|
import { c as EWorkflowType } from './interfaces.js';
|
11
11
|
import { s as state } from './publicNotificationStore.js';
|
@@ -213,7 +213,7 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
213
213
|
*/
|
214
214
|
_getUseLayerFeaturesOptions() {
|
215
215
|
const useLayerFeaturesClass = this._useLayerFeaturesEnabled ? "div-visible" : "div-not-visible";
|
216
|
-
return (h("div", null, h("div", { class: "padding-top-1 display-flex" }, h("calcite-label", { class: "label-margin-0 w-100", layout: "inline-space-between" }, h("div", { class: "tooltip-container" }, this._translations.useLayerFeatures, h("calcite-icon", { class: "padding-start-1-2 icon", icon: "question", id: "use-layer-features-icon", scale: "s" }))), h("calcite-popover", { closable: true, label: "", referenceElement: "use-layer-features-icon" }, h("span", { class: "tooltip-message" }, this._translations.useLayerFeaturesTooltip)), h("calcite-switch", { checked: this._useLayerFeaturesEnabled, onCalciteSwitchChange: () => { this._useLayerFeaturesEnabledChanged(); } })), h("div", { class: useLayerFeaturesClass + " padding-top-1" }, h("map-layer-picker", { enabledLayerIds: this.selectionLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => { void this._layerSelectionChange(evt); },
|
216
|
+
return (h("div", null, h("div", { class: "padding-top-1 display-flex" }, h("calcite-label", { class: "label-margin-0 w-100", layout: "inline-space-between" }, h("div", { class: "tooltip-container" }, this._translations.useLayerFeatures, h("calcite-icon", { class: "padding-start-1-2 icon", icon: "question", id: "use-layer-features-icon", scale: "s" }))), h("calcite-popover", { closable: true, label: "", referenceElement: "use-layer-features-icon" }, h("span", { class: "tooltip-message" }, this._translations.useLayerFeaturesTooltip)), h("calcite-switch", { checked: this._useLayerFeaturesEnabled, onCalciteSwitchChange: () => { this._useLayerFeaturesEnabledChanged(); } })), h("div", { class: useLayerFeaturesClass + " padding-top-1" }, h("map-layer-picker", { enabledLayerIds: this.selectionLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => { void this._layerSelectionChange(evt); }, selectedIds: this.layerViews.map(l => l.layer.id) }))));
|
217
217
|
}
|
218
218
|
/**
|
219
219
|
* Renders the number of selected features
|
@@ -242,7 +242,7 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
242
242
|
* @protected
|
243
243
|
*/
|
244
244
|
_getMapLayerPicker() {
|
245
|
-
return (h("div", { class: "display-flex padding-sides-1 padding-bottom-1" }, h("calcite-label", { class: "font-bold width-full label-margin-0" }, this._translations.inputLayer, h("map-layer-picker", { enabledLayerIds: this.enabledLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => this._inputLayerSelectionChange(evt),
|
245
|
+
return (h("div", { class: "display-flex padding-sides-1 padding-bottom-1" }, h("calcite-label", { class: "font-bold width-full label-margin-0" }, this._translations.inputLayer, h("map-layer-picker", { enabledLayerIds: this.enabledLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => this._inputLayerSelectionChange(evt), selectedIds: this.selectLayerView ? [this.selectLayerView.layer.id] : this.selectionSet ? [this.selectionSet.layerView.layer.id] : [] }))));
|
246
246
|
}
|
247
247
|
//--------------------------------------------------------------------------
|
248
248
|
//
|
@@ -675,7 +675,7 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
675
675
|
async _layerSelectionChange(evt) {
|
676
676
|
if (Array.isArray(evt.detail) && evt.detail.length > 0) {
|
677
677
|
const layerPromises = evt.detail.map(id => {
|
678
|
-
return
|
678
|
+
return getFeatureLayerView(this.mapView, id);
|
679
679
|
});
|
680
680
|
return Promise.all(layerPromises).then((layerViews) => {
|
681
681
|
this.layerViews = layerViews;
|
@@ -703,7 +703,7 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
703
703
|
var _a;
|
704
704
|
const id = ((_a = evt === null || evt === void 0 ? void 0 : evt.detail) === null || _a === void 0 ? void 0 : _a.length) > 0 ? evt.detail[0] : "";
|
705
705
|
if (!this.selectLayerView || id !== this.selectLayerView.layer.id) {
|
706
|
-
this.selectLayerView = await
|
706
|
+
this.selectLayerView = await getFeatureLayerView(this.mapView, id);
|
707
707
|
this._updateLabel();
|
708
708
|
this._bufferGeometry ? await this._selectFeatures([this._bufferGeometry]) :
|
709
709
|
await this._highlightWithOIDsOrGeoms();
|
@@ -41,6 +41,24 @@ async function getMapLayerHash(mapView) {
|
|
41
41
|
});
|
42
42
|
return layerHash;
|
43
43
|
}
|
44
|
+
/**
|
45
|
+
* Gets the table names from the current map
|
46
|
+
*
|
47
|
+
* @param mapView the map view to fetch the table names from
|
48
|
+
*
|
49
|
+
* @returns Promise resolving with an array of table names
|
50
|
+
*
|
51
|
+
*/
|
52
|
+
async function getMapTableHash(mapView) {
|
53
|
+
let tableHash = {};
|
54
|
+
await mapView.when(() => {
|
55
|
+
tableHash = mapView.map.allTables.toArray().reduce((prev, cur) => {
|
56
|
+
prev[cur.id] = cur.title;
|
57
|
+
return prev;
|
58
|
+
}, {});
|
59
|
+
});
|
60
|
+
return tableHash;
|
61
|
+
}
|
44
62
|
/**
|
45
63
|
* Gets the layer names from the current map
|
46
64
|
*
|
@@ -61,6 +79,25 @@ async function getMapLayerIds(mapView) {
|
|
61
79
|
});
|
62
80
|
return layerIds;
|
63
81
|
}
|
82
|
+
/**
|
83
|
+
* Gets the table names from the current map
|
84
|
+
*
|
85
|
+
* @param mapView the map view to fetch the table names from
|
86
|
+
*
|
87
|
+
* @returns Promise resolving with an array of table names
|
88
|
+
*
|
89
|
+
*/
|
90
|
+
async function getMapTableIds(mapView) {
|
91
|
+
// TODO...seems like its the same as the hash...see if I can remove this
|
92
|
+
let tableIds = [];
|
93
|
+
await mapView.when(() => {
|
94
|
+
tableIds = mapView.map.allTables.toArray().reduce((prev, cur) => {
|
95
|
+
prev.push(cur.id);
|
96
|
+
return prev;
|
97
|
+
}, []);
|
98
|
+
});
|
99
|
+
return tableIds;
|
100
|
+
}
|
64
101
|
/**
|
65
102
|
* Get a layer view by id
|
66
103
|
*
|
@@ -70,8 +107,8 @@ async function getMapLayerIds(mapView) {
|
|
70
107
|
* @returns Promise resolving with the fetched layer view
|
71
108
|
*
|
72
109
|
*/
|
73
|
-
async function
|
74
|
-
const layer = await
|
110
|
+
async function getFeatureLayerView(mapView, id) {
|
111
|
+
const layer = await getLayer(mapView, id);
|
75
112
|
return layer ? await mapView.whenLayerView(layer) : undefined;
|
76
113
|
}
|
77
114
|
/**
|
@@ -83,10 +120,13 @@ async function getMapLayerView(mapView, id) {
|
|
83
120
|
* @returns Promise resolving with the fetched layer
|
84
121
|
*
|
85
122
|
*/
|
86
|
-
async function
|
123
|
+
async function getLayer(mapView, id) {
|
87
124
|
let layers = [];
|
88
125
|
await mapView.when(() => {
|
89
|
-
layers =
|
126
|
+
layers = [
|
127
|
+
...mapView.map.allLayers.toArray(),
|
128
|
+
...mapView.map.allTables.toArray()
|
129
|
+
].filter((l) => {
|
90
130
|
return l.id === id;
|
91
131
|
});
|
92
132
|
});
|
@@ -101,7 +141,6 @@ async function getMapLayer(mapView, id) {
|
|
101
141
|
* @param updateExtent optional (default false) boolean to indicate if we should zoom to the extent
|
102
142
|
*
|
103
143
|
* @returns Promise resolving with the highlight handle
|
104
|
-
*
|
105
144
|
*/
|
106
145
|
async function highlightFeatures(ids, layerView, mapView, updateExtent = false) {
|
107
146
|
if (updateExtent) {
|
@@ -201,4 +240,4 @@ async function goToSelection(ids, layerView, mapView, flashFeatures = true, feat
|
|
201
240
|
}
|
202
241
|
}
|
203
242
|
|
204
|
-
export {
|
243
|
+
export { getLayer as a, getMapLayerIds as b, getMapTableIds as c, getMapLayerHash as d, getMapTableHash as e, getFeatureLayerView as f, goToSelection as g, highlightFeatures as h, getIdSets as i, highlightAllFeatures as j };
|
@@ -23,10 +23,14 @@ import { c as createStore } from './index3.js';
|
|
23
23
|
const { state, onChange } = createStore({
|
24
24
|
// List of layers added and managed by the component
|
25
25
|
managedLayers: [],
|
26
|
+
// List of tables added and managed by the component
|
27
|
+
managedTables: [],
|
26
28
|
// Handle[]: https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#Handle
|
27
29
|
highlightHandles: [],
|
28
|
-
//
|
30
|
+
// IMapItemHash title: id lookup to be used across components
|
29
31
|
layerNameHash: {},
|
32
|
+
// IMapItemHash title: id lookup to be used across components
|
33
|
+
tableNameHash: {},
|
30
34
|
// remove all handles
|
31
35
|
removeHandles: () => {
|
32
36
|
state.highlightHandles.forEach(h => h === null || h === void 0 ? void 0 : h.remove());
|
@@ -5,7 +5,7 @@
|
|
5
5
|
*/
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
7
7
|
import { f as ESelectionMode, d as EDrawMode, c as EWorkflowType } from './interfaces.js';
|
8
|
-
import {
|
8
|
+
import { f as getFeatureLayerView, i as getIdSets, j as highlightAllFeatures } from './mapViewUtils.js';
|
9
9
|
import { c as queryFeaturesByGeometry } from './queryUtils.js';
|
10
10
|
import { s as state } from './publicNotificationStore.js';
|
11
11
|
import { g as getLocaleComponentStrings } from './locale.js';
|
@@ -93,7 +93,7 @@ const RefineSelection = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
93
93
|
render() {
|
94
94
|
var _a, _b;
|
95
95
|
const layerPickerClass = this._enabledLayerIds.length > 1 ? "display-block" : "display-none";
|
96
|
-
return (h(Host, null, h("div", { class: layerPickerClass + " padding-top-sides-1" }, h("div", { class: "display-flex" }, h("calcite-label", { class: "font-bold width-full label-margin-0" }, h("div", { class: "display-flex" }, this._translations.inputLayer, h("calcite-icon", { class: "padding-start-1-2 icon", icon: "question", id: "refine-input-layer", scale: "s" })), h("map-layer-picker", { enabledLayerIds: this._enabledLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => { void this._layerSelectionChange(evt); }, ref: (el) => { this._layerPicker = el; },
|
96
|
+
return (h(Host, null, h("div", { class: layerPickerClass + " padding-top-sides-1" }, h("div", { class: "display-flex" }, h("calcite-label", { class: "font-bold width-full label-margin-0" }, h("div", { class: "display-flex" }, this._translations.inputLayer, h("calcite-icon", { class: "padding-start-1-2 icon", icon: "question", id: "refine-input-layer", scale: "s" })), h("map-layer-picker", { enabledLayerIds: this._enabledLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => { void this._layerSelectionChange(evt); }, ref: (el) => { this._layerPicker = el; }, selectedIds: [this._refineLayer.layer.id] })), h("calcite-popover", { closable: true, label: "", referenceElement: "refine-input-layer" }, h("span", { class: "tooltip-message" }, this._translations.inputLayerTip)))), h("div", { class: "padding-1" }, h("div", { class: "padding-bottom-1" }, h("calcite-segmented-control", { class: "w-100" }, h("calcite-segmented-control-item", { checked: this._addEnabled, class: "w-50 word-wrap-anywhere", onClick: () => this._setSelectionMode(ESelectionMode.ADD), value: ESelectionMode.ADD }, h("span", { class: "font-weight-500" }, this._translations.add)), h("calcite-segmented-control-item", { checked: !this._addEnabled, class: "w-50 word-wrap-anywhere", onClick: () => this._setSelectionMode(ESelectionMode.REMOVE), value: ESelectionMode.REMOVE }, h("span", { class: "font-weight-500" }, this._translations.remove)))), h("div", null, h("map-draw-tools", { active: true, drawMode: EDrawMode.REFINE, mapView: this.mapView, onDrawRedo: () => this._redo(), onDrawUndo: () => this._undo(), onSketchGraphicsChange: (evt) => this._sketchGraphicsChanged(evt), pointSymbol: this.sketchPointSymbol, polygonSymbol: this.sketchPolygonSymbol, polylineSymbol: this.sketchLineSymbol, redoEnabled: ((_a = this._refineSelectionSet) === null || _a === void 0 ? void 0 : _a.redoStack.length) > 0, ref: (el) => { this._drawTools = el; }, undoEnabled: ((_b = this._refineSelectionSet) === null || _b === void 0 ? void 0 : _b.undoStack.length) > 0 })), h("br", null), (h("calcite-list", { class: "list-border" }, this._getRefineSelectionSetList())))));
|
97
97
|
}
|
98
98
|
//--------------------------------------------------------------------------
|
99
99
|
//
|
@@ -187,7 +187,7 @@ const RefineSelection = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
187
187
|
refineInfo[id] = {
|
188
188
|
addIds: [],
|
189
189
|
removeIds: [],
|
190
|
-
layerView: await
|
190
|
+
layerView: await getFeatureLayerView(this.mapView, id)
|
191
191
|
};
|
192
192
|
if (selectionSet) {
|
193
193
|
selectionSet.refineInfos = Object.assign(Object.assign({}, selectionSet.refineInfos), refineInfo);
|
@@ -16,7 +16,7 @@ import { s as setUpLoadableComponent, a as setComponentLoaded, c as componentLoa
|
|
16
16
|
import { n as numberStringFormatter, c as connectLocalized, d as disconnectLocalized } from './locale-ead7fa24.js';
|
17
17
|
import { d as decimalPlaces, c as clamp } from './math-5e1080da.js';
|
18
18
|
import { f as EDrawMode } from './interfaces-bf20e69c.js';
|
19
|
-
import { s as state } from './publicNotificationStore-
|
19
|
+
import { s as state } from './publicNotificationStore-6ef555f3.js';
|
20
20
|
import './_commonjsHelpers-d5f9d613.js';
|
21
21
|
import './resources-ee3b03a3.js';
|
22
22
|
import './browser-f8ca09b7.js';
|