@vcmap/ui 5.1.7 → 5.2.0
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/build/buildTypes.js +9 -0
- package/config/base.config.json +33 -2
- package/config/dev.config.json +22 -2
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.42b085.js → core.627882.js} +4097 -3978
- package/dist/assets/core.js +1 -1
- package/dist/assets/index-76acacac.js +1 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/{ui.d91b1c.css → ui.895896.css} +2 -2
- package/dist/assets/{ui.d91b1c.js → ui.895896.js} +8629 -7658
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.be3c1c.js → vuetify.1621f3.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -1
- package/index.d.ts +16 -0
- package/index.js +23 -0
- package/package.json +2 -2
- package/plugins/@vcmap-show-case/collection-manager-example/src/CollectionManagerExample.vue +110 -37
- package/plugins/@vcmap-show-case/collection-manager-example/src/index.js +4 -0
- package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +10 -3
- package/plugins/@vcmap-show-case/panel-tester/README.md +3 -0
- package/plugins/@vcmap-show-case/panel-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/panel-tester/src/IframePanelExample.vue +15 -0
- package/plugins/@vcmap-show-case/panel-tester/src/ImgPanelExample.vue +19 -0
- package/plugins/@vcmap-show-case/panel-tester/src/PanelExample.vue +128 -0
- package/plugins/@vcmap-show-case/panel-tester/src/TextPanelExample.vue +34 -0
- package/plugins/@vcmap-show-case/panel-tester/src/index.js +63 -0
- package/src/actions/actionHelper.js +2 -2
- package/src/actions/flightActions.d.ts +38 -2
- package/src/actions/flightActions.js +257 -6
- package/src/application/VcsApp.vue +4 -104
- package/src/application/VcsApp.vue.d.ts +0 -6
- package/src/application/VcsContainer.vue +105 -0
- package/src/application/VcsContainer.vue.d.ts +14 -0
- package/src/application/VcsMainMap.vue +68 -0
- package/src/application/VcsMainMap.vue.d.ts +9 -0
- package/src/application/markdownHelper.d.ts +7 -0
- package/src/application/markdownHelper.js +57 -1
- package/src/components/form-inputs-controls/VcsRadioGrid.vue +27 -42
- package/src/contentTree/LayerTree.vue +40 -14
- package/src/downloadHelper.d.ts +0 -2
- package/src/downloadHelper.js +2 -4
- package/src/featureInfo/BalloonComponent.vue +31 -3
- package/src/featureInfo/BalloonComponent.vue.d.ts +1 -0
- package/src/featureInfo/MarkdownBalloonComponent.vue +24 -0
- package/src/featureInfo/MarkdownBalloonComponent.vue.d.ts +12 -0
- package/src/featureInfo/abstractFeatureInfoView.js +54 -22
- package/src/featureInfo/addressBalloonFeatureInfoView.d.ts +2 -2
- package/src/featureInfo/addressBalloonFeatureInfoView.js +1 -1
- package/src/featureInfo/balloonFeatureInfoView.js +1 -1
- package/src/featureInfo/balloonHelper.js +16 -9
- package/src/featureInfo/featureInfo.js +10 -0
- package/src/featureInfo/markdownBalloonFeatureInfoView.d.ts +47 -0
- package/src/featureInfo/markdownBalloonFeatureInfoView.js +81 -0
- package/src/featureInfo/markdownFeatureInfoView.d.ts +47 -0
- package/src/featureInfo/markdownFeatureInfoView.js +95 -0
- package/src/i18n/de.d.ts +8 -3
- package/src/i18n/de.js +3 -0
- package/src/i18n/en.d.ts +32 -26
- package/src/i18n/en.js +4 -1
- package/src/manager/collectionManager/CollectionComponent.vue +12 -49
- package/src/manager/collectionManager/CollectionComponent.vue.d.ts +5 -9
- package/src/manager/collectionManager/CollectionComponentContent.vue +102 -0
- package/src/manager/collectionManager/CollectionComponentContent.vue.d.ts +17 -0
- package/src/manager/collectionManager/CollectionComponentList.vue +10 -2
- package/src/manager/collectionManager/CollectionComponentList.vue.d.ts +9 -0
- package/src/manager/collectionManager/CollectionComponentStandalone.vue +91 -0
- package/src/manager/collectionManager/CollectionComponentStandalone.vue.d.ts +9 -0
- package/src/manager/collectionManager/collectionManager.d.ts +2 -2
- package/src/manager/collectionManager/collectionManager.js +21 -19
- package/src/manager/panel/PanelComponent.vue +110 -0
- package/src/manager/panel/PanelComponent.vue.d.ts +19 -0
- package/src/manager/panel/PanelManagerComponent.vue +224 -0
- package/src/manager/panel/PanelManagerComponent.vue.d.ts +36 -0
- package/src/manager/panel/panelHelper.d.ts +83 -0
- package/src/manager/panel/panelHelper.js +272 -0
- package/src/manager/panel/panelManager.d.ts +338 -0
- package/src/manager/panel/panelManager.js +381 -0
- package/src/manager/window/WindowManager.vue +14 -0
- package/src/manager/window/windowHelper.js +1 -1
- package/src/search/ResultItem.vue +1 -1
- package/src/search/search.d.ts +2 -2
- package/src/search/search.js +2 -2
- package/src/vcsUiApp.d.ts +14 -0
- package/src/vcsUiApp.js +18 -0
- package/dist/assets/index-c055a222.js +0 -1
- /package/dist/assets/{cesium.0b68c5.js → cesium.9e39f4.js} +0 -0
- /package/dist/assets/{ol.9e8753.js → ol.fe8c0e.js} +0 -0
- /package/dist/assets/{vue.33980b.js → vue.4b3319.js} +0 -0
- /package/dist/assets/{vuetify.be3c1c.css → vuetify.1621f3.css} +0 -0
@@ -0,0 +1,63 @@
|
|
1
|
+
import { ButtonLocation, createToggleAction } from '@vcmap/ui';
|
2
|
+
import packageJSON from '../package.json';
|
3
|
+
import panelExample from './PanelExample.vue';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @returns {VcsPlugin}
|
7
|
+
*/
|
8
|
+
export default async function panelTester() {
|
9
|
+
return {
|
10
|
+
get name() {
|
11
|
+
return packageJSON.name;
|
12
|
+
},
|
13
|
+
get version() {
|
14
|
+
return packageJSON.version;
|
15
|
+
},
|
16
|
+
get mapVersion() {
|
17
|
+
return packageJSON.mapVersion;
|
18
|
+
},
|
19
|
+
onVcsAppMounted(app) {
|
20
|
+
const { action, destroy } = createToggleAction(
|
21
|
+
{
|
22
|
+
name: 'Panel Tester',
|
23
|
+
},
|
24
|
+
{
|
25
|
+
id: 'panel-tester',
|
26
|
+
state: {
|
27
|
+
headerTitle: 'panelTester.title',
|
28
|
+
},
|
29
|
+
component: panelExample,
|
30
|
+
position: {
|
31
|
+
height: 200,
|
32
|
+
},
|
33
|
+
},
|
34
|
+
app.windowManager,
|
35
|
+
packageJSON.name,
|
36
|
+
);
|
37
|
+
app.navbarManager.add(
|
38
|
+
{ id: 'panel-tester', action },
|
39
|
+
packageJSON.name,
|
40
|
+
ButtonLocation.TOOL,
|
41
|
+
);
|
42
|
+
this._destroyAction = [destroy];
|
43
|
+
},
|
44
|
+
i18n: {
|
45
|
+
de: {
|
46
|
+
panelTester: {
|
47
|
+
title: 'Panel Tester',
|
48
|
+
},
|
49
|
+
},
|
50
|
+
en: {
|
51
|
+
panelTester: {
|
52
|
+
title: 'Panel Tester',
|
53
|
+
},
|
54
|
+
},
|
55
|
+
},
|
56
|
+
destroy() {
|
57
|
+
if (this._destroyActions) {
|
58
|
+
this._destroyActions.forEach((cb) => cb());
|
59
|
+
this._destroyActions = null;
|
60
|
+
}
|
61
|
+
},
|
62
|
+
};
|
63
|
+
}
|
@@ -82,7 +82,7 @@ export function createMapButtonAction(actionOptions, mapName, maps) {
|
|
82
82
|
},
|
83
83
|
};
|
84
84
|
const destroyListener = maps.mapActivated.addEventListener((map) => {
|
85
|
-
action.active = map
|
85
|
+
action.active = map?.name === mapName;
|
86
86
|
});
|
87
87
|
|
88
88
|
return { action, destroy: destroyListener };
|
@@ -178,7 +178,7 @@ export function createSearchButtonAction(app) {
|
|
178
178
|
);
|
179
179
|
destroyAction = action.destroy;
|
180
180
|
searchAction.value = reactive(action.action);
|
181
|
-
} else if (searchAction.value !== null) {
|
181
|
+
} else if (app.search.size === 0 && searchAction.value !== null) {
|
182
182
|
destroyAction();
|
183
183
|
destroyAction = () => {};
|
184
184
|
searchAction.value = null;
|
@@ -41,17 +41,53 @@ export function createFlightPlayerActions(app: import("../vcsUiApp.js").default,
|
|
41
41
|
destroy: (() => void);
|
42
42
|
actions: Array<import("./actionHelper.js").VcsAction>;
|
43
43
|
};
|
44
|
+
/**
|
45
|
+
* @param {import("../vcsUiApp.js").default} app
|
46
|
+
* @param {import("@vcmap/core").FlightInstance} instance
|
47
|
+
* @param {Array<import("./actionHelper.js").VcsAction>} actions
|
48
|
+
* @returns {(function(): void)}
|
49
|
+
*/
|
50
|
+
export function setupFlightListItemPlayer(app: import("../vcsUiApp.js").default, instance: import("@vcmap/core").FlightInstance, actions: Array<import("./actionHelper.js").VcsAction>): (() => void);
|
51
|
+
/**
|
52
|
+
*
|
53
|
+
* @param {import("../vcsUiApp.js").default} app
|
54
|
+
* @param {import("@vcmap/core").FlightInstance} instance
|
55
|
+
* @returns {{action: import("./actionHelper.js").VcsAction, destroy: function(): void}}
|
56
|
+
*/
|
57
|
+
export function createZoomToFlightAction(app: import("../vcsUiApp.js").default, instance: import("@vcmap/core").FlightInstance): {
|
58
|
+
action: import("./actionHelper.js").VcsAction;
|
59
|
+
destroy: () => void;
|
60
|
+
};
|
44
61
|
/**
|
45
62
|
*
|
46
63
|
* @param {import("../vcsUiApp.js").default} app
|
47
|
-
* @param {import("@vcmap/core").FlightInstance}
|
64
|
+
* @param {import("@vcmap/core").FlightInstance} instance
|
48
65
|
* @param {boolean} [active=true]
|
49
66
|
* @returns {Promise<{action: import("./actionHelper.js").VcsAction, destroy:()=>void}>}
|
50
67
|
*/
|
51
|
-
export function createFlightVisualizationAction(app: import("../vcsUiApp.js").default,
|
68
|
+
export function createFlightVisualizationAction(app: import("../vcsUiApp.js").default, instance: import("@vcmap/core").FlightInstance, active?: boolean | undefined): Promise<{
|
52
69
|
action: import("./actionHelper.js").VcsAction;
|
53
70
|
destroy: () => void;
|
54
71
|
}>;
|
72
|
+
/**
|
73
|
+
*
|
74
|
+
* @param {import("@vcmap/core").FlightInstance} instance
|
75
|
+
* @param {boolean} [isPathExport=false] - Set to true to export flight path. Per default flight is exported
|
76
|
+
* @returns {{action: import("./actionHelper.js").VcsAction, destroy: function(): void}}
|
77
|
+
*/
|
78
|
+
export function createExportFlightAction(instance: import("@vcmap/core").FlightInstance, isPathExport?: boolean | undefined): {
|
79
|
+
action: import("./actionHelper.js").VcsAction;
|
80
|
+
destroy: () => void;
|
81
|
+
};
|
82
|
+
/**
|
83
|
+
*
|
84
|
+
* @param {import("../vcsUiApp.js").default} app
|
85
|
+
* @param {File[]} files
|
86
|
+
* @param {string} [moduleId]
|
87
|
+
* @param {(imported:number[]) => void} [importSuccessCb] - An optional success cb providing the indices of app's flight collection for successful imported flight instances
|
88
|
+
* @returns {Promise<boolean>}
|
89
|
+
*/
|
90
|
+
export function importFlights(app: import("../vcsUiApp.js").default, files: File[], moduleId?: string | undefined, importSuccessCb?: ((imported: number[]) => void) | undefined): Promise<boolean>;
|
55
91
|
export type PlayerDirection = string;
|
56
92
|
export namespace PlayerDirection {
|
57
93
|
let Forward: string;
|
@@ -1,6 +1,15 @@
|
|
1
1
|
import { reactive } from 'vue';
|
2
|
-
import { check } from '@vcsuite/check';
|
3
|
-
import {
|
2
|
+
import { check, checkMaybe } from '@vcsuite/check';
|
3
|
+
import {
|
4
|
+
createFlightVisualization,
|
5
|
+
exportFlightAsGeoJson,
|
6
|
+
exportFlightPathAsGeoJson,
|
7
|
+
FlightInstance,
|
8
|
+
moduleIdSymbol,
|
9
|
+
parseFlightOptionsFromGeoJson,
|
10
|
+
} from '@vcmap/core';
|
11
|
+
import { NotificationType } from '../notifier/notifier.js';
|
12
|
+
import { downloadText } from '../downloadHelper.js';
|
4
13
|
|
5
14
|
/**
|
6
15
|
* @param {import("../vcsUiApp.js").default} app
|
@@ -186,19 +195,155 @@ export function createFlightPlayerActions(app, instance) {
|
|
186
195
|
};
|
187
196
|
}
|
188
197
|
|
198
|
+
/**
|
199
|
+
* @param {import("../vcsUiApp.js").default} app
|
200
|
+
* @param {import("@vcmap/core").FlightInstance} instance
|
201
|
+
* @param {Array<import("./actionHelper.js").VcsAction>} actions
|
202
|
+
* @returns {(function(): void)}
|
203
|
+
*/
|
204
|
+
export function setupFlightListItemPlayer(app, instance, actions) {
|
205
|
+
function removeAction(action) {
|
206
|
+
const index = actions.findIndex((a) => a.name === action.name);
|
207
|
+
if (index > -1) {
|
208
|
+
actions.splice(index, 1);
|
209
|
+
}
|
210
|
+
}
|
211
|
+
|
212
|
+
let player;
|
213
|
+
const listener = [];
|
214
|
+
|
215
|
+
function setupListener(playAction, stopAction) {
|
216
|
+
listener.forEach((cb) => cb());
|
217
|
+
listener.slice(0);
|
218
|
+
listener.push(
|
219
|
+
player.stateChanged.addEventListener((state) => {
|
220
|
+
if (state === 'stopped') {
|
221
|
+
removeAction(stopAction);
|
222
|
+
playAction.icon = 'mdi-play';
|
223
|
+
playAction.title = 'flight.playTooltip';
|
224
|
+
} else {
|
225
|
+
if (!actions.includes(stopAction)) {
|
226
|
+
actions.push(stopAction);
|
227
|
+
}
|
228
|
+
if (state === 'paused') {
|
229
|
+
playAction.icon = 'mdi-play';
|
230
|
+
playAction.title = 'flight.playTooltip';
|
231
|
+
} else {
|
232
|
+
playAction.icon = 'mdi-pause';
|
233
|
+
playAction.title = 'flight.pauseTooltip';
|
234
|
+
}
|
235
|
+
}
|
236
|
+
}),
|
237
|
+
player.destroyed.addEventListener(() => {
|
238
|
+
player = undefined;
|
239
|
+
removeAction(stopAction);
|
240
|
+
playAction.icon = 'mdi-play';
|
241
|
+
}),
|
242
|
+
instance.anchorsChanged.addEventListener(() => {
|
243
|
+
playAction.disabled = !instance.isValid();
|
244
|
+
}),
|
245
|
+
);
|
246
|
+
}
|
247
|
+
|
248
|
+
const stopAction = {
|
249
|
+
name: 'stop',
|
250
|
+
icon: 'mdi-square',
|
251
|
+
title: 'flight.stopTooltip',
|
252
|
+
callback: () => {
|
253
|
+
player?.stop();
|
254
|
+
},
|
255
|
+
};
|
256
|
+
|
257
|
+
const playAction = reactive({
|
258
|
+
name: 'play',
|
259
|
+
icon: 'mdi-play',
|
260
|
+
title: 'flight.playTooltip',
|
261
|
+
disabled: !instance.isValid(),
|
262
|
+
callback: async () => {
|
263
|
+
if (player) {
|
264
|
+
if (player.state === 'playing') {
|
265
|
+
player.pause();
|
266
|
+
} else {
|
267
|
+
player.play();
|
268
|
+
}
|
269
|
+
} else {
|
270
|
+
player = await app.flights.setPlayerForFlight(instance);
|
271
|
+
setupListener(playAction, stopAction);
|
272
|
+
player?.play();
|
273
|
+
}
|
274
|
+
},
|
275
|
+
});
|
276
|
+
|
277
|
+
if (!actions.includes(playAction)) {
|
278
|
+
actions.push(playAction);
|
279
|
+
}
|
280
|
+
|
281
|
+
const playerChangedListener = app.flights.playerChanged.addEventListener(
|
282
|
+
(flightPlayer) => {
|
283
|
+
if (!player && flightPlayer?.flightInstanceName === instance.name) {
|
284
|
+
player = flightPlayer;
|
285
|
+
setupListener(playAction, stopAction);
|
286
|
+
}
|
287
|
+
},
|
288
|
+
);
|
289
|
+
|
290
|
+
return () => {
|
291
|
+
listener.forEach((cb) => cb());
|
292
|
+
playerChangedListener();
|
293
|
+
if (player) {
|
294
|
+
player.stop();
|
295
|
+
player.destroy();
|
296
|
+
player = undefined;
|
297
|
+
}
|
298
|
+
removeAction(playAction);
|
299
|
+
};
|
300
|
+
}
|
301
|
+
|
189
302
|
/**
|
190
303
|
*
|
191
304
|
* @param {import("../vcsUiApp.js").default} app
|
192
|
-
* @param {import("@vcmap/core").FlightInstance}
|
305
|
+
* @param {import("@vcmap/core").FlightInstance} instance
|
306
|
+
* @returns {{action: import("./actionHelper.js").VcsAction, destroy: function(): void}}
|
307
|
+
*/
|
308
|
+
export function createZoomToFlightAction(app, instance) {
|
309
|
+
let flightVis;
|
310
|
+
|
311
|
+
const action = {
|
312
|
+
name: 'components.flight.zoom',
|
313
|
+
title: 'components.flight.zoom',
|
314
|
+
disabled: !instance.isValid(),
|
315
|
+
async callback() {
|
316
|
+
if (!flightVis) {
|
317
|
+
flightVis = await createFlightVisualization(instance, app);
|
318
|
+
}
|
319
|
+
await flightVis.zoomToExtent();
|
320
|
+
},
|
321
|
+
};
|
322
|
+
const listener = instance.anchorsChanged.addEventListener(() => {
|
323
|
+
action.disabled = !instance.isValid();
|
324
|
+
});
|
325
|
+
return {
|
326
|
+
action,
|
327
|
+
destroy: () => {
|
328
|
+
listener();
|
329
|
+
flightVis.destroy();
|
330
|
+
},
|
331
|
+
};
|
332
|
+
}
|
333
|
+
|
334
|
+
/**
|
335
|
+
*
|
336
|
+
* @param {import("../vcsUiApp.js").default} app
|
337
|
+
* @param {import("@vcmap/core").FlightInstance} instance
|
193
338
|
* @param {boolean} [active=true]
|
194
339
|
* @returns {Promise<{action: import("./actionHelper.js").VcsAction, destroy:()=>void}>}
|
195
340
|
*/
|
196
341
|
export async function createFlightVisualizationAction(
|
197
342
|
app,
|
198
|
-
|
343
|
+
instance,
|
199
344
|
active = true,
|
200
345
|
) {
|
201
|
-
let flightVis = await createFlightVisualization(
|
346
|
+
let flightVis = await createFlightVisualization(instance, app);
|
202
347
|
|
203
348
|
const action = reactive({
|
204
349
|
name: 'components.flight.hidePath',
|
@@ -207,7 +352,7 @@ export async function createFlightVisualizationAction(
|
|
207
352
|
active,
|
208
353
|
async callback() {
|
209
354
|
if (!flightVis) {
|
210
|
-
flightVis = await createFlightVisualization(
|
355
|
+
flightVis = await createFlightVisualization(instance, app);
|
211
356
|
}
|
212
357
|
if (this.active) {
|
213
358
|
flightVis.deactivate();
|
@@ -230,3 +375,109 @@ export async function createFlightVisualizationAction(
|
|
230
375
|
|
231
376
|
return { action, destroy };
|
232
377
|
}
|
378
|
+
|
379
|
+
/**
|
380
|
+
*
|
381
|
+
* @param {import("@vcmap/core").FlightInstance} instance
|
382
|
+
* @param {boolean} [isPathExport=false] - Set to true to export flight path. Per default flight is exported
|
383
|
+
* @returns {{action: import("./actionHelper.js").VcsAction, destroy: function(): void}}
|
384
|
+
*/
|
385
|
+
export function createExportFlightAction(instance, isPathExport = false) {
|
386
|
+
const exportFunction = (i) =>
|
387
|
+
isPathExport ? exportFlightPathAsGeoJson(i) : exportFlightAsGeoJson(i);
|
388
|
+
|
389
|
+
const name = isPathExport
|
390
|
+
? 'components.flight.exportPath'
|
391
|
+
: 'components.flight.export';
|
392
|
+
|
393
|
+
const action = {
|
394
|
+
name,
|
395
|
+
title: name,
|
396
|
+
disabled: !instance.isValid(),
|
397
|
+
callback() {
|
398
|
+
const text = JSON.stringify(exportFunction(instance), null, 2);
|
399
|
+
downloadText(
|
400
|
+
text,
|
401
|
+
`${instance.properties.title ?? instance.name}${
|
402
|
+
isPathExport ? '-path' : ''
|
403
|
+
}.json`,
|
404
|
+
);
|
405
|
+
},
|
406
|
+
};
|
407
|
+
|
408
|
+
const destroy = instance.anchorsChanged.addEventListener(() => {
|
409
|
+
action.disabled = !instance.isValid();
|
410
|
+
});
|
411
|
+
|
412
|
+
return { action, destroy };
|
413
|
+
}
|
414
|
+
|
415
|
+
/**
|
416
|
+
*
|
417
|
+
* @param {import("../vcsUiApp.js").default} app
|
418
|
+
* @param {File[]} files
|
419
|
+
* @param {string} [moduleId]
|
420
|
+
* @param {(imported:number[]) => void} [importSuccessCb] - An optional success cb providing the indices of app's flight collection for successful imported flight instances
|
421
|
+
* @returns {Promise<boolean>}
|
422
|
+
*/
|
423
|
+
export async function importFlights(app, files, moduleId, importSuccessCb) {
|
424
|
+
checkMaybe(moduleId, String);
|
425
|
+
checkMaybe(importSuccessCb, Function);
|
426
|
+
|
427
|
+
const { vueI18n } = app;
|
428
|
+
const results = await Promise.all(
|
429
|
+
files.map(async (file) => {
|
430
|
+
const text = await file.text();
|
431
|
+
try {
|
432
|
+
return parseFlightOptionsFromGeoJson(JSON.parse(text));
|
433
|
+
} catch (e) {
|
434
|
+
app.notifier.add({
|
435
|
+
type: NotificationType.ERROR,
|
436
|
+
message: vueI18n.t('components.import.failure', {
|
437
|
+
fileName: file.name,
|
438
|
+
}),
|
439
|
+
});
|
440
|
+
}
|
441
|
+
return undefined;
|
442
|
+
}),
|
443
|
+
);
|
444
|
+
|
445
|
+
const flightsToImport = results.filter((f) => f).flat();
|
446
|
+
|
447
|
+
const imported = flightsToImport
|
448
|
+
.map((options) => {
|
449
|
+
const instance = new FlightInstance(options);
|
450
|
+
if (!instance.isValid()) {
|
451
|
+
return null;
|
452
|
+
}
|
453
|
+
if (moduleId) {
|
454
|
+
instance[moduleIdSymbol] = moduleId;
|
455
|
+
}
|
456
|
+
return app.flights.add(instance);
|
457
|
+
})
|
458
|
+
.filter((id) => id != null);
|
459
|
+
const importedDelta = flightsToImport.length - imported.length;
|
460
|
+
if (importedDelta > 0) {
|
461
|
+
app.notifier.add({
|
462
|
+
type: NotificationType.WARNING,
|
463
|
+
message: vueI18n.t('components.import.addFailure', [importedDelta]),
|
464
|
+
});
|
465
|
+
return false;
|
466
|
+
}
|
467
|
+
if (imported.length > 0) {
|
468
|
+
if (importSuccessCb) {
|
469
|
+
importSuccessCb(imported);
|
470
|
+
}
|
471
|
+
app.notifier.add({
|
472
|
+
type: NotificationType.SUCCESS,
|
473
|
+
message: vueI18n.t('components.import.featuresAdded', [imported.length]),
|
474
|
+
});
|
475
|
+
} else {
|
476
|
+
app.notifier.add({
|
477
|
+
type: NotificationType.ERROR,
|
478
|
+
message: vueI18n.t('components.import.nothingAdded'),
|
479
|
+
});
|
480
|
+
return false;
|
481
|
+
}
|
482
|
+
return true;
|
483
|
+
}
|
@@ -1,36 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<v-container class="fill-height pa-0" absolute fluid>
|
3
3
|
<VcsNavbar />
|
4
|
-
<
|
5
|
-
class="vcs-main pa-0"
|
6
|
-
:class="{ 'vcs-main-xs': $vuetify.breakpoint.xs }"
|
7
|
-
fluid
|
8
|
-
absolute
|
9
|
-
>
|
10
|
-
<template v-if="$vuetify.breakpoint.xs">
|
11
|
-
<img
|
12
|
-
v-if="mobileLogo"
|
13
|
-
:src="mobileLogo"
|
14
|
-
alt="Logo"
|
15
|
-
draggable="false"
|
16
|
-
class="mobile-logo"
|
17
|
-
/>
|
18
|
-
</template>
|
19
|
-
<VcsButton
|
20
|
-
v-if="!$vuetify.breakpoint.smAndUp && $vuetify.breakpoint.mobile"
|
21
|
-
:key="attributionAction.name"
|
22
|
-
:tooltip="attributionAction.title"
|
23
|
-
:icon="attributionAction.icon"
|
24
|
-
:active="attributionAction.active"
|
25
|
-
@click.stop="attributionAction.callback($event)"
|
26
|
-
class="z-index-1 mobile-attribution-btn"
|
27
|
-
/>
|
28
|
-
<VcsMap :map-id="mapId" />
|
29
|
-
<MapNavigation v-if="showMapNavigation" />
|
30
|
-
<ToolboxManagerComponent />
|
31
|
-
<WindowManagerComponent />
|
32
|
-
<NotifierComponent />
|
33
|
-
</v-container>
|
4
|
+
<VcsContainer :attribution-action="attributionAction" />
|
34
5
|
<v-footer
|
35
6
|
absolute
|
36
7
|
v-if="$vuetify.breakpoint.smAndUp"
|
@@ -38,7 +9,6 @@
|
|
38
9
|
class="d-flex gap-1 pa-0"
|
39
10
|
>
|
40
11
|
<VcsPositionDisplay />
|
41
|
-
|
42
12
|
<VcsTextPageFooter
|
43
13
|
v-if="imprint"
|
44
14
|
:text-page="imprint"
|
@@ -53,7 +23,7 @@
|
|
53
23
|
class="align-wrapper"
|
54
24
|
:entries="attributionEntries"
|
55
25
|
:attribution-action="attributionAction"
|
56
|
-
|
26
|
+
/>
|
57
27
|
</v-footer>
|
58
28
|
</v-container>
|
59
29
|
</template>
|
@@ -67,61 +37,29 @@
|
|
67
37
|
right: 0;
|
68
38
|
margin-right: 4px !important;
|
69
39
|
}
|
70
|
-
.vcs-main {
|
71
|
-
position: absolute;
|
72
|
-
top: 48px;
|
73
|
-
left: 0;
|
74
|
-
right: 0;
|
75
|
-
bottom: 22px;
|
76
|
-
}
|
77
|
-
|
78
|
-
.vcs-main-xs {
|
79
|
-
top: 0;
|
80
|
-
bottom: 56px;
|
81
|
-
}
|
82
|
-
|
83
|
-
.mobile-logo {
|
84
|
-
max-height: 40px;
|
85
|
-
max-width: 70px;
|
86
|
-
position: absolute;
|
87
|
-
top: 1rem;
|
88
|
-
left: 1rem;
|
89
|
-
z-index: 1;
|
90
|
-
}
|
91
|
-
|
92
|
-
.mobile-attribution-btn {
|
93
|
-
position: fixed;
|
94
|
-
right: 2px;
|
95
|
-
bottom: 36px;
|
96
|
-
}
|
97
40
|
</style>
|
98
41
|
|
99
42
|
<script>
|
100
|
-
import { v4 as uuid } from 'uuid';
|
101
43
|
import {
|
102
44
|
computed,
|
103
45
|
getCurrentInstance,
|
104
46
|
onMounted,
|
105
47
|
onUnmounted,
|
106
48
|
provide,
|
107
|
-
ref,
|
108
49
|
watch,
|
109
50
|
} from 'vue';
|
110
51
|
import { getVcsAppById, moduleIdSymbol } from '@vcmap/core';
|
111
52
|
import { VContainer, VFooter } from 'vuetify/lib';
|
112
53
|
import { getLogger } from '@vcsuite/logger';
|
113
|
-
import
|
114
|
-
import ToolboxManagerComponent from '../manager/toolbox/ToolboxManager.vue';
|
54
|
+
import VcsContainer from './VcsContainer.vue';
|
115
55
|
import { ButtonLocation } from '../manager/navbarManager.js';
|
116
56
|
import { vcsAppSymbol } from '../pluginHelper.js';
|
117
|
-
import VcsMap from './VcsMap.vue';
|
118
57
|
import VcsNavbar from './VcsNavbar.vue';
|
119
58
|
import {
|
120
59
|
createLinkAction,
|
121
60
|
createMapButtonAction,
|
122
61
|
createToggleAction,
|
123
62
|
} from '../actions/actionHelper.js';
|
124
|
-
import MapNavigation from '../navigation/MapNavigation.vue';
|
125
63
|
import VcsSettings from './VcsSettings.vue';
|
126
64
|
import { WindowSlot } from '../manager/window/windowManager.js';
|
127
65
|
import CollectionManager from '../manager/collectionManager/CollectionManager.vue';
|
@@ -130,10 +68,8 @@
|
|
130
68
|
import { getLegendEntries } from '../legend/legendHelper.js';
|
131
69
|
import VcsAttributionsFooter from './VcsAttributionsFooter.vue';
|
132
70
|
import VcsTextPageFooter from './VcsTextPageFooter.vue';
|
133
|
-
import VcsButton from '../components/buttons/VcsButton.vue';
|
134
71
|
import VcsAttributions from './VcsAttributions.vue';
|
135
72
|
import { getAttributions } from './attributionsHelper.js';
|
136
|
-
import NotifierComponent from '../notifier/NotifierComponent.vue';
|
137
73
|
import VcsDefaultLogoMobile from '../logo-mobile.svg';
|
138
74
|
import VcsPositionDisplay from './VcsPositionDisplay.vue';
|
139
75
|
|
@@ -560,28 +496,6 @@
|
|
560
496
|
};
|
561
497
|
}
|
562
498
|
|
563
|
-
export function setupMapNavigation(app) {
|
564
|
-
const showMapNavigation = ref(false);
|
565
|
-
|
566
|
-
const listeners = [
|
567
|
-
app.maps.added.addEventListener(() => {
|
568
|
-
showMapNavigation.value = true;
|
569
|
-
}),
|
570
|
-
app.maps.removed.addEventListener(() => {
|
571
|
-
if (app.maps.size < 1) {
|
572
|
-
showMapNavigation.value = false;
|
573
|
-
}
|
574
|
-
}),
|
575
|
-
];
|
576
|
-
|
577
|
-
return {
|
578
|
-
showMapNavigation,
|
579
|
-
destroy: () => {
|
580
|
-
listeners.forEach((cb) => cb());
|
581
|
-
},
|
582
|
-
};
|
583
|
-
}
|
584
|
-
|
585
499
|
/**
|
586
500
|
* @description The base component to setup the entire application. To embed the VcsApp, use this component.
|
587
501
|
* @vue-prop {string} appId - the id of the app to inject. this will setup listeners on the app to call vcsAppMounted on plugins
|
@@ -589,18 +503,13 @@
|
|
589
503
|
*/
|
590
504
|
export default {
|
591
505
|
components: {
|
592
|
-
|
506
|
+
VcsContainer,
|
593
507
|
VcsPositionDisplay,
|
594
508
|
VcsAttributionsFooter,
|
595
509
|
VcsTextPageFooter,
|
596
|
-
MapNavigation,
|
597
510
|
VcsNavbar,
|
598
|
-
VcsMap,
|
599
|
-
WindowManagerComponent,
|
600
|
-
ToolboxManagerComponent,
|
601
511
|
VContainer,
|
602
512
|
VFooter,
|
603
|
-
NotifierComponent,
|
604
513
|
},
|
605
514
|
props: {
|
606
515
|
appId: {
|
@@ -609,8 +518,6 @@
|
|
609
518
|
},
|
610
519
|
},
|
611
520
|
setup(props) {
|
612
|
-
const id = uuid();
|
613
|
-
const mapId = `mapCollection-${id}`;
|
614
521
|
/** @type {import("../vcsUiApp.js").default} */
|
615
522
|
const app = getVcsAppById(props.appId);
|
616
523
|
provide('vcsApp', app);
|
@@ -626,14 +533,10 @@
|
|
626
533
|
);
|
627
534
|
const { attributionEntries, attributionAction, destroyAttributions } =
|
628
535
|
setupAttributions(app);
|
629
|
-
const { showMapNavigation, destroy: destroyMapNavigationListener } =
|
630
|
-
setupMapNavigation(app);
|
631
536
|
|
632
537
|
let pluginMountedListener;
|
633
538
|
onMounted(() => {
|
634
539
|
pluginMountedListener = setupPluginMountedListeners(app);
|
635
|
-
app.maps.setTarget(mapId);
|
636
|
-
app.mounted.raiseEvent(mapId);
|
637
540
|
});
|
638
541
|
|
639
542
|
onUnmounted(() => {
|
@@ -646,11 +549,9 @@
|
|
646
549
|
destroyComponentsWindow();
|
647
550
|
destroyThemingListener();
|
648
551
|
destroyAttributions();
|
649
|
-
destroyMapNavigationListener();
|
650
552
|
});
|
651
553
|
|
652
554
|
return {
|
653
|
-
mapId,
|
654
555
|
mobileLogo: computed(
|
655
556
|
() =>
|
656
557
|
app.uiConfig.config.value.mobileLogo ??
|
@@ -679,7 +580,6 @@
|
|
679
580
|
}),
|
680
581
|
attributionEntries,
|
681
582
|
attributionAction,
|
682
|
-
showMapNavigation,
|
683
583
|
};
|
684
584
|
},
|
685
585
|
};
|
@@ -60,17 +60,12 @@ export function setupAttributions(app: import("../vcsUiApp.js").default): {
|
|
60
60
|
attributionAction: import("../actions/actionHelper.js").VcsAction;
|
61
61
|
destroyAttributions: () => void;
|
62
62
|
};
|
63
|
-
export function setupMapNavigation(app: any): {
|
64
|
-
showMapNavigation: import("vue").Ref<boolean>;
|
65
|
-
destroy: () => void;
|
66
|
-
};
|
67
63
|
declare const _default: import("vue").DefineComponent<{
|
68
64
|
appId: {
|
69
65
|
type: StringConstructor;
|
70
66
|
required: true;
|
71
67
|
};
|
72
68
|
}, {
|
73
|
-
mapId: string;
|
74
69
|
mobileLogo: import("vue").ComputedRef<any>;
|
75
70
|
imprint: import("vue").ComputedRef<{
|
76
71
|
title: string;
|
@@ -82,7 +77,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
82
77
|
} | undefined>;
|
83
78
|
attributionEntries: import("vue").Ref<import("./attributionsHelper.js").AttributionEntry[]>;
|
84
79
|
attributionAction: import("../actions/actionHelper.js").VcsAction;
|
85
|
-
showMapNavigation: import("vue").Ref<boolean>;
|
86
80
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
87
81
|
appId: {
|
88
82
|
type: StringConstructor;
|