@esri/solutions-components 0.8.5 → 0.8.7
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/dist/assets/t9n/crowdsource-reporter/resources.json +5 -6
- package/dist/assets/t9n/crowdsource-reporter/resources_en.json +5 -6
- package/dist/assets/t9n/feature-list/resources.json +1 -1
- package/dist/assets/t9n/feature-list/resources_en.json +1 -1
- package/dist/assets/t9n/public-notification/resources.json +3 -1
- package/dist/assets/t9n/public-notification/resources_en.json +3 -1
- package/dist/cjs/buffer-tools_3.cjs.entry.js +2 -2
- package/dist/cjs/calcite-alert_4.cjs.entry.js +2 -2
- package/dist/cjs/calcite-combobox_5.cjs.entry.js +2 -2
- package/dist/cjs/calcite-flow_5.cjs.entry.js +163 -16
- package/dist/cjs/crowdsource-manager.cjs.entry.js +6 -4
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +124 -38
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
- package/dist/cjs/public-notification.cjs.entry.js +110 -4
- package/dist/cjs/{publicNotificationStore-ef379d11.js → publicNotificationStore-e790601d.js} +2 -2
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/create-feature/create-feature.css +9 -0
- package/dist/collection/components/create-feature/create-feature.js +134 -6
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +102 -66
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +5 -0
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +196 -38
- package/dist/collection/components/feature-list/feature-list.js +93 -5
- package/dist/collection/components/info-card/info-card.css +1 -1
- package/dist/collection/components/info-card/info-card.js +1 -1
- package/dist/collection/components/layer-list/layer-list.js +6 -6
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +1 -1
- package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
- package/dist/collection/components/public-notification/public-notification.js +110 -3
- package/dist/collection/demos/crowdsource-reporter.html +1 -1
- package/dist/collection/utils/interfaces.ts +23 -0
- package/dist/collection/utils/publicNotificationStore.js +2 -2
- package/dist/collection/utils/publicNotificationStore.ts +3 -2
- package/dist/components/create-feature2.js +111 -7
- package/dist/components/crowdsource-manager.js +12 -8
- package/dist/components/crowdsource-reporter.js +129 -39
- package/dist/components/feature-list2.js +54 -6
- package/dist/components/info-card2.js +2 -2
- package/dist/components/layer-list2.js +6 -6
- package/dist/components/map-draw-tools2.js +1 -1
- package/dist/components/map-layer-picker2.js +1 -1
- package/dist/components/map-select-tools2.js +1 -1
- package/dist/components/public-notification.js +110 -3
- package/dist/components/publicNotificationStore.js +2 -2
- package/dist/esm/buffer-tools_3.entry.js +2 -2
- package/dist/esm/calcite-alert_4.entry.js +3 -3
- package/dist/esm/calcite-combobox_5.entry.js +3 -3
- package/dist/esm/calcite-flow_5.entry.js +164 -17
- package/dist/esm/card-manager_3.entry.js +2 -2
- package/dist/esm/crowdsource-manager.entry.js +7 -5
- package/dist/esm/crowdsource-reporter.entry.js +125 -39
- package/dist/esm/{downloadUtils-0c13073b.js → downloadUtils-0c1e4d7b.js} +2 -2
- package/dist/esm/{index.es-ad250bc6.js → index.es-286e3cfa.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +4 -4
- package/dist/esm/{mapViewUtils-20504620.js → mapViewUtils-253178f1.js} +1 -1
- package/dist/esm/public-notification.entry.js +112 -6
- package/dist/esm/{publicNotificationStore-3bf4de75.js → publicNotificationStore-223faed2.js} +2 -2
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/crowdsource-reporter.html +1 -1
- package/dist/solutions-components/p-15f9624a.entry.js +6 -0
- package/dist/solutions-components/{p-955647ea.entry.js → p-1ea5e061.entry.js} +2 -2
- package/dist/solutions-components/{p-590a2a26.js → p-212b02e7.js} +1 -1
- package/dist/solutions-components/p-238d3b5f.entry.js +6 -0
- package/dist/solutions-components/{p-cc280aa1.js → p-322868ec.js} +1 -1
- package/dist/solutions-components/{p-1d3a1794.js → p-331b5d1e.js} +2 -2
- package/dist/solutions-components/{p-c897e3eb.js → p-3af79063.js} +1 -1
- package/dist/solutions-components/p-6db185bf.entry.js +6 -0
- package/dist/solutions-components/p-80b11ec1.entry.js +17 -0
- package/dist/solutions-components/{p-5c7e3941.entry.js → p-813fd8a4.entry.js} +2 -2
- package/dist/solutions-components/{p-ff302d95.entry.js → p-d136eab0.entry.js} +2 -2
- package/dist/solutions-components/p-e0446d5b.entry.js +6 -0
- package/dist/solutions-components/p-e8f13354.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +23 -0
- package/dist/solutions-components/utils/publicNotificationStore.ts +3 -2
- package/dist/types/components/create-feature/create-feature.d.ts +43 -1
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +22 -14
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +48 -11
- package/dist/types/components/feature-list/feature-list.d.ts +31 -0
- package/dist/types/components/layer-list/layer-list.d.ts +3 -3
- package/dist/types/components/public-notification/public-notification.d.ts +48 -0
- package/dist/types/components.d.ts +71 -2
- package/dist/types/utils/interfaces.d.ts +20 -0
- package/dist/types/utils/publicNotificationStore.d.ts +2 -1
- package/package.json +1 -1
- package/dist/solutions-components/p-6512dc44.entry.js +0 -6
- package/dist/solutions-components/p-6f65682c.entry.js +0 -6
- package/dist/solutions-components/p-989bf0bf.entry.js +0 -6
- package/dist/solutions-components/p-a0611720.entry.js +0 -6
- package/dist/solutions-components/p-b8c12736.entry.js +0 -6
- package/dist/solutions-components/p-efe1694a.entry.js +0 -17
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { g as getLocaleComponentStrings } from './locale.js';
|
|
8
8
|
import { l as loadModules } from './loadModules.js';
|
|
9
|
-
import { a as getAllLayers, e as getFeatureLayerView, h as highlightFeatures, g as getLayerOrTable } from './mapViewUtils.js';
|
|
9
|
+
import { a as getAllLayers, e as getFeatureLayerView, h as highlightFeatures, c as getMapLayerHash, g as getLayerOrTable } from './mapViewUtils.js';
|
|
10
10
|
import { q as queryFeaturesByID } from './queryUtils.js';
|
|
11
11
|
import { d as defineCustomElement$w } from './action.js';
|
|
12
12
|
import { d as defineCustomElement$v } from './action-menu.js';
|
|
@@ -40,7 +40,7 @@ import { d as defineCustomElement$4 } from './info-card2.js';
|
|
|
40
40
|
import { d as defineCustomElement$3 } from './instant-apps-social-share2.js';
|
|
41
41
|
import { d as defineCustomElement$2 } from './layer-list2.js';
|
|
42
42
|
|
|
43
|
-
const crowdsourceReporterCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100% !important}.width-0{width:0}.height-full{height:100% !important}.height-0{height:0}.overflow-hidden{overflow:hidden}.border{border:1px solid var(--calcite-color-border-3)}.notice-msg{padding:10px;width:calc(100% - 20px)}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}";
|
|
43
|
+
const crowdsourceReporterCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100% !important}.width-0{width:0}.height-full{height:100% !important}.height-0{height:0}.overflow-hidden{overflow:hidden}.border{border:1px solid var(--calcite-color-border-3)}.notice-msg{padding:10px;width:calc(100% - 20px)}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}.report-submitted-msg{position:absolute;z-index:1000}";
|
|
44
44
|
|
|
45
45
|
const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceReporter extends HTMLElement {
|
|
46
46
|
constructor() {
|
|
@@ -63,8 +63,11 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
63
63
|
this.objectId = undefined;
|
|
64
64
|
this.center = undefined;
|
|
65
65
|
this.level = undefined;
|
|
66
|
+
this.popupHeaderHoverColor = undefined;
|
|
67
|
+
this.popupHeaderColor = undefined;
|
|
66
68
|
this.reportButtonText = undefined;
|
|
67
69
|
this.reportsHeader = undefined;
|
|
70
|
+
this.reportingOptions = undefined;
|
|
68
71
|
this.reportSubmittedMessage = undefined;
|
|
69
72
|
this.searchConfiguration = undefined;
|
|
70
73
|
this.showComments = undefined;
|
|
@@ -74,8 +77,9 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
74
77
|
this.mapInfos = [];
|
|
75
78
|
this.theme = "light";
|
|
76
79
|
this.enableZoom = true;
|
|
80
|
+
this.zoomToScale = undefined;
|
|
77
81
|
this._mapInfo = undefined;
|
|
78
|
-
this._flowItems = [
|
|
82
|
+
this._flowItems = [];
|
|
79
83
|
this._sidePanelCollapsed = false;
|
|
80
84
|
this._translations = undefined;
|
|
81
85
|
this._hasValidLayers = false;
|
|
@@ -114,16 +118,20 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
114
118
|
* @returns Promise when complete
|
|
115
119
|
*/
|
|
116
120
|
async componentWillLoad() {
|
|
121
|
+
var _a;
|
|
117
122
|
this._urlParamsLoaded = false;
|
|
118
123
|
await this._initModules();
|
|
119
124
|
await this._getTranslations();
|
|
125
|
+
await ((_a = this.mapView) === null || _a === void 0 ? void 0 : _a.when(async () => {
|
|
126
|
+
await this.setMapView();
|
|
127
|
+
}));
|
|
120
128
|
}
|
|
121
129
|
/**
|
|
122
130
|
* Renders the component.
|
|
123
131
|
*/
|
|
124
132
|
render() {
|
|
125
133
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
|
126
|
-
return (h(Host, null, this._reportSubmitted && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { slot: "
|
|
134
|
+
return (h(Host, null, this._reportSubmitted && h("calcite-alert", { "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), h("div", null, h("calcite-shell", { "content-behind": true }, this._getReporter()))));
|
|
127
135
|
}
|
|
128
136
|
//--------------------------------------------------------------------------
|
|
129
137
|
//
|
|
@@ -193,8 +201,9 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
193
201
|
* @protected
|
|
194
202
|
*/
|
|
195
203
|
getLayerListFlowItem() {
|
|
204
|
+
var _a;
|
|
196
205
|
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
|
|
197
|
-
h("calcite-button", { appearance: "solid", onClick: this.navigateToChooseCategory.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true, "full-width": true }, h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._noLayerToDisplayErrorMsg, onLayerSelect: this.displayFeaturesList.bind(this), onLayersListLoaded: this.layerListLoaded.bind(this), ref: el => this._layerList = el, showFeatureCount: true, showNextIcon: true }))));
|
|
206
|
+
h("calcite-button", { appearance: "solid", onClick: this.navigateToChooseCategory.bind(this), slot: "footer", width: "full" }, this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText), h("calcite-panel", { "full-height": true, "full-width": true }, h("layer-list", { class: "height-full", layers: ((_a = this._editableLayerIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this._editableLayerIds : this.layers, mapView: this.mapView, noLayerErrorMsg: this._noLayerToDisplayErrorMsg, onLayerSelect: this.displayFeaturesList.bind(this), onLayersListLoaded: this.layerListLoaded.bind(this), ref: el => this._layerList = el, showFeatureCount: true, showNextIcon: true }))));
|
|
198
207
|
}
|
|
199
208
|
/**
|
|
200
209
|
* Get the layer list for creating a report
|
|
@@ -202,7 +211,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
202
211
|
* @protected
|
|
203
212
|
*/
|
|
204
213
|
getChooseCategoryFlowItem() {
|
|
205
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.
|
|
214
|
+
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("calcite-panel", { "full-height": true, "full-width": true }, h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.chooseCategoryMsg)), h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._noLayerToDisplayErrorMsg, onLayerSelect: this.navigateToCreateFeature.bind(this), showFeatureCount: false, showNextIcon: false }))));
|
|
206
215
|
}
|
|
207
216
|
/**
|
|
208
217
|
* Get Feature create form of the selected feature layer
|
|
@@ -210,7 +219,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
210
219
|
* @protected
|
|
211
220
|
*/
|
|
212
221
|
getFeatureCreateFlowItem() {
|
|
213
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromCreateFeaturePanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this._showSubmitCancelButton && h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", onClick: this.onSubmitButtonClick.bind(this), width: "full" }, this._translations.submit), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromCreateFeaturePanel.bind(this), width: "full" }, this._translations.cancel)), h("calcite-panel", { "full-height": true, "full-width": true }, h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.featureEditFormInfoMsg)), h("create-feature", { customizeSubmit: true, mapView: this.mapView, onDrawComplete: this.onDrawComplete.bind(this), onEditingAttachment: this.showSubmitCancelButton.bind(this), onFail: this.createFeatureFailed.bind(this), onSuccess: this.onReportSubmitted.bind(this), ref: el => this._createFeature = el, selectedLayerId: this._selectedLayerId }))));
|
|
222
|
+
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromCreateFeaturePanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this._showSubmitCancelButton && h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", onClick: this.onSubmitButtonClick.bind(this), width: "full" }, this._translations.submit), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromCreateFeaturePanel.bind(this), width: "full" }, this._translations.cancel)), h("calcite-panel", { "full-height": true, "full-width": true }, h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.featureEditFormInfoMsg)), h("create-feature", { customizeSubmit: true, mapView: this.mapView, onDrawComplete: this.onDrawComplete.bind(this), onEditingAttachment: this.showSubmitCancelButton.bind(this), onFail: this.createFeatureFailed.bind(this), onSuccess: this.onReportSubmitted.bind(this), ref: el => this._createFeature = el, searchConfiguration: this.searchConfiguration, selectedLayerId: this._selectedLayerId }))));
|
|
214
223
|
}
|
|
215
224
|
/**
|
|
216
225
|
* When drawing of incident location completed on map show the submit and cancel button
|
|
@@ -260,13 +269,13 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
260
269
|
*/
|
|
261
270
|
onReportSubmitted() {
|
|
262
271
|
this._reportSubmitted = true;
|
|
263
|
-
this.navigateToHomePage();
|
|
272
|
+
void this.navigateToHomePage();
|
|
264
273
|
}
|
|
265
274
|
/**
|
|
266
275
|
* Navigates to layer-list
|
|
267
276
|
* @protected
|
|
268
277
|
*/
|
|
269
|
-
navigateToHomePage() {
|
|
278
|
+
async navigateToHomePage() {
|
|
270
279
|
if (this._createFeature) {
|
|
271
280
|
this._createFeature.close();
|
|
272
281
|
}
|
|
@@ -274,21 +283,23 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
274
283
|
this._layerList.refresh();
|
|
275
284
|
}
|
|
276
285
|
this.setSelectedFeatures([]);
|
|
277
|
-
this.
|
|
286
|
+
if (this._editableLayerIds.length === 1) {
|
|
287
|
+
await this._featureList.refresh();
|
|
288
|
+
this._flowItems = ["feature-list"];
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
this._flowItems = ["layer-list"];
|
|
292
|
+
}
|
|
278
293
|
}
|
|
279
294
|
/**
|
|
280
|
-
*
|
|
295
|
+
* On layer select open the feature create flow item
|
|
281
296
|
* @param evt Event which has details of selected layerId and layerName
|
|
282
297
|
* @protected
|
|
283
298
|
*/
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
* On next button click open the feature create flow item
|
|
289
|
-
* @protected
|
|
290
|
-
*/
|
|
291
|
-
async navigateToCreateFeature() {
|
|
299
|
+
async navigateToCreateFeature(evt) {
|
|
300
|
+
if (evt.detail.layerId && evt.detail.layerName) {
|
|
301
|
+
this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
|
302
|
+
}
|
|
292
303
|
this._showSubmitCancelButton = false;
|
|
293
304
|
this._flowItems = [...this._flowItems, "feature-create"];
|
|
294
305
|
}
|
|
@@ -341,8 +352,8 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
341
352
|
updatedFlowItems.pop();
|
|
342
353
|
this.clearHighlights();
|
|
343
354
|
//Back to layer list, and return as the flowItems will be reset in navigateToHomePage
|
|
344
|
-
if (updatedFlowItems.length === 1) {
|
|
345
|
-
this.navigateToHomePage();
|
|
355
|
+
if (updatedFlowItems.length === 1 && updatedFlowItems[0] === 'layer-list') {
|
|
356
|
+
void this.navigateToHomePage();
|
|
346
357
|
return;
|
|
347
358
|
}
|
|
348
359
|
this._flowItems = [...updatedFlowItems];
|
|
@@ -372,7 +383,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
372
383
|
*/
|
|
373
384
|
getFeatureListFlowItem(layerId, layerName) {
|
|
374
385
|
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
|
|
375
|
-
h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true }, h("feature-list", { class: "height-full", mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, selectedLayerId: layerId }))));
|
|
386
|
+
h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText), h("calcite-panel", { "full-height": true }, h("feature-list", { class: "height-full", highlightOnHover: true, mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, ref: el => this._featureList = el, selectedLayerId: layerId }))));
|
|
376
387
|
}
|
|
377
388
|
/**
|
|
378
389
|
* Returns the calcite-flow item for feature details
|
|
@@ -400,7 +411,9 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
400
411
|
this._currentFeatureId = selectedFeature.attributes[layer.objectIdField];
|
|
401
412
|
}
|
|
402
413
|
else {
|
|
403
|
-
this.
|
|
414
|
+
if (this._editableLayerIds.length > 1) {
|
|
415
|
+
this.setSelectedLayer('', '');
|
|
416
|
+
}
|
|
404
417
|
this._currentFeatureId = '';
|
|
405
418
|
}
|
|
406
419
|
this._updateShareURL();
|
|
@@ -423,6 +436,8 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
423
436
|
// highlight the newly selected feature only when it has valid geometry
|
|
424
437
|
if (selectedFeature && selectedFeature.geometry && selectedFeature.layer) {
|
|
425
438
|
const selectedLayerView = await getFeatureLayerView(this.mapView, selectedFeature.layer.id);
|
|
439
|
+
// remove previous highlight options (if any) to highlight the feature by default color
|
|
440
|
+
selectedLayerView.highlightOptions = null;
|
|
426
441
|
this._highlightHandle = await highlightFeatures([selectedFeature.getObjectId()], selectedLayerView, this.mapView, true);
|
|
427
442
|
}
|
|
428
443
|
}
|
|
@@ -448,6 +463,15 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
448
463
|
* @protected
|
|
449
464
|
*/
|
|
450
465
|
async setMapView() {
|
|
466
|
+
var _a;
|
|
467
|
+
await this.getLayersToShowInList();
|
|
468
|
+
// if only one valid layer is present then directly render features list
|
|
469
|
+
if (((_a = this._editableLayerIds) === null || _a === void 0 ? void 0 : _a.length) === 1) {
|
|
470
|
+
await this.renderFeaturesList();
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
this._flowItems = ['layer-list'];
|
|
474
|
+
}
|
|
451
475
|
this.mapView.popupEnabled = false;
|
|
452
476
|
if (this._defaultCenter && this._defaultLevel) {
|
|
453
477
|
await this.mapView.goTo({
|
|
@@ -471,7 +495,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
471
495
|
this._mapClickHandle = this.reactiveUtils.on(() => this.mapView, "click", this.onMapClick.bind(this));
|
|
472
496
|
}
|
|
473
497
|
/**
|
|
474
|
-
* On map click do hitTest and get the clicked graphics
|
|
498
|
+
* On map click do hitTest and get the clicked graphics from both reporting and non-reporting layers, and show feature details
|
|
475
499
|
* @param event IMapClick map click event details
|
|
476
500
|
*
|
|
477
501
|
* @protected
|
|
@@ -479,12 +503,8 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
479
503
|
async onMapClick(event) {
|
|
480
504
|
//disable map popup
|
|
481
505
|
this.mapView.popupEnabled = false;
|
|
482
|
-
// only include graphics from valid layers listed in the layer list widget
|
|
483
|
-
const opts = {
|
|
484
|
-
include: this._validLayers
|
|
485
|
-
};
|
|
486
506
|
// Perform a hitTest on the View
|
|
487
|
-
const hitTest = await this.mapView.hitTest(event
|
|
507
|
+
const hitTest = await this.mapView.hitTest(event);
|
|
488
508
|
if (hitTest.results.length > 0) {
|
|
489
509
|
const clickedGraphics = [];
|
|
490
510
|
hitTest.results.forEach(function (result) {
|
|
@@ -493,16 +513,35 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
493
513
|
clickedGraphics.push(result.graphic);
|
|
494
514
|
}
|
|
495
515
|
});
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
this.
|
|
516
|
+
const reportingLayerGraphics = clickedGraphics.filter((graphic) => {
|
|
517
|
+
return this._validLayers.includes(graphic.layer);
|
|
518
|
+
});
|
|
519
|
+
const nonReportingLayerGraphics = clickedGraphics.filter((graphic) => {
|
|
520
|
+
var _a;
|
|
521
|
+
return !this._validLayers.includes(graphic.layer) && ((_a = graphic === null || graphic === void 0 ? void 0 : graphic.layer) === null || _a === void 0 ? void 0 : _a.id);
|
|
522
|
+
});
|
|
523
|
+
// if clicked graphic's layer is one of the reporting layers then show details in layer panel
|
|
524
|
+
if (reportingLayerGraphics.length > 0) {
|
|
525
|
+
//update the selectedFeature
|
|
526
|
+
this.setSelectedFeatures(reportingLayerGraphics);
|
|
527
|
+
//if featureDetails not open then add it to the list else just reInit flowItems which will update details with newly selected features
|
|
528
|
+
// eslint-disable-next-line unicorn/prefer-ternary
|
|
529
|
+
if (this._flowItems.length && this._flowItems[this._flowItems.length - 1] !== "feature-details") {
|
|
530
|
+
this._flowItems = [...this._flowItems, "feature-details"];
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
this._flowItems = [...this._flowItems];
|
|
534
|
+
void this.highlightOnMap(clickedGraphics[0]);
|
|
535
|
+
}
|
|
502
536
|
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
537
|
+
// if clicked graphic's layer is from non reporting layers then show popup on map
|
|
538
|
+
if (nonReportingLayerGraphics.length > 0) {
|
|
539
|
+
this.mapView.popupEnabled = true;
|
|
540
|
+
const options = {
|
|
541
|
+
features: nonReportingLayerGraphics,
|
|
542
|
+
updateLocationEnabled: true
|
|
543
|
+
};
|
|
544
|
+
await this.mapView.openPopup(options);
|
|
506
545
|
}
|
|
507
546
|
}
|
|
508
547
|
}
|
|
@@ -515,10 +554,57 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
515
554
|
const messages = await getLocaleComponentStrings(this.el);
|
|
516
555
|
this._translations = messages[0];
|
|
517
556
|
}
|
|
557
|
+
/**
|
|
558
|
+
* Returns the ids of all OR configured layers that support edits with the update capability
|
|
559
|
+
* @param hash each layer item details
|
|
560
|
+
* @param layers list of layers id
|
|
561
|
+
* @returns array of editable layer ids
|
|
562
|
+
*/
|
|
563
|
+
reduceToConfiguredLayers(hash) {
|
|
564
|
+
var _a;
|
|
565
|
+
const configuredLayers = ((_a = this.layers) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.layers : [];
|
|
566
|
+
return Object.keys(hash).reduce((prev, cur) => {
|
|
567
|
+
let showLayer = hash[cur].supportsAdd;
|
|
568
|
+
if ((configuredLayers === null || configuredLayers === void 0 ? void 0 : configuredLayers.length) > 0) {
|
|
569
|
+
showLayer = configuredLayers.indexOf(cur) > -1 ? hash[cur].supportsAdd : false;
|
|
570
|
+
}
|
|
571
|
+
if (showLayer) {
|
|
572
|
+
prev.push(cur);
|
|
573
|
+
}
|
|
574
|
+
return prev;
|
|
575
|
+
}, []);
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Creates the list of layers to be listed in layer list
|
|
579
|
+
* @protected
|
|
580
|
+
*/
|
|
581
|
+
async getLayersToShowInList() {
|
|
582
|
+
const layerItemsHash = await getMapLayerHash(this.mapView, true);
|
|
583
|
+
const allMapLayers = await getAllLayers(this.mapView);
|
|
584
|
+
allMapLayers.forEach((eachLayer) => {
|
|
585
|
+
var _a, _b;
|
|
586
|
+
if ((eachLayer === null || eachLayer === void 0 ? void 0 : eachLayer.type) === "feature" && (eachLayer === null || eachLayer === void 0 ? void 0 : eachLayer.editingEnabled) && ((_b = (_a = eachLayer === null || eachLayer === void 0 ? void 0 : eachLayer.capabilities) === null || _a === void 0 ? void 0 : _a.operations) === null || _b === void 0 ? void 0 : _b.supportsAdd)) {
|
|
587
|
+
layerItemsHash[eachLayer.id].supportsAdd = true;
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
this._editableLayerIds = this.reduceToConfiguredLayers(layerItemsHash);
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* renders feature list
|
|
594
|
+
* @protected
|
|
595
|
+
*/
|
|
596
|
+
async renderFeaturesList() {
|
|
597
|
+
const evt = {
|
|
598
|
+
detail: this._editableLayerIds
|
|
599
|
+
};
|
|
600
|
+
await this.layerListLoaded(evt);
|
|
601
|
+
this.setSelectedLayer(this._validLayers[0].id, this._validLayers[0].title);
|
|
602
|
+
this._flowItems = ['feature-list'];
|
|
603
|
+
}
|
|
518
604
|
/**
|
|
519
605
|
* Updates the share url for current selected feature
|
|
520
606
|
* @protected
|
|
521
|
-
|
|
607
|
+
*/
|
|
522
608
|
_updateShareURL() {
|
|
523
609
|
var _a, _b;
|
|
524
610
|
const url = (_a = this._shareNode) === null || _a === void 0 ? void 0 : _a.shareUrl;
|
|
@@ -596,8 +682,11 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
596
682
|
"objectId": [1, "object-id"],
|
|
597
683
|
"center": [1],
|
|
598
684
|
"level": [1],
|
|
685
|
+
"popupHeaderHoverColor": [1, "popup-header-hover-color"],
|
|
686
|
+
"popupHeaderColor": [1, "popup-header-color"],
|
|
599
687
|
"reportButtonText": [1, "report-button-text"],
|
|
600
688
|
"reportsHeader": [1, "reports-header"],
|
|
689
|
+
"reportingOptions": [16],
|
|
601
690
|
"reportSubmittedMessage": [1, "report-submitted-message"],
|
|
602
691
|
"searchConfiguration": [16],
|
|
603
692
|
"showComments": [4, "show-comments"],
|
|
@@ -607,6 +696,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
|
607
696
|
"mapInfos": [16],
|
|
608
697
|
"theme": [1],
|
|
609
698
|
"enableZoom": [4, "enable-zoom"],
|
|
699
|
+
"zoomToScale": [2, "zoom-to-scale"],
|
|
610
700
|
"_mapInfo": [32],
|
|
611
701
|
"_flowItems": [32],
|
|
612
702
|
"_sidePanelCollapsed": [32],
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
7
|
+
import { l as loadModules } from './loadModules.js';
|
|
7
8
|
import { P as PopupUtils } from './popupUtils.js';
|
|
8
9
|
import { g as getLayerOrTable, e as getFeatureLayerView, h as highlightFeatures } from './mapViewUtils.js';
|
|
9
10
|
import { g as getLocaleComponentStrings } from './locale.js';
|
|
@@ -36,6 +37,7 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
|
|
|
36
37
|
this.noFeaturesFoundMsg = undefined;
|
|
37
38
|
this.pageSize = 100;
|
|
38
39
|
this.highlightOnMap = false;
|
|
40
|
+
this.highlightOnHover = false;
|
|
39
41
|
this._featureItems = [];
|
|
40
42
|
this._featuresCount = 0;
|
|
41
43
|
this._isLoading = false;
|
|
@@ -55,6 +57,16 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
|
|
|
55
57
|
}
|
|
56
58
|
//--------------------------------------------------------------------------
|
|
57
59
|
//
|
|
60
|
+
// Methods (public)
|
|
61
|
+
/**
|
|
62
|
+
* Refresh the feature list which will fetch the latest features and update the features list
|
|
63
|
+
* @returns Promise that resolves when the operation is complete
|
|
64
|
+
*/
|
|
65
|
+
async refresh() {
|
|
66
|
+
await this.initializeFeatureItems();
|
|
67
|
+
}
|
|
68
|
+
//--------------------------------------------------------------------------
|
|
69
|
+
//
|
|
58
70
|
// Functions (lifecycle)
|
|
59
71
|
//
|
|
60
72
|
//--------------------------------------------------------------------------
|
|
@@ -63,6 +75,7 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
|
|
|
63
75
|
* @returns Promise when complete
|
|
64
76
|
*/
|
|
65
77
|
async componentWillLoad() {
|
|
78
|
+
await this.initModules();
|
|
66
79
|
await this._getTranslations();
|
|
67
80
|
this._isLoading = true;
|
|
68
81
|
this._popupUtils = new PopupUtils();
|
|
@@ -89,6 +102,17 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
|
|
|
89
102
|
// Functions (protected)
|
|
90
103
|
//
|
|
91
104
|
//--------------------------------------------------------------------------
|
|
105
|
+
/**
|
|
106
|
+
* Load esri javascript api modules
|
|
107
|
+
* @returns Promise resolving when function is done
|
|
108
|
+
* @protected
|
|
109
|
+
*/
|
|
110
|
+
async initModules() {
|
|
111
|
+
const [Color] = await loadModules([
|
|
112
|
+
"esri/Color"
|
|
113
|
+
]);
|
|
114
|
+
this.Color = Color;
|
|
115
|
+
}
|
|
92
116
|
/**
|
|
93
117
|
* Initialize the features list using the selected layer
|
|
94
118
|
* @protected
|
|
@@ -124,10 +148,7 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
|
|
|
124
148
|
*/
|
|
125
149
|
async featureClicked(event, selectedFeature) {
|
|
126
150
|
//clear previous highlight and remove the highlightHandle
|
|
127
|
-
|
|
128
|
-
this._highlightHandle.remove();
|
|
129
|
-
this._highlightHandle = null;
|
|
130
|
-
}
|
|
151
|
+
this.clearHighlights();
|
|
131
152
|
//highlight on map only if it is selected item
|
|
132
153
|
if (this.highlightOnMap) {
|
|
133
154
|
const selectedFeatureObjectId = Number(event.target.value);
|
|
@@ -136,6 +157,31 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
|
|
|
136
157
|
}
|
|
137
158
|
this.featureSelect.emit(selectedFeature);
|
|
138
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* On feature hover in feature list highlight the feature on the map
|
|
162
|
+
* @param selectedFeature mouseovered feature graphic
|
|
163
|
+
* @protected
|
|
164
|
+
*/
|
|
165
|
+
async onFeatureHover(selectedFeature) {
|
|
166
|
+
//clear previous highlight and remove the highlightHandle
|
|
167
|
+
this.clearHighlights();
|
|
168
|
+
if (this.highlightOnHover) {
|
|
169
|
+
const oId = selectedFeature.getObjectId();
|
|
170
|
+
const selectedLayerView = await getFeatureLayerView(this.mapView, this.selectedLayerId);
|
|
171
|
+
selectedLayerView.highlightOptions = { color: new this.Color("#FFFF00") };
|
|
172
|
+
this._highlightHandle = selectedLayerView.highlight([oId]);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Clears the highlight
|
|
177
|
+
* @protected
|
|
178
|
+
*/
|
|
179
|
+
clearHighlights() {
|
|
180
|
+
//if a feature is already highlighted, then remove the highlight
|
|
181
|
+
if (this._highlightHandle) {
|
|
182
|
+
this._highlightHandle.remove();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
139
185
|
/**
|
|
140
186
|
* Query the selected feature layer, in descending order of object id's
|
|
141
187
|
* @param page 0th page number in the pagination item
|
|
@@ -186,7 +232,7 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
|
|
|
186
232
|
const oId = selectedFeature.attributes[this._selectedLayer.objectIdField].toString();
|
|
187
233
|
//use object id if popupTitle is null or undefined
|
|
188
234
|
popupTitle = popupTitle !== null && popupTitle !== void 0 ? popupTitle : oId;
|
|
189
|
-
return (h("calcite-list-item", { onCalciteListItemSelect: (e) => { void this.featureClicked(e, selectedFeature); }, value: oId }, h("div", { class: "popup-title", slot: "content-start" }, popupTitle), h("calcite-icon", { icon: "chevron-right", scale: "s", slot: "content-end" })));
|
|
235
|
+
return (h("calcite-list-item", { onCalciteListItemSelect: (e) => { void this.featureClicked(e, selectedFeature); }, onMouseLeave: () => { void this.clearHighlights(); }, onMouseOver: () => { void this.onFeatureHover(selectedFeature); }, value: oId }, h("div", { class: "popup-title", slot: "content-start" }, popupTitle), h("calcite-icon", { icon: "chevron-right", scale: "s", slot: "content-end" })));
|
|
190
236
|
}
|
|
191
237
|
/**
|
|
192
238
|
* Fetches the component's translations
|
|
@@ -208,10 +254,12 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
|
|
|
208
254
|
"noFeaturesFoundMsg": [1, "no-features-found-msg"],
|
|
209
255
|
"pageSize": [2, "page-size"],
|
|
210
256
|
"highlightOnMap": [4, "highlight-on-map"],
|
|
257
|
+
"highlightOnHover": [4, "highlight-on-hover"],
|
|
211
258
|
"_featureItems": [32],
|
|
212
259
|
"_featuresCount": [32],
|
|
213
260
|
"_isLoading": [32],
|
|
214
|
-
"_translations": [32]
|
|
261
|
+
"_translations": [32],
|
|
262
|
+
"refresh": [64]
|
|
215
263
|
}, undefined, {
|
|
216
264
|
"selectedLayerId": ["selectedLayerWatchHandler"]
|
|
217
265
|
}]);
|
|
@@ -24,7 +24,7 @@ import { d as defineCustomElement$3 } from './tooltip.js';
|
|
|
24
24
|
import { d as defineCustomElement$2 } from './delete-button2.js';
|
|
25
25
|
import { d as defineCustomElement$1 } from './edit-card2.js';
|
|
26
26
|
|
|
27
|
-
const infoCardCss = ":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.esri-features__footer{display:none !important}.button-container{justify-content:space-between;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.min-width-100{min-width:100px}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}.border-width-0{border-width:0px}";
|
|
27
|
+
const infoCardCss = ":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.feature-node .esri-features__footer{display:none !important}.button-container{justify-content:space-between;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.min-width-100{min-width:100px}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}.border-width-0{border-width:0px}";
|
|
28
28
|
|
|
29
29
|
const InfoCard = /*@__PURE__*/ proxyCustomElement(class InfoCard extends HTMLElement {
|
|
30
30
|
constructor() {
|
|
@@ -148,7 +148,7 @@ const InfoCard = /*@__PURE__*/ proxyCustomElement(class InfoCard extends HTMLEle
|
|
|
148
148
|
const id = (_d = (_c = this._features) === null || _c === void 0 ? void 0 : _c.selectedFeature) === null || _d === void 0 ? void 0 : _d.getObjectId();
|
|
149
149
|
const ids = parseInt(id === null || id === void 0 ? void 0 : id.toString(), 10) > -1 ? [id] : [];
|
|
150
150
|
const deleteEnabled = ((_e = this._layer) === null || _e === void 0 ? void 0 : _e.editingEnabled) && ((_h = (_g = (_f = this._layer) === null || _f === void 0 ? void 0 : _f.capabilities) === null || _g === void 0 ? void 0 : _g.operations) === null || _h === void 0 ? void 0 : _h.supportsDelete);
|
|
151
|
-
return (h(Host, null, h("calcite-shell", null, this._getHeader(), h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData }), h("div", { class: "esri-widget " + featureNodeClass, id: "features-node" }), h("div", { class: `${editButtonClass} width-100`, slot: "footer" }, this.allowEditing &&
|
|
151
|
+
return (h(Host, null, h("calcite-shell", null, this._getHeader(), h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData }), h("div", { class: "esri-widget feature-node " + featureNodeClass, id: "features-node" }), h("div", { class: `${editButtonClass} width-100`, slot: "footer" }, this.allowEditing &&
|
|
152
152
|
h("div", { class: "display-flex top-border padding-1-2" }, h("calcite-button", { appearance: "solid", id: "solutions-edit", onClick: () => this._openEditRecord(), width: "full" }, this._translations.edit), this.isMobile && deleteEnabled ? (h("delete-button", { class: "padding-inline-start-1 width-100", id: "solutions-delete", ids: ids, layer: this._layer, onEditsComplete: () => this._closePopup() })) : undefined, h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": "solutions-edit" }, h("span", null, this._translations.edit)), this.isMobile ? (h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": "solutions-delete" }, h("span", null, this._translations.delete))) : undefined), !nextBackDisabled && h("div", { class: `display-flex padding-1-2 button-container top-border ${nextBackClass}` }, h("div", { class: "min-width-100" }, h("calcite-button", { appearance: "outline", disabled: nextBackDisabled, id: "solutions-back", onClick: () => this._back(), width: "full" }, this._translations.back), h("calcite-tooltip", { label: "", placement: "top", "reference-element": "solutions-back" }, h("span", null, this._translations.back))), h("div", null, h("calcite-action", { icon: "list", onClick: () => this._toggleListView(), scale: "s", text: this._count, textEnabled: true })), h("div", { class: "min-width-100" }, h("calcite-button", { appearance: "outline", disabled: nextBackDisabled, id: "solutions-next", onClick: () => this._next(), width: "full" }, this._translations.next), h("calcite-tooltip", { label: "", placement: "top", "reference-element": "solutions-next" }, h("span", null, this._translations.next))))), h("edit-card", { class: editClass, graphicIndex: (_j = this._features) === null || _j === void 0 ? void 0 : _j.selectedFeatureIndex, graphics: this.graphics, mapView: this.mapView, open: this._editRecordOpen }), h("calcite-alert", { icon: "layer-broken", kind: "warning", label: "", onCalciteAlertClose: () => this._alertClosed(), open: this._alertOpen, placement: "top" }, h("div", { slot: "title" }, this._translations.editDisabled), h("div", { slot: "message" }, this._translations.enableEditing)))));
|
|
153
153
|
}
|
|
154
154
|
//--------------------------------------------------------------------------
|
|
@@ -82,7 +82,7 @@ const LayerList = /*@__PURE__*/ proxyCustomElement(class LayerList extends HTMLE
|
|
|
82
82
|
render() {
|
|
83
83
|
return (h(Fragment, null, this._isLoading && h("calcite-loader", { label: "", scale: "m" }), !this._isLoading && this.mapView && this._noLayersToDisplay &&
|
|
84
84
|
h("calcite-notice", { class: "error-msg", icon: "layers-reference", kind: "danger", open: true }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this.noLayerErrorMsg ? this.noLayerErrorMsg : this._noLayerToDisplayErrorMsg)), !this._isLoading && this.mapView &&
|
|
85
|
-
h("calcite-list", { "selection-appearance": "border", "selection-mode":
|
|
85
|
+
h("calcite-list", { "selection-appearance": "border", "selection-mode": "none" }, this.renderLayerList())));
|
|
86
86
|
}
|
|
87
87
|
//--------------------------------------------------------------------------
|
|
88
88
|
//
|
|
@@ -130,7 +130,7 @@ const LayerList = /*@__PURE__*/ proxyCustomElement(class LayerList extends HTMLE
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
await Promise.all(def).then(() => {
|
|
133
|
-
const editableLayerIds = this.
|
|
133
|
+
const editableLayerIds = this.getLayersToBeShownInList(this._layerItemsHash);
|
|
134
134
|
this._mapLayerIds = editableLayerIds.reverse();
|
|
135
135
|
this.handleNoLayersToDisplay();
|
|
136
136
|
}, () => {
|
|
@@ -146,17 +146,17 @@ const LayerList = /*@__PURE__*/ proxyCustomElement(class LayerList extends HTMLE
|
|
|
146
146
|
this.layersListLoaded.emit(this._mapLayerIds);
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
-
* Returns the ids of all OR configured layers that
|
|
149
|
+
* Returns the ids of all OR configured layers that needs to be shown in the list
|
|
150
150
|
* @param hash each layer item details
|
|
151
151
|
* @returns array of layer ids
|
|
152
152
|
*/
|
|
153
|
-
|
|
153
|
+
getLayersToBeShownInList(hash) {
|
|
154
154
|
var _a;
|
|
155
155
|
const configuredLayers = ((_a = this.layers) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.layers : [];
|
|
156
156
|
return Object.keys(hash).reduce((prev, cur) => {
|
|
157
|
-
let showLayer =
|
|
157
|
+
let showLayer = true;
|
|
158
158
|
if ((configuredLayers === null || configuredLayers === void 0 ? void 0 : configuredLayers.length) > 0) {
|
|
159
|
-
showLayer = configuredLayers.indexOf(cur) > -1
|
|
159
|
+
showLayer = configuredLayers.indexOf(cur) > -1;
|
|
160
160
|
}
|
|
161
161
|
if (showLayer) {
|
|
162
162
|
prev.push(cur);
|
|
@@ -167,7 +167,7 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class MapDrawTools extends
|
|
|
167
167
|
}
|
|
168
168
|
else {
|
|
169
169
|
this._sketchGraphicsLayer = new this.GraphicsLayer({ title, listMode: "hide" });
|
|
170
|
-
state.managedLayers
|
|
170
|
+
state.managedLayers[title] = "sketch";
|
|
171
171
|
this.mapView.map.layers.add(this._sketchGraphicsLayer);
|
|
172
172
|
}
|
|
173
173
|
if (this.graphics && this.graphics.length > 0) {
|
|
@@ -305,7 +305,7 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class MapLayerPicker ext
|
|
|
305
305
|
_validLayer(id) {
|
|
306
306
|
var _a;
|
|
307
307
|
const name = (_a = this._layerNameHash[id]) === null || _a === void 0 ? void 0 : _a.name;
|
|
308
|
-
return name && state.managedLayers.indexOf(name) < 0 && (this.enabledLayerIds.length > 0 ?
|
|
308
|
+
return name && Object.keys(state.managedLayers).indexOf(name) < 0 && (this.enabledLayerIds.length > 0 ?
|
|
309
309
|
this.enabledLayerIds.indexOf(id) > -1 : true);
|
|
310
310
|
}
|
|
311
311
|
/**
|
|
@@ -443,7 +443,7 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class MapSelectTools ext
|
|
|
443
443
|
}
|
|
444
444
|
else {
|
|
445
445
|
this._bufferGraphicsLayer = new this.GraphicsLayer({ title, listMode: "hide" });
|
|
446
|
-
state.managedLayers
|
|
446
|
+
state.managedLayers[title] = "buffer";
|
|
447
447
|
const sketchIndex = this.mapView.map.layers.findIndex((l) => l.title === this._translations.sketchLayer);
|
|
448
448
|
if (sketchIndex > -1) {
|
|
449
449
|
this.mapView.map.layers.add(this._bufferGraphicsLayer, sketchIndex);
|