@esri/solutions-components 0.6.36 → 0.6.38
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +16 -0
- package/dist/cjs/calcite-alert_3.cjs.entry.js +2 -13
- package/dist/cjs/calcite-combobox_6.cjs.entry.js +1 -1
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
- package/dist/cjs/card-manager_3.cjs.entry.js +4 -3
- package/dist/cjs/{downloadUtils-37d9aaf3.js → downloadUtils-d8e48fbd.js} +55 -12
- package/dist/cjs/{index.es-d1d9b140.js → index.es-6159eedc.js} +4 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +4 -3
- package/dist/cjs/{mapViewUtils-96172223.js → mapViewUtils-f7bbc35b.js} +5 -2
- package/dist/cjs/public-notification.cjs.entry.js +6 -5
- package/dist/cjs/{clean-url-d5326abb.js → restHelpersGet-c94617cf.js} +398 -0
- package/dist/cjs/solution-configuration.cjs.entry.js +565 -565
- package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
- package/dist/cjs/{solution-store-714601a2.js → solution-store-b40c2f46.js} +19 -383
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/basemap-gallery/basemap-gallery.js +8 -0
- package/dist/collection/components/edit-card/edit-card.js +1 -12
- package/dist/collection/components/map-legend/map-legend.js +9 -1
- package/dist/collection/components/public-notification/public-notification.js +7 -6
- package/dist/collection/utils/downloadUtils.js +50 -8
- package/dist/collection/utils/downloadUtils.ts +62 -9
- package/dist/collection/utils/queryUtils.js +5 -2
- package/dist/collection/utils/queryUtils.ts +4 -2
- package/dist/components/basemap-gallery2.js +8 -0
- package/dist/components/downloadUtils.js +51 -8
- package/dist/components/edit-card2.js +1 -12
- package/dist/components/map-legend2.js +8 -0
- package/dist/components/public-notification.js +3 -3
- package/dist/components/queryUtils.js +5 -2
- package/dist/components/{clean-url.js → restHelpersGet.js} +392 -1
- package/dist/components/solution-configuration.js +552 -552
- package/dist/components/solution-store.js +2 -365
- package/dist/esm/basemap-gallery_7.entry.js +16 -0
- package/dist/esm/calcite-alert_3.entry.js +2 -13
- package/dist/esm/calcite-combobox_6.entry.js +1 -1
- package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
- package/dist/esm/card-manager_3.entry.js +4 -3
- package/dist/esm/{downloadUtils-76379e4a.js → downloadUtils-d41ecba9.js} +53 -10
- package/dist/esm/{index.es-0d134a52.js → index.es-b226bf47.js} +4 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +4 -3
- package/dist/esm/{mapViewUtils-08f6cfce.js → mapViewUtils-1e2befd7.js} +5 -2
- package/dist/esm/public-notification.entry.js +6 -5
- package/dist/esm/{clean-url-bce022e6.js → restHelpersGet-a5ec2192.js} +392 -1
- package/dist/esm/solution-configuration.entry.js +552 -552
- package/dist/esm/solution-contents_3.entry.js +2 -2
- package/dist/esm/{solution-store-3ee6c7a3.js → solution-store-17bb0a75.js} +2 -365
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-9800e602.entry.js → p-091120c5.entry.js} +1 -1
- package/dist/solutions-components/p-1b14b687.entry.js +6 -0
- package/dist/solutions-components/p-20e627ed.entry.js +6 -0
- package/dist/solutions-components/{p-646e983f.entry.js → p-2d143359.entry.js} +1 -1
- package/dist/solutions-components/{p-ac7332b3.entry.js → p-40e95e2b.entry.js} +1 -1
- package/dist/solutions-components/p-420e1585.entry.js +36 -0
- package/dist/solutions-components/p-4807b2a1.js +36 -0
- package/dist/solutions-components/p-56a3b81e.entry.js +6 -0
- package/dist/solutions-components/p-5856dc4f.js +66 -0
- package/dist/solutions-components/p-89b4b401.js +145 -0
- package/dist/solutions-components/{p-0f50087e.entry.js → p-973625f8.entry.js} +2 -2
- package/dist/solutions-components/{p-03130804.js → p-9ecb5d66.js} +1 -1
- package/dist/solutions-components/{p-b02eb8f4.js → p-a8661f1f.js} +30 -30
- package/dist/solutions-components/p-fbc7fc26.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +62 -9
- package/dist/solutions-components/utils/queryUtils.ts +4 -2
- package/dist/types/components/basemap-gallery/basemap-gallery.d.ts +4 -0
- package/dist/types/components/map-legend/map-legend.d.ts +4 -0
- package/dist/types/components/public-notification/public-notification.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/solutions-components/p-13b21d19.entry.js +0 -36
- package/dist/solutions-components/p-15070568.js +0 -36
- package/dist/solutions-components/p-1682bd0f.entry.js +0 -6
- package/dist/solutions-components/p-7b61f856.entry.js +0 -6
- package/dist/solutions-components/p-81a0c88f.entry.js +0 -6
- package/dist/solutions-components/p-d0544f24.js +0 -192
- package/dist/solutions-components/p-eba875d9.entry.js +0 -6
- package/dist/solutions-components/p-ecc95259.js +0 -20
@@ -47,7 +47,7 @@ export class PublicNotification {
|
|
47
47
|
this.defaultBufferDistance = undefined;
|
48
48
|
this.defaultBufferUnit = undefined;
|
49
49
|
this.defaultExportTitle = "";
|
50
|
-
this.defaultNumLabelsPerPage =
|
50
|
+
this.defaultNumLabelsPerPage = 6;
|
51
51
|
this.featureEffect = undefined;
|
52
52
|
this.featureHighlightEnabled = undefined;
|
53
53
|
this.mapView = undefined;
|
@@ -517,7 +517,7 @@ export class PublicNotification {
|
|
517
517
|
const displayClass = this._exportType === EExportType.PDF ? "display-block" : "display-none";
|
518
518
|
const titleOptionsClass = this._addTitle ? "display-block" : "display-none";
|
519
519
|
const title = this._titleValue ? this._titleValue : this.defaultExportTitle ? this.defaultExportTitle : "";
|
520
|
-
return (h("div", { class: displayClass }, this._getLabel(this._translations.pdfOptions, true), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0" }, this._translations.selectPDFLabelOption)), h("div", { class: "padding-sides-1" }, h("pdf-download", { defaultNumLabelsPerPage: this.defaultNumLabelsPerPage, disabled: !this._downloadActive, ref: (el) => { this._downloadTools = el; } })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addTitle, onCalciteCheckboxChange: () => this._addTitle = !this._addTitle }), this._translations.addTitle)), h("div", { class: titleOptionsClass }, this._getLabel(this._translations.title, true, ""), h("calcite-input-text", { class: "padding-sides-1", onCalciteInputTextInput: () => this._changeTitle(), placeholder: this._translations.titlePlaceholder, ref: (el) => { this._titleElement = el; }, value: title })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addMap, onCalciteCheckboxChange: () => this._addMap = !this._addMap }), this._translations.includeMap))));
|
520
|
+
return (h("div", { class: displayClass }, this._getLabel(this._translations.pdfOptions, true), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0" }, this._translations.selectPDFLabelOption)), h("div", { class: "padding-sides-1" }, h("pdf-download", { defaultNumLabelsPerPage: parseInt(this.defaultNumLabelsPerPage.toString(), 10), disabled: !this._downloadActive, ref: (el) => { this._downloadTools = el; } })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addTitle, onCalciteCheckboxChange: () => this._addTitle = !this._addTitle }), this._translations.addTitle)), h("div", { class: titleOptionsClass }, this._getLabel(this._translations.title, true, ""), h("calcite-input-text", { class: "padding-sides-1", onCalciteInputTextInput: () => this._changeTitle(), placeholder: this._translations.titlePlaceholder, ref: (el) => { this._titleElement = el; }, value: title })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addMap, onCalciteCheckboxChange: () => this._addMap = !this._addMap }), this._translations.includeMap))));
|
521
521
|
}
|
522
522
|
/**
|
523
523
|
* Render the refine page
|
@@ -991,11 +991,11 @@ export class PublicNotification {
|
|
991
991
|
"defaultValue": "\"\""
|
992
992
|
},
|
993
993
|
"defaultNumLabelsPerPage": {
|
994
|
-
"type": "
|
994
|
+
"type": "number",
|
995
995
|
"mutable": false,
|
996
996
|
"complexType": {
|
997
|
-
"original": "
|
998
|
-
"resolved": "
|
997
|
+
"original": "number",
|
998
|
+
"resolved": "number",
|
999
999
|
"references": {}
|
1000
1000
|
},
|
1001
1001
|
"required": false,
|
@@ -1005,7 +1005,8 @@ export class PublicNotification {
|
|
1005
1005
|
"text": "number: The default number of labels per page to export"
|
1006
1006
|
},
|
1007
1007
|
"attribute": "default-num-labels-per-page",
|
1008
|
-
"reflect": false
|
1008
|
+
"reflect": false,
|
1009
|
+
"defaultValue": "6"
|
1009
1010
|
},
|
1010
1011
|
"featureEffect": {
|
1011
1012
|
"type": "unknown",
|
@@ -23,7 +23,7 @@ import { exportCSV } from "./csvUtils";
|
|
23
23
|
import { exportPDF } from "./pdfUtils";
|
24
24
|
import { loadModules } from "./loadModules";
|
25
25
|
import { queryFeaturesByID } from "./queryUtils";
|
26
|
-
|
26
|
+
import * as common from "@esri/solution-common";
|
27
27
|
export { ILabel } from "./pdfUtils";
|
28
28
|
const lineSeparatorChar = "|";
|
29
29
|
import { queryRelated } from "@esri/arcgis-rest-feature-layer";
|
@@ -427,13 +427,55 @@ export async function _getLabelFormat(webmap, layer, formatUsingLayerPopup) {
|
|
427
427
|
const labelFormatType = (_b = (_a = layer.popupTemplate) === null || _a === void 0 ? void 0 : _a.content[0]) === null || _b === void 0 ? void 0 : _b.type;
|
428
428
|
if (labelFormatType === "relationship") {
|
429
429
|
const relationshipId = layer.popupTemplate.content[0].relationshipId;
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
&&
|
434
|
-
&&
|
435
|
-
|
436
|
-
|
430
|
+
// Get related layer
|
431
|
+
let webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray());
|
432
|
+
webmapLayers = webmapLayers.filter((webmapLayer) => webmapLayer.type === "feature"
|
433
|
+
&& webmapLayer.id !== layer.id
|
434
|
+
&& webmapLayer.relationships
|
435
|
+
&& webmapLayer.relationships.some(relationship => relationship.id === relationshipId));
|
436
|
+
if (webmapLayers.length > 0) {
|
437
|
+
labelFormatProps = await _getLabelFormat(webmap, webmapLayers[0], formatUsingLayerPopup);
|
438
|
+
labelFormatProps.relationshipId = relationshipId;
|
439
|
+
}
|
440
|
+
else {
|
441
|
+
// Related layer info is not in webmap; get the label info from the related layer
|
442
|
+
webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray());
|
443
|
+
// Keep only feature layers and tables that have the type "feature" and whose layerId doesn't
|
444
|
+
// match the one we entered this function with and who have a URL that we can query
|
445
|
+
const relationshipCandidatePromises = [];
|
446
|
+
webmapLayers = webmapLayers.filter((webmapLayer) => {
|
447
|
+
if (webmapLayer.type === "feature" && webmapLayer.layerId != layer.layerId && webmapLayer.url) {
|
448
|
+
// Query the feature layer/table for properties missing from the webmap version
|
449
|
+
const webmapLayerUrl = webmapLayer.url + "/" + webmapLayer.layerId.toString();
|
450
|
+
relationshipCandidatePromises.push(common.getJson(webmapLayerUrl /*, authentication*/));
|
451
|
+
return true;
|
452
|
+
}
|
453
|
+
else {
|
454
|
+
return false;
|
455
|
+
}
|
456
|
+
});
|
457
|
+
// Of the queried feature layers/tables, find the one with the matching relationship id
|
458
|
+
const relationshipCandidates = await Promise.all(relationshipCandidatePromises);
|
459
|
+
let labelFormatPropsPromise;
|
460
|
+
if (!relationshipCandidates.some((candidateLayer, i) => {
|
461
|
+
if (candidateLayer.relationships
|
462
|
+
&& candidateLayer.relationships.some(relationship => relationship.id === relationshipId)) {
|
463
|
+
// Found the matching relationship; get the label format from it
|
464
|
+
labelFormatPropsPromise = _getLabelFormat(webmap, webmapLayers[i], formatUsingLayerPopup);
|
465
|
+
return true;
|
466
|
+
}
|
467
|
+
else {
|
468
|
+
return false;
|
469
|
+
}
|
470
|
+
})) {
|
471
|
+
// Fallback to all fields
|
472
|
+
labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
|
473
|
+
}
|
474
|
+
else {
|
475
|
+
labelFormatProps = await labelFormatPropsPromise;
|
476
|
+
labelFormatProps.relationshipId = relationshipId;
|
477
|
+
}
|
478
|
+
}
|
437
479
|
}
|
438
480
|
else if (labelFormatType === "fields") {
|
439
481
|
labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
|
@@ -21,7 +21,7 @@ import { ILabel, exportPDF } from "./pdfUtils";
|
|
21
21
|
import { loadModules } from "./loadModules";
|
22
22
|
import { queryFeaturesByID } from "./queryUtils";
|
23
23
|
import { IExportInfo, IExportInfos } from "../utils/interfaces";
|
24
|
-
|
24
|
+
import * as common from "@esri/solution-common";
|
25
25
|
|
26
26
|
export { ILabel } from "./pdfUtils";
|
27
27
|
|
@@ -584,15 +584,68 @@ export async function _getLabelFormat(
|
|
584
584
|
if (labelFormatType === "relationship") {
|
585
585
|
const relationshipId = layer.popupTemplate.content[0].relationshipId;
|
586
586
|
|
587
|
-
|
588
|
-
.
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
587
|
+
// Get related layer
|
588
|
+
let webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray()) as __esri.FeatureLayer[];
|
589
|
+
webmapLayers = webmapLayers.filter(
|
590
|
+
(webmapLayer: __esri.FeatureLayer) =>
|
591
|
+
webmapLayer.type === "feature"
|
592
|
+
&& webmapLayer.id !== layer.id
|
593
|
+
&& webmapLayer.relationships
|
594
|
+
&& webmapLayer.relationships.some(relationship => relationship.id === relationshipId)
|
595
|
+
);
|
593
596
|
|
594
|
-
|
595
|
-
|
597
|
+
if (webmapLayers.length > 0) {
|
598
|
+
labelFormatProps = await _getLabelFormat(webmap, webmapLayers[0], formatUsingLayerPopup);
|
599
|
+
labelFormatProps.relationshipId = relationshipId;
|
600
|
+
|
601
|
+
} else {
|
602
|
+
// Related layer info is not in webmap; get the label info from the related layer
|
603
|
+
webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray()) as __esri.FeatureLayer[];
|
604
|
+
|
605
|
+
// Keep only feature layers and tables that have the type "feature" and whose layerId doesn't
|
606
|
+
// match the one we entered this function with and who have a URL that we can query
|
607
|
+
const relationshipCandidatePromises: Promise<any>[] = [];
|
608
|
+
webmapLayers = webmapLayers.filter(
|
609
|
+
(webmapLayer: __esri.FeatureLayer) => {
|
610
|
+
if (webmapLayer.type === "feature" && webmapLayer.layerId != layer.layerId && webmapLayer.url) {
|
611
|
+
// Query the feature layer/table for properties missing from the webmap version
|
612
|
+
const webmapLayerUrl = webmapLayer.url + "/" + webmapLayer.layerId.toString();
|
613
|
+
relationshipCandidatePromises.push(
|
614
|
+
common.getJson(webmapLayerUrl/*, authentication*/)
|
615
|
+
);
|
616
|
+
return true;
|
617
|
+
} else {
|
618
|
+
return false;
|
619
|
+
}
|
620
|
+
}
|
621
|
+
)
|
622
|
+
|
623
|
+
// Of the queried feature layers/tables, find the one with the matching relationship id
|
624
|
+
const relationshipCandidates = await Promise.all(relationshipCandidatePromises);
|
625
|
+
let labelFormatPropsPromise: Promise<ILabelFormatProps>;
|
626
|
+
if (
|
627
|
+
!relationshipCandidates.some(
|
628
|
+
(candidateLayer: any, i: number) => {
|
629
|
+
if (
|
630
|
+
candidateLayer.relationships
|
631
|
+
&& candidateLayer.relationships.some(relationship => relationship.id === relationshipId)
|
632
|
+
) {
|
633
|
+
// Found the matching relationship; get the label format from it
|
634
|
+
labelFormatPropsPromise = _getLabelFormat(webmap, webmapLayers[i], formatUsingLayerPopup);
|
635
|
+
return true;
|
636
|
+
} else {
|
637
|
+
return false;
|
638
|
+
}
|
639
|
+
}
|
640
|
+
)
|
641
|
+
) {
|
642
|
+
// Fallback to all fields
|
643
|
+
labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
|
644
|
+
} else {
|
645
|
+
labelFormatProps = await labelFormatPropsPromise;
|
646
|
+
labelFormatProps.relationshipId = relationshipId;
|
647
|
+
}
|
648
|
+
}
|
596
649
|
|
597
650
|
} else if (labelFormatType === "fields") {
|
598
651
|
labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
|
@@ -103,13 +103,16 @@ export async function queryObjectIds(geometries, layer) {
|
|
103
103
|
* @returns Promise with the featureSet from the layer that match the provided ids
|
104
104
|
*/
|
105
105
|
export async function queryFeaturesByID(ids, layer, graphics, returnGeometry, outSpatialReference) {
|
106
|
-
|
106
|
+
var _a;
|
107
|
+
const num = (_a = layer.capabilities) === null || _a === void 0 ? void 0 : _a.query.maxRecordCount;
|
107
108
|
const start = 0;
|
108
109
|
const q = layer.createQuery();
|
109
110
|
q.start = start;
|
110
|
-
q.num = num;
|
111
111
|
q.returnGeometry = returnGeometry;
|
112
112
|
q.objectIds = ids.slice(start, num);
|
113
|
+
if (num) {
|
114
|
+
q.num = num;
|
115
|
+
}
|
113
116
|
if (outSpatialReference) {
|
114
117
|
q.outSpatialReference = outSpatialReference;
|
115
118
|
}
|
@@ -128,14 +128,16 @@ export async function queryFeaturesByID(
|
|
128
128
|
returnGeometry: boolean,
|
129
129
|
outSpatialReference?: __esri.SpatialReference
|
130
130
|
): Promise<__esri.Graphic[]> {
|
131
|
-
const num = layer.capabilities
|
131
|
+
const num = layer.capabilities?.query.maxRecordCount;
|
132
132
|
const start = 0;
|
133
133
|
|
134
134
|
const q = layer.createQuery();
|
135
135
|
q.start = start;
|
136
|
-
q.num = num;
|
137
136
|
q.returnGeometry = returnGeometry;
|
138
137
|
q.objectIds = ids.slice(start, num);
|
138
|
+
if (num) {
|
139
|
+
q.num = num;
|
140
|
+
}
|
139
141
|
if (outSpatialReference) {
|
140
142
|
q.outSpatialReference = outSpatialReference;
|
141
143
|
}
|
@@ -54,6 +54,14 @@ const BasemapGallery = /*@__PURE__*/ proxyCustomElement(class BasemapGallery ext
|
|
54
54
|
render() {
|
55
55
|
return (h(Host, null, h("div", { ref: (el) => { this._basemapElement = el; } })));
|
56
56
|
}
|
57
|
+
/**
|
58
|
+
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
59
|
+
*/
|
60
|
+
async componentDidLoad() {
|
61
|
+
if (this.mapView) {
|
62
|
+
await this.mapViewWatchHandler();
|
63
|
+
}
|
64
|
+
}
|
57
65
|
//--------------------------------------------------------------------------
|
58
66
|
//
|
59
67
|
// Functions (protected)
|
@@ -7,7 +7,8 @@ import { c as createCommonjsModule, g as getDefaultExportFromCjs } from './_comm
|
|
7
7
|
import { getAssetPath } from '@stencil/core/internal/client';
|
8
8
|
import { l as loadModules } from './loadModules.js';
|
9
9
|
import { q as queryFeaturesByID } from './queryUtils.js';
|
10
|
-
import
|
10
|
+
import './solution-resource.js';
|
11
|
+
import { _ as __assign$1, r as request, c as cleanUrl, g as getJson } from './restHelpersGet.js';
|
11
12
|
|
12
13
|
/** @license
|
13
14
|
* Copyright 2022 Esri
|
@@ -2742,13 +2743,55 @@ async function _getLabelFormat(webmap, layer, formatUsingLayerPopup) {
|
|
2742
2743
|
const labelFormatType = (_b = (_a = layer.popupTemplate) === null || _a === void 0 ? void 0 : _a.content[0]) === null || _b === void 0 ? void 0 : _b.type;
|
2743
2744
|
if (labelFormatType === "relationship") {
|
2744
2745
|
const relationshipId = layer.popupTemplate.content[0].relationshipId;
|
2745
|
-
|
2746
|
-
|
2747
|
-
|
2748
|
-
&&
|
2749
|
-
&&
|
2750
|
-
|
2751
|
-
|
2746
|
+
// Get related layer
|
2747
|
+
let webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray());
|
2748
|
+
webmapLayers = webmapLayers.filter((webmapLayer) => webmapLayer.type === "feature"
|
2749
|
+
&& webmapLayer.id !== layer.id
|
2750
|
+
&& webmapLayer.relationships
|
2751
|
+
&& webmapLayer.relationships.some(relationship => relationship.id === relationshipId));
|
2752
|
+
if (webmapLayers.length > 0) {
|
2753
|
+
labelFormatProps = await _getLabelFormat(webmap, webmapLayers[0], formatUsingLayerPopup);
|
2754
|
+
labelFormatProps.relationshipId = relationshipId;
|
2755
|
+
}
|
2756
|
+
else {
|
2757
|
+
// Related layer info is not in webmap; get the label info from the related layer
|
2758
|
+
webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray());
|
2759
|
+
// Keep only feature layers and tables that have the type "feature" and whose layerId doesn't
|
2760
|
+
// match the one we entered this function with and who have a URL that we can query
|
2761
|
+
const relationshipCandidatePromises = [];
|
2762
|
+
webmapLayers = webmapLayers.filter((webmapLayer) => {
|
2763
|
+
if (webmapLayer.type === "feature" && webmapLayer.layerId != layer.layerId && webmapLayer.url) {
|
2764
|
+
// Query the feature layer/table for properties missing from the webmap version
|
2765
|
+
const webmapLayerUrl = webmapLayer.url + "/" + webmapLayer.layerId.toString();
|
2766
|
+
relationshipCandidatePromises.push(getJson(webmapLayerUrl /*, authentication*/));
|
2767
|
+
return true;
|
2768
|
+
}
|
2769
|
+
else {
|
2770
|
+
return false;
|
2771
|
+
}
|
2772
|
+
});
|
2773
|
+
// Of the queried feature layers/tables, find the one with the matching relationship id
|
2774
|
+
const relationshipCandidates = await Promise.all(relationshipCandidatePromises);
|
2775
|
+
let labelFormatPropsPromise;
|
2776
|
+
if (!relationshipCandidates.some((candidateLayer, i) => {
|
2777
|
+
if (candidateLayer.relationships
|
2778
|
+
&& candidateLayer.relationships.some(relationship => relationship.id === relationshipId)) {
|
2779
|
+
// Found the matching relationship; get the label format from it
|
2780
|
+
labelFormatPropsPromise = _getLabelFormat(webmap, webmapLayers[i], formatUsingLayerPopup);
|
2781
|
+
return true;
|
2782
|
+
}
|
2783
|
+
else {
|
2784
|
+
return false;
|
2785
|
+
}
|
2786
|
+
})) {
|
2787
|
+
// Fallback to all fields
|
2788
|
+
labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
|
2789
|
+
}
|
2790
|
+
else {
|
2791
|
+
labelFormatProps = await labelFormatPropsPromise;
|
2792
|
+
labelFormatProps.relationshipId = relationshipId;
|
2793
|
+
}
|
2794
|
+
}
|
2752
2795
|
}
|
2753
2796
|
else if (labelFormatType === "fields") {
|
2754
2797
|
labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
|
@@ -137,11 +137,7 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
|
|
137
137
|
const container = document.createElement("div");
|
138
138
|
const layers = await getAllLayers(this.mapView);
|
139
139
|
const layerInfos = layers.map(layer => {
|
140
|
-
return {
|
141
|
-
layer,
|
142
|
-
geometryUpdatesEnabled: false,
|
143
|
-
addEnabled: false
|
144
|
-
};
|
140
|
+
return { layer };
|
145
141
|
});
|
146
142
|
this._editor = new this.Editor({
|
147
143
|
allowedWorkflows: "update",
|
@@ -157,7 +153,6 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
|
|
157
153
|
this._editHandle.remove();
|
158
154
|
this._attachmentHandle.remove();
|
159
155
|
this._activeWorkflowHandle.remove();
|
160
|
-
this._addRelatedRecordHandle.remove();
|
161
156
|
}
|
162
157
|
this._attachmentHandle = this.reactiveUtils.when(() => this._editor.viewModel.state === "adding-attachment" ||
|
163
158
|
this._editor.viewModel.state === "editing-attachment" ||
|
@@ -177,12 +172,6 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
|
|
177
172
|
this._shouldClose = false;
|
178
173
|
}
|
179
174
|
});
|
180
|
-
// Temp workaround until a new prop is added at 4.29
|
181
|
-
this._addRelatedRecordHandle = this.reactiveUtils.when(() => !!this._editor.viewModel.featureFormViewModel.relatedRecordCallbacks, () => {
|
182
|
-
this._editor.viewModel.featureFormViewModel.relatedRecordCallbacks.addRelatedRecord = null;
|
183
|
-
}, {
|
184
|
-
once: true
|
185
|
-
});
|
186
175
|
// had issues with destroy before adding like this
|
187
176
|
this._editContainer.appendChild(container);
|
188
177
|
}
|
@@ -53,6 +53,14 @@ const MapLegend = /*@__PURE__*/ proxyCustomElement(class MapLegend extends HTMLE
|
|
53
53
|
render() {
|
54
54
|
return (h(Host, null, h("div", { ref: (el) => { this._legendElement = el; } })));
|
55
55
|
}
|
56
|
+
/**
|
57
|
+
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
58
|
+
*/
|
59
|
+
async componentDidLoad() {
|
60
|
+
if (this.mapView) {
|
61
|
+
await this.mapViewWatchHandler();
|
62
|
+
}
|
63
|
+
}
|
56
64
|
//--------------------------------------------------------------------------
|
57
65
|
//
|
58
66
|
// Functions (protected)
|
@@ -80,7 +80,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class PublicNotifi
|
|
80
80
|
this.defaultBufferDistance = undefined;
|
81
81
|
this.defaultBufferUnit = undefined;
|
82
82
|
this.defaultExportTitle = "";
|
83
|
-
this.defaultNumLabelsPerPage =
|
83
|
+
this.defaultNumLabelsPerPage = 6;
|
84
84
|
this.featureEffect = undefined;
|
85
85
|
this.featureHighlightEnabled = undefined;
|
86
86
|
this.mapView = undefined;
|
@@ -550,7 +550,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class PublicNotifi
|
|
550
550
|
const displayClass = this._exportType === EExportType.PDF ? "display-block" : "display-none";
|
551
551
|
const titleOptionsClass = this._addTitle ? "display-block" : "display-none";
|
552
552
|
const title = this._titleValue ? this._titleValue : this.defaultExportTitle ? this.defaultExportTitle : "";
|
553
|
-
return (h("div", { class: displayClass }, this._getLabel(this._translations.pdfOptions, true), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0" }, this._translations.selectPDFLabelOption)), h("div", { class: "padding-sides-1" }, h("pdf-download", { defaultNumLabelsPerPage: this.defaultNumLabelsPerPage, disabled: !this._downloadActive, ref: (el) => { this._downloadTools = el; } })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addTitle, onCalciteCheckboxChange: () => this._addTitle = !this._addTitle }), this._translations.addTitle)), h("div", { class: titleOptionsClass }, this._getLabel(this._translations.title, true, ""), h("calcite-input-text", { class: "padding-sides-1", onCalciteInputTextInput: () => this._changeTitle(), placeholder: this._translations.titlePlaceholder, ref: (el) => { this._titleElement = el; }, value: title })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addMap, onCalciteCheckboxChange: () => this._addMap = !this._addMap }), this._translations.includeMap))));
|
553
|
+
return (h("div", { class: displayClass }, this._getLabel(this._translations.pdfOptions, true), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0" }, this._translations.selectPDFLabelOption)), h("div", { class: "padding-sides-1" }, h("pdf-download", { defaultNumLabelsPerPage: parseInt(this.defaultNumLabelsPerPage.toString(), 10), disabled: !this._downloadActive, ref: (el) => { this._downloadTools = el; } })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addTitle, onCalciteCheckboxChange: () => this._addTitle = !this._addTitle }), this._translations.addTitle)), h("div", { class: titleOptionsClass }, this._getLabel(this._translations.title, true, ""), h("calcite-input-text", { class: "padding-sides-1", onCalciteInputTextInput: () => this._changeTitle(), placeholder: this._translations.titlePlaceholder, ref: (el) => { this._titleElement = el; }, value: title })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addMap, onCalciteCheckboxChange: () => this._addMap = !this._addMap }), this._translations.includeMap))));
|
554
554
|
}
|
555
555
|
/**
|
556
556
|
* Render the refine page
|
@@ -901,7 +901,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class PublicNotifi
|
|
901
901
|
"defaultBufferDistance": [2, "default-buffer-distance"],
|
902
902
|
"defaultBufferUnit": [1, "default-buffer-unit"],
|
903
903
|
"defaultExportTitle": [1, "default-export-title"],
|
904
|
-
"defaultNumLabelsPerPage": [
|
904
|
+
"defaultNumLabelsPerPage": [2, "default-num-labels-per-page"],
|
905
905
|
"featureEffect": [16],
|
906
906
|
"featureHighlightEnabled": [4, "feature-highlight-enabled"],
|
907
907
|
"mapView": [16],
|
@@ -60,13 +60,16 @@ async function queryObjectIds(geometries, layer) {
|
|
60
60
|
* @returns Promise with the featureSet from the layer that match the provided ids
|
61
61
|
*/
|
62
62
|
async function queryFeaturesByID(ids, layer, graphics, returnGeometry, outSpatialReference) {
|
63
|
-
|
63
|
+
var _a;
|
64
|
+
const num = (_a = layer.capabilities) === null || _a === void 0 ? void 0 : _a.query.maxRecordCount;
|
64
65
|
const start = 0;
|
65
66
|
const q = layer.createQuery();
|
66
67
|
q.start = start;
|
67
|
-
q.num = num;
|
68
68
|
q.returnGeometry = returnGeometry;
|
69
69
|
q.objectIds = ids.slice(start, num);
|
70
|
+
if (num) {
|
71
|
+
q.num = num;
|
72
|
+
}
|
70
73
|
if (outSpatialReference) {
|
71
74
|
q.outSpatialReference = outSpatialReference;
|
72
75
|
}
|