@vcmap/ui 5.1.2 → 5.1.4
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/getPluginProxies.js +4 -1
- package/config/www.config.json +40 -6
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.753649.js → core.8b769f.js} +3360 -3334
- package/dist/assets/core.js +1 -1
- package/dist/assets/index-97b02a80.js +1 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/{ui.a843ac.css → ui.576b59.css} +2 -2
- package/dist/assets/{ui.a843ac.js → ui.576b59.js} +2854 -2716
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.50800a.js → vuetify.515b3c.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/src/actions/listActions.d.ts +2 -1
- package/src/actions/listActions.js +3 -1
- package/src/application/VcsPositionDisplay.vue +10 -0
- package/src/components/icons/+all.js +12 -0
- package/src/components/icons/2DPointIcon.vue +22 -0
- package/src/components/icons/2DPointIcon.vue.d.ts +2 -0
- package/src/components/icons/3DPointIcon.vue +22 -0
- package/src/components/icons/3DPointIcon.vue.d.ts +2 -0
- package/src/components/icons/AxisIcon.vue +10 -15
- package/src/components/icons/PointMeasurementIcon.vue +7 -17
- package/src/components/icons/TransparentTerrainIcon.vue +17 -0
- package/src/components/icons/TransparentTerrainIcon.vue.d.ts +2 -0
- package/src/components/import/ImportComponent.vue +6 -0
- package/src/components/import/ImportComponent.vue.d.ts +1 -0
- package/src/components/viewpoint/VcsViewpointComponent.vue +24 -18
- package/src/featureInfo/abstractFeatureInfoView.d.ts +8 -0
- package/src/featureInfo/abstractFeatureInfoView.js +20 -1
- package/src/featureInfo/featureInfo.js +1 -1
- package/src/manager/collectionManager/collectionComponentClass.d.ts +14 -4
- package/src/manager/collectionManager/collectionComponentClass.js +40 -22
- package/src/manager/collectionManager/editorCollectionComponentClass.d.ts +7 -1
- package/src/manager/collectionManager/editorCollectionComponentClass.js +7 -2
- package/src/manager/contextMenu/contextMenuManager.d.ts +11 -0
- package/src/manager/contextMenu/contextMenuManager.js +22 -1
- package/src/manager/toolbox/SelectToolboxComponent.vue +1 -1
- package/src/manager/toolbox/ToolboxManager.vue +31 -4
- package/src/manager/toolbox/ToolboxManager.vue.d.ts +3 -0
- package/src/manager/window/WindowManager.vue +1 -1
- package/src/manager/window/windowManager.d.ts +30 -1
- package/src/manager/window/windowManager.js +71 -2
- package/src/navigation/MapNavigation.vue +7 -4
- package/src/navigation/overviewMap.js +24 -19
- package/dist/assets/index-cc59d4fd.js +0 -1
- /package/dist/assets/{cesium.6a1548.js → cesium.88a354.js} +0 -0
- /package/dist/assets/{ol.441b59.js → ol.98520e.js} +0 -0
- /package/dist/assets/{vue.118f2c.js → vue.e13c02.js} +0 -0
- /package/dist/assets/{vuetify.50800a.css → vuetify.515b3c.css} +0 -0
@@ -24,6 +24,9 @@ import { sortByOwner } from '../navbarManager.js';
|
|
24
24
|
* @property {boolean} [singleSelect=false]
|
25
25
|
* @property {number} [overflowCount=2] - number of header action buttons rendered until overflow
|
26
26
|
* @property {number} [limit=10] - limit number of items in rendered list (more items are rendered in extra window)
|
27
|
+
* @property {string} [removeTitle="list.deleteItem"]
|
28
|
+
* @property {string} [bulkRemoveTitle="list.delete"]
|
29
|
+
* @property {string} [renameTitle="list.renameItem"]
|
27
30
|
*/
|
28
31
|
|
29
32
|
/**
|
@@ -188,6 +191,23 @@ class CollectionComponentClass {
|
|
188
191
|
*/
|
189
192
|
this.selection = ref([]);
|
190
193
|
|
194
|
+
/**
|
195
|
+
*
|
196
|
+
* @type {{ removeTitle: string, bulkRemoveTitle: string, renameTitle: string }}
|
197
|
+
* @private
|
198
|
+
*/
|
199
|
+
this._actionTitles = {
|
200
|
+
removeTitle: options.removeTitle ?? 'list.deleteItem',
|
201
|
+
bulkRemoveTitle: options.bulkRemoveTitle ?? 'list.delete',
|
202
|
+
renameTitle: options.renameTitle ?? 'list.renameItem',
|
203
|
+
};
|
204
|
+
|
205
|
+
/**
|
206
|
+
* @tyep {() => void}
|
207
|
+
* @private
|
208
|
+
*/
|
209
|
+
this._removeBulkDeleteAction = () => {};
|
210
|
+
|
191
211
|
this._resetWatchers = [
|
192
212
|
watch(this.renamable, () => this.reset()),
|
193
213
|
watch([this.removable, this.selectable], () => {
|
@@ -293,7 +313,7 @@ class CollectionComponentClass {
|
|
293
313
|
*/
|
294
314
|
_addBulkDeleteAction() {
|
295
315
|
const { action, destroy } = createListItemBulkAction(this.selection, {
|
296
|
-
name:
|
316
|
+
name: this._actionTitles.bulkRemoveTitle,
|
297
317
|
callback: () => {
|
298
318
|
[...this.selection.value].forEach((listItem) => {
|
299
319
|
this._collection.remove(this._collection.getByKey(listItem.name));
|
@@ -301,26 +321,16 @@ class CollectionComponentClass {
|
|
301
321
|
},
|
302
322
|
});
|
303
323
|
this._destroyBulkDelete = destroy;
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
]);
|
311
|
-
}
|
324
|
+
const ownedAction = {
|
325
|
+
action,
|
326
|
+
owner: this._owner,
|
327
|
+
weight: 100,
|
328
|
+
};
|
329
|
+
this.addActions([ownedAction]);
|
312
330
|
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
_removeBulkDeleteAction() {
|
317
|
-
this._destroyBulkDelete();
|
318
|
-
const action = this._actions.value.find(
|
319
|
-
(a) => a.action.name === 'list.delete',
|
320
|
-
);
|
321
|
-
if (action) {
|
322
|
-
this.removeActions([action]);
|
323
|
-
}
|
331
|
+
this._removeBulkDeleteAction = () => {
|
332
|
+
this.removeActions([ownedAction]);
|
333
|
+
};
|
324
334
|
}
|
325
335
|
|
326
336
|
/**
|
@@ -349,12 +359,20 @@ class CollectionComponentClass {
|
|
349
359
|
destroyFunctions: [],
|
350
360
|
};
|
351
361
|
if (this.renamable.value) {
|
352
|
-
listItem.actions.push(
|
362
|
+
listItem.actions.push(
|
363
|
+
createListItemRenameAction(listItem, {
|
364
|
+
name: this._actionTitles.renameTitle,
|
365
|
+
}),
|
366
|
+
);
|
353
367
|
listItem.titleChanged = (newTitle) =>
|
354
368
|
titleChanged(item, listItem, newTitle);
|
355
369
|
}
|
356
370
|
if (this.removable.value) {
|
357
|
-
listItem.actions.push(
|
371
|
+
listItem.actions.push(
|
372
|
+
createListItemDeleteAction(this._collection, item, {
|
373
|
+
name: this._actionTitles.removeTitle,
|
374
|
+
}),
|
375
|
+
);
|
358
376
|
}
|
359
377
|
this._itemMappings.forEach((itemMapping) => {
|
360
378
|
if (
|
@@ -18,12 +18,16 @@ export function makeEditorCollectionComponentClass<T extends Object | import("@v
|
|
18
18
|
* editor: EditorWindowComponentOptions|function(T):EditorWindowComponentOptions|undefined,
|
19
19
|
* multiEditor?: EditorWindowComponentOptions,
|
20
20
|
* predicate?: import("./collectionManager.js").PredicateFunction<T>,
|
21
|
-
* selectionBased?: boolean
|
21
|
+
* selectionBased?: boolean,
|
22
|
+
* editTitle?: string,
|
23
|
+
* bulkEditTitle?: string
|
22
24
|
* }} EditingOptions
|
23
25
|
* @property {EditorWindowComponentOptions|function(T)|undefined} editor
|
24
26
|
* @property {EditorWindowComponentOptions} [multiEditor]
|
25
27
|
* @property {import("./collectionManager.js").PredicateFunction<T>} [predicate=()=>true] - Optional predicate function for editor
|
26
28
|
* @property {boolean} [selectionBased=true] - If true, editor windows are coupled to selection and editor windows are exclusive
|
29
|
+
* @property {string} [editTitle="list.editItem"]
|
30
|
+
* @property {string} [bulkEditTitle="list.edit"]
|
27
31
|
* @template {Object} T
|
28
32
|
*/
|
29
33
|
/**
|
@@ -49,6 +53,8 @@ export type EditingOptions<T extends Object> = {
|
|
49
53
|
multiEditor?: EditorWindowComponentOptions;
|
50
54
|
predicate?: import("./collectionManager.js").PredicateFunction<T>;
|
51
55
|
selectionBased?: boolean;
|
56
|
+
editTitle?: string;
|
57
|
+
bulkEditTitle?: string;
|
52
58
|
};
|
53
59
|
export type EditorCollectionComponentClass<T extends Object> = import("./collectionComponentClass.js").default<T> & {
|
54
60
|
getEditorWindowId: (arg0: T) => string;
|
@@ -13,12 +13,16 @@ import { createListEditAction } from '../../actions/listActions.js';
|
|
13
13
|
* editor: EditorWindowComponentOptions|function(T):EditorWindowComponentOptions|undefined,
|
14
14
|
* multiEditor?: EditorWindowComponentOptions,
|
15
15
|
* predicate?: import("./collectionManager.js").PredicateFunction<T>,
|
16
|
-
* selectionBased?: boolean
|
16
|
+
* selectionBased?: boolean,
|
17
|
+
* editTitle?: string,
|
18
|
+
* bulkEditTitle?: string
|
17
19
|
* }} EditingOptions
|
18
20
|
* @property {EditorWindowComponentOptions|function(T)|undefined} editor
|
19
21
|
* @property {EditorWindowComponentOptions} [multiEditor]
|
20
22
|
* @property {import("./collectionManager.js").PredicateFunction<T>} [predicate=()=>true] - Optional predicate function for editor
|
21
23
|
* @property {boolean} [selectionBased=true] - If true, editor windows are coupled to selection and editor windows are exclusive
|
24
|
+
* @property {string} [editTitle="list.editItem"]
|
25
|
+
* @property {string} [bulkEditTitle="list.edit"]
|
22
26
|
* @template {Object} T
|
23
27
|
*/
|
24
28
|
|
@@ -236,7 +240,7 @@ export function makeEditorCollectionComponentClass(
|
|
236
240
|
});
|
237
241
|
|
238
242
|
const editItemAction = {
|
239
|
-
name: 'list.editItem',
|
243
|
+
name: editingOptions.editTitle ?? 'list.editItem',
|
240
244
|
async callback() {
|
241
245
|
if (selectionBased) {
|
242
246
|
closeEditorWindows();
|
@@ -263,6 +267,7 @@ export function makeEditorCollectionComponentClass(
|
|
263
267
|
app.windowManager,
|
264
268
|
editorCollectionComponent.owner,
|
265
269
|
getMultiEditorWindowId(),
|
270
|
+
editingOptions.bulkEditTitle,
|
266
271
|
);
|
267
272
|
|
268
273
|
editorCollectionComponent.addActions([
|
@@ -38,6 +38,16 @@ declare class ContextMenuManager {
|
|
38
38
|
* @private
|
39
39
|
*/
|
40
40
|
private _listeners;
|
41
|
+
/**
|
42
|
+
* An event called when the context menu is closed
|
43
|
+
* @type {VcsEvent<void>}
|
44
|
+
*/
|
45
|
+
closed: VcsEvent<void>;
|
46
|
+
/**
|
47
|
+
* @type {() => void}
|
48
|
+
* @private
|
49
|
+
*/
|
50
|
+
private _closedListener;
|
41
51
|
_ensureInteraction(): void;
|
42
52
|
_setupListeners(): void;
|
43
53
|
/**
|
@@ -68,3 +78,4 @@ declare class ContextMenuManager {
|
|
68
78
|
clear(): void;
|
69
79
|
destroy(): void;
|
70
80
|
}
|
81
|
+
import { VcsEvent } from '@vcmap/core';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CesiumMap, BaseOLMap } from '@vcmap/core';
|
1
|
+
import { CesiumMap, BaseOLMap, VcsEvent } from '@vcmap/core';
|
2
2
|
import { unByKey } from 'ol/Observable.js';
|
3
3
|
import { check } from '@vcsuite/check';
|
4
4
|
import ContextMenuInteraction from './contextMenuInteraction.js';
|
@@ -81,6 +81,24 @@ class ContextMenuManager {
|
|
81
81
|
* @private
|
82
82
|
*/
|
83
83
|
this._listeners = [];
|
84
|
+
|
85
|
+
/**
|
86
|
+
* An event called when the context menu is closed
|
87
|
+
* @type {VcsEvent<void>}
|
88
|
+
*/
|
89
|
+
this.closed = new VcsEvent();
|
90
|
+
|
91
|
+
/**
|
92
|
+
* @type {() => void}
|
93
|
+
* @private
|
94
|
+
*/
|
95
|
+
this._closedListener = this._app.windowManager.removed.addEventListener(
|
96
|
+
(window) => {
|
97
|
+
if (window.id === contextMenuWindowId) {
|
98
|
+
this.closed.raiseEvent();
|
99
|
+
}
|
100
|
+
},
|
101
|
+
);
|
84
102
|
}
|
85
103
|
|
86
104
|
_ensureInteraction() {
|
@@ -208,12 +226,15 @@ class ContextMenuManager {
|
|
208
226
|
}
|
209
227
|
|
210
228
|
destroy() {
|
229
|
+
this.clear();
|
211
230
|
this._interaction.destroy();
|
212
231
|
if (this._interactionListener) {
|
213
232
|
this._interactionListener();
|
214
233
|
this._interactionListener = null;
|
215
234
|
}
|
216
235
|
this._eventHandlers = [];
|
236
|
+
this._closedListener();
|
237
|
+
this.closed.destroy();
|
217
238
|
}
|
218
239
|
}
|
219
240
|
|
@@ -11,7 +11,7 @@
|
|
11
11
|
:active="group.action.active"
|
12
12
|
:disabled="group.action.disabled"
|
13
13
|
:background="group.action.background"
|
14
|
-
@click
|
14
|
+
@click="group.action.callback($event)"
|
15
15
|
v-bind="{ ...$attrs }"
|
16
16
|
class="vcs-toolbox-action-selected"
|
17
17
|
:min-width="32"
|
@@ -9,6 +9,8 @@
|
|
9
9
|
toolbar__secondary: !isDefaultToolbox,
|
10
10
|
}"
|
11
11
|
:height="40"
|
12
|
+
:style="{ zIndex }"
|
13
|
+
@click.stop="bringToTop"
|
12
14
|
width="fit-content"
|
13
15
|
dense
|
14
16
|
>
|
@@ -21,12 +23,12 @@
|
|
21
23
|
<ToolboxActionGroup
|
22
24
|
v-if="group.type === ToolboxType.GROUP"
|
23
25
|
:group="group"
|
24
|
-
@toggle="
|
26
|
+
@toggle="openGroup"
|
25
27
|
/>
|
26
28
|
<ToolboxActionSelect
|
27
29
|
v-else-if="group.type === ToolboxType.SELECT"
|
28
30
|
:group="group"
|
29
|
-
@toggle="
|
31
|
+
@toggle="openGroup"
|
30
32
|
/>
|
31
33
|
<VcsToolButton
|
32
34
|
v-else
|
@@ -35,7 +37,7 @@
|
|
35
37
|
:active="group.action.active"
|
36
38
|
:background="group.action.background"
|
37
39
|
:disabled="group.action.disabled"
|
38
|
-
@click
|
40
|
+
@click="group.action.callback($event)"
|
39
41
|
v-bind="{ ...$attrs }"
|
40
42
|
/>
|
41
43
|
</div>
|
@@ -133,6 +135,11 @@
|
|
133
135
|
toolboxName.value = name;
|
134
136
|
});
|
135
137
|
|
138
|
+
const zIndex = app.windowManager.addExternalIdToZIndex(
|
139
|
+
'toolbox',
|
140
|
+
vcsAppSymbol,
|
141
|
+
);
|
142
|
+
|
136
143
|
/**
|
137
144
|
* To be rendered in Toolbox components must meet certain conditions:
|
138
145
|
* - SingleToolboxComponent: no further conditions
|
@@ -189,16 +196,36 @@
|
|
189
196
|
onUnmounted(() => {
|
190
197
|
stopWatching();
|
191
198
|
nameChangeListener();
|
199
|
+
app.windowManager.removeExternalIdFromZIndex('toolbox');
|
200
|
+
});
|
201
|
+
|
202
|
+
watch(toolboxOpen, () => {
|
203
|
+
if (toolboxOpen.value) {
|
204
|
+
app.windowManager.bringWindowToTop('toolbox');
|
205
|
+
}
|
192
206
|
});
|
193
207
|
|
208
|
+
const open = ref(false);
|
209
|
+
const bringToTop = () => {
|
210
|
+
app.windowManager.bringWindowToTop('toolbox');
|
211
|
+
};
|
212
|
+
|
194
213
|
return {
|
195
214
|
toolboxOpen,
|
196
215
|
orderedGroups,
|
216
|
+
zIndex,
|
197
217
|
isDefaultToolbox: computed(
|
198
218
|
() => toolboxName.value === defaultToolboxName,
|
199
219
|
),
|
200
220
|
ToolboxType,
|
201
|
-
open
|
221
|
+
open,
|
222
|
+
bringToTop,
|
223
|
+
openGroup(group) {
|
224
|
+
open.value = group;
|
225
|
+
if (open.value) {
|
226
|
+
bringToTop();
|
227
|
+
}
|
228
|
+
},
|
202
229
|
};
|
203
230
|
},
|
204
231
|
};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
2
2
|
toolboxOpen: import("vue").Ref<boolean>;
|
3
3
|
orderedGroups: import("vue").ComputedRef<(import("../buttonManager.js").ButtonComponent | import("./toolboxManager.js").ToolboxComponent)[]>;
|
4
|
+
zIndex: any;
|
4
5
|
isDefaultToolbox: import("vue").ComputedRef<boolean>;
|
5
6
|
ToolboxType: {
|
6
7
|
SINGLE: number;
|
@@ -8,6 +9,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
8
9
|
GROUP: number;
|
9
10
|
};
|
10
11
|
open: import("vue").Ref<boolean>;
|
12
|
+
bringToTop: () => void;
|
13
|
+
openGroup(group: any): void;
|
11
14
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
12
15
|
export default _default;
|
13
16
|
export type ToolboxButtonGroup = {
|
@@ -97,7 +97,7 @@
|
|
97
97
|
* @returns {boolean}
|
98
98
|
*/
|
99
99
|
const isOnTop = (id) => {
|
100
|
-
return windowManager.get(id)?.zIndex.value ===
|
100
|
+
return windowManager.get(id)?.zIndex.value === windowManager.maxZIndex;
|
101
101
|
};
|
102
102
|
/**
|
103
103
|
* @param {WindowComponent} windowComponent
|
@@ -302,8 +302,15 @@ declare class WindowManager implements IWindowManager {
|
|
302
302
|
/**
|
303
303
|
* reactive ordered array of ids, defining the zIndex of a component
|
304
304
|
* @type {import("vue").Ref<Array<string>>}
|
305
|
+
* @private
|
306
|
+
*/
|
307
|
+
private _zIndices;
|
308
|
+
/**
|
309
|
+
* Map of <id, owner> for external zIndexIds
|
310
|
+
* @type {Map<string, string>}
|
311
|
+
* @private
|
305
312
|
*/
|
306
|
-
|
313
|
+
private _externalZIndexIds;
|
307
314
|
/**
|
308
315
|
* @type {Map<string, WindowComponent>}
|
309
316
|
* @private
|
@@ -314,6 +321,14 @@ declare class WindowManager implements IWindowManager {
|
|
314
321
|
* @private
|
315
322
|
*/
|
316
323
|
private _windowPositionsCache;
|
324
|
+
/**
|
325
|
+
* @type {number}
|
326
|
+
*/
|
327
|
+
get maxZIndex(): number;
|
328
|
+
/**
|
329
|
+
* @return {string[]}
|
330
|
+
*/
|
331
|
+
get externalZIndexIds(): string[];
|
317
332
|
/**
|
318
333
|
* @param {string} id
|
319
334
|
* @returns {WindowComponent}
|
@@ -411,6 +426,20 @@ declare class WindowManager implements IWindowManager {
|
|
411
426
|
* @param {string|vcsAppSymbol} owner
|
412
427
|
*/
|
413
428
|
removeOwner(owner: string | symbol): void;
|
429
|
+
/**
|
430
|
+
* Adds a string id to the z index handling of windows. The returned computed
|
431
|
+
* will give you the current z index of the id. Use bringToTop with the id to bring it
|
432
|
+
* to the top, just like a window.
|
433
|
+
* @param {string} id
|
434
|
+
* @param {string|vcsAppSymbol} owner
|
435
|
+
* @return {import("vue").ComputedRef<number>}
|
436
|
+
*/
|
437
|
+
addExternalIdToZIndex(id: string, owner: string | symbol): import("vue").ComputedRef<number>;
|
438
|
+
/**
|
439
|
+
* Removes an external z index id
|
440
|
+
* @param {string} id
|
441
|
+
*/
|
442
|
+
removeExternalIdFromZIndex(id: string): void;
|
414
443
|
/**
|
415
444
|
* removes all windowComponents and fires removed Events
|
416
445
|
*/
|
@@ -269,14 +269,23 @@ class WindowManager {
|
|
269
269
|
/**
|
270
270
|
* reactive ordered array of ids, defining the zIndex of a component
|
271
271
|
* @type {import("vue").Ref<Array<string>>}
|
272
|
+
* @private
|
272
273
|
*/
|
273
274
|
this._zIndices = ref([]);
|
274
275
|
|
276
|
+
/**
|
277
|
+
* Map of <id, owner> for external zIndexIds
|
278
|
+
* @type {Map<string, string>}
|
279
|
+
* @private
|
280
|
+
*/
|
281
|
+
this._externalZIndexIds = new Map();
|
282
|
+
|
275
283
|
/**
|
276
284
|
* @type {Map<string, WindowComponent>}
|
277
285
|
* @private
|
278
286
|
*/
|
279
287
|
this._windowComponents = new Map();
|
288
|
+
|
280
289
|
/**
|
281
290
|
* @type {Map<string, WindowPosition>}
|
282
291
|
* @private
|
@@ -284,6 +293,20 @@ class WindowManager {
|
|
284
293
|
this._windowPositionsCache = new Map();
|
285
294
|
}
|
286
295
|
|
296
|
+
/**
|
297
|
+
* @type {number}
|
298
|
+
*/
|
299
|
+
get maxZIndex() {
|
300
|
+
return this._zIndices.value.length - 1;
|
301
|
+
}
|
302
|
+
|
303
|
+
/**
|
304
|
+
* @return {string[]}
|
305
|
+
*/
|
306
|
+
get externalZIndexIds() {
|
307
|
+
return [...this._externalZIndexIds.keys()];
|
308
|
+
}
|
309
|
+
|
287
310
|
/**
|
288
311
|
* @param {string} id
|
289
312
|
* @returns {WindowComponent}
|
@@ -515,7 +538,11 @@ class WindowManager {
|
|
515
538
|
add(windowComponentOptions, owner) {
|
516
539
|
check(owner, [String, vcsAppSymbol]);
|
517
540
|
|
518
|
-
if (
|
541
|
+
if (
|
542
|
+
windowComponentOptions.id &&
|
543
|
+
(this.has(windowComponentOptions.id) ||
|
544
|
+
this._externalZIndexIds.has(windowComponentOptions.id))
|
545
|
+
) {
|
519
546
|
throw new Error(
|
520
547
|
`A window with id ${windowComponentOptions.id} has already been registered.`,
|
521
548
|
);
|
@@ -569,6 +596,7 @@ class WindowManager {
|
|
569
596
|
const position = reactive(windowPosition);
|
570
597
|
const initialPosition = { ...windowPositionOptions };
|
571
598
|
const zIndex = computed(() => this._zIndices.value.indexOf(id));
|
599
|
+
|
572
600
|
/**
|
573
601
|
* @type {WindowComponent}
|
574
602
|
*/
|
@@ -627,7 +655,7 @@ class WindowManager {
|
|
627
655
|
* @param {string} id
|
628
656
|
*/
|
629
657
|
bringWindowToTop(id) {
|
630
|
-
if (this.has(id)) {
|
658
|
+
if (this.has(id) || this._externalZIndexIds.has(id)) {
|
631
659
|
const index = this._zIndices.value.indexOf(id);
|
632
660
|
if (index >= 0 && index !== this._zIndices.value.length - 1) {
|
633
661
|
this._zIndices.value.push(id);
|
@@ -675,6 +703,47 @@ class WindowManager {
|
|
675
703
|
this.remove(id);
|
676
704
|
}
|
677
705
|
});
|
706
|
+
this._externalZIndexIds.forEach((externalOwner, id) => {
|
707
|
+
if (externalOwner === owner) {
|
708
|
+
this.removeExternalIdFromZIndex(id);
|
709
|
+
}
|
710
|
+
});
|
711
|
+
}
|
712
|
+
|
713
|
+
/**
|
714
|
+
* Adds a string id to the z index handling of windows. The returned computed
|
715
|
+
* will give you the current z index of the id. Use bringToTop with the id to bring it
|
716
|
+
* to the top, just like a window.
|
717
|
+
* @param {string} id
|
718
|
+
* @param {string|vcsAppSymbol} owner
|
719
|
+
* @return {import("vue").ComputedRef<number>}
|
720
|
+
*/
|
721
|
+
addExternalIdToZIndex(id, owner) {
|
722
|
+
check(id, String);
|
723
|
+
check(owner, [String, vcsAppSymbol]);
|
724
|
+
|
725
|
+
if (this.has(id)) {
|
726
|
+
throw new Error(`Id ${id} already belongs to a window id`);
|
727
|
+
}
|
728
|
+
|
729
|
+
if (this._externalZIndexIds.has(id)) {
|
730
|
+
throw new Error(`Id ${id} is already added`);
|
731
|
+
}
|
732
|
+
this._externalZIndexIds.set(id, owner);
|
733
|
+
this._zIndices.value.push(id);
|
734
|
+
return computed(() => this._zIndices.value.indexOf(id));
|
735
|
+
}
|
736
|
+
|
737
|
+
/**
|
738
|
+
* Removes an external z index id
|
739
|
+
* @param {string} id
|
740
|
+
*/
|
741
|
+
removeExternalIdFromZIndex(id) {
|
742
|
+
this._externalZIndexIds.delete(id);
|
743
|
+
const index = this._zIndices.value.indexOf(id);
|
744
|
+
if (index > -1) {
|
745
|
+
this._zIndices.value.splice(index, 1);
|
746
|
+
}
|
678
747
|
}
|
679
748
|
|
680
749
|
/**
|
@@ -64,7 +64,9 @@
|
|
64
64
|
} else {
|
65
65
|
listener = app.maps.mapActivated.addEventListener((map) => {
|
66
66
|
defaultViewpoint = map.getViewpointSync();
|
67
|
-
|
67
|
+
if (defaultViewpoint?.isValid()) {
|
68
|
+
listener();
|
69
|
+
}
|
68
70
|
});
|
69
71
|
}
|
70
72
|
|
@@ -88,9 +90,10 @@
|
|
88
90
|
title: 'navigation.homeButton',
|
89
91
|
icon: '$vcsHomePoint',
|
90
92
|
async callback() {
|
91
|
-
|
92
|
-
|
93
|
-
|
93
|
+
const vp = getStartingViewpoint() || defaultViewpoint;
|
94
|
+
if (app.maps.activeMap && vp?.isValid()) {
|
95
|
+
await app.maps.activeMap.gotoViewpoint(vp);
|
96
|
+
}
|
94
97
|
},
|
95
98
|
});
|
96
99
|
|
@@ -11,6 +11,7 @@ import {
|
|
11
11
|
Extent,
|
12
12
|
Viewpoint,
|
13
13
|
deserializeLayer,
|
14
|
+
maxZIndex,
|
14
15
|
} from '@vcmap/core';
|
15
16
|
import Point from 'ol/geom/Point.js';
|
16
17
|
import Feature from 'ol/Feature.js';
|
@@ -454,23 +455,25 @@ class OverviewMap {
|
|
454
455
|
* @private
|
455
456
|
*/
|
456
457
|
_obliqueImageChange(image) {
|
457
|
-
|
458
|
-
|
459
|
-
this._obliqueViewDirection
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
458
|
+
if (image) {
|
459
|
+
const { source } = this._obliqueImageLayer;
|
460
|
+
if (this._obliqueViewDirection !== image.viewDirection) {
|
461
|
+
this._obliqueViewDirection = image.viewDirection;
|
462
|
+
source.changed();
|
463
|
+
}
|
464
|
+
const activeFeature = source.getFeatureById(image.name);
|
465
|
+
if (activeFeature) {
|
466
|
+
this._obliqueSelectedImageLayer.removeAllFeatures();
|
467
|
+
this._obliqueSelectedImageLayer.addFeatures([activeFeature]);
|
468
|
+
const extent = new Extent({
|
469
|
+
coordinates: activeFeature.getGeometry().getExtent(),
|
470
|
+
projection: mercatorProjection.toJSON(),
|
471
|
+
});
|
472
|
+
|
473
|
+
const vp = Viewpoint.createViewpointFromExtent(extent);
|
474
|
+
vp.distance /= this._obliqueResolutionFactor;
|
475
|
+
this._map.gotoViewpoint(vp);
|
476
|
+
}
|
474
477
|
}
|
475
478
|
}
|
476
479
|
|
@@ -492,7 +495,7 @@ class OverviewMap {
|
|
492
495
|
this._obliqueTileLayer = new VectorLayer({
|
493
496
|
projection: mercatorProjection.toJSON(),
|
494
497
|
style: obliqueTileStyle,
|
495
|
-
zIndex:
|
498
|
+
zIndex: maxZIndex - 3,
|
496
499
|
});
|
497
500
|
this._obliqueTileLayer[overviewMapLayerSymbol] = true;
|
498
501
|
|
@@ -507,11 +510,13 @@ class OverviewMap {
|
|
507
510
|
this._obliqueImageLayer = new VectorLayer({
|
508
511
|
projection: mercatorProjection.toJSON(),
|
509
512
|
style: obliqueImageStyle,
|
513
|
+
zIndex: maxZIndex - 2,
|
510
514
|
});
|
511
515
|
this._obliqueImageLayer[overviewMapLayerSymbol] = true;
|
512
516
|
this._obliqueSelectedImageLayer = new VectorLayer({
|
513
517
|
projection: mercatorProjection.toJSON(),
|
514
518
|
style: this.obliqueSelectedStyle,
|
519
|
+
zIndex: maxZIndex - 1,
|
515
520
|
});
|
516
521
|
this._obliqueSelectedImageLayer[overviewMapLayerSymbol] = true;
|
517
522
|
this._map.layerCollection.add(this._obliqueImageLayer);
|
@@ -539,7 +544,7 @@ class OverviewMap {
|
|
539
544
|
if (!this._cameraIconLayer) {
|
540
545
|
this._cameraIconLayer = new VectorLayer({
|
541
546
|
projection: mercatorProjection.toJSON(),
|
542
|
-
zIndex:
|
547
|
+
zIndex: maxZIndex,
|
543
548
|
});
|
544
549
|
this._cameraIconLayer[overviewMapLayerSymbol] = true;
|
545
550
|
this._map.layerCollection.add(this._cameraIconLayer);
|
@@ -1 +0,0 @@
|
|
1
|
-
import{initAppFromAppConfig as p}from"./ui.a843ac.js";p("#app","app.config.json");
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|