@esri/solutions-components 0.8.4 → 0.8.6
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/card-manager_3.cjs.entry.js +41 -2
- package/dist/cjs/crowdsource-manager.cjs.entry.js +2 -1
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +120 -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 +19 -1
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +5 -0
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +120 -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-card/map-card.js +27 -2
- 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 +7 -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 +3 -1
- package/dist/components/crowdsource-reporter.js +121 -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-card2.js +42 -2
- 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 +43 -4
- package/dist/esm/crowdsource-manager.entry.js +3 -2
- package/dist/esm/crowdsource-reporter.entry.js +121 -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-273d833b.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-45ed16d5.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/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +7 -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 +4 -0
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +31 -10
- 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/map-card/map-card.d.ts +8 -0
- package/dist/types/components/public-notification/public-notification.d.ts +48 -0
- package/dist/types/components.d.ts +37 -0
- package/dist/types/utils/interfaces.d.ts +6 -0
- package/dist/types/utils/publicNotificationStore.d.ts +2 -1
- package/package.json +2 -1
- package/dist/solutions-components/p-6512dc44.entry.js +0 -6
- package/dist/solutions-components/p-65ad1625.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-efe1694a.entry.js +0 -17
- package/dist/solutions-components/p-f3467807.entry.js +0 -6
|
@@ -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) {
|
|
@@ -44,7 +44,7 @@ const CrowdsourceReporter = class {
|
|
|
44
44
|
this.theme = "light";
|
|
45
45
|
this.enableZoom = true;
|
|
46
46
|
this._mapInfo = undefined;
|
|
47
|
-
this._flowItems = [
|
|
47
|
+
this._flowItems = [];
|
|
48
48
|
this._sidePanelCollapsed = false;
|
|
49
49
|
this._translations = undefined;
|
|
50
50
|
this._hasValidLayers = false;
|
|
@@ -83,16 +83,20 @@ const CrowdsourceReporter = class {
|
|
|
83
83
|
* @returns Promise when complete
|
|
84
84
|
*/
|
|
85
85
|
async componentWillLoad() {
|
|
86
|
+
var _a;
|
|
86
87
|
this._urlParamsLoaded = false;
|
|
87
88
|
await this._initModules();
|
|
88
89
|
await this._getTranslations();
|
|
90
|
+
await ((_a = this.mapView) === null || _a === void 0 ? void 0 : _a.when(async () => {
|
|
91
|
+
await this.setMapView();
|
|
92
|
+
}));
|
|
89
93
|
}
|
|
90
94
|
/**
|
|
91
95
|
* Renders the component.
|
|
92
96
|
*/
|
|
93
97
|
render() {
|
|
94
98
|
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: "
|
|
99
|
+
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
100
|
}
|
|
97
101
|
//--------------------------------------------------------------------------
|
|
98
102
|
//
|
|
@@ -162,8 +166,9 @@ const CrowdsourceReporter = class {
|
|
|
162
166
|
* @protected
|
|
163
167
|
*/
|
|
164
168
|
getLayerListFlowItem() {
|
|
169
|
+
var _a;
|
|
165
170
|
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 }))));
|
|
171
|
+
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
172
|
}
|
|
168
173
|
/**
|
|
169
174
|
* Get the layer list for creating a report
|
|
@@ -171,7 +176,7 @@ const CrowdsourceReporter = class {
|
|
|
171
176
|
* @protected
|
|
172
177
|
*/
|
|
173
178
|
getChooseCategoryFlowItem() {
|
|
174
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.
|
|
179
|
+
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
180
|
}
|
|
176
181
|
/**
|
|
177
182
|
* Get Feature create form of the selected feature layer
|
|
@@ -179,7 +184,7 @@ const CrowdsourceReporter = class {
|
|
|
179
184
|
* @protected
|
|
180
185
|
*/
|
|
181
186
|
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 }))));
|
|
187
|
+
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
188
|
}
|
|
184
189
|
/**
|
|
185
190
|
* When drawing of incident location completed on map show the submit and cancel button
|
|
@@ -229,13 +234,13 @@ const CrowdsourceReporter = class {
|
|
|
229
234
|
*/
|
|
230
235
|
onReportSubmitted() {
|
|
231
236
|
this._reportSubmitted = true;
|
|
232
|
-
this.navigateToHomePage();
|
|
237
|
+
void this.navigateToHomePage();
|
|
233
238
|
}
|
|
234
239
|
/**
|
|
235
240
|
* Navigates to layer-list
|
|
236
241
|
* @protected
|
|
237
242
|
*/
|
|
238
|
-
navigateToHomePage() {
|
|
243
|
+
async navigateToHomePage() {
|
|
239
244
|
if (this._createFeature) {
|
|
240
245
|
this._createFeature.close();
|
|
241
246
|
}
|
|
@@ -243,21 +248,23 @@ const CrowdsourceReporter = class {
|
|
|
243
248
|
this._layerList.refresh();
|
|
244
249
|
}
|
|
245
250
|
this.setSelectedFeatures([]);
|
|
246
|
-
this.
|
|
251
|
+
if (this._editableLayerIds.length === 1) {
|
|
252
|
+
await this._featureList.refresh();
|
|
253
|
+
this._flowItems = ["feature-list"];
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
this._flowItems = ["layer-list"];
|
|
257
|
+
}
|
|
247
258
|
}
|
|
248
259
|
/**
|
|
249
|
-
*
|
|
260
|
+
* On layer select open the feature create flow item
|
|
250
261
|
* @param evt Event which has details of selected layerId and layerName
|
|
251
262
|
* @protected
|
|
252
263
|
*/
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
* On next button click open the feature create flow item
|
|
258
|
-
* @protected
|
|
259
|
-
*/
|
|
260
|
-
async navigateToCreateFeature() {
|
|
264
|
+
async navigateToCreateFeature(evt) {
|
|
265
|
+
if (evt.detail.layerId && evt.detail.layerName) {
|
|
266
|
+
this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
|
267
|
+
}
|
|
261
268
|
this._showSubmitCancelButton = false;
|
|
262
269
|
this._flowItems = [...this._flowItems, "feature-create"];
|
|
263
270
|
}
|
|
@@ -310,8 +317,8 @@ const CrowdsourceReporter = class {
|
|
|
310
317
|
updatedFlowItems.pop();
|
|
311
318
|
this.clearHighlights();
|
|
312
319
|
//Back to layer list, and return as the flowItems will be reset in navigateToHomePage
|
|
313
|
-
if (updatedFlowItems.length === 1) {
|
|
314
|
-
this.navigateToHomePage();
|
|
320
|
+
if (updatedFlowItems.length === 1 && updatedFlowItems[0] === 'layer-list') {
|
|
321
|
+
void this.navigateToHomePage();
|
|
315
322
|
return;
|
|
316
323
|
}
|
|
317
324
|
this._flowItems = [...updatedFlowItems];
|
|
@@ -341,7 +348,7 @@ const CrowdsourceReporter = class {
|
|
|
341
348
|
*/
|
|
342
349
|
getFeatureListFlowItem(layerId, layerName) {
|
|
343
350
|
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 }))));
|
|
351
|
+
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
352
|
}
|
|
346
353
|
/**
|
|
347
354
|
* Returns the calcite-flow item for feature details
|
|
@@ -369,7 +376,9 @@ const CrowdsourceReporter = class {
|
|
|
369
376
|
this._currentFeatureId = selectedFeature.attributes[layer.objectIdField];
|
|
370
377
|
}
|
|
371
378
|
else {
|
|
372
|
-
this.
|
|
379
|
+
if (this._editableLayerIds.length > 1) {
|
|
380
|
+
this.setSelectedLayer('', '');
|
|
381
|
+
}
|
|
373
382
|
this._currentFeatureId = '';
|
|
374
383
|
}
|
|
375
384
|
this._updateShareURL();
|
|
@@ -392,6 +401,8 @@ const CrowdsourceReporter = class {
|
|
|
392
401
|
// highlight the newly selected feature only when it has valid geometry
|
|
393
402
|
if (selectedFeature && selectedFeature.geometry && selectedFeature.layer) {
|
|
394
403
|
const selectedLayerView = await getFeatureLayerView(this.mapView, selectedFeature.layer.id);
|
|
404
|
+
// remove previous highlight options (if any) to highlight the feature by default color
|
|
405
|
+
selectedLayerView.highlightOptions = null;
|
|
395
406
|
this._highlightHandle = await highlightFeatures([selectedFeature.getObjectId()], selectedLayerView, this.mapView, true);
|
|
396
407
|
}
|
|
397
408
|
}
|
|
@@ -417,6 +428,15 @@ const CrowdsourceReporter = class {
|
|
|
417
428
|
* @protected
|
|
418
429
|
*/
|
|
419
430
|
async setMapView() {
|
|
431
|
+
var _a;
|
|
432
|
+
await this.getLayersToShowInList();
|
|
433
|
+
// if only one valid layer is present then directly render features list
|
|
434
|
+
if (((_a = this._editableLayerIds) === null || _a === void 0 ? void 0 : _a.length) === 1) {
|
|
435
|
+
await this.renderFeaturesList();
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
this._flowItems = ['layer-list'];
|
|
439
|
+
}
|
|
420
440
|
this.mapView.popupEnabled = false;
|
|
421
441
|
if (this._defaultCenter && this._defaultLevel) {
|
|
422
442
|
await this.mapView.goTo({
|
|
@@ -440,7 +460,7 @@ const CrowdsourceReporter = class {
|
|
|
440
460
|
this._mapClickHandle = this.reactiveUtils.on(() => this.mapView, "click", this.onMapClick.bind(this));
|
|
441
461
|
}
|
|
442
462
|
/**
|
|
443
|
-
* On map click do hitTest and get the clicked graphics
|
|
463
|
+
* On map click do hitTest and get the clicked graphics from both reporting and non-reporting layers, and show feature details
|
|
444
464
|
* @param event IMapClick map click event details
|
|
445
465
|
*
|
|
446
466
|
* @protected
|
|
@@ -448,12 +468,8 @@ const CrowdsourceReporter = class {
|
|
|
448
468
|
async onMapClick(event) {
|
|
449
469
|
//disable map popup
|
|
450
470
|
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
471
|
// Perform a hitTest on the View
|
|
456
|
-
const hitTest = await this.mapView.hitTest(event
|
|
472
|
+
const hitTest = await this.mapView.hitTest(event);
|
|
457
473
|
if (hitTest.results.length > 0) {
|
|
458
474
|
const clickedGraphics = [];
|
|
459
475
|
hitTest.results.forEach(function (result) {
|
|
@@ -462,16 +478,35 @@ const CrowdsourceReporter = class {
|
|
|
462
478
|
clickedGraphics.push(result.graphic);
|
|
463
479
|
}
|
|
464
480
|
});
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
this.
|
|
481
|
+
const reportingLayerGraphics = clickedGraphics.filter((graphic) => {
|
|
482
|
+
return this._validLayers.includes(graphic.layer);
|
|
483
|
+
});
|
|
484
|
+
const nonReportingLayerGraphics = clickedGraphics.filter((graphic) => {
|
|
485
|
+
var _a;
|
|
486
|
+
return !this._validLayers.includes(graphic.layer) && ((_a = graphic === null || graphic === void 0 ? void 0 : graphic.layer) === null || _a === void 0 ? void 0 : _a.id);
|
|
487
|
+
});
|
|
488
|
+
// if clicked graphic's layer is one of the reporting layers then show details in layer panel
|
|
489
|
+
if (reportingLayerGraphics.length > 0) {
|
|
490
|
+
//update the selectedFeature
|
|
491
|
+
this.setSelectedFeatures(reportingLayerGraphics);
|
|
492
|
+
//if featureDetails not open then add it to the list else just reInit flowItems which will update details with newly selected features
|
|
493
|
+
// eslint-disable-next-line unicorn/prefer-ternary
|
|
494
|
+
if (this._flowItems.length && this._flowItems[this._flowItems.length - 1] !== "feature-details") {
|
|
495
|
+
this._flowItems = [...this._flowItems, "feature-details"];
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
this._flowItems = [...this._flowItems];
|
|
499
|
+
void this.highlightOnMap(clickedGraphics[0]);
|
|
500
|
+
}
|
|
471
501
|
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
502
|
+
// if clicked graphic's layer is from non reporting layers then show popup on map
|
|
503
|
+
if (nonReportingLayerGraphics.length > 0) {
|
|
504
|
+
this.mapView.popupEnabled = true;
|
|
505
|
+
const options = {
|
|
506
|
+
features: nonReportingLayerGraphics,
|
|
507
|
+
updateLocationEnabled: true
|
|
508
|
+
};
|
|
509
|
+
await this.mapView.openPopup(options);
|
|
475
510
|
}
|
|
476
511
|
}
|
|
477
512
|
}
|
|
@@ -484,10 +519,57 @@ const CrowdsourceReporter = class {
|
|
|
484
519
|
const messages = await getLocaleComponentStrings(this.el);
|
|
485
520
|
this._translations = messages[0];
|
|
486
521
|
}
|
|
522
|
+
/**
|
|
523
|
+
* Returns the ids of all OR configured layers that support edits with the update capability
|
|
524
|
+
* @param hash each layer item details
|
|
525
|
+
* @param layers list of layers id
|
|
526
|
+
* @returns array of editable layer ids
|
|
527
|
+
*/
|
|
528
|
+
reduceToConfiguredLayers(hash) {
|
|
529
|
+
var _a;
|
|
530
|
+
const configuredLayers = ((_a = this.layers) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.layers : [];
|
|
531
|
+
return Object.keys(hash).reduce((prev, cur) => {
|
|
532
|
+
let showLayer = hash[cur].supportsAdd;
|
|
533
|
+
if ((configuredLayers === null || configuredLayers === void 0 ? void 0 : configuredLayers.length) > 0) {
|
|
534
|
+
showLayer = configuredLayers.indexOf(cur) > -1 ? hash[cur].supportsAdd : false;
|
|
535
|
+
}
|
|
536
|
+
if (showLayer) {
|
|
537
|
+
prev.push(cur);
|
|
538
|
+
}
|
|
539
|
+
return prev;
|
|
540
|
+
}, []);
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* Creates the list of layers to be listed in layer list
|
|
544
|
+
* @protected
|
|
545
|
+
*/
|
|
546
|
+
async getLayersToShowInList() {
|
|
547
|
+
const layerItemsHash = await getMapLayerHash(this.mapView, true);
|
|
548
|
+
const allMapLayers = await getAllLayers(this.mapView);
|
|
549
|
+
allMapLayers.forEach((eachLayer) => {
|
|
550
|
+
var _a, _b;
|
|
551
|
+
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)) {
|
|
552
|
+
layerItemsHash[eachLayer.id].supportsAdd = true;
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
this._editableLayerIds = this.reduceToConfiguredLayers(layerItemsHash);
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* renders feature list
|
|
559
|
+
* @protected
|
|
560
|
+
*/
|
|
561
|
+
async renderFeaturesList() {
|
|
562
|
+
const evt = {
|
|
563
|
+
detail: this._editableLayerIds
|
|
564
|
+
};
|
|
565
|
+
await this.layerListLoaded(evt);
|
|
566
|
+
this.setSelectedLayer(this._validLayers[0].id, this._validLayers[0].title);
|
|
567
|
+
this._flowItems = ['feature-list'];
|
|
568
|
+
}
|
|
487
569
|
/**
|
|
488
570
|
* Updates the share url for current selected feature
|
|
489
571
|
* @protected
|
|
490
|
-
|
|
572
|
+
*/
|
|
491
573
|
_updateShareURL() {
|
|
492
574
|
var _a, _b;
|
|
493
575
|
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';
|