@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
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-164d485a.js';
|
|
7
7
|
import { l as loadModules, g as getLocaleComponentStrings } from './locale-bcbea4ef.js';
|
|
8
|
-
import { a as getAllLayers, b as getFeatureLayerView, h as highlightFeatures, g as getLayerOrTable, q as queryFeaturesByID } from './mapViewUtils-
|
|
8
|
+
import { a as getAllLayers, b as getFeatureLayerView, h as highlightFeatures, c as getMapLayerHash, g as getLayerOrTable, q as queryFeaturesByID } from './mapViewUtils-253178f1.js';
|
|
9
9
|
import './esri-loader-1b324844.js';
|
|
10
10
|
import './_commonjsHelpers-0f74c230.js';
|
|
11
11
|
import './interfaces-586e863c.js';
|
|
12
12
|
|
|
13
|
-
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}";
|
|
13
|
+
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}";
|
|
14
14
|
|
|
15
15
|
const CrowdsourceReporter = class {
|
|
16
16
|
constructor(hostRef) {
|
|
@@ -32,8 +32,11 @@ const CrowdsourceReporter = class {
|
|
|
32
32
|
this.objectId = undefined;
|
|
33
33
|
this.center = undefined;
|
|
34
34
|
this.level = undefined;
|
|
35
|
+
this.popupHeaderHoverColor = undefined;
|
|
36
|
+
this.popupHeaderColor = undefined;
|
|
35
37
|
this.reportButtonText = undefined;
|
|
36
38
|
this.reportsHeader = undefined;
|
|
39
|
+
this.reportingOptions = undefined;
|
|
37
40
|
this.reportSubmittedMessage = undefined;
|
|
38
41
|
this.searchConfiguration = undefined;
|
|
39
42
|
this.showComments = undefined;
|
|
@@ -43,8 +46,9 @@ const CrowdsourceReporter = class {
|
|
|
43
46
|
this.mapInfos = [];
|
|
44
47
|
this.theme = "light";
|
|
45
48
|
this.enableZoom = true;
|
|
49
|
+
this.zoomToScale = undefined;
|
|
46
50
|
this._mapInfo = undefined;
|
|
47
|
-
this._flowItems = [
|
|
51
|
+
this._flowItems = [];
|
|
48
52
|
this._sidePanelCollapsed = false;
|
|
49
53
|
this._translations = undefined;
|
|
50
54
|
this._hasValidLayers = false;
|
|
@@ -83,16 +87,20 @@ const CrowdsourceReporter = class {
|
|
|
83
87
|
* @returns Promise when complete
|
|
84
88
|
*/
|
|
85
89
|
async componentWillLoad() {
|
|
90
|
+
var _a;
|
|
86
91
|
this._urlParamsLoaded = false;
|
|
87
92
|
await this._initModules();
|
|
88
93
|
await this._getTranslations();
|
|
94
|
+
await ((_a = this.mapView) === null || _a === void 0 ? void 0 : _a.when(async () => {
|
|
95
|
+
await this.setMapView();
|
|
96
|
+
}));
|
|
89
97
|
}
|
|
90
98
|
/**
|
|
91
99
|
* Renders the component.
|
|
92
100
|
*/
|
|
93
101
|
render() {
|
|
94
102
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
|
95
|
-
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: "
|
|
103
|
+
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()))));
|
|
96
104
|
}
|
|
97
105
|
//--------------------------------------------------------------------------
|
|
98
106
|
//
|
|
@@ -162,8 +170,9 @@ const CrowdsourceReporter = class {
|
|
|
162
170
|
* @protected
|
|
163
171
|
*/
|
|
164
172
|
getLayerListFlowItem() {
|
|
173
|
+
var _a;
|
|
165
174
|
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
|
|
166
|
-
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 }))));
|
|
175
|
+
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 }))));
|
|
167
176
|
}
|
|
168
177
|
/**
|
|
169
178
|
* Get the layer list for creating a report
|
|
@@ -171,7 +180,7 @@ const CrowdsourceReporter = class {
|
|
|
171
180
|
* @protected
|
|
172
181
|
*/
|
|
173
182
|
getChooseCategoryFlowItem() {
|
|
174
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.
|
|
183
|
+
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 }))));
|
|
175
184
|
}
|
|
176
185
|
/**
|
|
177
186
|
* Get Feature create form of the selected feature layer
|
|
@@ -179,7 +188,7 @@ const CrowdsourceReporter = class {
|
|
|
179
188
|
* @protected
|
|
180
189
|
*/
|
|
181
190
|
getFeatureCreateFlowItem() {
|
|
182
|
-
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 }))));
|
|
191
|
+
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 }))));
|
|
183
192
|
}
|
|
184
193
|
/**
|
|
185
194
|
* When drawing of incident location completed on map show the submit and cancel button
|
|
@@ -229,13 +238,13 @@ const CrowdsourceReporter = class {
|
|
|
229
238
|
*/
|
|
230
239
|
onReportSubmitted() {
|
|
231
240
|
this._reportSubmitted = true;
|
|
232
|
-
this.navigateToHomePage();
|
|
241
|
+
void this.navigateToHomePage();
|
|
233
242
|
}
|
|
234
243
|
/**
|
|
235
244
|
* Navigates to layer-list
|
|
236
245
|
* @protected
|
|
237
246
|
*/
|
|
238
|
-
navigateToHomePage() {
|
|
247
|
+
async navigateToHomePage() {
|
|
239
248
|
if (this._createFeature) {
|
|
240
249
|
this._createFeature.close();
|
|
241
250
|
}
|
|
@@ -243,21 +252,23 @@ const CrowdsourceReporter = class {
|
|
|
243
252
|
this._layerList.refresh();
|
|
244
253
|
}
|
|
245
254
|
this.setSelectedFeatures([]);
|
|
246
|
-
this.
|
|
255
|
+
if (this._editableLayerIds.length === 1) {
|
|
256
|
+
await this._featureList.refresh();
|
|
257
|
+
this._flowItems = ["feature-list"];
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
this._flowItems = ["layer-list"];
|
|
261
|
+
}
|
|
247
262
|
}
|
|
248
263
|
/**
|
|
249
|
-
*
|
|
264
|
+
* On layer select open the feature create flow item
|
|
250
265
|
* @param evt Event which has details of selected layerId and layerName
|
|
251
266
|
* @protected
|
|
252
267
|
*/
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
* On next button click open the feature create flow item
|
|
258
|
-
* @protected
|
|
259
|
-
*/
|
|
260
|
-
async navigateToCreateFeature() {
|
|
268
|
+
async navigateToCreateFeature(evt) {
|
|
269
|
+
if (evt.detail.layerId && evt.detail.layerName) {
|
|
270
|
+
this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
|
271
|
+
}
|
|
261
272
|
this._showSubmitCancelButton = false;
|
|
262
273
|
this._flowItems = [...this._flowItems, "feature-create"];
|
|
263
274
|
}
|
|
@@ -310,8 +321,8 @@ const CrowdsourceReporter = class {
|
|
|
310
321
|
updatedFlowItems.pop();
|
|
311
322
|
this.clearHighlights();
|
|
312
323
|
//Back to layer list, and return as the flowItems will be reset in navigateToHomePage
|
|
313
|
-
if (updatedFlowItems.length === 1) {
|
|
314
|
-
this.navigateToHomePage();
|
|
324
|
+
if (updatedFlowItems.length === 1 && updatedFlowItems[0] === 'layer-list') {
|
|
325
|
+
void this.navigateToHomePage();
|
|
315
326
|
return;
|
|
316
327
|
}
|
|
317
328
|
this._flowItems = [...updatedFlowItems];
|
|
@@ -341,7 +352,7 @@ const CrowdsourceReporter = class {
|
|
|
341
352
|
*/
|
|
342
353
|
getFeatureListFlowItem(layerId, layerName) {
|
|
343
354
|
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
|
|
344
|
-
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 }))));
|
|
355
|
+
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 }))));
|
|
345
356
|
}
|
|
346
357
|
/**
|
|
347
358
|
* Returns the calcite-flow item for feature details
|
|
@@ -369,7 +380,9 @@ const CrowdsourceReporter = class {
|
|
|
369
380
|
this._currentFeatureId = selectedFeature.attributes[layer.objectIdField];
|
|
370
381
|
}
|
|
371
382
|
else {
|
|
372
|
-
this.
|
|
383
|
+
if (this._editableLayerIds.length > 1) {
|
|
384
|
+
this.setSelectedLayer('', '');
|
|
385
|
+
}
|
|
373
386
|
this._currentFeatureId = '';
|
|
374
387
|
}
|
|
375
388
|
this._updateShareURL();
|
|
@@ -392,6 +405,8 @@ const CrowdsourceReporter = class {
|
|
|
392
405
|
// highlight the newly selected feature only when it has valid geometry
|
|
393
406
|
if (selectedFeature && selectedFeature.geometry && selectedFeature.layer) {
|
|
394
407
|
const selectedLayerView = await getFeatureLayerView(this.mapView, selectedFeature.layer.id);
|
|
408
|
+
// remove previous highlight options (if any) to highlight the feature by default color
|
|
409
|
+
selectedLayerView.highlightOptions = null;
|
|
395
410
|
this._highlightHandle = await highlightFeatures([selectedFeature.getObjectId()], selectedLayerView, this.mapView, true);
|
|
396
411
|
}
|
|
397
412
|
}
|
|
@@ -417,6 +432,15 @@ const CrowdsourceReporter = class {
|
|
|
417
432
|
* @protected
|
|
418
433
|
*/
|
|
419
434
|
async setMapView() {
|
|
435
|
+
var _a;
|
|
436
|
+
await this.getLayersToShowInList();
|
|
437
|
+
// if only one valid layer is present then directly render features list
|
|
438
|
+
if (((_a = this._editableLayerIds) === null || _a === void 0 ? void 0 : _a.length) === 1) {
|
|
439
|
+
await this.renderFeaturesList();
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
this._flowItems = ['layer-list'];
|
|
443
|
+
}
|
|
420
444
|
this.mapView.popupEnabled = false;
|
|
421
445
|
if (this._defaultCenter && this._defaultLevel) {
|
|
422
446
|
await this.mapView.goTo({
|
|
@@ -440,7 +464,7 @@ const CrowdsourceReporter = class {
|
|
|
440
464
|
this._mapClickHandle = this.reactiveUtils.on(() => this.mapView, "click", this.onMapClick.bind(this));
|
|
441
465
|
}
|
|
442
466
|
/**
|
|
443
|
-
* On map click do hitTest and get the clicked graphics
|
|
467
|
+
* On map click do hitTest and get the clicked graphics from both reporting and non-reporting layers, and show feature details
|
|
444
468
|
* @param event IMapClick map click event details
|
|
445
469
|
*
|
|
446
470
|
* @protected
|
|
@@ -448,12 +472,8 @@ const CrowdsourceReporter = class {
|
|
|
448
472
|
async onMapClick(event) {
|
|
449
473
|
//disable map popup
|
|
450
474
|
this.mapView.popupEnabled = false;
|
|
451
|
-
// only include graphics from valid layers listed in the layer list widget
|
|
452
|
-
const opts = {
|
|
453
|
-
include: this._validLayers
|
|
454
|
-
};
|
|
455
475
|
// Perform a hitTest on the View
|
|
456
|
-
const hitTest = await this.mapView.hitTest(event
|
|
476
|
+
const hitTest = await this.mapView.hitTest(event);
|
|
457
477
|
if (hitTest.results.length > 0) {
|
|
458
478
|
const clickedGraphics = [];
|
|
459
479
|
hitTest.results.forEach(function (result) {
|
|
@@ -462,16 +482,35 @@ const CrowdsourceReporter = class {
|
|
|
462
482
|
clickedGraphics.push(result.graphic);
|
|
463
483
|
}
|
|
464
484
|
});
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
this.
|
|
485
|
+
const reportingLayerGraphics = clickedGraphics.filter((graphic) => {
|
|
486
|
+
return this._validLayers.includes(graphic.layer);
|
|
487
|
+
});
|
|
488
|
+
const nonReportingLayerGraphics = clickedGraphics.filter((graphic) => {
|
|
489
|
+
var _a;
|
|
490
|
+
return !this._validLayers.includes(graphic.layer) && ((_a = graphic === null || graphic === void 0 ? void 0 : graphic.layer) === null || _a === void 0 ? void 0 : _a.id);
|
|
491
|
+
});
|
|
492
|
+
// if clicked graphic's layer is one of the reporting layers then show details in layer panel
|
|
493
|
+
if (reportingLayerGraphics.length > 0) {
|
|
494
|
+
//update the selectedFeature
|
|
495
|
+
this.setSelectedFeatures(reportingLayerGraphics);
|
|
496
|
+
//if featureDetails not open then add it to the list else just reInit flowItems which will update details with newly selected features
|
|
497
|
+
// eslint-disable-next-line unicorn/prefer-ternary
|
|
498
|
+
if (this._flowItems.length && this._flowItems[this._flowItems.length - 1] !== "feature-details") {
|
|
499
|
+
this._flowItems = [...this._flowItems, "feature-details"];
|
|
500
|
+
}
|
|
501
|
+
else {
|
|
502
|
+
this._flowItems = [...this._flowItems];
|
|
503
|
+
void this.highlightOnMap(clickedGraphics[0]);
|
|
504
|
+
}
|
|
471
505
|
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
506
|
+
// if clicked graphic's layer is from non reporting layers then show popup on map
|
|
507
|
+
if (nonReportingLayerGraphics.length > 0) {
|
|
508
|
+
this.mapView.popupEnabled = true;
|
|
509
|
+
const options = {
|
|
510
|
+
features: nonReportingLayerGraphics,
|
|
511
|
+
updateLocationEnabled: true
|
|
512
|
+
};
|
|
513
|
+
await this.mapView.openPopup(options);
|
|
475
514
|
}
|
|
476
515
|
}
|
|
477
516
|
}
|
|
@@ -484,10 +523,57 @@ const CrowdsourceReporter = class {
|
|
|
484
523
|
const messages = await getLocaleComponentStrings(this.el);
|
|
485
524
|
this._translations = messages[0];
|
|
486
525
|
}
|
|
526
|
+
/**
|
|
527
|
+
* Returns the ids of all OR configured layers that support edits with the update capability
|
|
528
|
+
* @param hash each layer item details
|
|
529
|
+
* @param layers list of layers id
|
|
530
|
+
* @returns array of editable layer ids
|
|
531
|
+
*/
|
|
532
|
+
reduceToConfiguredLayers(hash) {
|
|
533
|
+
var _a;
|
|
534
|
+
const configuredLayers = ((_a = this.layers) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.layers : [];
|
|
535
|
+
return Object.keys(hash).reduce((prev, cur) => {
|
|
536
|
+
let showLayer = hash[cur].supportsAdd;
|
|
537
|
+
if ((configuredLayers === null || configuredLayers === void 0 ? void 0 : configuredLayers.length) > 0) {
|
|
538
|
+
showLayer = configuredLayers.indexOf(cur) > -1 ? hash[cur].supportsAdd : false;
|
|
539
|
+
}
|
|
540
|
+
if (showLayer) {
|
|
541
|
+
prev.push(cur);
|
|
542
|
+
}
|
|
543
|
+
return prev;
|
|
544
|
+
}, []);
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Creates the list of layers to be listed in layer list
|
|
548
|
+
* @protected
|
|
549
|
+
*/
|
|
550
|
+
async getLayersToShowInList() {
|
|
551
|
+
const layerItemsHash = await getMapLayerHash(this.mapView, true);
|
|
552
|
+
const allMapLayers = await getAllLayers(this.mapView);
|
|
553
|
+
allMapLayers.forEach((eachLayer) => {
|
|
554
|
+
var _a, _b;
|
|
555
|
+
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)) {
|
|
556
|
+
layerItemsHash[eachLayer.id].supportsAdd = true;
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
this._editableLayerIds = this.reduceToConfiguredLayers(layerItemsHash);
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* renders feature list
|
|
563
|
+
* @protected
|
|
564
|
+
*/
|
|
565
|
+
async renderFeaturesList() {
|
|
566
|
+
const evt = {
|
|
567
|
+
detail: this._editableLayerIds
|
|
568
|
+
};
|
|
569
|
+
await this.layerListLoaded(evt);
|
|
570
|
+
this.setSelectedLayer(this._validLayers[0].id, this._validLayers[0].title);
|
|
571
|
+
this._flowItems = ['feature-list'];
|
|
572
|
+
}
|
|
487
573
|
/**
|
|
488
574
|
* Updates the share url for current selected feature
|
|
489
575
|
* @protected
|
|
490
|
-
|
|
576
|
+
*/
|
|
491
577
|
_updateShareURL() {
|
|
492
578
|
var _a, _b;
|
|
493
579
|
const url = (_a = this._shareNode) === null || _a === void 0 ? void 0 : _a.shareUrl;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { c as createCommonjsModule, d as getDefaultExportFromCjs } from './_commonjsHelpers-0f74c230.js';
|
|
7
7
|
import { a as getAssetPath } from './index-164d485a.js';
|
|
8
8
|
import { l as loadModules } from './locale-bcbea4ef.js';
|
|
9
|
-
import { q as queryFeaturesByID } from './mapViewUtils-
|
|
9
|
+
import { q as queryFeaturesByID } from './mapViewUtils-253178f1.js';
|
|
10
10
|
import './solution-resource-77aa99c8.js';
|
|
11
11
|
import './index-a1e91462.js';
|
|
12
12
|
import { _ as __assign$1, r as request, c as cleanUrl, g as getJson } from './restHelpersGet-2a85d395.js';
|
|
@@ -1508,7 +1508,7 @@ function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++
|
|
|
1508
1508
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1509
1509
|
* ====================================================================
|
|
1510
1510
|
*/
|
|
1511
|
-
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-
|
|
1511
|
+
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-286e3cfa.js')).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}E.API.addSvgAsImage=function(t,r,n,i,o,s,c,u){if(isNaN(r)||isNaN(n))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var l=h.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,h.width,h.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return e().then((function(e){return e.fromString(l,t,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){d.addImage(h.toDataURL("image/jpeg",1),r,n,i,o,c,u);}))};}(),E.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},E.API.viewerPreferences=function(e,r){var n;e=e||{},r=r||!1;var i,a,o,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(s),u=[],h=0,l=0,f=0;function d(t,e){var r,n=!1;for(r=0;r<t.length;r+=1)t[r]===e&&(n=!0);return n}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===r){var p=c.length;for(f=0;f<p;f+=1)n[c[f]].value=n[c[f]].defaultValue,n[c[f]].explicitSet=!1;}if("object"===t(e))for(a in e)if(o=e[a],d(c,a)&&void 0!==o){if("boolean"===n[a].type&&"boolean"==typeof o)n[a].value=o;else if("name"===n[a].type&&d(n[a].valueSet,o))n[a].value=o;else if("integer"===n[a].type&&Number.isInteger(o))n[a].value=o;else if("array"===n[a].type){for(h=0;h<o.length;h+=1)if(i=!0,1===o[h].length&&"number"==typeof o[h][0])u.push(String(o[h]-1));else if(o[h].length>1){for(l=0;l<o[h].length;l+=1)"number"!=typeof o[h][l]&&(i=!1);!0===i&&u.push([o[h][0]-1,o[h][1]-1].join(" "));}n[a].value="["+u.join(" ")+"]";}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0;}return !1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
|
|
1512
1512
|
/** ====================================================================
|
|
1513
1513
|
* @license
|
|
1514
1514
|
* jsPDF XMP metadata plugin
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { a as commonjsGlobal, c as createCommonjsModule, d as getDefaultExportFromCjs } from './_commonjsHelpers-0f74c230.js';
|
|
7
|
-
import { _ as _typeof_1 } from './downloadUtils-
|
|
7
|
+
import { _ as _typeof_1 } from './downloadUtils-0c1e4d7b.js';
|
|
8
8
|
import './index-164d485a.js';
|
|
9
9
|
import './locale-bcbea4ef.js';
|
|
10
10
|
import './esri-loader-1b324844.js';
|
|
11
|
-
import './mapViewUtils-
|
|
11
|
+
import './mapViewUtils-253178f1.js';
|
|
12
12
|
import './interfaces-586e863c.js';
|
|
13
13
|
import './solution-resource-77aa99c8.js';
|
|
14
14
|
import './index-a1e91462.js';
|