@vcmap/ui 6.1.0-rc.7 → 6.1.1

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.
Files changed (106) hide show
  1. package/build/bundle.js +3 -3
  2. package/config/base.config.json +7 -3
  3. package/config/cluster.config.json +1 -1
  4. package/config/dev.config.json +172 -56
  5. package/config/projects.config.json +2 -1
  6. package/config/vectorTile.config.json +42 -1
  7. package/dist/assets/cesium.js +1 -1
  8. package/dist/assets/{core-52c2ef11.js → core-5ae90f6d.js} +7515 -5451
  9. package/dist/assets/core.js +1 -1
  10. package/dist/assets/ol.js +1 -1
  11. package/dist/assets/{ui-dccb9009.css → ui-e659989f.css} +1 -1
  12. package/dist/assets/{ui-dccb9009.js → ui-e659989f.js} +21736 -20926
  13. package/dist/assets/ui.js +1 -1
  14. package/dist/assets/vue.js +1 -1
  15. package/dist/assets/{vuetify-43a20e18.css → vuetify-cc6a8213.css} +2 -2
  16. package/dist/assets/{vuetify-43a20e18.js → vuetify-cc6a8213.js} +6694 -6593
  17. package/dist/assets/vuetify.js +1 -1
  18. package/index.d.ts +14 -6
  19. package/index.js +14 -5
  20. package/package.json +18 -9
  21. package/plugins/@vcmap-show-case/vector-properties-example/src/LayerSettings.vue +39 -0
  22. package/plugins/@vcmap-show-case/vector-properties-example/src/VectorPropertiesExample.vue +3 -0
  23. package/plugins/@vcmap-show-case/vector-properties-example/src/lib.js +13 -0
  24. package/plugins/@vcmap-show-case/window-tester/src/WindowExample.vue +9 -0
  25. package/plugins/package.json +9 -5
  26. package/src/actions/actionHelper.d.ts +6 -0
  27. package/src/actions/actionHelper.js +30 -2
  28. package/src/actions/deepPickingAction.d.ts +23 -0
  29. package/src/actions/deepPickingAction.js +404 -0
  30. package/src/actions/extentActions.js +20 -6
  31. package/src/actions/flightActions.js +5 -1
  32. package/src/application/VcsApp.vue +33 -21
  33. package/src/application/VcsApp.vue.d.ts +4 -0
  34. package/src/application/VcsAttributionsFooter.vue +1 -0
  35. package/src/application/VcsContainer.vue +1 -0
  36. package/src/application/VcsContainer.vue.d.ts +4 -0
  37. package/src/application/VcsMobileMenuList.vue +34 -41
  38. package/src/application/VcsNavbar.vue +3 -0
  39. package/src/application/VcsNavbarMobile.vue +6 -18
  40. package/src/application/VcsNavbarMobile.vue.d.ts +0 -1
  41. package/src/application/VcsPositionDisplay.vue +1 -0
  42. package/src/callback/activateLayersCallback.js +9 -1
  43. package/src/callback/addModuleCallback.js +2 -1
  44. package/src/components/buttons/VcsActionButtonList.vue +1 -0
  45. package/src/components/form-inputs-controls/VcsSelect.vue +8 -6
  46. package/src/components/icons/+all.d.ts +5 -0
  47. package/src/components/icons/+all.js +14 -0
  48. package/src/components/lists/VcsActionList.vue +1 -0
  49. package/src/components/lists/VcsGroupedList.vue +2 -1
  50. package/src/components/lists/VcsListItemComponent.vue +1 -0
  51. package/src/components/lists/VcsTreeNode.vue +5 -1
  52. package/src/components/lists/VcsTreeview.vue +14 -2
  53. package/src/components/style/{MenuWrapper.vue → StyleMenuWrapper.vue} +2 -1
  54. package/src/components/style/VcsFillMenu.vue +4 -4
  55. package/src/components/style/VcsImageMenu.vue +4 -4
  56. package/src/components/style/VcsStrokeMenu.vue +4 -4
  57. package/src/components/style/VcsTextMenu.vue +4 -4
  58. package/src/contentTree/LayerTree.vue +8 -46
  59. package/src/contentTree/LayerTree.vue.d.ts +1 -3
  60. package/src/contentTree/contentTreeCollection.d.ts +7 -0
  61. package/src/contentTree/contentTreeCollection.js +30 -10
  62. package/src/contentTree/contentTreeItem.d.ts +4 -4
  63. package/src/contentTree/contentTreeItem.js +2 -2
  64. package/src/contentTree/groupContentTreeItem.d.ts +5 -0
  65. package/src/contentTree/groupContentTreeItem.js +1 -1
  66. package/src/contentTree/layerContentTreeItem.js +1 -1
  67. package/src/contentTree/layerGroupContentTreeItem.js +11 -1
  68. package/src/contentTree/nodeContentTreeItem.d.ts +21 -0
  69. package/src/contentTree/nodeContentTreeItem.js +31 -2
  70. package/src/contentTree/wmsChildContentTreeItem.d.ts +56 -0
  71. package/src/contentTree/wmsChildContentTreeItem.js +159 -0
  72. package/src/contentTree/wmsGroupContentTreeItem.d.ts +171 -0
  73. package/src/contentTree/wmsGroupContentTreeItem.js +620 -0
  74. package/src/featureInfo/ClusterFeatureComponent.vue +47 -11
  75. package/src/featureInfo/ClusterFeatureComponent.vue.d.ts +1 -0
  76. package/src/featureInfo/balloonFeatureInfoView.d.ts +3 -0
  77. package/src/featureInfo/balloonFeatureInfoView.js +78 -11
  78. package/src/featureInfo/balloonHelper.js +8 -12
  79. package/src/featureInfo/featureInfo.d.ts +32 -7
  80. package/src/featureInfo/featureInfo.js +193 -91
  81. package/src/i18n/de.d.ts +22 -16
  82. package/src/i18n/de.js +4 -0
  83. package/src/i18n/en.d.ts +22 -16
  84. package/src/i18n/en.js +4 -0
  85. package/src/legend/legendHelper.d.ts +15 -0
  86. package/src/legend/legendHelper.js +28 -3
  87. package/src/manager/toolbox/GroupToolboxComponent.vue +1 -0
  88. package/src/manager/toolbox/SelectToolboxComponent.vue +2 -0
  89. package/src/manager/toolbox/ToolboxManagerComponent.vue +1 -0
  90. package/src/manager/window/windowManager.d.ts +2 -2
  91. package/src/manager/window/windowManager.js +17 -16
  92. package/src/navigation/MapNavigation.vue +3 -1
  93. package/src/navigation/overviewMap.js +1 -1
  94. package/src/notifier/NotifierComponent.vue +1 -0
  95. package/src/search/ResultsComponent.vue +10 -1
  96. package/src/search/SearchComponent.vue +11 -6
  97. package/src/search/search.js +3 -16
  98. package/src/state.d.ts +2 -1
  99. package/src/state.js +2 -1
  100. package/src/uiConfig.d.ts +9 -0
  101. package/src/uiConfig.js +1 -0
  102. package/src/vcsUiApp.js +7 -1
  103. /package/dist/assets/{cesium-6c6aa853.js → cesium-be8a1422.js} +0 -0
  104. /package/dist/assets/{ol-b0589b0c.js → ol-d5f8aba6.js} +0 -0
  105. /package/dist/assets/{vue-f7a0b088.js → vue-3435e55b.js} +0 -0
  106. /package/src/components/style/{MenuWrapper.vue.d.ts → StyleMenuWrapper.vue.d.ts} +0 -0
@@ -99,6 +99,10 @@ class ContentTreeCollection extends IndexedCollection {
99
99
  child.name,
100
100
  child.weightChanged.addEventListener(recreateTree),
101
101
  );
102
+ if (child.initOpen) {
103
+ const subTreeId = this._getSubtreeIdForItem(child);
104
+ this.getTreeOpenState(subTreeId).push(child.name);
105
+ }
102
106
  }),
103
107
  this.removed.addEventListener((child) => {
104
108
  recreateTree();
@@ -287,25 +291,42 @@ class ContentTreeCollection extends IndexedCollection {
287
291
  return tree.name;
288
292
  }),
289
293
  );
294
+
290
295
  subTrees.forEach((subTree) => {
291
- if (!this._app.navbarManager.has(subTree.name) || resetSubtreeButtons) {
296
+ if (!this._subTreeViewItems.value.has(subTree.name)) {
292
297
  this._subTreeViewItems.value.set(subTree.name, subTree);
293
- if (!this._app.uiConfig.config.hideContentTree) {
298
+ }
299
+
300
+ if (!this._app.uiConfig.config.hideContentTree) {
301
+ if (!this._app.navbarManager.has(subTree.name) || resetSubtreeButtons) {
294
302
  this._subTreeListeners.get(subTree.name)?.();
295
303
  this._subTreeListeners.set(
296
304
  subTree.name,
297
305
  this._createSubtreeActionButton(subTree),
298
306
  );
299
- }
300
- } else {
301
- const buttonComponent = this._app.navbarManager.get(subTree.name);
302
- if (buttonComponent.weight !== subTree[subTreeItemWeight]) {
303
- buttonComponent.weight = subTree[subTreeItemWeight];
307
+ } else {
308
+ const buttonComponent = this._app.navbarManager.get(subTree.name);
309
+ if (buttonComponent.weight !== subTree[subTreeItemWeight]) {
310
+ buttonComponent.weight = subTree[subTreeItemWeight];
311
+ }
304
312
  }
305
313
  }
306
314
  });
307
315
  }
308
316
 
317
+ /**
318
+ * @param {ContentTreeItem} item
319
+ * @returns {string}
320
+ * @private
321
+ */
322
+ _getSubtreeIdForItem(item) {
323
+ const [parent] = item.name.split('.');
324
+ if (this._subTreeViewItems.value.has(parent)) {
325
+ return parent;
326
+ }
327
+ return defaultContentTreeComponentId;
328
+ }
329
+
309
330
  /**
310
331
  * Returns all managed subtrees. Entries are not persisted and will change, if the trees get recalculated.
311
332
  * @type {import("vue").Ref<Map<string, import("./contentTreeItem.js").TreeViewItem>>}
@@ -376,6 +397,7 @@ class ContentTreeCollection extends IndexedCollection {
376
397
  }
377
398
 
378
399
  /**
400
+ * This returns a proxy to the subtrees open state. You should mutate this array in place.
379
401
  * @param {string} id
380
402
  * @returns {Array<string>}
381
403
  */
@@ -383,9 +405,7 @@ class ContentTreeCollection extends IndexedCollection {
383
405
  const subTree = this._getSubTree(id);
384
406
  if (subTree) {
385
407
  if (!subTree[subTreeOpenStateSymbol]) {
386
- subTree[subTreeOpenStateSymbol] = this.getChildrenForSubTree(id)
387
- .filter((i) => i.initOpen)
388
- .map((i) => i.name);
408
+ subTree[subTreeOpenStateSymbol] = [];
389
409
  }
390
410
  return subTree[subTreeOpenStateSymbol];
391
411
  }
@@ -99,14 +99,14 @@ declare class ContentTreeItem {
99
99
  static get className(): string;
100
100
  /**
101
101
  * @param {ContentTreeItemOptions} options
102
- * @param {import("@src/vcsUiApp.js").default} app
102
+ * @param {import("../vcsUiApp.js").default} app
103
103
  */
104
- constructor(options: ContentTreeItemOptions, app: import("@src/vcsUiApp.js").default);
104
+ constructor(options: ContentTreeItemOptions, app: import("../vcsUiApp.js").default);
105
105
  /**
106
106
  * @protected
107
- * @type {import("@src/vcsUiApp.js").default}
107
+ * @type {import("../vcsUiApp.js").default}
108
108
  */
109
- protected _app: import("@src/vcsUiApp.js").default;
109
+ protected _app: import("../vcsUiApp.js").default;
110
110
  /**
111
111
  * @type {import("vue").ShallowRef<Array<import("../actions/actionHelper.js").VcsAction>>}
112
112
  * @private
@@ -65,12 +65,12 @@ class ContentTreeItem {
65
65
 
66
66
  /**
67
67
  * @param {ContentTreeItemOptions} options
68
- * @param {import("@src/vcsUiApp.js").default} app
68
+ * @param {import("../vcsUiApp.js").default} app
69
69
  */
70
70
  constructor(options, app) {
71
71
  /**
72
72
  * @protected
73
- * @type {import("@src/vcsUiApp.js").default}
73
+ * @type {import("../vcsUiApp.js").default}
74
74
  */
75
75
  this._app = app;
76
76
 
@@ -12,6 +12,11 @@ export type GroupContentTreeItemOptions = import("./contentTreeItem.js").Content
12
12
  * @extends {ContentTreeItem}
13
13
  */
14
14
  declare class GroupContentTreeItem extends ContentTreeItem {
15
+ /**
16
+ * @param {GroupContentTreeItemOptions} options
17
+ * @param {import("@src/vcsUiApp.js").default} app
18
+ */
19
+ constructor(options: GroupContentTreeItemOptions, app: import("@src/vcsUiApp.js").default);
15
20
  /**
16
21
  * @type {boolean}
17
22
  * @private
@@ -24,7 +24,7 @@ class GroupContentTreeItem extends ContentTreeItem {
24
24
  }
25
25
 
26
26
  /**
27
- * @param {import("./contentTreeItem.js").ContentTreeItemOptions} options
27
+ * @param {GroupContentTreeItemOptions} options
28
28
  * @param {import("@src/vcsUiApp.js").default} app
29
29
  */
30
30
  constructor(options, app) {
@@ -35,7 +35,7 @@ export function setViewpointAction(item, app, viewpoint) {
35
35
  const action = createGoToViewpointAction(
36
36
  {
37
37
  name,
38
- icon: 'mdi-crosshairs-gps',
38
+ icon: 'mdi-target',
39
39
  },
40
40
  viewpoint,
41
41
  app.viewpoints,
@@ -1,3 +1,4 @@
1
+ import { getLogger } from '@vcsuite/logger';
1
2
  import { parseBoolean } from '@vcsuite/parsers';
2
3
  import ContentTreeItem, {
3
4
  contentTreeClassRegistry,
@@ -184,7 +185,16 @@ class LayerGroupContentTreeItem extends ContentTreeItem {
184
185
  const layers = this._layers;
185
186
  const activate = layers.some((l) => !(l.active || l.loading));
186
187
  if (activate) {
187
- await Promise.all(layers.map((l) => l.activate()));
188
+ await Promise.all(
189
+ layers.map((l) =>
190
+ l.activate().catch((e) => {
191
+ getLogger('LayerGroupContentTreeItem').error(
192
+ `Could not activate layer ${l.name}`,
193
+ e,
194
+ );
195
+ }),
196
+ ),
197
+ );
188
198
  executeCallbacks(this._app, this._onActivate);
189
199
  } else {
190
200
  layers.forEach((l) => {
@@ -1,10 +1,31 @@
1
1
  export default NodeContentTreeItem;
2
+ export type NodeContentTreeItemOptions = import("./contentTreeItem.js").ContentTreeItemOptions & {
3
+ disableIfChildrenDisabled?: boolean;
4
+ };
5
+ /**
6
+ * @typedef {import("./contentTreeItem.js").ContentTreeItemOptions & { disableIfChildrenDisabled?: boolean }} NodeContentTreeItemOptions
7
+ * @property {boolean} [disableIfChildrenDisabled=false] - optional flag to disable the contentTreeItem if all children are disabled.
8
+ */
2
9
  /**
3
10
  * A group item which has _no click handler_
4
11
  * @class
5
12
  * @extends {ContentTreeItem}
6
13
  */
7
14
  declare class NodeContentTreeItem extends ContentTreeItem {
15
+ /**
16
+ * @param {NodeContentTreeItemOptions} options
17
+ * @param {import("@src/vcsUiApp.js").default} app
18
+ */
19
+ constructor(options: NodeContentTreeItemOptions, app: import("@src/vcsUiApp.js").default);
20
+ /**
21
+ * @type {boolean}
22
+ * @private
23
+ */
24
+ private _disableIfChildrenDisabled;
8
25
  _childWatcher: import("vue").WatchStopHandle;
26
+ /**
27
+ * @returns {NodeContentTreeItemOptions}
28
+ */
29
+ toJSON(): NodeContentTreeItemOptions;
9
30
  }
10
31
  import ContentTreeItem from './contentTreeItem.js';
@@ -1,8 +1,14 @@
1
1
  import { watch } from 'vue';
2
+ import { parseBoolean } from '@vcsuite/parsers';
2
3
  import ContentTreeItem, {
3
4
  contentTreeClassRegistry,
4
5
  } from './contentTreeItem.js';
5
6
 
7
+ /**
8
+ * @typedef {import("./contentTreeItem.js").ContentTreeItemOptions & { disableIfChildrenDisabled?: boolean }} NodeContentTreeItemOptions
9
+ * @property {boolean} [disableIfChildrenDisabled=false] - optional flag to disable the contentTreeItem if all children are disabled.
10
+ */
11
+
6
12
  /**
7
13
  * A group item which has _no click handler_
8
14
  * @class
@@ -17,7 +23,7 @@ class NodeContentTreeItem extends ContentTreeItem {
17
23
  }
18
24
 
19
25
  /**
20
- * @param {import("./contentTreeItem.js").ContentTreeItemOptions} options
26
+ * @param {NodeContentTreeItemOptions} options
21
27
  * @param {import("@src/vcsUiApp.js").default} app
22
28
  */
23
29
  constructor(options, app) {
@@ -25,16 +31,39 @@ class NodeContentTreeItem extends ContentTreeItem {
25
31
 
26
32
  this.clickable = false;
27
33
 
34
+ /**
35
+ * @type {boolean}
36
+ * @private
37
+ */
38
+ this._disableIfChildrenDisabled = parseBoolean(
39
+ options.disableIfChildrenDisabled,
40
+ false,
41
+ );
42
+
28
43
  this._childWatcher = watch(
29
44
  this._children,
30
45
  () => {
31
46
  const children = this._children.value;
32
47
  this.visible = children.some((c) => c.visible);
48
+ if (this._disableIfChildrenDisabled) {
49
+ this.disabled = children.every((c) => c.disabled);
50
+ }
33
51
  },
34
- { deep: true },
52
+ { deep: true, immediate: true },
35
53
  );
36
54
  }
37
55
 
56
+ /**
57
+ * @returns {NodeContentTreeItemOptions}
58
+ */
59
+ toJSON() {
60
+ const config = super.toJSON();
61
+ if (this._disableIfChildrenDisabled) {
62
+ config.disableIfChildrenDisabled = this._disableIfChildrenDisabled;
63
+ }
64
+ return config;
65
+ }
66
+
38
67
  destroy() {
39
68
  this._childWatcher();
40
69
  super.destroy();
@@ -0,0 +1,56 @@
1
+ export default WmsChildContentTreeItem;
2
+ export type WMSChildItemOptions = import("./contentTreeItem.js").ContentTreeItemOptions & {
3
+ wmsEntry: import("./wmsGroupContentTreeItem.js").WMSEntry;
4
+ };
5
+ /**
6
+ * @typedef {import("./contentTreeItem.js").ContentTreeItemOptions &
7
+ * { wmsEntry:import("./wmsGroupContentTreeItem.js").WMSEntry }} WMSChildItemOptions
8
+ * @property {import("./wmsGroupContentTreeItem.js").WMSEntry} wmsEntry - the wmsEntry
9
+ * @property {boolean} hideStyleSelector - hides the style selector
10
+ */
11
+ /**
12
+ * A WMS child layer. Toggles this child in the parent WMS layer.
13
+ * @extends {ContentTreeItem}
14
+ * @class
15
+ */
16
+ declare class WmsChildContentTreeItem extends ContentTreeItem {
17
+ /**
18
+ * @param {WMSChildItemOptions} options
19
+ * @param {import("../vcsUiApp.js").default} app
20
+ */
21
+ constructor(options: WMSChildItemOptions, app: import("../vcsUiApp.js").default);
22
+ /**
23
+ * @type {import("./wmsGroupContentTreeItem.js").WMSEntry}
24
+ */
25
+ _wmsEntry: import("./wmsGroupContentTreeItem.js").WMSEntry;
26
+ /**
27
+ * @type {() => void}
28
+ */
29
+ _stateWatcher: () => void;
30
+ /**
31
+ * Event fires if the Item has been clicked
32
+ * @type {VcsEvent<void>}
33
+ */
34
+ clickedEvent: VcsEvent<void>;
35
+ /**
36
+ * Event fires if a style has been selected
37
+ * @type {VcsEvent<string>}
38
+ */
39
+ styleSelected: VcsEvent<string>;
40
+ /**
41
+ * @type {() => void}
42
+ */
43
+ _destroyStyleAction: () => void;
44
+ /**
45
+ * @type {import("./wmsGroupContentTreeItem.js").WMSEntry}
46
+ */
47
+ get wmsEntry(): import("./wmsGroupContentTreeItem.js").WMSEntry;
48
+ /**
49
+ * @param {number[]} [extent]
50
+ * @private
51
+ */
52
+ private _setExtentAction;
53
+ _setStyleAction(): void;
54
+ }
55
+ import ContentTreeItem from './contentTreeItem.js';
56
+ import { VcsEvent } from '@vcmap/core';
@@ -0,0 +1,159 @@
1
+ import { VcsEvent, Viewpoint } from '@vcmap/core';
2
+ import { reactive, computed, watch } from 'vue';
3
+ import {
4
+ createGoToViewpointAction,
5
+ createModalAction,
6
+ } from '../actions/actionHelper.js';
7
+ import { StateActionState } from '../actions/stateRefAction.js';
8
+ import ContentTreeItem from './contentTreeItem.js';
9
+ import VcsActionList from '../components/lists/VcsActionList.vue';
10
+ import { vcsAppSymbol } from '../pluginHelper.js';
11
+
12
+ /**
13
+ * @typedef {import("./contentTreeItem.js").ContentTreeItemOptions &
14
+ * { wmsEntry:import("./wmsGroupContentTreeItem.js").WMSEntry }} WMSChildItemOptions
15
+ * @property {import("./wmsGroupContentTreeItem.js").WMSEntry} wmsEntry - the wmsEntry
16
+ * @property {boolean} hideStyleSelector - hides the style selector
17
+ */
18
+
19
+ /**
20
+ * A WMS child layer. Toggles this child in the parent WMS layer.
21
+ * @extends {ContentTreeItem}
22
+ * @class
23
+ */
24
+ class WmsChildContentTreeItem extends ContentTreeItem {
25
+ static get className() {
26
+ return 'WmsChildContentTreeItem';
27
+ }
28
+
29
+ /**
30
+ * @param {WMSChildItemOptions} options
31
+ * @param {import("../vcsUiApp.js").default} app
32
+ */
33
+ constructor(options, app) {
34
+ super(options, app);
35
+
36
+ /**
37
+ * @type {import("./wmsGroupContentTreeItem.js").WMSEntry}
38
+ */
39
+ this._wmsEntry = options.wmsEntry;
40
+
41
+ /**
42
+ * @type {() => void}
43
+ */
44
+ this._stateWatcher = watch(
45
+ this._wmsEntry.active,
46
+ () => {
47
+ if (this._wmsEntry.active.value) {
48
+ this.state = StateActionState.ACTIVE;
49
+ } else {
50
+ this.state = StateActionState.INACTIVE;
51
+ }
52
+ },
53
+ { immediate: true },
54
+ );
55
+
56
+ /**
57
+ * Event fires if the Item has been clicked
58
+ * @type {VcsEvent<void>}
59
+ */
60
+ this.clickedEvent = new VcsEvent();
61
+
62
+ /**
63
+ * Event fires if a style has been selected
64
+ * @type {VcsEvent<string>}
65
+ */
66
+ this.styleSelected = new VcsEvent();
67
+
68
+ /**
69
+ * @type {() => void}
70
+ */
71
+ this._destroyStyleAction = () => {};
72
+
73
+ this._setExtentAction(this._wmsEntry.extent);
74
+ if (!options.hideStyleSelector) {
75
+ this._setStyleAction();
76
+ }
77
+ }
78
+
79
+ /**
80
+ * @type {import("./wmsGroupContentTreeItem.js").WMSEntry}
81
+ */
82
+ get wmsEntry() {
83
+ return this._wmsEntry;
84
+ }
85
+
86
+ /**
87
+ * @param {number[]} [extent]
88
+ * @private
89
+ */
90
+ _setExtentAction(extent) {
91
+ const name = 'content.layerExtentAction.name';
92
+ this.removeAction(name);
93
+ if (extent) {
94
+ const viewpoint = Viewpoint.createViewpointFromExtent(extent);
95
+ const action = createGoToViewpointAction(
96
+ {
97
+ name,
98
+ title: 'content.layerExtentAction.title',
99
+ },
100
+ viewpoint,
101
+ this._app.viewpoints,
102
+ this._app.maps,
103
+ );
104
+ this.addAction(action, 8);
105
+ }
106
+ }
107
+
108
+ _setStyleAction() {
109
+ const name = 'content.wmsStyleAction.name';
110
+ this.removeAction(name);
111
+ let modalAction = null;
112
+ if (this._wmsEntry.styles.length > 1) {
113
+ const styleActions = this._wmsEntry.styles.map((style) => {
114
+ return reactive({
115
+ name: style.title,
116
+ active: computed(
117
+ () => style.name === this.wmsEntry.activeStyle.value,
118
+ ),
119
+ callback: () => {
120
+ this.styleSelected.raiseEvent(style.name);
121
+ modalAction?.callback();
122
+ },
123
+ });
124
+ });
125
+ const { action, destroy } = createModalAction(
126
+ {
127
+ name,
128
+ icon: '$vcsColorSwatch',
129
+ title: 'content.styleAction.title',
130
+ },
131
+ {
132
+ component: VcsActionList,
133
+ position: { width: 200 },
134
+ props: { actions: styleActions },
135
+ },
136
+ this._app,
137
+ vcsAppSymbol,
138
+ );
139
+ modalAction = action;
140
+ this._destroyStyleAction = destroy;
141
+ this.addAction(action);
142
+ }
143
+ }
144
+
145
+ async clicked() {
146
+ await super.clicked();
147
+ this.clickedEvent.raiseEvent();
148
+ }
149
+
150
+ destroy() {
151
+ super.destroy();
152
+ this._stateWatcher();
153
+ this.clickedEvent.destroy();
154
+ this.styleSelected.destroy();
155
+ this._destroyStyleAction();
156
+ }
157
+ }
158
+
159
+ export default WmsChildContentTreeItem;
@@ -0,0 +1,171 @@
1
+ export default WMSGroupContentTreeItem;
2
+ export type WMSGroupContentTreeItemOptions = import('./contentTreeItem.js').ContentTreeItemOptions & {
3
+ layerName: string;
4
+ showWhenNotSupported?: boolean;
5
+ setWMSLayersExclusive?: boolean;
6
+ hideStyleSelector?: boolean;
7
+ allowedWMSLayers?: string[];
8
+ };
9
+ export type WMSStyleEntry = {
10
+ name: string;
11
+ title: string;
12
+ legend: import("../legend/legendHelper.js").LegendItem;
13
+ };
14
+ export type WMSEntry = {
15
+ name: string;
16
+ active: import("vue").Ref<boolean>;
17
+ activeStyle: import("vue").Ref<string>;
18
+ title: string;
19
+ extent: import("@vcmap/core").Extent;
20
+ styles: Array<WMSStyleEntry>;
21
+ };
22
+ /**
23
+ * @typedef {import('./contentTreeItem.js').ContentTreeItemOptions &
24
+ * { layerName: string, showWhenNotSupported?: boolean, setWMSLayersExclusive?:boolean, hideStyleSelector?:boolean, allowedWMSLayers?:string[]}} WMSGroupContentTreeItemOptions
25
+ * @property {boolean} showWhenNotSupported - optional flag to show the item even if it is not supported by the activeMap.
26
+ * @property {string} layerName - The name of the WMSLayer to show the children of.
27
+ * @property {boolean} [setWMSLayersExclusive=false] - Whether the WMSlayers are mutually exclusive.
28
+ * @property {boolean} [hideStyleSelector=false] - Whether the layer style can be selected. Will add a StyleSelector action to compatible items if the Layer has more than one style.
29
+ * @property {string[]} allowedWMSLayers - The list of layers to be shown, other available layers will not be shown.
30
+ */
31
+ /**
32
+ * @typedef {Object} WMSStyleEntry
33
+ * @property {string} name
34
+ * @property {string} title
35
+ * @property {import("../legend/legendHelper.js").LegendItem} legend
36
+ */
37
+ /**
38
+ * @typedef {Object} WMSEntry
39
+ * @property {string} name
40
+ * @property {import("vue").Ref<boolean>} active
41
+ * @property {import("vue").Ref<string>} activeStyle
42
+ * @property {string} title
43
+ * @property {import("@vcmap/core").Extent} extent
44
+ * @property {Array<WMSStyleEntry>} styles
45
+ */
46
+ /**
47
+ * A WMSGroupItem, will take over a WMSLayer and request the Capabilities of the layer to show all available
48
+ * layers as child Items. The WMSGroupItem will also set the legend on the Layer based on the Capabilities,
49
+ * if the Layer does not have a legend configured.
50
+ * @extends {VcsObjectContentTreeItem<import("./vcsObjectContentTreeItem.js").VcsObjectContentTreeItemProperties>}
51
+ * @class
52
+ */
53
+ declare class WMSGroupContentTreeItem extends VcsObjectContentTreeItem<import("./vcsObjectContentTreeItem.js").VcsObjectContentTreeItemProperties> {
54
+ /**
55
+ * @param {WMSGroupContentTreeItemOptions} options
56
+ * @param {import("../vcsUiApp.js").default} app
57
+ */
58
+ constructor(options: WMSGroupContentTreeItemOptions, app: import("../vcsUiApp.js").default);
59
+ /**
60
+ * @type {string}
61
+ * @private
62
+ */
63
+ private _layerName;
64
+ /**
65
+ * @type {boolean}
66
+ * @private
67
+ */
68
+ private _showWhenNotSupported;
69
+ /**
70
+ * @type {boolean}
71
+ * @private
72
+ */
73
+ private _setWMSLayersExclusive;
74
+ /**
75
+ * @type {boolean}
76
+ * @private
77
+ */
78
+ private _hideStyleSelector;
79
+ /**
80
+ * @type {boolean}
81
+ * @private
82
+ */
83
+ private _invalid;
84
+ /**
85
+ * The only allowed layers.
86
+ * @type {Array<string>|undefined}
87
+ * @private
88
+ */
89
+ private _allowedWMSLayers;
90
+ /**
91
+ * @type {Array<WMSEntry>}
92
+ * @private
93
+ */
94
+ private _availableWMSEntries;
95
+ /**
96
+ * references the current ChildItems, this WMSGroupContentTreeItem manages
97
+ * @type {Array<WmsChildContentTreeItem>}
98
+ * @private
99
+ */
100
+ private _childItems;
101
+ /**
102
+ * @type {Array<Function>}
103
+ * @private
104
+ */
105
+ private _listeners;
106
+ /**
107
+ * this flag is set to true, if the legend is already set, so we do not need to manage the legend
108
+ * @type {boolean}
109
+ * @private
110
+ */
111
+ private _legendSet;
112
+ /**
113
+ * pause the stateChangedListener, if the state is set from the Layer to the WMSGroupContentTreeItem
114
+ * @type {boolean}
115
+ * @private
116
+ */
117
+ private _pauseStateChangedListener;
118
+ /**
119
+ * readonly access, do not manipulate the entries directly.
120
+ * @type {Array<WMSEntry>}
121
+ */
122
+ get wmsEntries(): WMSEntry[];
123
+ /**
124
+ * @type {import("@vcmap/core").WMSLayer|undefined}
125
+ * @private
126
+ */
127
+ private get _layer();
128
+ _setState(): void;
129
+ /**
130
+ * Sets the Legend on the Layer, based on the active WMSLayers and the active Styles.
131
+ * @private
132
+ */
133
+ private _setLegend;
134
+ /**
135
+ * sets the State of to the underlying Layer
136
+ * @private
137
+ */
138
+ private _setStateToLayer;
139
+ /**
140
+ * this reacts to clickEvents from the ChildItem, and sets internal State correspondingly,
141
+ * and also sets the State to the Layer and the children.
142
+ * @param {WmsChildContentTreeItem} item
143
+ */
144
+ _handleChildClickedEvent(item: WmsChildContentTreeItem): void;
145
+ /**
146
+ * @param {WmsChildContentTreeItem} item
147
+ * @param {string} style
148
+ * @private
149
+ */
150
+ private _handleStyleSelectedEvent;
151
+ /**
152
+ * @private
153
+ */
154
+ private _clear;
155
+ /**
156
+ * syncs the State from the Layer to the WMSGroupContentTreeItem
157
+ * @private
158
+ */
159
+ private _setStateFromLayer;
160
+ /**
161
+ * @returns {Promise<void>}
162
+ * @private
163
+ */
164
+ private _setup;
165
+ /**
166
+ * @returns {WMSGroupContentTreeItemOptions}
167
+ */
168
+ toJSON(): WMSGroupContentTreeItemOptions;
169
+ }
170
+ import VcsObjectContentTreeItem from './vcsObjectContentTreeItem.js';
171
+ import WmsChildContentTreeItem from './wmsChildContentTreeItem.js';