@esri/solutions-components 0.7.4 → 0.7.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/map-tools/resources.json +2 -2
- package/dist/assets/t9n/map-tools/resources_en.json +2 -2
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +38 -20
- package/dist/cjs/calcite-alert_3.cjs.entry.js +17 -13
- package/dist/cjs/card-manager_3.cjs.entry.js +11 -9
- package/dist/cjs/crowdsource-manager.cjs.entry.js +33 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +107 -6
- package/dist/collection/components/edit-card/edit-card.js +30 -13
- package/dist/collection/components/info-card/info-card.js +12 -0
- package/dist/collection/components/layer-table/layer-table.css +7 -1
- package/dist/collection/components/layer-table/layer-table.js +43 -7
- package/dist/collection/components/map-card/map-card.js +1 -1
- package/dist/collection/components/map-fullscreen/map-fullscreen.js +33 -17
- package/dist/collection/components/map-tools/map-tools.js +22 -3
- package/dist/components/crowdsource-manager.js +39 -6
- package/dist/components/edit-card2.js +11 -13
- package/dist/components/info-card2.js +7 -1
- package/dist/components/layer-table2.js +12 -8
- package/dist/components/map-card2.js +1 -1
- package/dist/components/map-fullscreen2.js +17 -18
- package/dist/components/map-tools2.js +22 -3
- package/dist/esm/basemap-gallery_7.entry.js +38 -20
- package/dist/esm/calcite-alert_3.entry.js +17 -13
- package/dist/esm/card-manager_3.entry.js +11 -9
- package/dist/esm/crowdsource-manager.entry.js +33 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-3272b303.entry.js → p-14236e25.entry.js} +1 -1
- package/dist/solutions-components/p-3c3b48c7.entry.js +6 -0
- package/dist/solutions-components/p-4b3ebd24.entry.js +6 -0
- package/dist/solutions-components/p-7e9449c5.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +35 -2
- package/dist/types/components/edit-card/edit-card.d.ts +5 -0
- package/dist/types/components/info-card/info-card.d.ts +4 -0
- package/dist/types/components/layer-table/layer-table.d.ts +9 -1
- package/dist/types/components/map-fullscreen/map-fullscreen.d.ts +14 -1
- package/dist/types/components/map-tools/map-tools.d.ts +8 -0
- package/dist/types/components.d.ts +72 -0
- package/dist/types/preact.d.ts +5 -2
- package/package.json +1 -1
- package/dist/solutions-components/p-089dc6bf.entry.js +0 -6
- package/dist/solutions-components/p-dfb33c83.entry.js +0 -6
- package/dist/solutions-components/p-ed254530.entry.js +0 -6
@@ -4,7 +4,7 @@
|
|
4
4
|
"expand": "Expand",
|
5
5
|
"basemap": "Basemap",
|
6
6
|
"collapse": "Collapse",
|
7
|
-
"enterFullscreen": "Enter
|
8
|
-
"exitFullscreen": "Exit
|
7
|
+
"enterFullscreen": "Enter full screen",
|
8
|
+
"exitFullscreen": "Exit full screen",
|
9
9
|
"floorFilter": "Floor filter"
|
10
10
|
}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
"expand": "Expand",
|
5
5
|
"basemap": "Basemap",
|
6
6
|
"collapse": "Collapse",
|
7
|
-
"enterFullscreen": "Enter
|
8
|
-
"exitFullscreen": "Exit
|
7
|
+
"enterFullscreen": "Enter full screen",
|
8
|
+
"exitFullscreen": "Exit full screen",
|
9
9
|
"floorFilter": "Floor filter"
|
10
10
|
}
|
@@ -215,6 +215,7 @@ const mapFullscreenCss = ":host{display:block}";
|
|
215
215
|
const MapFullscreen = class {
|
216
216
|
constructor(hostRef) {
|
217
217
|
index.registerInstance(this, hostRef);
|
218
|
+
this.fullscreenStateChange = index.createEvent(this, "fullscreenStateChange", 7);
|
218
219
|
this.mapView = undefined;
|
219
220
|
this.fullscreenWidget = undefined;
|
220
221
|
}
|
@@ -229,22 +230,12 @@ const MapFullscreen = class {
|
|
229
230
|
* @returns Promise when complete
|
230
231
|
*/
|
231
232
|
async mapViewWatchHandler() {
|
232
|
-
await this.mapView.when(() => {
|
233
|
-
this._initFullscreenWidget();
|
233
|
+
await this.mapView.when(async () => {
|
234
|
+
await this._initFullscreenWidget();
|
234
235
|
});
|
235
236
|
}
|
236
237
|
//--------------------------------------------------------------------------
|
237
238
|
//
|
238
|
-
// Methods (public)
|
239
|
-
//
|
240
|
-
//--------------------------------------------------------------------------
|
241
|
-
//--------------------------------------------------------------------------
|
242
|
-
//
|
243
|
-
// Events (public)
|
244
|
-
//
|
245
|
-
//--------------------------------------------------------------------------
|
246
|
-
//--------------------------------------------------------------------------
|
247
|
-
//
|
248
239
|
// Functions (lifecycle)
|
249
240
|
//
|
250
241
|
//--------------------------------------------------------------------------
|
@@ -265,13 +256,13 @@ const MapFullscreen = class {
|
|
265
256
|
* It's never called during the first render().
|
266
257
|
*/
|
267
258
|
async componentDidUpdate() {
|
268
|
-
this._initFullscreenWidget();
|
259
|
+
await this._initFullscreenWidget();
|
269
260
|
}
|
270
261
|
/**
|
271
262
|
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
272
263
|
*/
|
273
264
|
async componentDidLoad() {
|
274
|
-
this._initFullscreenWidget();
|
265
|
+
await this._initFullscreenWidget();
|
275
266
|
}
|
276
267
|
//--------------------------------------------------------------------------
|
277
268
|
//
|
@@ -286,21 +277,29 @@ const MapFullscreen = class {
|
|
286
277
|
* @protected
|
287
278
|
*/
|
288
279
|
async _initModules() {
|
289
|
-
const [Fullscreen] = await loadModules.loadModules([
|
290
|
-
"esri/widgets/Fullscreen"
|
280
|
+
const [Fullscreen, reactiveUtils] = await loadModules.loadModules([
|
281
|
+
"esri/widgets/Fullscreen",
|
282
|
+
"esri/core/reactiveUtils"
|
291
283
|
]);
|
292
284
|
this.Fullscreen = Fullscreen;
|
285
|
+
this.reactiveUtils = reactiveUtils;
|
293
286
|
}
|
294
287
|
/**
|
295
288
|
* Initialize the search widget
|
296
289
|
*
|
297
290
|
* @protected
|
298
291
|
*/
|
299
|
-
_initFullscreenWidget() {
|
292
|
+
async _initFullscreenWidget() {
|
300
293
|
if (this.mapView && this._fullscreenElement && !this.fullscreenWidget) {
|
301
294
|
this.fullscreenWidget = new this.Fullscreen({
|
302
295
|
view: this.mapView
|
303
296
|
});
|
297
|
+
await this.fullscreenWidget.when(() => {
|
298
|
+
if (this._fullscreenStateChangeHandle) {
|
299
|
+
this._fullscreenStateChangeHandle.remove();
|
300
|
+
}
|
301
|
+
this._fullscreenStateChangeHandle = this.reactiveUtils.watch(() => this.fullscreenWidget.viewModel.state, (state) => this.fullscreenStateChange.emit(state));
|
302
|
+
});
|
304
303
|
}
|
305
304
|
else if (this.fullscreenWidget) {
|
306
305
|
this.fullscreenWidget.view = this.mapView;
|
@@ -813,10 +812,14 @@ const MapTools = class {
|
|
813
812
|
async _showFullscreenWatchHandler(v) {
|
814
813
|
const fs = this._fullscreenElement.fullscreenWidget;
|
815
814
|
if (v) {
|
816
|
-
fs.viewModel.
|
815
|
+
if (fs.viewModel.state === "ready") {
|
816
|
+
fs.viewModel.enter();
|
817
|
+
}
|
817
818
|
}
|
818
819
|
else {
|
819
|
-
fs.viewModel.
|
820
|
+
if (fs.viewModel.state === "active") {
|
821
|
+
fs.viewModel.exit();
|
822
|
+
}
|
820
823
|
}
|
821
824
|
}
|
822
825
|
/**
|
@@ -893,7 +896,22 @@ const MapTools = class {
|
|
893
896
|
this._getActionGroup("basemap", false, this._translations.basemap, () => this._toggleBasemapPicker()) :
|
894
897
|
undefined, this.enableFloorFilter && this._hasFloorInfo ?
|
895
898
|
this._getActionGroup("urban-model", false, this._translations.floorFilter, () => this._toggleFloorFilter()) :
|
896
|
-
undefined)), index.h("basemap-gallery", { basemapConfig: this.basemapConfig, class: basemapClass, mapView: this.mapView, ref: (el) => { this._basemapElement = el; } }), index.h("map-search", { class: searchClass, mapView: this.mapView, ref: (el) => { this._searchElement = el; }, resultGraphicEnabled: true, searchConfiguration: this.searchConfiguration }), index.h("map-legend", { class: legendClass, mapView: this.mapView, ref: (el) => { this._legendElement = el; } }), index.h("map-fullscreen", { class: fullscreenClass, mapView: this.mapView, ref: (el) => { this._fullscreenElement = el; } }), index.h("floor-filter", { class: floorFilterClass, enabled: this.enableFloorFilter, mapView: this.mapView, ref: (el) => { this._floorFilterElement = el; } })));
|
899
|
+
undefined)), index.h("basemap-gallery", { basemapConfig: this.basemapConfig, class: basemapClass, mapView: this.mapView, ref: (el) => { this._basemapElement = el; } }), index.h("map-search", { class: searchClass, mapView: this.mapView, ref: (el) => { this._searchElement = el; }, resultGraphicEnabled: true, searchConfiguration: this.searchConfiguration }), index.h("map-legend", { class: legendClass, mapView: this.mapView, ref: (el) => { this._legendElement = el; } }), index.h("map-fullscreen", { class: fullscreenClass, mapView: this.mapView, onFullscreenStateChange: (evt) => this._fullscreenStateChange(evt.detail), ref: (el) => { this._fullscreenElement = el; } }), index.h("floor-filter", { class: floorFilterClass, enabled: this.enableFloorFilter, mapView: this.mapView, ref: (el) => { this._floorFilterElement = el; } })));
|
900
|
+
}
|
901
|
+
/**
|
902
|
+
* Respond to fullscreen state change and ensure our state var is in sync
|
903
|
+
*
|
904
|
+
* @param state The fullscreen view model's state.
|
905
|
+
*
|
906
|
+
* @protected
|
907
|
+
*/
|
908
|
+
_fullscreenStateChange(state) {
|
909
|
+
if (state === "ready" && this._showFullscreen) {
|
910
|
+
this._showFullscreen = false;
|
911
|
+
}
|
912
|
+
else if (state === "active" && !this._showFullscreen) {
|
913
|
+
this._showFullscreen = true;
|
914
|
+
}
|
897
915
|
}
|
898
916
|
//--------------------------------------------------------------------------
|
899
917
|
//
|
@@ -318,6 +318,7 @@ const EditCard = class {
|
|
318
318
|
index.registerInstance(this, hostRef);
|
319
319
|
this.closeEdit = index.createEvent(this, "closeEdit", 7);
|
320
320
|
this.editsComplete = index.createEvent(this, "editsComplete", 7);
|
321
|
+
this.refreshGraphics = index.createEvent(this, "refreshGraphics", 7);
|
321
322
|
/**
|
322
323
|
* boolean: When true the Editor widget should be closed
|
323
324
|
*/
|
@@ -388,7 +389,7 @@ const EditCard = class {
|
|
388
389
|
}
|
389
390
|
this._layerEditHandle = this._layer.on("edits", () => {
|
390
391
|
this.editsComplete.emit();
|
391
|
-
|
392
|
+
this.open = false;
|
392
393
|
});
|
393
394
|
}
|
394
395
|
}
|
@@ -451,8 +452,7 @@ const EditCard = class {
|
|
451
452
|
},
|
452
453
|
container
|
453
454
|
});
|
454
|
-
if (this.
|
455
|
-
this._editHandle.remove();
|
455
|
+
if (this._attachmentHandle && this._activeWorkflowHandle) {
|
456
456
|
this._attachmentHandle.remove();
|
457
457
|
this._activeWorkflowHandle.remove();
|
458
458
|
}
|
@@ -461,18 +461,13 @@ const EditCard = class {
|
|
461
461
|
this._editor.viewModel.state === "creating-features", () => {
|
462
462
|
this._shouldClose = false;
|
463
463
|
});
|
464
|
-
this._editHandle = this.reactiveUtils.when(() => this._editor.viewModel.state === "ready", () => {
|
465
|
-
if (this._shouldClose) {
|
466
|
-
void this._closeEdit();
|
467
|
-
}
|
468
|
-
else if (this.graphicIndex > -1 && this.graphics.length > 0 && this.open && !this._shouldClose) {
|
469
|
-
void this._startUpdate();
|
470
|
-
}
|
471
|
-
});
|
472
464
|
this._activeWorkflowHandle = this.reactiveUtils.watch(() => { var _a; return (_a = this._editor.viewModel.activeWorkflow) === null || _a === void 0 ? void 0 : _a.activeWorkflow; }, (activeWorkflow) => {
|
473
465
|
if ((activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) === "update-table-record" || (activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) === "create-features") {
|
474
466
|
this._shouldClose = false;
|
475
467
|
}
|
468
|
+
if (!(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) && !(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.hasPendingEdits)) {
|
469
|
+
this.open = false;
|
470
|
+
}
|
476
471
|
});
|
477
472
|
// had issues with destroy before adding like this
|
478
473
|
this._editContainer.appendChild(container);
|
@@ -484,12 +479,15 @@ const EditCard = class {
|
|
484
479
|
* @returns void
|
485
480
|
*/
|
486
481
|
async _closeEdit() {
|
487
|
-
var _a, _b, _c;
|
482
|
+
var _a, _b, _c, _d;
|
488
483
|
this._shouldClose = true;
|
489
484
|
if ((_a = this._editor) === null || _a === void 0 ? void 0 : _a.activeWorkflow) {
|
490
485
|
await ((_b = this._editor) === null || _b === void 0 ? void 0 : _b.cancelWorkflow());
|
491
486
|
}
|
492
|
-
(_c = this.
|
487
|
+
if (this.graphicIndex > -1 && ((_c = this.graphics) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
488
|
+
this.refreshGraphics.emit(this.graphics);
|
489
|
+
}
|
490
|
+
(_d = this._editor) === null || _d === void 0 ? void 0 : _d.destroy();
|
493
491
|
this._shouldClose = false;
|
494
492
|
this.closeEdit.emit();
|
495
493
|
}
|
@@ -587,6 +585,12 @@ const InfoCard = class {
|
|
587
585
|
async closeEdit() {
|
588
586
|
this._editRecordOpen = false;
|
589
587
|
}
|
588
|
+
/**
|
589
|
+
* Refresh the info-card graphics
|
590
|
+
*/
|
591
|
+
async refreshGraphics(evt) {
|
592
|
+
this.graphics = [...evt.detail];
|
593
|
+
}
|
590
594
|
//--------------------------------------------------------------------------
|
591
595
|
//
|
592
596
|
// Functions (lifecycle)
|
@@ -106,7 +106,7 @@ const CardManager = class {
|
|
106
106
|
};
|
107
107
|
CardManager.style = cardManagerCss;
|
108
108
|
|
109
|
-
const layerTableCss = ":host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.border-end{border-inline-end:1px solid var(--calcite-ui-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir=\"rtl\"] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-ui-background)}.text-color{color:var(--calcite-ui-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-ui-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{padding:var(--lumo-space-xs) var(--lumo-space-m) !important;font-size:14px !important}.share-action{position:absolute;right:0;margin-top:
|
109
|
+
const layerTableCss = ":host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.border-end{border-inline-end:1px solid var(--calcite-ui-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir=\"rtl\"] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-ui-background)}.text-color{color:var(--calcite-ui-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-ui-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{padding:var(--lumo-space-xs) var(--lumo-space-m) !important;font-size:14px !important}.share-action{position:absolute;right:0;margin-top:4px;margin-inline-end:4px;margin-bottom:4px}html[dir=\"rtl\"] .share-action{left:0}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled);pointer-events:none}.instant-app-share{height:42px !important;display:inline-flex}";
|
110
110
|
|
111
111
|
const LayerTable = class {
|
112
112
|
constructor(hostRef) {
|
@@ -152,6 +152,8 @@ const LayerTable = class {
|
|
152
152
|
this.mapInfo = undefined;
|
153
153
|
this.mapView = undefined;
|
154
154
|
this.onlyShowUpdatableLayers = undefined;
|
155
|
+
this.shareIncludeEmbed = undefined;
|
156
|
+
this.shareIncludeSocial = undefined;
|
155
157
|
this.showNewestFirst = undefined;
|
156
158
|
this.zoomAndScrollToSelected = undefined;
|
157
159
|
this._confirmDelete = false;
|
@@ -699,7 +701,7 @@ const LayerTable = class {
|
|
699
701
|
* @returns VNode The node representing the DOM element that will contain the action
|
700
702
|
*/
|
701
703
|
_getShare(icon) {
|
702
|
-
return (index.h("div", { class: "share-action", id: this._getId(icon) }, index.h("instant-apps-social-share", { autoUpdateShareUrl: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, scale: "m", shareButtonColor: "neutral", socialMedia:
|
704
|
+
return (index.h("div", { class: "share-action", id: this._getId(icon) }, index.h("instant-apps-social-share", { autoUpdateShareUrl: false, class: "instant-app-share", embed: this.shareIncludeEmbed, popoverButtonIconScale: "s", ref: el => this._shareNode = el, scale: "m", shareButtonColor: "neutral", socialMedia: this.shareIncludeSocial, view: this.mapView }), this._getToolTip("bottom", icon, this._translations.share)));
|
703
705
|
}
|
704
706
|
/**
|
705
707
|
* Called each time the values that are used for custom url params change
|
@@ -818,11 +820,11 @@ const LayerTable = class {
|
|
818
820
|
* @returns void
|
819
821
|
*/
|
820
822
|
async _resetTable() {
|
821
|
-
var _a
|
823
|
+
var _a;
|
822
824
|
this._clearSelection();
|
823
825
|
this._allIds = [];
|
824
826
|
this.featureSelectionChange.emit(this._selectedIndexes);
|
825
|
-
const columnTemplates = this._getColumnTemplates(this._layer.id, (
|
827
|
+
const columnTemplates = this._getColumnTemplates(this._layer.id, (_a = this._layer) === null || _a === void 0 ? void 0 : _a.fields);
|
826
828
|
this._allIds = await mapViewUtils.queryAllIds(this._layer);
|
827
829
|
if (!this._table) {
|
828
830
|
await this._getTable(this._tableNode, columnTemplates);
|
@@ -1153,8 +1155,8 @@ const LayerTable = class {
|
|
1153
1155
|
if (fieldInfos) {
|
1154
1156
|
columnTemplates = columnTemplates ? columnTemplates.map(columnTemplate => {
|
1155
1157
|
fieldInfos.some(fieldInfo => {
|
1156
|
-
if (fieldInfo.
|
1157
|
-
columnTemplate.label = fieldInfo.
|
1158
|
+
if (fieldInfo.name === columnTemplate.fieldName) {
|
1159
|
+
columnTemplate.label = fieldInfo.alias;
|
1158
1160
|
return true;
|
1159
1161
|
}
|
1160
1162
|
});
|
@@ -1162,8 +1164,8 @@ const LayerTable = class {
|
|
1162
1164
|
}) : fieldInfos.map(fieldInfo => {
|
1163
1165
|
return {
|
1164
1166
|
type: "field",
|
1165
|
-
fieldName: fieldInfo.
|
1166
|
-
label: fieldInfo.
|
1167
|
+
fieldName: fieldInfo.name,
|
1168
|
+
label: fieldInfo.alias
|
1167
1169
|
};
|
1168
1170
|
});
|
1169
1171
|
}
|
@@ -1306,7 +1308,7 @@ const MapCard = class {
|
|
1306
1308
|
this.mapView = new this.MapView({
|
1307
1309
|
container: this._mapDiv,
|
1308
1310
|
map: webMap,
|
1309
|
-
resizeAlign: "
|
1311
|
+
resizeAlign: "center"
|
1310
1312
|
});
|
1311
1313
|
this._loadedId = id;
|
1312
1314
|
this._searchConfiguration = this._webMapInfo.searchConfiguration;
|
@@ -24,8 +24,10 @@ const CrowdsourceManager = class {
|
|
24
24
|
*/
|
25
25
|
this._shouldSetMapView = false;
|
26
26
|
this.classicGrid = false;
|
27
|
+
this.defaultCenter = "";
|
27
28
|
this.defaultGlobalId = "";
|
28
29
|
this.defaultLayer = "";
|
30
|
+
this.defaultLevel = "";
|
29
31
|
this.defaultOid = "";
|
30
32
|
this.defaultWebmap = "";
|
31
33
|
this.enableAutoRefresh = false;
|
@@ -46,6 +48,8 @@ const CrowdsourceManager = class {
|
|
46
48
|
this.mapInfos = [];
|
47
49
|
this.onlyShowUpdatableLayers = true;
|
48
50
|
this.searchConfiguration = undefined;
|
51
|
+
this.shareIncludeEmbed = undefined;
|
52
|
+
this.shareIncludeSocial = undefined;
|
49
53
|
this.theme = "light";
|
50
54
|
this.zoomAndScrollToSelected = false;
|
51
55
|
this._expandPopup = false;
|
@@ -59,6 +63,13 @@ const CrowdsourceManager = class {
|
|
59
63
|
// Watch handlers
|
60
64
|
//
|
61
65
|
//--------------------------------------------------------------------------
|
66
|
+
/**
|
67
|
+
* Watch for center url param to be set
|
68
|
+
*/
|
69
|
+
defaultCenterWatchHandler() {
|
70
|
+
this._defaultCenter = !this.defaultCenter ? undefined :
|
71
|
+
this.defaultCenter.split(";").map(v => parseFloat(v));
|
72
|
+
}
|
62
73
|
/**
|
63
74
|
* Watch for globalid url param to be set
|
64
75
|
*/
|
@@ -73,6 +84,12 @@ const CrowdsourceManager = class {
|
|
73
84
|
this._defaultOid = !this.defaultOid ? undefined :
|
74
85
|
this.defaultOid.indexOf(",") > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
|
75
86
|
}
|
87
|
+
/**
|
88
|
+
* Watch for zoom level param to be set
|
89
|
+
*/
|
90
|
+
defaultLevelWatchHandler() {
|
91
|
+
this._defaultLevel = !this.defaultLevel ? undefined : parseInt(this.defaultLevel, 10);
|
92
|
+
}
|
76
93
|
/**
|
77
94
|
* When true the map zoom tools will be available
|
78
95
|
*/
|
@@ -100,8 +117,8 @@ const CrowdsourceManager = class {
|
|
100
117
|
*/
|
101
118
|
async mapChanged(evt) {
|
102
119
|
this._mapChange = evt.detail;
|
103
|
-
await this._mapChange.mapView.when(() => {
|
104
|
-
this._setMapView();
|
120
|
+
await this._mapChange.mapView.when(async () => {
|
121
|
+
await this._setMapView();
|
105
122
|
});
|
106
123
|
}
|
107
124
|
/**
|
@@ -136,10 +153,10 @@ const CrowdsourceManager = class {
|
|
136
153
|
* Called after each render
|
137
154
|
* Used to delay the setting of the mapView when the popup is expaneded and obstructs the view
|
138
155
|
*/
|
139
|
-
componentDidRender() {
|
156
|
+
async componentDidRender() {
|
140
157
|
if (this._shouldSetMapView) {
|
141
158
|
this._shouldSetMapView = false;
|
142
|
-
this._setMapView();
|
159
|
+
await this._setMapView();
|
143
160
|
}
|
144
161
|
}
|
145
162
|
//--------------------------------------------------------------------------
|
@@ -328,7 +345,7 @@ const CrowdsourceManager = class {
|
|
328
345
|
this.classicGrid && layoutMode === interfaces.ELayoutMode.VERTICAL ? "panel-end" :
|
329
346
|
layoutMode === interfaces.ELayoutMode.HORIZONTAL ? "header" : "panel-start";
|
330
347
|
const hasMapAndLayer = this.defaultWebmap && this.defaultLayer;
|
331
|
-
return (index.h("calcite-shell", { class: tableSizeClass + " border-bottom" }, index.h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, index.h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), index.h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, index.h("span", null, tooltip))), index.h("div", { class: "width-full height-full position-relative" }, index.h("layer-table", { defaultGlobalId: hasMapAndLayer ? this._defaultGlobalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !this.defaultGlobalId ? this._defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, enableZoom: this.enableZoom, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
|
348
|
+
return (index.h("calcite-shell", { class: tableSizeClass + " border-bottom" }, index.h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, index.h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), index.h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, index.h("span", null, tooltip))), index.h("div", { class: "width-full height-full position-relative" }, index.h("layer-table", { defaultGlobalId: hasMapAndLayer ? this._defaultGlobalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !this.defaultGlobalId ? this._defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, enableZoom: this.enableZoom, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
|
332
349
|
}
|
333
350
|
/**
|
334
351
|
* Open/Close the appropriate panel.
|
@@ -361,11 +378,19 @@ const CrowdsourceManager = class {
|
|
361
378
|
*
|
362
379
|
* @protected
|
363
380
|
*/
|
364
|
-
_setMapView() {
|
381
|
+
async _setMapView() {
|
365
382
|
this._mapInfo = this._getMapInfo(this._mapChange.id);
|
366
383
|
this._mapView = this._mapChange.mapView;
|
367
384
|
this._initMapZoom();
|
368
385
|
this._mapView.popupEnabled = false;
|
386
|
+
if (this._defaultCenter && this._defaultLevel) {
|
387
|
+
await this._mapView.goTo({
|
388
|
+
center: this._defaultCenter,
|
389
|
+
zoom: this._defaultLevel
|
390
|
+
});
|
391
|
+
this._defaultCenter = undefined;
|
392
|
+
this._defaultLevel = undefined;
|
393
|
+
}
|
369
394
|
}
|
370
395
|
/**
|
371
396
|
* Add/remove zoom tools based on enableZoom prop
|
@@ -396,8 +421,10 @@ const CrowdsourceManager = class {
|
|
396
421
|
}
|
397
422
|
get el() { return index.getElement(this); }
|
398
423
|
static get watchers() { return {
|
424
|
+
"defaultCenter": ["defaultCenterWatchHandler"],
|
399
425
|
"defaultGlobalId": ["defaultGlobalIdWatchHandler"],
|
400
426
|
"defaultOid": ["defaultOidWatchHandler"],
|
427
|
+
"defaultLevel": ["defaultLevelWatchHandler"],
|
401
428
|
"enableZoom": ["enableZoomWatchHandler"]
|
402
429
|
}; }
|
403
430
|
};
|