@vcmap/ui 5.0.0-rc.10 → 5.0.0-rc.13

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 (165) hide show
  1. package/README.md +12 -5
  2. package/build/build.js +6 -3
  3. package/build/buildHelpers.js +12 -4
  4. package/build/buildPreview.js +7 -0
  5. package/build/getPluginProxies.js +4 -0
  6. package/config/aerowest.config.json +13 -3
  7. package/config/base.config.json +398 -219
  8. package/config/codes.config.json +397 -0
  9. package/config/dev.config.json +375 -1
  10. package/config/graphFeatureInfo.config.json +100 -0
  11. package/config/www.config.json +1232 -0
  12. package/dist/assets/{cesium.eb5667.js → cesium.21663e.js} +0 -0
  13. package/dist/assets/cesium.js +1 -1
  14. package/dist/assets/core.63242d.js +4 -0
  15. package/dist/assets/core.js +1 -1
  16. package/dist/assets/font/OFL.txt +93 -0
  17. package/dist/assets/font/TitilliumWeb-Regular.woff2 +0 -0
  18. package/dist/assets/{index.4ccd4433.js → index.44b91cfe.js} +1 -1
  19. package/dist/assets/{ol.ef03b1.js → ol.88ba9d.js} +0 -0
  20. package/dist/assets/ol.js +1 -1
  21. package/dist/assets/ui.3c2933.css +1 -0
  22. package/dist/assets/ui.3c2933.js +71 -0
  23. package/dist/assets/ui.js +1 -1
  24. package/dist/assets/vue.c897fc.js +9 -0
  25. package/dist/assets/vue.js +2 -1
  26. package/dist/assets/{vuetify.401a29.css → vuetify.147c3a.css} +1 -1
  27. package/dist/assets/{vuetify.401a29.js → vuetify.147c3a.js} +72 -72
  28. package/dist/assets/vuetify.js +2 -2
  29. package/dist/index.html +1 -5
  30. package/index.js +39 -5
  31. package/lib/vue.js +1 -0
  32. package/map.config.json +15 -6
  33. package/package.json +17 -8
  34. package/plugins/@vcmap/create-link/fallbackCreateLink.vue +71 -0
  35. package/plugins/@vcmap/create-link/index.js +83 -0
  36. package/plugins/@vcmap/create-link/package.json +6 -0
  37. package/plugins/@vcmap/pluginExample/index.js +2 -2
  38. package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +20 -3
  39. package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +1 -1
  40. package/plugins/@vcmap/project-selector/index.js +1 -1
  41. package/plugins/@vcmap/project-selector/package.json +1 -2
  42. package/plugins/@vcmap/theme-changer/ThemeChangerComponent.vue +1 -1
  43. package/plugins/@vcmap/theme-changer/index.js +1 -1
  44. package/plugins/@vcmap/theme-changer/package.json +1 -2
  45. package/plugins/categoryTest/Categories.vue +89 -1
  46. package/plugins/categoryTest/Category.vue +1 -1
  47. package/plugins/example/index.js +10 -23
  48. package/plugins/simple-graph/README.md +51 -0
  49. package/plugins/simple-graph/SimpleGraphComponent.vue +70 -0
  50. package/plugins/simple-graph/index.js +17 -0
  51. package/plugins/simple-graph/package.json +11 -0
  52. package/plugins/simple-graph/simpleGraphView.js +76 -0
  53. package/plugins/test/editor.vue +1 -1
  54. package/plugins/test/index.js +76 -9
  55. package/plugins/test/toolbox-data.js +82 -57
  56. package/plugins/test/windowManagerExample.vue +1 -1
  57. package/src/actions/stateRefAction.js +2 -2
  58. package/src/actions/styleSelector.vue +1 -1
  59. package/src/application/Navbar.vue +13 -2
  60. package/src/application/VcsApp.vue +301 -116
  61. package/src/application/VcsMap.vue +1 -1
  62. package/src/application/VcsSettings.vue +1 -1
  63. package/src/application/vcsAppWrapper.vue +1 -0
  64. package/src/assets/font/OFL.txt +93 -0
  65. package/src/assets/font/TitilliumWeb-Regular.woff2 +0 -0
  66. package/src/components/form-inputs-controls/VcsCheckbox.vue +13 -0
  67. package/src/components/form-inputs-controls/VcsColorPicker.vue +1 -1
  68. package/src/components/form-inputs-controls/VcsRadio.vue +123 -0
  69. package/src/components/form-output/VcsFormattedNumber.vue +1 -1
  70. package/src/components/lists/VcsActionList.vue +22 -7
  71. package/src/components/lists/VcsTreeview.vue +4 -4
  72. package/src/components/lists/VcsTreeviewLeaf.vue +10 -3
  73. package/src/components/lists/VcsTreeviewSearchbar.vue +1 -2
  74. package/src/components/tables/VcsTable.vue +245 -0
  75. package/src/contentTree/LayerTree.vue +1 -1
  76. package/src/contentTree/contentTreeCollection.js +4 -4
  77. package/src/contentTree/contentTreeItem.js +9 -9
  78. package/src/contentTree/groupContentTreeItem.js +1 -1
  79. package/src/contentTree/layerContentTreeItem.js +15 -1
  80. package/src/contentTree/layerGroupContentTreeItem.js +21 -1
  81. package/src/contentTree/nodeContentTreeItem.js +1 -1
  82. package/src/featureInfo/AddressBalloonComponent.vue +47 -0
  83. package/src/featureInfo/BalloonComponent.vue +140 -0
  84. package/src/featureInfo/abstractFeatureInfoView.js +313 -0
  85. package/src/featureInfo/addressBalloonFeatureInfoView.js +118 -0
  86. package/src/featureInfo/balloonFeatureInfoView.js +151 -0
  87. package/src/featureInfo/balloonHelper.js +132 -0
  88. package/src/featureInfo/featureInfo.js +457 -0
  89. package/src/featureInfo/featureInfoInteraction.js +42 -0
  90. package/src/featureInfo/iframeFeatureInfoView.js +95 -0
  91. package/src/featureInfo/tableFeatureInfoView.js +106 -0
  92. package/src/i18n/de.js +26 -0
  93. package/src/i18n/en.js +26 -0
  94. package/src/i18n/i18nCollection.js +17 -0
  95. package/src/icons/+all.js +80 -0
  96. package/src/icons/ClippingHorizontalIcon.vue +7 -0
  97. package/src/icons/ClippingIcon.vue +7 -0
  98. package/src/icons/ClippingVerticalIcon.vue +7 -0
  99. package/src/icons/ColorPickerIcon.vue +7 -0
  100. package/src/icons/ComponentsIcon.vue +2 -2
  101. package/src/icons/DimensionsHouseIcon.vue +11 -9
  102. package/src/icons/EditIcon.vue +7 -0
  103. package/src/icons/GlobalTerrainIcon.vue +9 -0
  104. package/src/icons/GroundIcon.vue +18 -0
  105. package/src/icons/HideIcon.vue +12 -0
  106. package/src/icons/LogoutIcon.vue +7 -0
  107. package/src/icons/ObjectAttributeIcon.vue +2 -13
  108. package/src/icons/PedestrianIcon.vue +2 -3
  109. package/src/icons/PenIcon.vue +2 -9
  110. package/src/icons/PoiIcon.vue +5 -2
  111. package/src/icons/PointSelectIcon.vue +4 -2
  112. package/src/icons/QueryIcon.vue +6 -7
  113. package/src/icons/ScreenshotIcon.vue +16 -0
  114. package/src/icons/ShareIcon.vue +4 -16
  115. package/src/icons/SkipNextIcon.vue +3 -1
  116. package/src/icons/TerrainBoxIcon.vue +9 -0
  117. package/src/icons/ToolsIcon.vue +4 -30
  118. package/src/icons/UploadIcon.vue +2 -9
  119. package/src/icons/UserProfileIcon.vue +7 -0
  120. package/src/icons/UserShareIcon.vue +7 -0
  121. package/src/icons/VideoRecorderIcon.vue +5 -9
  122. package/src/icons/ViewpointFlightIcon.vue +11 -0
  123. package/src/icons/ViewpointIcon.vue +11 -0
  124. package/src/icons/Viewshed360Icon.vue +7 -0
  125. package/src/icons/ViewshedConeIcon.vue +7 -0
  126. package/src/icons/ViewshedIcon.vue +7 -0
  127. package/src/icons/WallIcon.vue +4 -9
  128. package/src/legend/legendHelper.js +193 -0
  129. package/src/legend/styleLegendItem.vue +129 -0
  130. package/src/legend/vcsLegend.vue +92 -0
  131. package/src/manager/buttonManager.js +7 -12
  132. package/src/manager/categoryManager/ComponentsManager.vue +30 -0
  133. package/src/manager/categoryManager/categoryManager.js +500 -0
  134. package/src/manager/contextMenu/contextMenuComponent.vue +43 -0
  135. package/src/manager/contextMenu/contextMenuInteraction.js +42 -0
  136. package/src/manager/contextMenu/contextMenuManager.js +197 -0
  137. package/src/manager/navbarManager.js +9 -9
  138. package/src/manager/toolbox/GroupToolboxComponent.vue +118 -0
  139. package/src/manager/toolbox/SelectToolboxComponent.vue +128 -0
  140. package/src/manager/toolbox/ToolboxManager.vue +116 -98
  141. package/src/manager/toolbox/toolboxManager.js +235 -86
  142. package/src/manager/window/WindowComponent.vue +1 -1
  143. package/src/manager/window/WindowManager.vue +5 -3
  144. package/src/manager/window/windowManager.js +118 -14
  145. package/src/navigation/mapNavigation.vue +3 -5
  146. package/src/navigation/overviewMap.js +28 -5
  147. package/src/navigation/vcsCompass.vue +1 -1
  148. package/src/pluginHelper.js +42 -10
  149. package/src/setup.js +0 -2
  150. package/src/state.js +256 -0
  151. package/src/styles/_theming.scss +0 -5
  152. package/src/styles/variables.scss +7 -0
  153. package/src/styles/vcsFont.scss +17 -0
  154. package/src/uiConfig.js +79 -0
  155. package/src/vcsUiApp.js +213 -22
  156. package/src/vuePlugins/vuetify.js +14 -4
  157. package/config/berlin.config.json +0 -510
  158. package/dist/assets/core.216494.js +0 -4
  159. package/dist/assets/ui.99a1a7.css +0 -1
  160. package/dist/assets/ui.99a1a7.js +0 -70
  161. package/dist/assets/vue-composition-api.c5aca1.js +0 -14
  162. package/dist/assets/vue-composition-api.js +0 -2
  163. package/dist/assets/vue.762edd.js +0 -9
  164. package/lib/vue-composition-api.js +0 -2
  165. package/src/manager/toolbox/ToolboxGroupComponent.vue +0 -128
@@ -0,0 +1,151 @@
1
+ import { Feature } from 'ol';
2
+ import { getCenter } from 'ol/extent.js';
3
+ import { Cartographic, Entity, Math as CesiumMath } from '@vcmap/cesium';
4
+ import { Projection } from '@vcmap/core';
5
+ import { check } from '@vcsuite/check';
6
+ import AbstractFeatureInfoView from './abstractFeatureInfoView.js';
7
+ import { getWindowPositionOptions, WindowAlignment, WindowSlot } from '../manager/window/windowManager.js';
8
+ import BalloonComponent from './BalloonComponent.vue';
9
+ import { balloonOffset } from './balloonHelper.js';
10
+
11
+ /**
12
+ * derive value from attributes
13
+ * @param {string} key - key or nested key
14
+ * @param {Object} attrs
15
+ * @param {string|null} [defaultValue]
16
+ * @returns {string|null}
17
+ */
18
+ export function extractNestedKey(key, attrs, defaultValue = null) {
19
+ check(key, String);
20
+ check(attrs, Object);
21
+
22
+ const keys = key.split('.');
23
+ const derivedValue = keys.reduce((obj, prop) => (obj[prop] || {}), attrs);
24
+ return typeof derivedValue === 'string' ? derivedValue : defaultValue;
25
+ }
26
+
27
+ /**
28
+ * @typedef {FeatureInfoViewOptions} BalloonFeatureInfoViewOptions
29
+ * @property {string} [title] - optional title to overwrite default (layerName). Can be attribute key (nested key using '.'), i18n key or text
30
+ * @property {string} [subtitle] - optional window title to overwrite default (featureId). Can be attribute key (nested key using '.'), i18n key or text
31
+ */
32
+
33
+ /**
34
+ * @typedef {FeatureInfoProps} BalloonFeatureInfoViewProps
35
+ * @property {string} title
36
+ * @property {string} subtitle
37
+ * @property {import("ol/coordinate").Coordinate} position
38
+ */
39
+
40
+ /**
41
+ * @param {import("@vcmap/core").Cartesian3} cartesian
42
+ * @returns {import("ol/coordinate").Coordinate}
43
+ */
44
+ function cartesian3ToCoordinate(cartesian) {
45
+ const cartographic = Cartographic.fromCartesian(cartesian);
46
+ const wgs84position = [
47
+ CesiumMath.toDegrees(cartographic.longitude),
48
+ CesiumMath.toDegrees(cartographic.latitude),
49
+ cartographic.height,
50
+ ];
51
+ return Projection.wgs84ToMercator(wgs84position);
52
+ }
53
+
54
+ /**
55
+ * @param {FeatureType} feature
56
+ * @returns {import("ol/coordinate").Coordinate|null}
57
+ */
58
+ function getPositionFromFeature(feature) {
59
+ if (feature instanceof Feature && feature.getGeometry()) {
60
+ return getCenter(feature.getGeometry().getExtent());
61
+ } else if (feature instanceof Entity) {
62
+ return cartesian3ToCoordinate(feature.position);
63
+ } else if (feature?.primitive?.boundingSphere?.center) {
64
+ return cartesian3ToCoordinate(feature.primitive.boundingSphere.center);
65
+ }
66
+ return null;
67
+ }
68
+
69
+ /**
70
+ * @class
71
+ * @description An balloon view.
72
+ * @extends {AbstractFeatureInfoView}
73
+ */
74
+ class BalloonFeatureInfoView extends AbstractFeatureInfoView {
75
+ /**
76
+ * @type {string}
77
+ */
78
+ static get className() { return 'BalloonFeatureInfoView'; }
79
+
80
+ /**
81
+ * @param {BalloonFeatureInfoViewOptions} options
82
+ * @param {import("vue").Component} [component=BalloonComponent]
83
+ */
84
+ constructor(options, component) {
85
+ super(options, component || BalloonComponent);
86
+
87
+ /**
88
+ * @type {string}
89
+ */
90
+ this.title = options.title;
91
+
92
+ /**
93
+ * @type {string}
94
+ */
95
+ this.subtitle = options.subtitle;
96
+ }
97
+
98
+ /**
99
+ * @param {FeatureInfoEvent} featureInfo
100
+ * @param {import("@vcmap/core").Layer} layer
101
+ * @returns {BalloonFeatureInfoViewProps}
102
+ */
103
+ getProperties(featureInfo, layer) {
104
+ const properties = super.getProperties(featureInfo, layer);
105
+ return {
106
+ ...properties,
107
+ position: featureInfo.position ?? getPositionFromFeature(featureInfo.feature),
108
+ title: this.title ?
109
+ extractNestedKey(this.title, properties.attributes, this.title) :
110
+ properties.layerProperties.title,
111
+ subtitle: this.subtitle ?
112
+ extractNestedKey(this.subtitle, properties.attributes, this.subtitle) :
113
+ properties.featureId,
114
+ };
115
+ }
116
+
117
+ /**
118
+ * @param {FeatureInfoEvent} featureInfo
119
+ * @param {import("@vcmap/core").Layer} layer
120
+ * @returns {WindowComponentOptions}
121
+ */
122
+ getWindowComponentOptions(featureInfo, layer) {
123
+ const options = super.getWindowComponentOptions(featureInfo, layer);
124
+ options.state.hideHeader = true;
125
+ options.state.classes = ['balloon'];
126
+ options.slot = WindowSlot.DETACHED;
127
+ options.position = getWindowPositionOptions(
128
+ (featureInfo.windowPosition?.[0] ?? 0) - balloonOffset.x, // if we do not have a windowPosition, let the next render handle it
129
+ (featureInfo.windowPosition?.[1] ?? 0) - balloonOffset.y,
130
+ null,
131
+ WindowAlignment.BOTTOM_LEFT,
132
+ );
133
+ return options;
134
+ }
135
+
136
+ /**
137
+ * @returns {BalloonFeatureInfoViewOptions}
138
+ */
139
+ toJSON() {
140
+ const config = super.toJSON();
141
+ if (this.title) {
142
+ config.title = this.title;
143
+ }
144
+ if (this.subtitle) {
145
+ config.subtitle = this.subtitle;
146
+ }
147
+ return config;
148
+ }
149
+ }
150
+
151
+ export default BalloonFeatureInfoView;
@@ -0,0 +1,132 @@
1
+ import { Cartesian2, Cartographic, SceneTransforms } from '@vcmap/cesium';
2
+ import { CesiumMap, ObliqueMap, OpenlayersMap, Projection, transformToImage } from '@vcmap/core';
3
+ import { unByKey } from 'ol/Observable.js';
4
+ import {
5
+ getWindowPositionOptionsFromMapEvent,
6
+ WindowAlignment,
7
+ } from '../manager/window/windowManager.js';
8
+
9
+ /**
10
+ * balloon offset from location or click position in pixel
11
+ * @type {{x: number, y: number}}
12
+ */
13
+ export const balloonOffset = { x: 55, y: 25 };
14
+
15
+ /**
16
+ * @param {import("@vcmap/cesium").Scene} scene
17
+ * @param {import("@vcmap/cesium").Cartesian3} cartesian
18
+ * @returns {undefined|import("@vcmap/cesium").Cartesian2}
19
+ */
20
+ function getBalloonPositionCesium(scene, cartesian) {
21
+ return SceneTransforms.wgs84ToWindowCoordinates(scene, cartesian);
22
+ }
23
+
24
+ /**
25
+ * @param {import("@vcmap/core").OpenlayersMap} olMap
26
+ * @param {import("ol/coordinate").Coordinate} position
27
+ * @returns {undefined|import("@vcmap/cesium").Cartesian2}
28
+ */
29
+ function getBalloonPositionOL(olMap, position) {
30
+ const pixel = olMap.getPixelFromCoordinate(position);
31
+ if (pixel) {
32
+ return new Cartesian2(...pixel);
33
+ }
34
+ return undefined;
35
+ }
36
+
37
+ /**
38
+ * returns the windowPosition of a balloon from a map position
39
+ * @param {VcsApp} app
40
+ * @param {import("ol/coordinate").Coordinate} position - position in mercator
41
+ * @returns {Promise<undefined|Cartesian2>}
42
+ */
43
+ export async function getBalloonPosition(app, position) {
44
+ const map = app.maps.activeMap;
45
+ if (map instanceof CesiumMap) {
46
+ const wgs84Position = Projection.mercatorToWgs84(position);
47
+ const cartesian = Cartographic.toCartesian(Cartographic.fromDegrees(...wgs84Position));
48
+ return getBalloonPositionCesium(map.getScene(), cartesian);
49
+ } else if (map instanceof OpenlayersMap) {
50
+ return getBalloonPositionOL(map.olMap, position);
51
+ } else if (map instanceof ObliqueMap) {
52
+ const { coords } = await transformToImage(
53
+ map.currentImage,
54
+ position,
55
+ );
56
+ return getBalloonPositionOL(map.olMap, coords);
57
+ }
58
+ return undefined;
59
+ }
60
+
61
+ /**
62
+ * sets the windowPosition of a balloon
63
+ * @param {WindowManager} windowManager
64
+ * @param {string} id - windowId of balloon
65
+ * @param {import("@vcmap/cesium").Cartesian2|undefined} windowPosition
66
+ */
67
+ export function setBalloonPosition(windowManager, id, windowPosition) {
68
+ if (!windowPosition) {
69
+ return;
70
+ }
71
+ windowManager.setWindowPositionOptions(
72
+ id,
73
+ getWindowPositionOptionsFromMapEvent(
74
+ new Cartesian2(windowPosition.x - balloonOffset.x, windowPosition.y - balloonOffset.y),
75
+ WindowAlignment.BOTTOM_LEFT,
76
+ ),
77
+ );
78
+ }
79
+
80
+ /**
81
+ * @param {VcsApp} vcsApp
82
+ * @param {string} windowId
83
+ * @param {import("ol/coordinate").Coordinate} clickedPosition - position in mercator
84
+ * @returns {Promise<(() => void)>}
85
+ */
86
+ export async function setupBalloonPositionListener(vcsApp, windowId, clickedPosition) {
87
+ const listeners = [];
88
+
89
+ const destroy = () => {
90
+ listeners.forEach(cb => cb());
91
+ };
92
+
93
+ const setup = async (app, id, position) => {
94
+ destroy();
95
+
96
+ listeners.push(app.maps.mapActivated.addEventListener(
97
+ setup.bind(null, app, id, position),
98
+ ));
99
+
100
+ const map = app.maps.activeMap;
101
+ if (map instanceof CesiumMap) {
102
+ const wgs84Position = Projection.mercatorToWgs84(position);
103
+ const cartesian = Cartographic.toCartesian(Cartographic.fromDegrees(...wgs84Position));
104
+ listeners.push(map.getScene().postRender.addEventListener((scene) => {
105
+ setBalloonPosition(app.windowManager, windowId, getBalloonPositionCesium(scene, cartesian));
106
+ }));
107
+ } else if (map instanceof OpenlayersMap) {
108
+ const handler = () => setBalloonPosition(app.windowManager, windowId, getBalloonPositionOL(map.olMap, position));
109
+ const key = map.olMap.on(
110
+ 'postrender',
111
+ handler,
112
+ );
113
+ listeners.push(() => unByKey(key));
114
+ } else if (map instanceof ObliqueMap) {
115
+ const { coords } = await transformToImage(
116
+ map.currentImage,
117
+ position,
118
+ );
119
+ listeners.push(map.imageChanged.addEventListener(setup.bind(null, app, windowId, position)));
120
+ const handler = () => setBalloonPosition(app.windowManager, windowId, getBalloonPositionOL(map.olMap, coords));
121
+ const key = map.olMap.on(
122
+ 'postrender',
123
+ handler,
124
+ );
125
+ listeners.push(() => unByKey(key));
126
+ }
127
+ };
128
+
129
+ await setup(vcsApp, windowId, clickedPosition);
130
+
131
+ return destroy;
132
+ }