@esri/solutions-components 0.7.30 → 0.7.32
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/t9n/crowdsource-reporter/resources.json +7 -5
- package/dist/assets/t9n/crowdsource-reporter/resources_en.json +7 -5
- 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/layer-list/resources.json +1 -1
- package/dist/assets/t9n/layer-list/resources_en.json +1 -1
- package/dist/cjs/{calcite-flow_4.cjs.entry.js → calcite-flow_5.cjs.entry.js} +286 -19
- package/dist/cjs/card-manager_3.cjs.entry.js +1 -1
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +248 -32
- package/dist/cjs/{downloadUtils-83c6d3c3.js → downloadUtils-10e0de31.js} +2 -2
- package/dist/cjs/{index.es-bd1a93b2.js → index.es-72dc7ab9.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/create-feature/create-feature.css +50 -0
- package/dist/collection/components/create-feature/create-feature.js +444 -0
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +10 -1
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +287 -33
- package/dist/collection/components/feature-list/feature-list.js +1 -0
- package/dist/collection/components/layer-list/layer-list.js +60 -16
- package/dist/collection/demos/create-feature.html +90 -0
- package/dist/collection/demos/crowdsource-reporter.html +26 -11
- package/dist/collection/utils/downloadUtils.js +1 -1
- package/dist/collection/utils/downloadUtils.ts +1 -1
- package/dist/components/create-feature.d.ts +11 -0
- package/dist/components/create-feature.js +11 -0
- package/dist/components/create-feature2.js +278 -0
- package/dist/components/crowdsource-reporter.js +324 -90
- package/dist/components/downloadUtils.js +1 -1
- package/dist/components/feature-list2.js +1 -0
- package/dist/components/layer-list2.js +38 -17
- package/dist/esm/{calcite-flow_4.entry.js → calcite-flow_5.entry.js} +286 -20
- package/dist/esm/card-manager_3.entry.js +1 -1
- package/dist/esm/crowdsource-reporter.entry.js +249 -33
- package/dist/esm/{downloadUtils-d070a467.js → downloadUtils-d297078f.js} +2 -2
- package/dist/esm/{index.es-d48535a2.js → index.es-3b4fa9d0.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +1 -1
- package/dist/esm/public-notification.entry.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/create-feature.html +90 -0
- package/dist/solutions-components/demos/crowdsource-reporter.html +26 -11
- package/dist/solutions-components/{p-f120ff40.entry.js → p-09ec8c8f.entry.js} +1 -1
- package/dist/solutions-components/{p-55b835a1.js → p-103c5318.js} +2 -2
- package/dist/solutions-components/{p-309cdea1.entry.js → p-57d49d15.entry.js} +1 -1
- package/dist/solutions-components/{p-b913a4fd.js → p-8ec25bf4.js} +1 -1
- package/dist/solutions-components/{p-f22ff57e.entry.js → p-921f21d5.entry.js} +1 -1
- package/dist/solutions-components/p-d5263cb9.entry.js +17 -0
- package/dist/solutions-components/p-ea17cefb.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +1 -1
- package/dist/types/components/create-feature/create-feature.d.ts +125 -0
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +146 -12
- package/dist/types/components/feature-list/feature-list.d.ts +1 -0
- package/dist/types/components/layer-list/layer-list.d.ts +6 -0
- package/dist/types/components.d.ts +102 -0
- package/dist/types/preact.d.ts +7 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-2f162664.entry.js +0 -6
- package/dist/solutions-components/p-94ee3ef7.entry.js +0 -17
@@ -6,15 +6,17 @@
|
|
6
6
|
"expand": "Expand",
|
7
7
|
"collapse": "Collapse",
|
8
8
|
"next": "Next",
|
9
|
+
"submit": "Submit",
|
9
10
|
"cancel": "Cancel",
|
10
11
|
"back": "Back",
|
11
12
|
"error": "Error",
|
12
13
|
"invalidConfigurationErrorMsg": "Invalid configuration",
|
13
|
-
"noLayerToDisplayErrorMsg": "Configured web map don't have any editable feature layer",
|
14
|
-
"chooseCategoryMsg": "Choose a category for
|
15
|
-
"featureErrorMsg": "Features not found",
|
16
|
-
"featureEditFormInfoMsg": "Please provide the details for
|
14
|
+
"noLayerToDisplayErrorMsg": "Configured web map don't have any editable feature layer.",
|
15
|
+
"chooseCategoryMsg": "Choose a category for your report.",
|
16
|
+
"featureErrorMsg": "Features not found.",
|
17
|
+
"featureEditFormInfoMsg": "Please provide the details for your report.",
|
17
18
|
"currentLocationMsg": "Use my current location",
|
19
|
+
"addLocationMsg": "Add the location for your report.",
|
18
20
|
"reportSubmit": "Report Submitted.",
|
19
|
-
"submitMsg": "Thank you! Your report was successfully submitted"
|
21
|
+
"submitMsg": "Thank you! Your report was successfully submitted."
|
20
22
|
}
|
@@ -6,15 +6,17 @@
|
|
6
6
|
"expand": "Expand",
|
7
7
|
"collapse": "Collapse",
|
8
8
|
"next": "Next",
|
9
|
+
"submit": "Submit",
|
9
10
|
"cancel": "Cancel",
|
10
11
|
"back": "Back",
|
11
12
|
"error": "Error",
|
12
13
|
"invalidConfigurationErrorMsg": "Invalid configuration",
|
13
|
-
"noLayerToDisplayErrorMsg": "Configured web map don't have any editable feature layer",
|
14
|
-
"chooseCategoryMsg": "Choose a category for
|
15
|
-
"featureErrorMsg": "Features not found",
|
16
|
-
"featureEditFormInfoMsg": "Please provide the details for
|
14
|
+
"noLayerToDisplayErrorMsg": "Configured web map don't have any editable feature layer.",
|
15
|
+
"chooseCategoryMsg": "Choose a category for your report.",
|
16
|
+
"featureErrorMsg": "Features not found.",
|
17
|
+
"featureEditFormInfoMsg": "Please provide the details for your report.",
|
17
18
|
"currentLocationMsg": "Use my current location",
|
19
|
+
"addLocationMsg": "Add the location for your report.",
|
18
20
|
"reportSubmit": "Report Submitted.",
|
19
|
-
"submitMsg": "Thank you! Your report was successfully submitted"
|
21
|
+
"submitMsg": "Thank you! Your report was successfully submitted."
|
20
22
|
}
|
@@ -15,16 +15,16 @@ const interactive = require('./interactive-8aff886e.js');
|
|
15
15
|
const locale = require('./locale-6a627639.js');
|
16
16
|
const t9n = require('./t9n-0556abcb.js');
|
17
17
|
const resources = require('./resources-8e3763a4.js');
|
18
|
-
const popupUtils = require('./popupUtils-7755782a.js');
|
19
|
-
const mapViewUtils = require('./mapViewUtils-8aa325de.js');
|
20
18
|
const locale$1 = require('./locale-a476e15d.js');
|
19
|
+
const mapViewUtils = require('./mapViewUtils-8aa325de.js');
|
20
|
+
const popupUtils = require('./popupUtils-7755782a.js');
|
21
21
|
require('./guid-1a466ca6.js');
|
22
22
|
require('./resources-6c60363a.js');
|
23
23
|
require('./browser-9a43b900.js');
|
24
24
|
require('./key-b8c05387.js');
|
25
|
-
require('./interfaces-7cd0a48a.js');
|
26
25
|
require('./esri-loader-a91c0ec1.js');
|
27
26
|
require('./_commonjsHelpers-384729db.js');
|
27
|
+
require('./interfaces-7cd0a48a.js');
|
28
28
|
|
29
29
|
/*!
|
30
30
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
@@ -339,6 +339,251 @@ const FlowItem = class {
|
|
339
339
|
};
|
340
340
|
FlowItem.style = flowItemCss;
|
341
341
|
|
342
|
+
const createFeatureCss = ":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__update-actions{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}";
|
343
|
+
|
344
|
+
const CreateFeature = class {
|
345
|
+
constructor(hostRef) {
|
346
|
+
index.registerInstance(this, hostRef);
|
347
|
+
this.success = index.createEvent(this, "success", 7);
|
348
|
+
this.fail = index.createEvent(this, "fail", 7);
|
349
|
+
this.drawComplete = index.createEvent(this, "drawComplete", 7);
|
350
|
+
this.editingAttachment = index.createEvent(this, "editingAttachment", 7);
|
351
|
+
this.mapView = undefined;
|
352
|
+
this.selectedLayerId = undefined;
|
353
|
+
this.customizeSubmit = false;
|
354
|
+
}
|
355
|
+
//--------------------------------------------------------------------------
|
356
|
+
//
|
357
|
+
// Watch handlers
|
358
|
+
//
|
359
|
+
//--------------------------------------------------------------------------
|
360
|
+
/**
|
361
|
+
* Called each time the mapView prop is changed.
|
362
|
+
*/
|
363
|
+
async mapViewWatchHandler() {
|
364
|
+
await this.mapView.when(async () => {
|
365
|
+
await this.init();
|
366
|
+
});
|
367
|
+
}
|
368
|
+
//--------------------------------------------------------------------------
|
369
|
+
//
|
370
|
+
// Methods (public)
|
371
|
+
//
|
372
|
+
//--------------------------------------------------------------------------
|
373
|
+
/**
|
374
|
+
* Destroy the Editor widget instance
|
375
|
+
* @returns Promise that resolves when the operation is complete
|
376
|
+
*/
|
377
|
+
async close() {
|
378
|
+
if (this._editor) {
|
379
|
+
this._editor.destroy();
|
380
|
+
}
|
381
|
+
}
|
382
|
+
/**
|
383
|
+
* Submit the created feature
|
384
|
+
* @returns Promise that resolves when the operation is complete
|
385
|
+
*/
|
386
|
+
async submit() {
|
387
|
+
if (this._editor) {
|
388
|
+
this._editor.viewModel.featureFormViewModel.submit();
|
389
|
+
}
|
390
|
+
}
|
391
|
+
//--------------------------------------------------------------------------
|
392
|
+
//
|
393
|
+
// Functions (lifecycle)
|
394
|
+
//
|
395
|
+
//--------------------------------------------------------------------------
|
396
|
+
/**
|
397
|
+
* StencilJS: Called once just after the component is first connected to the DOM.
|
398
|
+
* @returns Promise when complete
|
399
|
+
*/
|
400
|
+
async componentWillLoad() {
|
401
|
+
await this.initModules();
|
402
|
+
}
|
403
|
+
/**
|
404
|
+
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
405
|
+
*/
|
406
|
+
async componentDidLoad() {
|
407
|
+
await this.init();
|
408
|
+
}
|
409
|
+
/**
|
410
|
+
* Renders the component.
|
411
|
+
*/
|
412
|
+
render() {
|
413
|
+
return (index.h(index.Host, { id: "feature-form" }));
|
414
|
+
}
|
415
|
+
//--------------------------------------------------------------------------
|
416
|
+
//
|
417
|
+
// Functions (protected)
|
418
|
+
//
|
419
|
+
//--------------------------------------------------------------------------
|
420
|
+
/**
|
421
|
+
* Init Editor widget and starts the create workflow
|
422
|
+
*/
|
423
|
+
async init() {
|
424
|
+
if (this.mapView && this.selectedLayerId) {
|
425
|
+
await this.createEditorWidget();
|
426
|
+
}
|
427
|
+
}
|
428
|
+
/**
|
429
|
+
* Load esri javascript api modules
|
430
|
+
* @returns Promise resolving when function is done
|
431
|
+
* @protected
|
432
|
+
*/
|
433
|
+
async initModules() {
|
434
|
+
const [Editor, reactiveUtils] = await locale$1.loadModules([
|
435
|
+
"esri/widgets/Editor",
|
436
|
+
"esri/core/reactiveUtils"
|
437
|
+
]);
|
438
|
+
this.Editor = Editor;
|
439
|
+
this.reactiveUtils = reactiveUtils;
|
440
|
+
}
|
441
|
+
/**
|
442
|
+
* Display editor widget to create the new feature
|
443
|
+
* @protected
|
444
|
+
*/
|
445
|
+
async createEditorWidget() {
|
446
|
+
if (this._editor) {
|
447
|
+
this._editor.destroy();
|
448
|
+
}
|
449
|
+
const layerInfos = [];
|
450
|
+
const container = document.createElement("div");
|
451
|
+
const allMapLayers = await mapViewUtils.getAllLayers(this.mapView);
|
452
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
453
|
+
allMapLayers.forEach(async (eachLayer) => {
|
454
|
+
layerInfos.push({
|
455
|
+
layer: eachLayer,
|
456
|
+
enabled: (eachLayer === null || eachLayer === void 0 ? void 0 : eachLayer.type) === "feature" && (eachLayer === null || eachLayer === void 0 ? void 0 : eachLayer.id) === this.selectedLayerId,
|
457
|
+
addEnabled: true,
|
458
|
+
updateEnabled: false,
|
459
|
+
deleteEnabled: false // default is true, set to false to disable the ability to delete features
|
460
|
+
});
|
461
|
+
});
|
462
|
+
this._editor = new this.Editor({
|
463
|
+
allowedWorkflows: "create-features",
|
464
|
+
view: this.mapView,
|
465
|
+
layerInfos: layerInfos,
|
466
|
+
visibleElements: {
|
467
|
+
snappingControls: false
|
468
|
+
},
|
469
|
+
container
|
470
|
+
});
|
471
|
+
this.el.appendChild(container);
|
472
|
+
//Add handle to watch if attachments are added/edited
|
473
|
+
const attachmentHandle = this.reactiveUtils.watch(() => this._editor.viewModel.state, (state) => {
|
474
|
+
if (state === 'adding-attachment' || state === 'editing-attachment') {
|
475
|
+
this._addingAttachment = true;
|
476
|
+
this.editingAttachment.emit(true);
|
477
|
+
}
|
478
|
+
else {
|
479
|
+
if (this._addingAttachment) {
|
480
|
+
this.editingAttachment.emit(false);
|
481
|
+
this._addingAttachment = false;
|
482
|
+
}
|
483
|
+
}
|
484
|
+
});
|
485
|
+
this._editor.viewModel.addHandles(attachmentHandle);
|
486
|
+
//Add handle to watch featureTemplatesViewModel ready state and then start the creation
|
487
|
+
const handle = this.reactiveUtils.watch(() => this._editor.viewModel.featureTemplatesViewModel.state, (state) => {
|
488
|
+
if (state === 'ready') {
|
489
|
+
void this.startCreate();
|
490
|
+
}
|
491
|
+
});
|
492
|
+
this._editor.viewModel.addHandles(handle);
|
493
|
+
}
|
494
|
+
/**
|
495
|
+
* Start creating the feature
|
496
|
+
* @protected
|
497
|
+
*/
|
498
|
+
async startCreate() {
|
499
|
+
var _a;
|
500
|
+
if ((_a = this._editor.viewModel.featureTemplatesViewModel.items) === null || _a === void 0 ? void 0 : _a.length) {
|
501
|
+
const items = this._editor.viewModel.featureTemplatesViewModel.items[0].get("items");
|
502
|
+
//once the feature template is selected handle the event for formSubmit and sketch complete
|
503
|
+
//also, hide the headers and footer in the editor as we will be showing our own submit and cancel button
|
504
|
+
this._editor.viewModel.featureTemplatesViewModel.on('select', () => {
|
505
|
+
setTimeout(() => {
|
506
|
+
//on form submit
|
507
|
+
this._editor.viewModel.featureFormViewModel.on('submit', this.submitted.bind(this));
|
508
|
+
//on sketch complete emit the event
|
509
|
+
this._editor.viewModel.sketchViewModel.on("create", (evt) => {
|
510
|
+
if (evt.state === "complete") {
|
511
|
+
this.drawComplete.emit();
|
512
|
+
}
|
513
|
+
});
|
514
|
+
this.hideEditorsElements();
|
515
|
+
}, 700);
|
516
|
+
this.hideEditorsElements();
|
517
|
+
});
|
518
|
+
//if only one feature template then directly start geometry creation for that
|
519
|
+
//else allow feature template selection to user
|
520
|
+
if (items.length === 1) {
|
521
|
+
this._editor.viewModel.featureTemplatesViewModel.select(items[0]);
|
522
|
+
}
|
523
|
+
//hides the header and footer elements in editor widget
|
524
|
+
this.hideEditorsElements();
|
525
|
+
}
|
526
|
+
}
|
527
|
+
/**
|
528
|
+
* Hides the elements of editor widget
|
529
|
+
* @protected
|
530
|
+
*/
|
531
|
+
hideEditorsElements() {
|
532
|
+
if (!this.customizeSubmit) {
|
533
|
+
return;
|
534
|
+
}
|
535
|
+
setTimeout(() => {
|
536
|
+
var _a;
|
537
|
+
//hides the header and footer on the featureForm
|
538
|
+
(_a = this.el.querySelector('.esri-editor').querySelectorAll('calcite-flow-item')) === null || _a === void 0 ? void 0 : _a.forEach((flowItem) => {
|
539
|
+
var _a, _b, _c, _d, _e;
|
540
|
+
const article = (_c = (_b = (_a = flowItem.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('calcite-panel')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('article');
|
541
|
+
//hide the header
|
542
|
+
(_d = article === null || article === void 0 ? void 0 : article.querySelector('header')) === null || _d === void 0 ? void 0 : _d.setAttribute('style', 'display: none');
|
543
|
+
//hide the footer
|
544
|
+
(_e = article === null || article === void 0 ? void 0 : article.querySelector('footer')) === null || _e === void 0 ? void 0 : _e.setAttribute('style', 'display: none');
|
545
|
+
});
|
546
|
+
}, 700);
|
547
|
+
}
|
548
|
+
/**
|
549
|
+
* On creation of feature emit the event that the feature is created
|
550
|
+
* @param evt feature submit event
|
551
|
+
* @protected
|
552
|
+
*/
|
553
|
+
async submitted(evt) {
|
554
|
+
var _a;
|
555
|
+
//return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
|
556
|
+
if (evt.invalid.length) {
|
557
|
+
return;
|
558
|
+
}
|
559
|
+
//Submit only when valid attributes
|
560
|
+
//emit success or fail based on the result
|
561
|
+
if (evt.valid.length) {
|
562
|
+
try {
|
563
|
+
await this._editor.activeWorkflow.commit();
|
564
|
+
//throw errors if any failures
|
565
|
+
if ((_a = this._editor.viewModel.failures) === null || _a === void 0 ? void 0 : _a.length) {
|
566
|
+
this._editor.viewModel.failures.some((failure) => {
|
567
|
+
if (failure.error) {
|
568
|
+
throw (failure.error);
|
569
|
+
}
|
570
|
+
});
|
571
|
+
}
|
572
|
+
}
|
573
|
+
catch (e) {
|
574
|
+
this.fail.emit(e);
|
575
|
+
return;
|
576
|
+
}
|
577
|
+
this.success.emit();
|
578
|
+
}
|
579
|
+
}
|
580
|
+
get el() { return index.getElement(this); }
|
581
|
+
static get watchers() { return {
|
582
|
+
"mapView": ["mapViewWatchHandler"]
|
583
|
+
}; }
|
584
|
+
};
|
585
|
+
CreateFeature.style = createFeatureCss;
|
586
|
+
|
342
587
|
const featureListCss = ":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.popup-title{font-weight:500;padding:10px 12px}";
|
343
588
|
|
344
589
|
const FeatureList = class {
|
@@ -405,6 +650,7 @@ const FeatureList = class {
|
|
405
650
|
//--------------------------------------------------------------------------
|
406
651
|
/**
|
407
652
|
* Initialize the features list using the selected layer
|
653
|
+
* @protected
|
408
654
|
*/
|
409
655
|
async initializeFeatureItems() {
|
410
656
|
if (this._selectedLayer) {
|
@@ -538,6 +784,23 @@ const LayerList = class {
|
|
538
784
|
}
|
539
785
|
//--------------------------------------------------------------------------
|
540
786
|
//
|
787
|
+
// Watch handlers
|
788
|
+
//
|
789
|
+
//--------------------------------------------------------------------------
|
790
|
+
//--------------------------------------------------------------------------
|
791
|
+
//
|
792
|
+
// Methods (public)
|
793
|
+
//
|
794
|
+
//--------------------------------------------------------------------------
|
795
|
+
/**
|
796
|
+
* Refresh the layer list which will fetch the latest layer count and update the list
|
797
|
+
* @returns Promise that resolves when the operation is complete
|
798
|
+
*/
|
799
|
+
async refresh() {
|
800
|
+
await this.setLayers();
|
801
|
+
}
|
802
|
+
//--------------------------------------------------------------------------
|
803
|
+
//
|
541
804
|
// Functions (lifecycle)
|
542
805
|
//
|
543
806
|
//--------------------------------------------------------------------------
|
@@ -562,7 +825,7 @@ const LayerList = class {
|
|
562
825
|
render() {
|
563
826
|
return (index.h(index.Fragment, null, this._isLoading && index.h("calcite-loader", { scale: "m" }), !this._isLoading && this.mapView && this._noLayersToDisplay &&
|
564
827
|
index.h("calcite-notice", { class: "error-msg", icon: "layers-reference", kind: "danger", open: true }, index.h("div", { slot: "title" }, this._translations.error), index.h("div", { slot: "message" }, this.noLayerErrorMsg ? this.noLayerErrorMsg : this._translations.noLayerToDisplayErrorMsg)), !this._isLoading && this.mapView &&
|
565
|
-
index.h("calcite-list", { "selection-appearance": "border", "selection-mode": this.showNextIcon ? "none" : "single" }, this.renderLayerList())));
|
828
|
+
index.h("calcite-list", { "selection-appearance": "border", "selection-mode": this.showNextIcon ? "none" : "single-persist" }, this.renderLayerList())));
|
566
829
|
}
|
567
830
|
//--------------------------------------------------------------------------
|
568
831
|
//
|
@@ -589,21 +852,24 @@ const LayerList = class {
|
|
589
852
|
this._layerItemsHash = await mapViewUtils.getMapLayerHash(this.mapView, true);
|
590
853
|
const allMapLayers = await mapViewUtils.getAllLayers(this.mapView);
|
591
854
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
592
|
-
|
855
|
+
allMapLayers.forEach(async (eachLayer) => {
|
593
856
|
var _a, _b;
|
594
857
|
//TODO: checking editable condition could be configurable
|
595
|
-
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.
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
858
|
+
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)) {
|
859
|
+
this._layerItemsHash[eachLayer.id].supportsAdd = true;
|
860
|
+
if (this.showFeatureCount) {
|
861
|
+
const q = eachLayer.createQuery();
|
862
|
+
const result = eachLayer.queryFeatureCount(q);
|
863
|
+
def.push(result);
|
864
|
+
void result.then(async (resCount) => {
|
865
|
+
const formattedCount = !isNaN(resCount) ? await locale$1.formatNumber(resCount, {
|
866
|
+
places: 0,
|
867
|
+
api: 4,
|
868
|
+
type: "decimal"
|
869
|
+
}) : "";
|
870
|
+
this._layerItemsHash[eachLayer.id].formattedFeatureCount = formattedCount;
|
871
|
+
});
|
872
|
+
}
|
607
873
|
}
|
608
874
|
});
|
609
875
|
await Promise.all(def).then(() => {
|
@@ -631,9 +897,9 @@ const LayerList = class {
|
|
631
897
|
var _a;
|
632
898
|
const configuredLayers = ((_a = this.layers) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.layers : [];
|
633
899
|
return Object.keys(hash).reduce((prev, cur) => {
|
634
|
-
let showLayer = hash[cur].
|
900
|
+
let showLayer = hash[cur].supportsAdd;
|
635
901
|
if ((configuredLayers === null || configuredLayers === void 0 ? void 0 : configuredLayers.length) > 0) {
|
636
|
-
showLayer = configuredLayers.indexOf(cur) > -1 ? hash[cur].
|
902
|
+
showLayer = configuredLayers.indexOf(cur) > -1 ? hash[cur].supportsAdd : false;
|
637
903
|
}
|
638
904
|
if (showLayer) {
|
639
905
|
prev.push(cur);
|
@@ -687,5 +953,6 @@ LayerList.style = layerListCss;
|
|
687
953
|
|
688
954
|
exports.calcite_flow = Flow;
|
689
955
|
exports.calcite_flow_item = FlowItem;
|
956
|
+
exports.create_feature = CreateFeature;
|
690
957
|
exports.feature_list = FeatureList;
|
691
958
|
exports.layer_list = LayerList;
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
10
|
const index = require('./index-b8a649fc.js');
|
11
11
|
const locale = require('./locale-a476e15d.js');
|
12
12
|
const mapViewUtils = require('./mapViewUtils-8aa325de.js');
|
13
|
-
const downloadUtils = require('./downloadUtils-
|
13
|
+
const downloadUtils = require('./downloadUtils-10e0de31.js');
|
14
14
|
require('./esri-loader-a91c0ec1.js');
|
15
15
|
require('./_commonjsHelpers-384729db.js');
|
16
16
|
require('./interfaces-7cd0a48a.js');
|