@vcmap/ui 5.0.0 → 5.0.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 (31) hide show
  1. package/config/base.config.json +10 -0
  2. package/config/www.config.json +57 -15
  3. package/dist/assets/cesium.js +1 -1
  4. package/dist/assets/{core.306872.js → core.860907.js} +7 -7
  5. package/dist/assets/core.js +1 -1
  6. package/dist/assets/index-f265c560.js +1 -0
  7. package/dist/assets/ol.js +1 -1
  8. package/dist/assets/{ui.e84ce9.css → ui.7758a8.css} +1 -1
  9. package/dist/assets/{ui.e84ce9.js → ui.7758a8.js} +4761 -4340
  10. package/dist/assets/ui.js +1 -1
  11. package/dist/assets/vue.js +2 -2
  12. package/dist/assets/{vuetify.008fac.js → vuetify.2818ff.js} +1 -1
  13. package/dist/assets/vuetify.js +2 -2
  14. package/dist/index.html +1 -1
  15. package/package.json +6 -6
  16. package/plugins/@vcmap-show-case/table-example/src/DataTableExample.vue +5 -0
  17. package/src/actions/StyleSelector.vue +24 -9
  18. package/src/actions/actionHelper.js +19 -1
  19. package/src/components/lists/VcsList.vue +5 -2
  20. package/src/components/lists/VcsTreeview.vue +6 -6
  21. package/src/components/style/VcsImageSelector.vue +423 -14
  22. package/src/components/tables/VcsDataTable.vue +29 -1
  23. package/src/manager/buttonManager.js +3 -1
  24. package/src/manager/toolbox/toolboxManager.js +5 -2
  25. package/src/manager/window/windowManager.js +4 -1
  26. package/src/navigation/MapNavigation.vue +31 -46
  27. package/dist/assets/index-cfed33b1.js +0 -1
  28. /package/dist/assets/{cesium.4137c8.js → cesium.888ef7.js} +0 -0
  29. /package/dist/assets/{ol.328bbf.js → ol.5e8a90.js} +0 -0
  30. /package/dist/assets/{vue.1c8696.js → vue.9771b3.js} +0 -0
  31. /package/dist/assets/{vuetify.008fac.css → vuetify.2818ff.css} +0 -0
@@ -40,10 +40,7 @@
40
40
  import { computed, inject, ref, reactive, onUnmounted } from 'vue';
41
41
  import { ObliqueMap, CesiumMap } from '@vcmap/core';
42
42
  import { VContainer, VRow } from 'vuetify/lib';
43
- import {
44
- createGoToViewpointAction,
45
- createOverviewMapAction,
46
- } from '../actions/actionHelper.js';
43
+ import { createOverviewMapAction } from '../actions/actionHelper.js';
47
44
  import {
48
45
  getWindowComponentOptions,
49
46
  overviewMapLayerSymbol,
@@ -55,24 +52,24 @@
55
52
  import OrientationToolsButton from './OrientationToolsButton.vue';
56
53
 
57
54
  /**
58
- * @description Creates a go-to viewpoint action from a startingViewpointName defined in a module
55
+ * @description Creates a go-to viewpoint action from a startingViewpointName defined in a module. If no startingViewpointName is defined, uses default map view as fallback.
59
56
  * @param {VcsUiApp} app
60
- * @returns {{action: import("vue").Reactive<{}>, destroy: function():void}}
57
+ * @returns {{ action: import("vue").Reactive<VcsAction>, destroy: function():void }}
61
58
  */
62
59
  function setupHomeButton(app) {
63
- const initialAction = {
64
- icon: undefined,
65
- title: undefined,
66
- active: undefined,
67
- callback: undefined,
68
- };
69
- const action = reactive({ ...initialAction });
70
- /**
71
- * Gets the starting viewpoint of the last added module, where a startingViewpointName was defined
72
- * and sets it on the home button action.
73
- */
74
- const updateStartingViewpoint = () => {
75
- let viewpoint = null;
60
+ let defaultViewpoint;
61
+ let listener;
62
+ if (app.maps.activeMap) {
63
+ defaultViewpoint = app.maps.activeMap?.getViewpointSync();
64
+ } else {
65
+ listener = app.maps.mapActivated.addEventListener((map) => {
66
+ defaultViewpoint = map.getViewpointSync();
67
+ listener();
68
+ });
69
+ }
70
+
71
+ const getStartingViewpoint = () => {
72
+ let viewpoint;
76
73
  for (let idx = app.modules.length - 1; idx >= 0; idx--) {
77
74
  const { startingViewpointName } = app.modules[idx].config;
78
75
  if (
@@ -83,35 +80,21 @@
83
80
  break;
84
81
  }
85
82
  }
86
- if (!viewpoint) {
87
- Object.assign(action, { ...initialAction });
88
- } else {
89
- Object.assign(
90
- action,
91
- createGoToViewpointAction(
92
- {
93
- name: 'home-action',
94
- title: 'navigation.homeButton',
95
- icon: '$vcsHomePoint',
96
- },
97
- viewpoint,
98
- app.viewpoints,
99
- app.maps,
100
- ),
101
- );
102
- }
83
+ return viewpoint;
103
84
  };
104
85
 
105
- const listener = [
106
- app.moduleAdded.addEventListener(updateStartingViewpoint),
107
- app.moduleRemoved.addEventListener(updateStartingViewpoint),
108
- ];
109
-
110
- const destroy = () => {
111
- listener.forEach((cb) => cb());
112
- };
86
+ const action = reactive({
87
+ name: 'home-action',
88
+ title: 'navigation.homeButton',
89
+ icon: '$vcsHomePoint',
90
+ async callback() {
91
+ await app.maps.activeMap?.gotoViewpoint(
92
+ getStartingViewpoint() || defaultViewpoint,
93
+ );
94
+ },
95
+ });
113
96
 
114
- return { action, destroy };
97
+ return { action, destroy: () => listener?.() };
115
98
  }
116
99
 
117
100
  /**
@@ -241,9 +224,11 @@
241
224
  if (overviewDestroy) {
242
225
  overviewDestroy();
243
226
  }
227
+ if (homeDestroy) {
228
+ homeDestroy();
229
+ }
244
230
  postRenderHandler();
245
231
  overviewMapListeners.forEach((cb) => cb());
246
- homeDestroy();
247
232
  });
248
233
 
249
234
  return {
@@ -1 +0,0 @@
1
- import{initAppFromAppConfig as p}from"./ui.e84ce9.js";p("#app","app.config.json");
File without changes
File without changes