@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.
- package/README.md +12 -5
- package/build/build.js +6 -3
- package/build/buildHelpers.js +12 -4
- package/build/buildPreview.js +7 -0
- package/build/getPluginProxies.js +4 -0
- package/config/aerowest.config.json +13 -3
- package/config/base.config.json +398 -219
- package/config/codes.config.json +397 -0
- package/config/dev.config.json +375 -1
- package/config/graphFeatureInfo.config.json +100 -0
- package/config/www.config.json +1232 -0
- package/dist/assets/{cesium.eb5667.js → cesium.21663e.js} +0 -0
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/core.63242d.js +4 -0
- package/dist/assets/core.js +1 -1
- package/dist/assets/font/OFL.txt +93 -0
- package/dist/assets/font/TitilliumWeb-Regular.woff2 +0 -0
- package/dist/assets/{index.4ccd4433.js → index.44b91cfe.js} +1 -1
- package/dist/assets/{ol.ef03b1.js → ol.88ba9d.js} +0 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui.3c2933.css +1 -0
- package/dist/assets/ui.3c2933.js +71 -0
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.c897fc.js +9 -0
- package/dist/assets/vue.js +2 -1
- package/dist/assets/{vuetify.401a29.css → vuetify.147c3a.css} +1 -1
- package/dist/assets/{vuetify.401a29.js → vuetify.147c3a.js} +72 -72
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -5
- package/index.js +39 -5
- package/lib/vue.js +1 -0
- package/map.config.json +15 -6
- package/package.json +17 -8
- package/plugins/@vcmap/create-link/fallbackCreateLink.vue +71 -0
- package/plugins/@vcmap/create-link/index.js +83 -0
- package/plugins/@vcmap/create-link/package.json +6 -0
- package/plugins/@vcmap/pluginExample/index.js +2 -2
- package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +20 -3
- package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +1 -1
- package/plugins/@vcmap/project-selector/index.js +1 -1
- package/plugins/@vcmap/project-selector/package.json +1 -2
- package/plugins/@vcmap/theme-changer/ThemeChangerComponent.vue +1 -1
- package/plugins/@vcmap/theme-changer/index.js +1 -1
- package/plugins/@vcmap/theme-changer/package.json +1 -2
- package/plugins/categoryTest/Categories.vue +89 -1
- package/plugins/categoryTest/Category.vue +1 -1
- package/plugins/example/index.js +10 -23
- package/plugins/simple-graph/README.md +51 -0
- package/plugins/simple-graph/SimpleGraphComponent.vue +70 -0
- package/plugins/simple-graph/index.js +17 -0
- package/plugins/simple-graph/package.json +11 -0
- package/plugins/simple-graph/simpleGraphView.js +76 -0
- package/plugins/test/editor.vue +1 -1
- package/plugins/test/index.js +76 -9
- package/plugins/test/toolbox-data.js +82 -57
- package/plugins/test/windowManagerExample.vue +1 -1
- package/src/actions/stateRefAction.js +2 -2
- package/src/actions/styleSelector.vue +1 -1
- package/src/application/Navbar.vue +13 -2
- package/src/application/VcsApp.vue +301 -116
- package/src/application/VcsMap.vue +1 -1
- package/src/application/VcsSettings.vue +1 -1
- package/src/application/vcsAppWrapper.vue +1 -0
- package/src/assets/font/OFL.txt +93 -0
- package/src/assets/font/TitilliumWeb-Regular.woff2 +0 -0
- package/src/components/form-inputs-controls/VcsCheckbox.vue +13 -0
- package/src/components/form-inputs-controls/VcsColorPicker.vue +1 -1
- package/src/components/form-inputs-controls/VcsRadio.vue +123 -0
- package/src/components/form-output/VcsFormattedNumber.vue +1 -1
- package/src/components/lists/VcsActionList.vue +22 -7
- package/src/components/lists/VcsTreeview.vue +4 -4
- package/src/components/lists/VcsTreeviewLeaf.vue +10 -3
- package/src/components/lists/VcsTreeviewSearchbar.vue +1 -2
- package/src/components/tables/VcsTable.vue +245 -0
- package/src/contentTree/LayerTree.vue +1 -1
- package/src/contentTree/contentTreeCollection.js +4 -4
- package/src/contentTree/contentTreeItem.js +9 -9
- package/src/contentTree/groupContentTreeItem.js +1 -1
- package/src/contentTree/layerContentTreeItem.js +15 -1
- package/src/contentTree/layerGroupContentTreeItem.js +21 -1
- package/src/contentTree/nodeContentTreeItem.js +1 -1
- package/src/featureInfo/AddressBalloonComponent.vue +47 -0
- package/src/featureInfo/BalloonComponent.vue +140 -0
- package/src/featureInfo/abstractFeatureInfoView.js +313 -0
- package/src/featureInfo/addressBalloonFeatureInfoView.js +118 -0
- package/src/featureInfo/balloonFeatureInfoView.js +151 -0
- package/src/featureInfo/balloonHelper.js +132 -0
- package/src/featureInfo/featureInfo.js +457 -0
- package/src/featureInfo/featureInfoInteraction.js +42 -0
- package/src/featureInfo/iframeFeatureInfoView.js +95 -0
- package/src/featureInfo/tableFeatureInfoView.js +106 -0
- package/src/i18n/de.js +26 -0
- package/src/i18n/en.js +26 -0
- package/src/i18n/i18nCollection.js +17 -0
- package/src/icons/+all.js +80 -0
- package/src/icons/ClippingHorizontalIcon.vue +7 -0
- package/src/icons/ClippingIcon.vue +7 -0
- package/src/icons/ClippingVerticalIcon.vue +7 -0
- package/src/icons/ColorPickerIcon.vue +7 -0
- package/src/icons/ComponentsIcon.vue +2 -2
- package/src/icons/DimensionsHouseIcon.vue +11 -9
- package/src/icons/EditIcon.vue +7 -0
- package/src/icons/GlobalTerrainIcon.vue +9 -0
- package/src/icons/GroundIcon.vue +18 -0
- package/src/icons/HideIcon.vue +12 -0
- package/src/icons/LogoutIcon.vue +7 -0
- package/src/icons/ObjectAttributeIcon.vue +2 -13
- package/src/icons/PedestrianIcon.vue +2 -3
- package/src/icons/PenIcon.vue +2 -9
- package/src/icons/PoiIcon.vue +5 -2
- package/src/icons/PointSelectIcon.vue +4 -2
- package/src/icons/QueryIcon.vue +6 -7
- package/src/icons/ScreenshotIcon.vue +16 -0
- package/src/icons/ShareIcon.vue +4 -16
- package/src/icons/SkipNextIcon.vue +3 -1
- package/src/icons/TerrainBoxIcon.vue +9 -0
- package/src/icons/ToolsIcon.vue +4 -30
- package/src/icons/UploadIcon.vue +2 -9
- package/src/icons/UserProfileIcon.vue +7 -0
- package/src/icons/UserShareIcon.vue +7 -0
- package/src/icons/VideoRecorderIcon.vue +5 -9
- package/src/icons/ViewpointFlightIcon.vue +11 -0
- package/src/icons/ViewpointIcon.vue +11 -0
- package/src/icons/Viewshed360Icon.vue +7 -0
- package/src/icons/ViewshedConeIcon.vue +7 -0
- package/src/icons/ViewshedIcon.vue +7 -0
- package/src/icons/WallIcon.vue +4 -9
- package/src/legend/legendHelper.js +193 -0
- package/src/legend/styleLegendItem.vue +129 -0
- package/src/legend/vcsLegend.vue +92 -0
- package/src/manager/buttonManager.js +7 -12
- package/src/manager/categoryManager/ComponentsManager.vue +30 -0
- package/src/manager/categoryManager/categoryManager.js +500 -0
- package/src/manager/contextMenu/contextMenuComponent.vue +43 -0
- package/src/manager/contextMenu/contextMenuInteraction.js +42 -0
- package/src/manager/contextMenu/contextMenuManager.js +197 -0
- package/src/manager/navbarManager.js +9 -9
- package/src/manager/toolbox/GroupToolboxComponent.vue +118 -0
- package/src/manager/toolbox/SelectToolboxComponent.vue +128 -0
- package/src/manager/toolbox/ToolboxManager.vue +116 -98
- package/src/manager/toolbox/toolboxManager.js +235 -86
- package/src/manager/window/WindowComponent.vue +1 -1
- package/src/manager/window/WindowManager.vue +5 -3
- package/src/manager/window/windowManager.js +118 -14
- package/src/navigation/mapNavigation.vue +3 -5
- package/src/navigation/overviewMap.js +28 -5
- package/src/navigation/vcsCompass.vue +1 -1
- package/src/pluginHelper.js +42 -10
- package/src/setup.js +0 -2
- package/src/state.js +256 -0
- package/src/styles/_theming.scss +0 -5
- package/src/styles/variables.scss +7 -0
- package/src/styles/vcsFont.scss +17 -0
- package/src/uiConfig.js +79 -0
- package/src/vcsUiApp.js +213 -22
- package/src/vuePlugins/vuetify.js +14 -4
- package/config/berlin.config.json +0 -510
- package/dist/assets/core.216494.js +0 -4
- package/dist/assets/ui.99a1a7.css +0 -1
- package/dist/assets/ui.99a1a7.js +0 -70
- package/dist/assets/vue-composition-api.c5aca1.js +0 -14
- package/dist/assets/vue-composition-api.js +0 -2
- package/dist/assets/vue.762edd.js +0 -9
- package/lib/vue-composition-api.js +0 -2
- 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
|
+
}
|