@vcmap/ui 6.3.6 → 6.3.8

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 (38) hide show
  1. package/config/base.config.json +22 -3
  2. package/config/concepts-show-case.config.json +4 -0
  3. package/dist/assets/{cesium-13cf3c65.js → cesium-c32c5784.js} +64804 -64777
  4. package/dist/assets/cesium.js +1 -1
  5. package/dist/assets/{core-b552e43f.js → core-118b5284.js} +5861 -5824
  6. package/dist/assets/core-workers/panoramaImageWorker.js +1 -1
  7. package/dist/assets/core.js +1 -1
  8. package/dist/assets/ol.js +1 -1
  9. package/dist/assets/{ui-a2ca1d03.css → ui-2b2de3ce.css} +1 -1
  10. package/dist/assets/{ui-a2ca1d03.js → ui-2b2de3ce.js} +136 -126
  11. package/dist/assets/ui.js +1 -1
  12. package/dist/assets/vue.js +1 -1
  13. package/dist/assets/{vuetify-e536bde6.js → vuetify-5d94bb1a.js} +1 -1
  14. package/dist/assets/vuetify.js +1 -1
  15. package/package.json +2 -2
  16. package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +1 -0
  17. package/plugins/@vcmap-show-case/tileset-feature-visibility/package.json +5 -0
  18. package/plugins/@vcmap-show-case/tileset-feature-visibility/src/TilesetFeatureVisibilityComponent.vue +349 -0
  19. package/plugins/@vcmap-show-case/tileset-feature-visibility/src/TilesetFeatureVisibilityInteraction.js +66 -0
  20. package/plugins/@vcmap-show-case/tileset-feature-visibility/src/index.js +135 -0
  21. package/plugins/package.json +4 -4
  22. package/src/callback/activateLayersCallback.d.ts +1 -1
  23. package/src/callback/activateLayersCallback.js +5 -3
  24. package/src/callback/activateMapCallback.d.ts +1 -1
  25. package/src/callback/activateMapCallback.js +5 -3
  26. package/src/callback/activateOverviewMapCallback.d.ts +1 -1
  27. package/src/callback/activateOverviewMapCallback.js +5 -3
  28. package/src/callback/addModuleCallback.d.ts +1 -1
  29. package/src/callback/addModuleCallback.js +9 -11
  30. package/src/callback/removeModuleCallback.d.ts +1 -1
  31. package/src/callback/removeModuleCallback.js +8 -3
  32. package/src/components/form-inputs-controls/VcsLabeledSlider.vue +4 -4
  33. package/src/components/form-inputs-controls/VcsLabeledSlider.vue.d.ts +8 -7
  34. package/src/vuePlugins/vuetify.js +2 -4
  35. /package/dist/assets/core-workers/{panoramaImageWorker.js-1169c1e6.js → panoramaImageWorker.js-e4d99227.js} +0 -0
  36. /package/dist/assets/{ol-bb6d9ab8.js → ol-d44cf1bf.js} +0 -0
  37. /package/dist/assets/{vue-1a9cf873.js → vue-a7d70c19.js} +0 -0
  38. /package/dist/assets/{vuetify-e536bde6.css → vuetify-5d94bb1a.css} +0 -0
package/dist/assets/ui.js CHANGED
@@ -1 +1 @@
1
- export * from "./ui-a2ca1d03.js";
1
+ export * from "./ui-2b2de3ce.js";
@@ -1 +1 @@
1
- export * from "./vue-1a9cf873.js";
1
+ export * from "./vue-a7d70c19.js";
@@ -10,7 +10,7 @@ function loadCss(href) {
10
10
  elem.onerror = reject;
11
11
  document.head.appendChild(elem);
12
12
  });
13
- } await loadCss('./assets/vuetify-e536bde6.css');import { watch as Q, onScopeDispose as Ze, effectScope as Zl, shallowRef as K, reactive as it, computed as b, watchEffect as Fe, toRefs as Yt, capitalize as Nn, unref as ot, Fragment as ie, isVNode as Rc, Comment as Nc, warn as ja, getCurrentInstance as Hc, ref as j, provide as De, inject as ye, defineComponent as zc, h as Gt, camelize as Ir, toRaw as Be, createVNode as r, mergeProps as O, onBeforeUnmount as Qe, readonly as Ql, onMounted as Ye, onDeactivated as _r, onActivated as Wc, nextTick as we, TransitionGroup as Jl, Transition as jt, isRef as Tn, toRef as $, onBeforeMount as ra, withDirectives as $e, resolveDirective as gt, vShow as Ct, onUpdated as jc, Text as Uc, resolveDynamicComponent as Yc, markRaw as Gc, Teleport as Kc, cloneVNode as qc, createTextVNode as Tt, onUnmounted as Tr, onBeforeUpdate as Xc, withModifiers as Tl, toDisplayString as Zc, vModelText as Qc, resolveComponent as Jc, render as Ar } from "./vue-1a9cf873.js";
13
+ } await loadCss('./assets/vuetify-5d94bb1a.css');import { watch as Q, onScopeDispose as Ze, effectScope as Zl, shallowRef as K, reactive as it, computed as b, watchEffect as Fe, toRefs as Yt, capitalize as Nn, unref as ot, Fragment as ie, isVNode as Rc, Comment as Nc, warn as ja, getCurrentInstance as Hc, ref as j, provide as De, inject as ye, defineComponent as zc, h as Gt, camelize as Ir, toRaw as Be, createVNode as r, mergeProps as O, onBeforeUnmount as Qe, readonly as Ql, onMounted as Ye, onDeactivated as _r, onActivated as Wc, nextTick as we, TransitionGroup as Jl, Transition as jt, isRef as Tn, toRef as $, onBeforeMount as ra, withDirectives as $e, resolveDirective as gt, vShow as Ct, onUpdated as jc, Text as Uc, resolveDynamicComponent as Yc, markRaw as Gc, Teleport as Kc, cloneVNode as qc, createTextVNode as Tt, onUnmounted as Tr, onBeforeUpdate as Xc, withModifiers as Tl, toDisplayString as Zc, vModelText as Qc, resolveComponent as Jc, render as Ar } from "./vue-a7d70c19.js";
14
14
  function rt(e, n) {
15
15
  let t;
16
16
  function a() {
@@ -1 +1 @@
1
- export * from "./vuetify-e536bde6.js";
1
+ export * from "./vuetify-5d94bb1a.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/ui",
3
- "version": "6.3.6",
3
+ "version": "6.3.8",
4
4
  "author": "Virtual City Systems",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@vcmap-cesium/engine": "^11.0.5",
58
- "@vcmap/core": "^6.3.5",
58
+ "@vcmap/core": "^6.3.8",
59
59
  "ol": "^10.4.0",
60
60
  "vue": "~3.4.38",
61
61
  "vuetify": "~3.7.14"
@@ -243,6 +243,7 @@
243
243
  :max="100"
244
244
  :step="0.001"
245
245
  allow-text-input
246
+ text-input-cols="3"
246
247
  />
247
248
  <v-row no-gutters>
248
249
  <v-col>
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "@vcmap-show-case/tileset-feature-visibility",
3
+ "version": "1.0.0",
4
+ "mapVersion": "^6.0"
5
+ }
@@ -0,0 +1,349 @@
1
+ <template>
2
+ <v-sheet>
3
+ <VcsFormSection heading="Tileset Layer" expandable start-open>
4
+ <v-container class="py-0 px-1">
5
+ <v-row no-gutters>
6
+ <v-col>
7
+ <VcsLabel html-for="layer-select">Layer</VcsLabel>
8
+ </v-col>
9
+ <v-col>
10
+ <VcsSelect
11
+ id="layer-select"
12
+ :items="layerItems"
13
+ v-model="selectedLayerName"
14
+ placeholder="Select a CesiumTilesetLayer"
15
+ />
16
+ </v-col>
17
+ </v-row>
18
+ </v-container>
19
+ </VcsFormSection>
20
+
21
+ <VcsFormSection heading="Interaction" expandable start-open>
22
+ <v-container class="py-1 px-2">
23
+ <v-row no-gutters class="align-center">
24
+ <v-col>
25
+ Click to highlight, Ctrl+Click to hide, Shift+Click to hide globally
26
+ </v-col>
27
+ </v-row>
28
+ <v-row no-gutters class="mt-2">
29
+ <v-col>
30
+ <VcsFormButton
31
+ :variant="interactionActive ? 'filled' : 'outlined'"
32
+ :disabled="!selectedLayerName"
33
+ @click="toggleInteraction"
34
+ >
35
+ {{
36
+ interactionActive
37
+ ? 'Deactivate Interaction'
38
+ : 'Activate Interaction'
39
+ }}
40
+ </VcsFormButton>
41
+ </v-col>
42
+ </v-row>
43
+ </v-container>
44
+ </VcsFormSection>
45
+
46
+ <VcsFormSection
47
+ v-if="highlightedIds.length > 0"
48
+ heading="Highlighted Features"
49
+ expandable
50
+ start-open
51
+ :header-actions="highlightedHeaderActions"
52
+ >
53
+ <VcsList :items="highlightedListItems" :show-title="false" />
54
+ </VcsFormSection>
55
+
56
+ <VcsFormSection
57
+ v-if="globallyHiddenIds.length > 0"
58
+ heading="Globally Hidden Features"
59
+ expandable
60
+ start-open
61
+ :header-actions="globallyHiddenHeaderActions"
62
+ >
63
+ <VcsList :items="globallyHiddenListItems" :show-title="false" />
64
+ </VcsFormSection>
65
+
66
+ <VcsFormSection
67
+ v-if="hiddenIds.length > 0"
68
+ heading="Hidden Features"
69
+ expandable
70
+ start-open
71
+ :header-actions="hiddenHeaderActions"
72
+ >
73
+ <VcsList :items="hiddenListItems" :show-title="false" />
74
+ </VcsFormSection>
75
+ </v-sheet>
76
+ </template>
77
+
78
+ <script>
79
+ import { computed, inject, onUnmounted, ref, watch } from 'vue';
80
+ import {
81
+ CesiumTilesetLayer,
82
+ I3SLayer,
83
+ VectorLayer,
84
+ VectorTileLayer,
85
+ } from '@vcmap/core';
86
+ import {
87
+ VcsFormButton,
88
+ VcsFormSection,
89
+ VcsList,
90
+ VcsLabel,
91
+ VcsSelect,
92
+ } from '@vcmap/ui';
93
+ import { VSheet, VContainer, VRow, VCol } from 'vuetify/components';
94
+ import { name } from '../package.json';
95
+
96
+ export const windowId = 'tileset-feature-visibility-window';
97
+
98
+ export default {
99
+ name: 'TilesetFeatureVisibilityComponent',
100
+ components: {
101
+ VSheet,
102
+ VContainer,
103
+ VRow,
104
+ VCol,
105
+ VcsFormButton,
106
+ VcsFormSection,
107
+ VcsList,
108
+ VcsLabel,
109
+ VcsSelect,
110
+ },
111
+ setup() {
112
+ /** @type {import('@vcmap/ui').VcsUiApp} */
113
+ const app = inject('vcsApp');
114
+ const plugin = app.plugins.getByKey(name);
115
+
116
+ const selectedLayerName = ref(null);
117
+ const interactionActive = ref(false);
118
+ const highlightedIds = ref([]);
119
+ const hiddenIds = ref([]);
120
+ const { globallyHiddenIds } = plugin;
121
+
122
+ let visibilityListener = null;
123
+
124
+ function buildLayerItems() {
125
+ return [...app.layers]
126
+ .filter(
127
+ (l) =>
128
+ l instanceof CesiumTilesetLayer ||
129
+ l instanceof I3SLayer ||
130
+ l instanceof VectorLayer ||
131
+ l instanceof VectorTileLayer,
132
+ )
133
+ .map((l) => ({ title: l.properties.title || l.name, value: l.name }));
134
+ }
135
+
136
+ const layerItems = ref(buildLayerItems());
137
+ const layerListeners = [
138
+ app.layers.added.addEventListener(() => {
139
+ layerItems.value = buildLayerItems();
140
+ }),
141
+ app.layers.removed.addEventListener(() => {
142
+ layerItems.value = buildLayerItems();
143
+ }),
144
+ ];
145
+
146
+ /** @returns {import('@vcmap/core').CesiumTilesetLayer|null} */
147
+ function getSelectedLayer() {
148
+ if (!selectedLayerName.value) return null;
149
+ return /** @type {import('@vcmap/core').CesiumTilesetLayer} */ (
150
+ app.layers.getByKey(selectedLayerName.value)
151
+ );
152
+ }
153
+
154
+ function syncVisibilityState() {
155
+ const layer = getSelectedLayer();
156
+ if (!layer) {
157
+ highlightedIds.value = [];
158
+ hiddenIds.value = [];
159
+ return;
160
+ }
161
+ highlightedIds.value = Object.keys(
162
+ layer.featureVisibility.highlightedObjects,
163
+ );
164
+ hiddenIds.value = Object.keys(layer.featureVisibility.hiddenObjects);
165
+ }
166
+
167
+ watch(selectedLayerName, () => {
168
+ // Deactivate interaction when layer changes
169
+ if (interactionActive.value) {
170
+ plugin.deactivateInteraction();
171
+ interactionActive.value = false;
172
+ }
173
+
174
+ // Remove old listener
175
+ if (visibilityListener) {
176
+ visibilityListener();
177
+ visibilityListener = null;
178
+ }
179
+
180
+ // Set up new listener
181
+ const layer = getSelectedLayer();
182
+ if (layer) {
183
+ visibilityListener = layer.featureVisibility.changed.addEventListener(
184
+ () => {
185
+ syncVisibilityState();
186
+ },
187
+ );
188
+ syncVisibilityState();
189
+ } else {
190
+ highlightedIds.value = [];
191
+ hiddenIds.value = [];
192
+ }
193
+ });
194
+
195
+ function toggleInteraction() {
196
+ if (!selectedLayerName.value) return;
197
+ if (interactionActive.value) {
198
+ plugin.deactivateInteraction();
199
+ interactionActive.value = false;
200
+ } else {
201
+ const layer = getSelectedLayer();
202
+ if (layer) {
203
+ plugin.activateInteraction(layer, () => {
204
+ // Called when the interaction is forcefully removed by another tool
205
+ interactionActive.value = false;
206
+ });
207
+ interactionActive.value = true;
208
+ }
209
+ }
210
+ }
211
+
212
+ function showAllFeatures() {
213
+ const layer = getSelectedLayer();
214
+ if (layer) {
215
+ layer.featureVisibility.clearHiddenObjects();
216
+ }
217
+ }
218
+
219
+ function clearHighlights() {
220
+ const layer = getSelectedLayer();
221
+ if (layer) {
222
+ layer.featureVisibility.clearHighlighting();
223
+ }
224
+ }
225
+
226
+ function unhighlightFeature(id) {
227
+ const layer = getSelectedLayer();
228
+ if (layer) {
229
+ layer.featureVisibility.unHighlight([id]);
230
+ }
231
+ }
232
+
233
+ function showFeature(id) {
234
+ const layer = getSelectedLayer();
235
+ if (layer) {
236
+ layer.featureVisibility.showObjects([id]);
237
+ }
238
+ }
239
+
240
+ function globalShowObject(id) {
241
+ plugin.globalShowObject(id);
242
+ }
243
+
244
+ function clearGloballyHidden() {
245
+ plugin.clearGloballyHidden();
246
+ }
247
+
248
+ const highlightedListItems = computed(() =>
249
+ highlightedIds.value.map((id) => ({
250
+ name: id,
251
+ title: id,
252
+ actions: [
253
+ {
254
+ name: 'unhighlight',
255
+ icon: 'mdi-eye-off-outline',
256
+ tooltip: 'Unhighlight feature',
257
+ callback: () => unhighlightFeature(id),
258
+ },
259
+ ],
260
+ })),
261
+ );
262
+
263
+ const hiddenListItems = computed(() =>
264
+ hiddenIds.value.map((id) => ({
265
+ name: id,
266
+ title: id,
267
+ actions: [
268
+ {
269
+ name: 'show',
270
+ icon: 'mdi-eye-outline',
271
+ tooltip: 'Show feature',
272
+ callback: () => showFeature(id),
273
+ },
274
+ ],
275
+ })),
276
+ );
277
+
278
+ const globallyHiddenListItems = computed(() =>
279
+ globallyHiddenIds.value.map((id) => ({
280
+ name: id,
281
+ title: id,
282
+ actions: [
283
+ {
284
+ name: 'globalShow',
285
+ icon: 'mdi-eye-outline',
286
+ tooltip: 'Show feature globally',
287
+ callback: () => globalShowObject(id),
288
+ },
289
+ ],
290
+ })),
291
+ );
292
+
293
+ const highlightedHeaderActions = computed(() => [
294
+ {
295
+ name: 'clearHighlights',
296
+ icon: 'mdi-close-circle-outline',
297
+ tooltip: 'Clear All Highlights',
298
+ callback: clearHighlights,
299
+ },
300
+ ]);
301
+
302
+ const hiddenHeaderActions = computed(() => [
303
+ {
304
+ name: 'showAllHidden',
305
+ icon: 'mdi-eye-outline',
306
+ tooltip: 'Show All Hidden Features',
307
+ callback: showAllFeatures,
308
+ },
309
+ ]);
310
+
311
+ const globallyHiddenHeaderActions = computed(() => [
312
+ {
313
+ name: 'clearGloballyHidden',
314
+ icon: 'mdi-eye-outline',
315
+ tooltip: 'Show All Globally Hidden',
316
+ callback: clearGloballyHidden,
317
+ },
318
+ ]);
319
+
320
+ onUnmounted(() => {
321
+ layerListeners.forEach((cb) => cb());
322
+ if (visibilityListener) {
323
+ visibilityListener();
324
+ visibilityListener = null;
325
+ }
326
+ if (interactionActive.value) {
327
+ plugin.deactivateInteraction();
328
+ interactionActive.value = false;
329
+ }
330
+ });
331
+
332
+ return {
333
+ layerItems,
334
+ selectedLayerName,
335
+ interactionActive,
336
+ highlightedIds,
337
+ hiddenIds,
338
+ globallyHiddenIds,
339
+ toggleInteraction,
340
+ highlightedListItems,
341
+ hiddenListItems,
342
+ globallyHiddenListItems,
343
+ highlightedHeaderActions,
344
+ hiddenHeaderActions,
345
+ globallyHiddenHeaderActions,
346
+ };
347
+ },
348
+ };
349
+ </script>
@@ -0,0 +1,66 @@
1
+ import {
2
+ AbstractInteraction,
3
+ EventType,
4
+ ModificationKeyType,
5
+ vcsLayerName,
6
+ VectorStyleItem,
7
+ } from '@vcmap/core';
8
+
9
+ /** @type {import('@vcmap/core').VectorStyleItem} */
10
+ const defaultHighlightStyle = new VectorStyleItem({
11
+ fill: { color: [255, 215, 0, 0.8] },
12
+ });
13
+
14
+ /**
15
+ * Interaction that allows highlighting and hiding features of a CesiumTilesetLayer.
16
+ * - Click on a feature: toggle highlight
17
+ * - Ctrl/Cmd + Click on a feature: hide the feature via featureVisibility
18
+ * - Shift + Click on a feature: hide the feature globally via globalHider
19
+ */
20
+ export default class TilesetFeatureVisibilityInteraction extends AbstractInteraction {
21
+ /**
22
+ * @param {import('@vcmap/core').CesiumTilesetLayer} layer
23
+ * @param {function(string):void} globalHideCallback - called with the feature id when globally hiding
24
+ */
25
+ constructor(layer, globalHideCallback) {
26
+ super(EventType.CLICK, ModificationKeyType.ALL);
27
+ /** @type {import('@vcmap/core').CesiumTilesetLayer} */
28
+ this._layer = layer;
29
+ /** @type {function(string):void} */
30
+ this._globalHideCallback = globalHideCallback;
31
+ }
32
+
33
+ /**
34
+ * @param {import('@vcmap/core').InteractionEvent} event
35
+ * @returns {Promise<import('@vcmap/core').InteractionEvent>}
36
+ */
37
+ pipe(event) {
38
+ const { feature } = event;
39
+ if (feature && feature[vcsLayerName] === this._layer.name) {
40
+ const id = String(feature.getId());
41
+ const { featureVisibility } = this._layer;
42
+
43
+ if (event.key === ModificationKeyType.CTRL) {
44
+ // Ctrl/Cmd + Click: hide the feature via featureVisibility
45
+ featureVisibility.hideObjects([id]);
46
+ event.stopPropagation = true;
47
+ } else if (event.key === ModificationKeyType.SHIFT) {
48
+ // Shift + Click: hide the feature globally via globalHider
49
+ this._globalHideCallback(id);
50
+ event.stopPropagation = true;
51
+ } else if (event.key === ModificationKeyType.NONE) {
52
+ // Click: toggle highlight
53
+ if (featureVisibility.highlightedObjects[id]) {
54
+ featureVisibility.unHighlight([id]);
55
+ } else {
56
+ const highlightStyle =
57
+ this._layer.highlightStyle ?? defaultHighlightStyle;
58
+ featureVisibility.highlight({ [id]: highlightStyle });
59
+ }
60
+ event.stopPropagation = true;
61
+ }
62
+ }
63
+
64
+ return Promise.resolve(event);
65
+ }
66
+ }
@@ -0,0 +1,135 @@
1
+ import { ref } from 'vue';
2
+ import { ButtonLocation, createToggleAction, WindowSlot } from '@vcmap/ui';
3
+ import { name, version, mapVersion } from '../package.json';
4
+ import TilesetFeatureVisibilityComponent, {
5
+ windowId,
6
+ } from './TilesetFeatureVisibilityComponent.vue';
7
+ import TilesetFeatureVisibilityInteraction from './TilesetFeatureVisibilityInteraction.js';
8
+
9
+ export default function tilesetFeatureVisibilityPlugin() {
10
+ /** @type {(() => number)|null} */
11
+ let removeInteraction = null;
12
+ /** @type {TilesetFeatureVisibilityInteraction|null} */
13
+ let interaction = null;
14
+ /** @type {import('@vcmap/ui').VcsUiApp|null} */
15
+ let vcsApp = null;
16
+ /** @type {import('vue').Ref<string[]>} */
17
+ const globallyHiddenIds = ref([]);
18
+
19
+ return {
20
+ get name() {
21
+ return name;
22
+ },
23
+ get version() {
24
+ return version;
25
+ },
26
+ get mapVersion() {
27
+ return mapVersion;
28
+ },
29
+
30
+ /**
31
+ * Activate the tileset feature visibility interaction for the given layer.
32
+ * @param {import('@vcmap/core').CesiumTilesetLayer} layer
33
+ * @param {function():void} [onRemoved] - called if the interaction is forcefully removed
34
+ */
35
+ activateInteraction(layer, onRemoved) {
36
+ if (removeInteraction) {
37
+ removeInteraction();
38
+ removeInteraction = null;
39
+ }
40
+ interaction = new TilesetFeatureVisibilityInteraction(layer, (id) => {
41
+ vcsApp.layers.globalHider.hideObjects([id]);
42
+ if (!globallyHiddenIds.value.includes(id)) {
43
+ globallyHiddenIds.value = [...globallyHiddenIds.value, id];
44
+ }
45
+ });
46
+ removeInteraction = vcsApp.maps.eventHandler.addExclusiveInteraction(
47
+ interaction,
48
+ () => {
49
+ interaction = null;
50
+ removeInteraction = null;
51
+ onRemoved?.();
52
+ },
53
+ undefined,
54
+ name,
55
+ );
56
+ },
57
+
58
+ /**
59
+ * Deactivate the tileset feature visibility interaction.
60
+ */
61
+ deactivateInteraction() {
62
+ if (removeInteraction) {
63
+ removeInteraction();
64
+ removeInteraction = null;
65
+ }
66
+ interaction = null;
67
+ },
68
+
69
+ /**
70
+ * Show a feature that was globally hidden by this plugin.
71
+ * @param {string} id
72
+ */
73
+ globalShowObject(id) {
74
+ vcsApp.layers.globalHider.showObjects([id]);
75
+ globallyHiddenIds.value = globallyHiddenIds.value.filter((i) => i !== id);
76
+ },
77
+
78
+ /**
79
+ * Show all features that were globally hidden by this plugin.
80
+ */
81
+ clearGloballyHidden() {
82
+ const ids = [...globallyHiddenIds.value];
83
+ vcsApp.layers.globalHider.showObjects(ids);
84
+ globallyHiddenIds.value = [];
85
+ },
86
+
87
+ /**
88
+ * Reactive ref of feature ids globally hidden by this plugin.
89
+ * @type {import('vue').Ref<string[]>}
90
+ */
91
+ get globallyHiddenIds() {
92
+ return globallyHiddenIds;
93
+ },
94
+
95
+ /**
96
+ * @param {import('@vcmap/ui').VcsUiApp} app
97
+ */
98
+ initialize(app) {
99
+ vcsApp = app;
100
+
101
+ const { action, destroy } = createToggleAction(
102
+ {
103
+ name: 'Tileset Feature Visibility',
104
+ title: 'Tileset Feature Visibility',
105
+ icon: 'mdi-layers-search',
106
+ },
107
+ {
108
+ id: windowId,
109
+ state: {
110
+ headerTitle: 'Tileset Feature Visibility',
111
+ headerIcon: 'mdi-layers-search',
112
+ },
113
+ component: TilesetFeatureVisibilityComponent,
114
+ slot: WindowSlot.DYNAMIC_LEFT,
115
+ },
116
+ app.windowManager,
117
+ name,
118
+ );
119
+
120
+ app.navbarManager.add(
121
+ { id: 'tileset-feature-visibility', action },
122
+ name,
123
+ ButtonLocation.TOOL,
124
+ );
125
+
126
+ this._destroy = destroy;
127
+ },
128
+
129
+ destroy() {
130
+ this.deactivateInteraction();
131
+ this.clearGloballyHidden();
132
+ this._destroy?.();
133
+ },
134
+ };
135
+ }
@@ -2,17 +2,17 @@
2
2
  "dependencies": {
3
3
  "@vcmap/print": "^4.0.0",
4
4
  "@vcmap/walk": "^2.0.0",
5
- "@vcmap/clipping-tool": "^3.0.0",
5
+ "@vcmap/clipping-tool": "^4.0.0",
6
6
  "@vcmap/transparent-terrain": "^3.0.0",
7
7
  "@vcmap/height-profile": "^3.0.0",
8
8
  "@vcmap/flight": "^3.0.0",
9
9
  "@vcmap/swipe-tool": "^4.0.0",
10
- "@vcmap/export": "^2.0.0",
11
- "@vcmap/viewshed": "^4.0.0",
10
+ "@vcmap/export": "^2.1.0",
11
+ "@vcmap/viewshed": "^4.1.0",
12
12
  "@vcmap/measurement": "^5.0.0",
13
13
  "@vcmap/multi-view": "^3.0.0",
14
14
  "@vcmap/draw": "^5.0.0",
15
- "@vcmap/shadow": "^3.0.0",
15
+ "@vcmap/shadow": "^3.1.0",
16
16
  "@vcmap/search-wfs": "^2.1.0",
17
17
  "@vcmap/search-esri": "^3.0.0",
18
18
  "@vcmap/search-coordinate": "^2.0.0",
@@ -21,7 +21,7 @@ declare class ActivateLayersCallback extends VcsCallback {
21
21
  * @private
22
22
  */
23
23
  private _layerNames;
24
- callback(): void;
24
+ callback(): Promise<void>;
25
25
  /**
26
26
  * @returns {ActivateLayersOptions}
27
27
  */
@@ -31,11 +31,11 @@ class ActivateLayersCallback extends VcsCallback {
31
31
  this._layerNames = options.layerNames;
32
32
  }
33
33
 
34
- callback() {
35
- this._layerNames
34
+ async callback() {
35
+ const layerPromises = this._layerNames
36
36
  .map((n) => this._app.layers.getByKey(n))
37
37
  .filter((l) => l)
38
- .forEach((l) =>
38
+ .map((l) =>
39
39
  l.activate().catch((e) => {
40
40
  getLogger('ActivateLayersCallback').error(
41
41
  `Could not activate layer: ${l.name}`,
@@ -43,6 +43,8 @@ class ActivateLayersCallback extends VcsCallback {
43
43
  );
44
44
  }),
45
45
  );
46
+
47
+ await Promise.all(layerPromises);
46
48
  }
47
49
 
48
50
  /**
@@ -25,7 +25,7 @@ declare class ActivateMapCallback extends VcsCallback {
25
25
  /**
26
26
  * Activates the map with the given name.
27
27
  */
28
- callback(): void;
28
+ callback(): Promise<void>;
29
29
  /**
30
30
  * @returns {ActivateMapCallbackOptions}
31
31
  */
@@ -28,14 +28,16 @@ class ActivateMapCallback extends VcsCallback {
28
28
  /**
29
29
  * Activates the map with the given name.
30
30
  */
31
- callback() {
31
+ async callback() {
32
32
  if (this._mapName) {
33
- this._app.maps.setActiveMap(this._mapName).catch((error) => {
33
+ try {
34
+ await this._app.maps.setActiveMap(this._mapName);
35
+ } catch (error) {
34
36
  getLogger(ActivateMapCallback.className).error(
35
37
  `Failed to activate map "${this._mapName}":`,
36
38
  error,
37
39
  );
38
- });
40
+ }
39
41
  }
40
42
  }
41
43