@vcmap/ui 6.1.0-rc.2 → 6.1.0-rc.3
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/config/base.config.json +6 -0
- package/config/clipping.config.json +384 -0
- package/config/cluster.config.json +106 -0
- package/config/concepts-show-case.config.json +4 -0
- package/config/projects.config.json +5 -2
- package/dist/assets/{cesium-57fbd309.js → cesium-87d5e72d.js} +438 -432
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core-fd079400.js → core-72f9f393.js} +4907 -4514
- package/dist/assets/core.js +1 -1
- package/dist/assets/{ol-50dfef96.js → ol-e468ba43.js} +23518 -22404
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui-73257b15.css +1 -0
- package/dist/assets/{ui-5135917c.js → ui-73257b15.js} +13440 -12742
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +1 -1
- package/dist/assets/{vuetify-f02b7bb9.css → vuetify-2437380c.css} +2 -2
- package/dist/assets/{vuetify-f02b7bb9.js → vuetify-2437380c.js} +8024 -7634
- package/dist/assets/vuetify.js +1 -1
- package/index.d.ts +38 -19
- package/index.js +35 -6
- package/lib/olLib.js +25 -3
- package/package.json +6 -6
- package/plugins/@vcmap-show-case/callback-tester/README.md +3 -0
- package/plugins/@vcmap-show-case/callback-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/callback-tester/src/CallbackTester.vue +62 -0
- package/plugins/@vcmap-show-case/callback-tester/src/index.js +48 -0
- package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +1 -0
- package/src/actions/actionHelper.d.ts +1 -0
- package/src/actions/actionHelper.js +70 -19
- package/src/application/VcsApp.vue +83 -50
- package/src/application/VcsApp.vue.d.ts +24 -2
- package/src/application/VcsContainer.vue.d.ts +8 -0
- package/src/application/VcsObliqueFooter.vue +9 -3
- package/src/application/VcsSplashScreen.vue +37 -0
- package/src/application/VcsSplashScreen.vue.d.ts +6 -0
- package/src/application/positionDisplayInteraction.js +1 -1
- package/src/callback/activateClippingPolygonCallback.d.ts +29 -0
- package/src/callback/activateClippingPolygonCallback.js +54 -0
- package/src/callback/closeSplashScreenCallback.d.ts +8 -0
- package/src/callback/closeSplashScreenCallback.js +33 -0
- package/src/callback/deactivateClippingPolygonCallback.d.ts +29 -0
- package/src/callback/deactivateClippingPolygonCallback.js +54 -0
- package/src/callback/openSplashScreenCallback.d.ts +8 -0
- package/src/callback/openSplashScreenCallback.js +35 -0
- package/src/callback/toggleNavbarButtonCallback.d.ts +36 -0
- package/src/callback/toggleNavbarButtonCallback.js +62 -0
- package/src/components/form-inputs-controls/VcsSelect.vue +1 -1
- package/src/components/form-inputs-controls/VcsTextArea.vue +12 -7
- package/src/components/form-output/markdownHelper.d.ts +0 -25
- package/src/components/form-output/markdownHelper.js +1 -386
- package/src/components/lists/VcsGroupedList.vue +178 -0
- package/src/components/lists/VcsGroupedList.vue.d.ts +17 -0
- package/src/components/lists/VcsList.vue +142 -396
- package/src/components/lists/VcsList.vue.d.ts +38 -168
- package/src/components/lists/VcsTreeview.vue +11 -12
- package/src/components/lists/listHelper.d.ts +87 -0
- package/src/components/lists/listHelper.js +348 -0
- package/src/components/section/VcsFormSection.vue +7 -2
- package/src/components/section/VcsFormSection.vue.d.ts +9 -0
- package/src/components/vector-properties/VcsVectorPropertiesComponent.vue.d.ts +1 -1
- package/src/contentTree/LayerTree.vue +2 -1
- package/src/contentTree/LayerTree.vue.d.ts +2 -0
- package/src/contentTree/contentTreeCollection.d.ts +1 -0
- package/src/contentTree/contentTreeCollection.js +7 -3
- package/src/contentTree/contentTreeItem.js +4 -2
- package/src/contentTree/groupContentTreeItem.js +5 -3
- package/src/featureInfo/ClusterFeatureComponent.vue +58 -0
- package/src/featureInfo/ClusterFeatureComponent.vue.d.ts +6 -0
- package/src/featureInfo/abstractFeatureInfoView.js +1 -2
- package/src/featureInfo/featureInfo.d.ts +87 -1
- package/src/featureInfo/featureInfo.js +342 -34
- package/src/featureInfo/featureInfoInteraction.js +18 -3
- package/src/featureInfo/iframeFeatureInfoView.js +1 -1
- package/src/featureInfo/markdownBalloonFeatureInfoView.js +2 -4
- package/src/featureInfo/markdownFeatureInfoView.js +1 -1
- package/src/i18n/de.d.ts +17 -4
- package/src/i18n/de.js +7 -0
- package/src/i18n/en.d.ts +17 -4
- package/src/i18n/en.js +7 -0
- package/src/legend/legendHelper.d.ts +1 -1
- package/src/legend/legendHelper.js +52 -9
- package/src/localStorage.d.ts +21 -0
- package/src/localStorage.js +51 -0
- package/src/manager/collectionManager/CollectionComponent.vue +1 -1
- package/src/manager/collectionManager/CollectionComponentContent.vue +2 -3
- package/src/manager/collectionManager/CollectionComponentList.vue +2 -3
- package/src/manager/collectionManager/CollectionComponentStandalone.vue +1 -1
- package/src/manager/navbarManager.js +9 -4
- package/src/manager/toolbox/ToolboxManagerComponent.vue +10 -8
- package/src/manager/toolbox/ToolboxManagerComponent.vue.d.ts +11 -0
- package/src/manager/window/windowHelper.d.ts +7 -3
- package/src/manager/window/windowHelper.js +30 -10
- package/src/navigation/overviewMap.d.ts +1 -0
- package/src/navigation/overviewMap.js +4 -3
- package/src/pluginHelper.d.ts +7 -0
- package/src/pluginHelper.js +18 -4
- package/src/search/ResultItem.vue.d.ts +1 -1
- package/src/search/search.js +1 -1
- package/src/state.d.ts +4 -2
- package/src/state.js +54 -31
- package/src/uiConfig.d.ts +27 -0
- package/src/uiConfig.js +16 -1
- package/src/vcsUiApp.js +7 -11
- package/dist/assets/ui-5135917c.css +0 -1
- /package/dist/assets/{vue-c3c55d88.js → vue-ff37ea23.js} +0 -0
@@ -12,6 +12,11 @@ import {
|
|
12
12
|
VectorStyleItem,
|
13
13
|
markVolatile,
|
14
14
|
maxZIndex,
|
15
|
+
vectorClusterGroupName,
|
16
|
+
hidden,
|
17
|
+
isProvidedClusterFeature,
|
18
|
+
alreadyTransformedToImage,
|
19
|
+
ObliqueMap,
|
15
20
|
} from '@vcmap/core';
|
16
21
|
import { getLogger as getLoggerByName } from '@vcsuite/logger';
|
17
22
|
import {
|
@@ -24,6 +29,7 @@ import { Feature } from 'ol';
|
|
24
29
|
import { check, maybe, oneOf } from '@vcsuite/check';
|
25
30
|
|
26
31
|
import { reactive } from 'vue';
|
32
|
+
import { WindowSlot } from '../manager/window/windowManager.js';
|
27
33
|
import { vcsAppSymbol } from '../pluginHelper.js';
|
28
34
|
import FeatureInfoInteraction from './featureInfoInteraction.js';
|
29
35
|
import AbstractFeatureInfoView from './abstractFeatureInfoView.js';
|
@@ -36,6 +42,7 @@ import { getDefaultPrimaryColor } from '../vuePlugins/vuetify.js';
|
|
36
42
|
import { ToolboxType } from '../manager/toolbox/toolboxManager.js';
|
37
43
|
import MarkdownBalloonFeatureInfoView from './markdownBalloonFeatureInfoView.js';
|
38
44
|
import IframeWmsFeatureInfoView from './iframeWmsFeatureInfoView.js';
|
45
|
+
import ClusterFeatureComponent from './ClusterFeatureComponent.vue';
|
39
46
|
|
40
47
|
/** @typedef {import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature|import("@vcmap-cesium/engine").Entity} FeatureType */
|
41
48
|
|
@@ -64,6 +71,43 @@ export const featureInfoClassRegistry = new ClassRegistry();
|
|
64
71
|
*/
|
65
72
|
export const featureInfoViewSymbol = Symbol('featureInfoView');
|
66
73
|
|
74
|
+
/**
|
75
|
+
*
|
76
|
+
* @param {import("ol/style/Style.js").default?} style
|
77
|
+
* @param {import("@vcmap-cesium/engine").Color} fillColor
|
78
|
+
* @returns {import("ol/style/Style.js").default}
|
79
|
+
*/
|
80
|
+
export function getHighlightStyleFromStyle(style, fillColor) {
|
81
|
+
const highlightStyle =
|
82
|
+
style?.clone?.() ??
|
83
|
+
new VectorStyleItem(getDefaultVectorStyleItemOptions()).style;
|
84
|
+
if (highlightStyle.getText()) {
|
85
|
+
if (highlightStyle.getText().getFill()) {
|
86
|
+
highlightStyle.getText().getFill().setColor(fillColor.toCssColorString());
|
87
|
+
}
|
88
|
+
highlightStyle
|
89
|
+
.getText()
|
90
|
+
.setScale((highlightStyle.getText().getScale() ?? 1) * 2);
|
91
|
+
}
|
92
|
+
if (highlightStyle.getImage()) {
|
93
|
+
highlightStyle
|
94
|
+
.getImage()
|
95
|
+
.setScale(highlightStyle.getImage().getScale() * 2);
|
96
|
+
}
|
97
|
+
if (highlightStyle.getStroke()) {
|
98
|
+
highlightStyle.getStroke().setColor(fillColor.toCssColorString());
|
99
|
+
highlightStyle
|
100
|
+
.getStroke()
|
101
|
+
.setWidth(highlightStyle.getStroke().getWidth() * 2);
|
102
|
+
}
|
103
|
+
if (highlightStyle.getFill()) {
|
104
|
+
const color = fillColor.toBytes();
|
105
|
+
color[3] /= 255;
|
106
|
+
highlightStyle.getFill().setColor(color);
|
107
|
+
}
|
108
|
+
return highlightStyle;
|
109
|
+
}
|
110
|
+
|
67
111
|
/**
|
68
112
|
* @param {FeatureType} feature
|
69
113
|
* @param {import("@vcmap/core").Layer} layer
|
@@ -71,7 +115,7 @@ export const featureInfoViewSymbol = Symbol('featureInfoView');
|
|
71
115
|
* @returns {import("ol/style/Style.js").default|import("@vcmap/core").VectorStyleItem}
|
72
116
|
*/
|
73
117
|
export function getHighlightStyle(feature, layer, defaultFillColor) {
|
74
|
-
if (layer
|
118
|
+
if (layer?.highlightStyle) {
|
75
119
|
return layer.highlightStyle;
|
76
120
|
}
|
77
121
|
|
@@ -81,32 +125,32 @@ export function getHighlightStyle(feature, layer, defaultFillColor) {
|
|
81
125
|
if (typeof style === 'function') {
|
82
126
|
style = style(feature, 1);
|
83
127
|
}
|
84
|
-
style
|
85
|
-
style?.clone?.() ??
|
86
|
-
new VectorStyleItem(getDefaultVectorStyleItemOptions()).style;
|
87
|
-
if (style.getText()) {
|
88
|
-
if (style.getText().getFill()) {
|
89
|
-
style.getText().getFill().setColor(fillColor.toCssColorString());
|
90
|
-
}
|
91
|
-
style.getText().setScale((style.getText().getScale() ?? 1) * 2);
|
92
|
-
}
|
93
|
-
if (style.getImage()) {
|
94
|
-
style.getImage().setScale(style.getImage().getScale() * 2);
|
95
|
-
}
|
96
|
-
if (style.getStroke()) {
|
97
|
-
style.getStroke().setColor(fillColor.toCssColorString());
|
98
|
-
style.getStroke().setWidth(style.getStroke().getWidth() * 2);
|
99
|
-
}
|
100
|
-
if (style.getFill()) {
|
101
|
-
const color = fillColor.toBytes();
|
102
|
-
color[3] /= 255;
|
103
|
-
style.getFill().setColor(color);
|
104
|
-
}
|
105
|
-
return style;
|
128
|
+
return getHighlightStyleFromStyle(style, fillColor);
|
106
129
|
}
|
107
130
|
return fromCesiumColor(fillColor);
|
108
131
|
}
|
109
132
|
|
133
|
+
/**
|
134
|
+
* @param {import("ol").Feature} clusterFeature
|
135
|
+
* @param {import("@vcmap/core").VectorClusterGroup} clusterGroup
|
136
|
+
* @param {import("ol/style/Style.js").default} clusterStyle
|
137
|
+
* @param {string} defaultFillColor
|
138
|
+
* @returns {import("ol/style/Style.js").default}
|
139
|
+
*/
|
140
|
+
export function getClusterHighlightStyle(
|
141
|
+
clusterFeature,
|
142
|
+
clusterGroup,
|
143
|
+
clusterStyle,
|
144
|
+
defaultFillColor,
|
145
|
+
) {
|
146
|
+
if (clusterGroup?.highlightStyle) {
|
147
|
+
return clusterGroup.getHighlightStyleForFeature(clusterFeature);
|
148
|
+
}
|
149
|
+
|
150
|
+
const fillColor = Color.fromCssColorString(defaultFillColor).withAlpha(0.8);
|
151
|
+
return getHighlightStyleFromStyle(clusterStyle, fillColor);
|
152
|
+
}
|
153
|
+
|
110
154
|
/**
|
111
155
|
* @param {import("../vcsUiApp.js").default} app
|
112
156
|
* @returns {FeatureInfoSession}
|
@@ -158,7 +202,7 @@ function setupFeatureInfoTool(app) {
|
|
158
202
|
session.stopped.addEventListener(() => {
|
159
203
|
action.active = false;
|
160
204
|
session = null;
|
161
|
-
app.featureInfo.
|
205
|
+
app.featureInfo.clearSelection();
|
162
206
|
action.title = 'featureInfo.activateToolTitle';
|
163
207
|
});
|
164
208
|
this.active = true;
|
@@ -266,7 +310,12 @@ class FeatureInfo extends Collection {
|
|
266
310
|
*/
|
267
311
|
this._windowId = null;
|
268
312
|
/**
|
269
|
-
* @type {
|
313
|
+
* @type {string|null}
|
314
|
+
* @private
|
315
|
+
*/
|
316
|
+
this._clusterWindowId = null;
|
317
|
+
/**
|
318
|
+
* @type {VcsEvent<FeatureType|null>}
|
270
319
|
* @private
|
271
320
|
*/
|
272
321
|
this._featureChanged = new VcsEvent();
|
@@ -280,6 +329,21 @@ class FeatureInfo extends Collection {
|
|
280
329
|
* @private
|
281
330
|
*/
|
282
331
|
this._selectedFeatureId = null;
|
332
|
+
/**
|
333
|
+
* @type {VcsEvent<import("ol").Feature|null>}
|
334
|
+
* @private
|
335
|
+
*/
|
336
|
+
this._clusterFeatureChanged = new VcsEvent();
|
337
|
+
/**
|
338
|
+
* @type {import("ol").Feature|null}
|
339
|
+
* @private
|
340
|
+
*/
|
341
|
+
this._selectedClusterFeature = null;
|
342
|
+
/**
|
343
|
+
* @type {string|null}
|
344
|
+
* @private
|
345
|
+
*/
|
346
|
+
this._selectedClusterFeatureId = null;
|
283
347
|
/**
|
284
348
|
* @type {Array<function():void>}
|
285
349
|
* @private
|
@@ -305,18 +369,39 @@ class FeatureInfo extends Collection {
|
|
305
369
|
) {
|
306
370
|
this._app.windowManager.remove(this._windowId);
|
307
371
|
}
|
372
|
+
|
373
|
+
if (
|
374
|
+
this._clusterWindowId &&
|
375
|
+
this._app.windowManager.has(this._clusterWindowId)
|
376
|
+
) {
|
377
|
+
const { props } = this._app.windowManager.get(this._clusterWindowId);
|
378
|
+
if (props.items.some((item) => item.group === layer.name)) {
|
379
|
+
props.items = props.items.filter(
|
380
|
+
(item) => item.group !== layer.name,
|
381
|
+
);
|
382
|
+
props.groups = props.groups.filter(
|
383
|
+
(group) => group.name !== layer.name,
|
384
|
+
);
|
385
|
+
if (props.items.length === 0) {
|
386
|
+
this._app.windowManager.remove(this._clusterWindowId);
|
387
|
+
}
|
388
|
+
}
|
389
|
+
}
|
308
390
|
}),
|
309
391
|
this._app.windowManager.removed.addEventListener(({ id }) => {
|
310
392
|
if (id === this._windowId) {
|
311
|
-
this.
|
393
|
+
this.clearFeature();
|
394
|
+
}
|
395
|
+
if (id === this._clusterWindowId) {
|
396
|
+
this.clearCluster();
|
312
397
|
}
|
313
398
|
}),
|
314
399
|
this._app.moduleAdded.addEventListener(() => {
|
315
|
-
this.
|
400
|
+
this.clearSelection();
|
316
401
|
this._destroyFeatureInfoTool();
|
317
402
|
this._destroyFeatureInfoTool = setupFeatureInfoTool(this._app);
|
318
403
|
}),
|
319
|
-
this._app.moduleRemoved.addEventListener(() => this.
|
404
|
+
this._app.moduleRemoved.addEventListener(() => this.clearSelection()),
|
320
405
|
];
|
321
406
|
/**
|
322
407
|
* A vector layer to render provided features on
|
@@ -332,6 +417,8 @@ class FeatureInfo extends Collection {
|
|
332
417
|
}
|
333
418
|
|
334
419
|
/**
|
420
|
+
* Emitted whenever a feature is selected or cleared.
|
421
|
+
* Does not reflect cluster feature changes!
|
335
422
|
* @type {VcsEvent<null|FeatureType>}
|
336
423
|
*/
|
337
424
|
get featureChanged() {
|
@@ -352,6 +439,28 @@ class FeatureInfo extends Collection {
|
|
352
439
|
return this._selectedFeatureId;
|
353
440
|
}
|
354
441
|
|
442
|
+
/**
|
443
|
+
* Emitted whenever a cluster feature is selected or cleared.
|
444
|
+
* @type {VcsEvent<null|import("ol").Feature>}
|
445
|
+
*/
|
446
|
+
get clusterFeatureChanged() {
|
447
|
+
return this._clusterFeatureChanged;
|
448
|
+
}
|
449
|
+
|
450
|
+
/**
|
451
|
+
* @type {null|import("ol").Feature}
|
452
|
+
*/
|
453
|
+
get selectedClusterFeature() {
|
454
|
+
return this._selectedClusterFeature;
|
455
|
+
}
|
456
|
+
|
457
|
+
/**
|
458
|
+
* @type {null|string}
|
459
|
+
*/
|
460
|
+
get selectedClusterFeatureId() {
|
461
|
+
return this._selectedClusterFeatureId;
|
462
|
+
}
|
463
|
+
|
355
464
|
/**
|
356
465
|
* The window id of the current features FeatureInfoView window
|
357
466
|
* @type {string|null}
|
@@ -360,6 +469,14 @@ class FeatureInfo extends Collection {
|
|
360
469
|
return this._windowId;
|
361
470
|
}
|
362
471
|
|
472
|
+
/**
|
473
|
+
* The window id of the current cluster feature window
|
474
|
+
* @type {string|null}
|
475
|
+
*/
|
476
|
+
get clusterWindowId() {
|
477
|
+
return this._clusterWindowId;
|
478
|
+
}
|
479
|
+
|
363
480
|
/**
|
364
481
|
* @private
|
365
482
|
*/
|
@@ -426,10 +543,19 @@ class FeatureInfo extends Collection {
|
|
426
543
|
|
427
544
|
if (usedFeatureInfoView && layer) {
|
428
545
|
this._clearInternal();
|
546
|
+
if (
|
547
|
+
this._selectedClusterFeature &&
|
548
|
+
!this._selectedClusterFeature.get('features').includes(feature)
|
549
|
+
) {
|
550
|
+
this.clearCluster();
|
551
|
+
}
|
429
552
|
if (feature[isProvidedFeature]) {
|
430
553
|
this._ensureScratchLayer();
|
431
|
-
|
432
|
-
const
|
554
|
+
// we need to clone the feature to avoid changing vcsLayerNameSymbol on the original feature
|
555
|
+
const clonedFeature = feature.clone();
|
556
|
+
clonedFeature.setId(feature.getId());
|
557
|
+
this._scratchLayer.addFeatures([clonedFeature]);
|
558
|
+
const featureId = clonedFeature.getId(); // make sure to grab ID after adding it to the layer
|
433
559
|
this._scratchLayer.featureVisibility.highlight({
|
434
560
|
[featureId]: getHighlightStyle(
|
435
561
|
feature,
|
@@ -440,6 +566,29 @@ class FeatureInfo extends Collection {
|
|
440
566
|
});
|
441
567
|
this._clearHighlightingCb = () =>
|
442
568
|
this._scratchLayer.featureVisibility.unHighlight([featureId]);
|
569
|
+
} else if (layer.vectorClusterGroup) {
|
570
|
+
this._ensureScratchLayer();
|
571
|
+
const clone = feature.clone();
|
572
|
+
const featureId = feature.getId();
|
573
|
+
this._scratchLayer.vectorProperties.setValuesForFeatures(
|
574
|
+
layer.vectorProperties.getValuesForFeatures([clone]),
|
575
|
+
[clone],
|
576
|
+
);
|
577
|
+
const eyeOffset = clone.get('olcs_eyeOffset') ?? [0, 0, 0];
|
578
|
+
eyeOffset[2] -= 10;
|
579
|
+
clone.set('olcs_eyeOffset', eyeOffset);
|
580
|
+
clone.setId(featureId);
|
581
|
+
this._scratchLayer.addFeatures([clone]);
|
582
|
+
this._scratchLayer.featureVisibility.highlight({
|
583
|
+
[featureId]: getHighlightStyle(
|
584
|
+
feature,
|
585
|
+
layer,
|
586
|
+
this._app.uiConfig.config.primaryColor ??
|
587
|
+
getDefaultPrimaryColor(this._app),
|
588
|
+
),
|
589
|
+
});
|
590
|
+
this._clearHighlightingCb = () =>
|
591
|
+
this._scratchLayer.featureVisibility.unHighlight([clone]);
|
443
592
|
} else if (layer.featureVisibility) {
|
444
593
|
const featureId = feature.getId();
|
445
594
|
layer.featureVisibility.highlight({
|
@@ -470,10 +619,117 @@ class FeatureInfo extends Collection {
|
|
470
619
|
this._selectedFeatureId = feature.getId();
|
471
620
|
this._featureChanged.raiseEvent(this._selectedFeature);
|
472
621
|
} else {
|
473
|
-
this.
|
622
|
+
this.clearSelection();
|
474
623
|
}
|
475
624
|
}
|
476
625
|
|
626
|
+
/**
|
627
|
+
* Selecting a cluster feature opens a window listing the features belonging to the cluster feature.
|
628
|
+
* To be listed the feature must meet the following criteria: a) the feature must be part of a layer, b) said layer must be managed in
|
629
|
+
* the same VcsApp as provided to the FeatureInfo on construction. if not providing a feature info view, then c) said layer must have a featureInfo property set on
|
630
|
+
* its properties bag and d) said featureInfo property must provide the name of a FeatureInfoView present on this FeatureInfos
|
631
|
+
* collection.
|
632
|
+
* The cluster feature will be cloned, highlighted and added on an internal scratch layer to ensure availability until deselection.
|
633
|
+
* The original cluster feature will be hidden until deselection.
|
634
|
+
* @param {import("ol").Feature} clusterFeature
|
635
|
+
* @returns {Promise<void>}
|
636
|
+
*/
|
637
|
+
async selectClusterFeature(clusterFeature) {
|
638
|
+
this.clearFeature();
|
639
|
+
this._clearClusterInternal();
|
640
|
+
const id = `cluster-at-${clusterFeature.getGeometry().getCoordinates().join('-')}`;
|
641
|
+
|
642
|
+
this._ensureScratchLayer();
|
643
|
+
const feature = clusterFeature.clone();
|
644
|
+
feature.setId(id);
|
645
|
+
|
646
|
+
clusterFeature[hidden] = true;
|
647
|
+
clusterFeature.changed();
|
648
|
+
|
649
|
+
const fillColor =
|
650
|
+
this._app.uiConfig.config.primaryColor ??
|
651
|
+
getDefaultPrimaryColor(this._app);
|
652
|
+
|
653
|
+
if (clusterFeature[vectorClusterGroupName]) {
|
654
|
+
const clusterGroup = this._app.vectorClusterGroups.getByKey(
|
655
|
+
clusterFeature[vectorClusterGroupName],
|
656
|
+
);
|
657
|
+
this._scratchLayer.vectorProperties.setValuesForFeatures(
|
658
|
+
clusterGroup.vectorProperties.getValuesForFeatures([feature]),
|
659
|
+
[feature],
|
660
|
+
);
|
661
|
+
const clusterStyle = clusterGroup.style.createStyleFunction((layerName) =>
|
662
|
+
this._app.layers.getByKey(layerName),
|
663
|
+
)(clusterFeature, 1);
|
664
|
+
const highlightStyle = getClusterHighlightStyle(
|
665
|
+
clusterFeature,
|
666
|
+
clusterGroup,
|
667
|
+
clusterStyle,
|
668
|
+
fillColor,
|
669
|
+
);
|
670
|
+
feature.setStyle(highlightStyle);
|
671
|
+
} else if (clusterFeature[isProvidedClusterFeature]) {
|
672
|
+
feature.setStyle(
|
673
|
+
fromCesiumColor(Color.fromCssColorString(fillColor)).style,
|
674
|
+
);
|
675
|
+
}
|
676
|
+
|
677
|
+
if (this._app.maps.activeMap instanceof ObliqueMap) {
|
678
|
+
feature.getGeometry()[alreadyTransformedToImage] = true;
|
679
|
+
}
|
680
|
+
this._scratchLayer.addFeatures([feature]);
|
681
|
+
|
682
|
+
const features = clusterFeature.get('features');
|
683
|
+
const groups = {};
|
684
|
+
const items = features.map((f) => {
|
685
|
+
const listItem = reactive({
|
686
|
+
name: f.getId(),
|
687
|
+
title: f.getAttributes()?.title || f.getAttributes()?.name || f.getId(),
|
688
|
+
disabled: !this._getFeatureInfoViewForFeature(f),
|
689
|
+
selectionChanged: (value) => {
|
690
|
+
if (value) {
|
691
|
+
this.selectFeature(f);
|
692
|
+
} else {
|
693
|
+
this.clearFeature();
|
694
|
+
}
|
695
|
+
},
|
696
|
+
});
|
697
|
+
const layerName = f[vcsLayerName];
|
698
|
+
if (layerName) {
|
699
|
+
if (!groups[layerName]) {
|
700
|
+
const title = this._app.layers.getByKey(layerName)?.properties?.title;
|
701
|
+
groups[layerName] = {
|
702
|
+
name: layerName,
|
703
|
+
title: title || layerName,
|
704
|
+
};
|
705
|
+
}
|
706
|
+
listItem.group = layerName;
|
707
|
+
}
|
708
|
+
return listItem;
|
709
|
+
});
|
710
|
+
|
711
|
+
this._clusterWindowId = id;
|
712
|
+
this._app.windowManager.add(
|
713
|
+
{
|
714
|
+
id,
|
715
|
+
component: ClusterFeatureComponent,
|
716
|
+
props: reactive({
|
717
|
+
items,
|
718
|
+
groups: Object.values(groups),
|
719
|
+
}),
|
720
|
+
state: {
|
721
|
+
headerTitle: 'featureInfo.cluster.headerTitle',
|
722
|
+
},
|
723
|
+
slot: WindowSlot.DYNAMIC_LEFT,
|
724
|
+
},
|
725
|
+
vcsAppSymbol,
|
726
|
+
);
|
727
|
+
|
728
|
+
this._selectedClusterFeature = clusterFeature;
|
729
|
+
this._selectedClusterFeatureId = id;
|
730
|
+
this._clusterFeatureChanged.raiseEvent(this._selectedClusterFeature);
|
731
|
+
}
|
732
|
+
|
477
733
|
/**
|
478
734
|
* Clears the current feature. remove window, highlighting and provided feature.
|
479
735
|
* @private
|
@@ -487,16 +743,35 @@ class FeatureInfo extends Collection {
|
|
487
743
|
this._app.windowManager.remove(this._windowId);
|
488
744
|
this._windowId = null;
|
489
745
|
}
|
746
|
+
if (this._scratchLayer && this._selectedFeatureId) {
|
747
|
+
this._scratchLayer.removeFeaturesById([this._selectedFeatureId]);
|
748
|
+
}
|
749
|
+
}
|
490
750
|
|
491
|
-
|
492
|
-
|
751
|
+
/**
|
752
|
+
* Clears the current cluster feature. remove window, highlighting and provided cluster feature.
|
753
|
+
* @private
|
754
|
+
*/
|
755
|
+
_clearClusterInternal() {
|
756
|
+
if (this._clusterWindowId) {
|
757
|
+
this._app.windowManager.remove(this._clusterWindowId);
|
758
|
+
this._clusterWindowId = null;
|
759
|
+
}
|
760
|
+
|
761
|
+
if (this._selectedClusterFeature) {
|
762
|
+
this._selectedClusterFeature[hidden] = false;
|
763
|
+
this._selectedClusterFeature.changed();
|
764
|
+
|
765
|
+
if (this._scratchLayer) {
|
766
|
+
this._scratchLayer.removeFeaturesById([this._selectedClusterFeatureId]);
|
767
|
+
}
|
493
768
|
}
|
494
769
|
}
|
495
770
|
|
496
771
|
/**
|
497
772
|
* Deselecting feature clears highlighting and closes FeatureInfoView. fires feature changed with null
|
498
773
|
*/
|
499
|
-
|
774
|
+
clearFeature() {
|
500
775
|
this._clearInternal();
|
501
776
|
if (this._selectedFeature) {
|
502
777
|
this._selectedFeature = null;
|
@@ -505,12 +780,45 @@ class FeatureInfo extends Collection {
|
|
505
780
|
}
|
506
781
|
}
|
507
782
|
|
783
|
+
/**
|
784
|
+
* Deselecting and removing cluster feature. Closing cluster window and fires cluster feature changed with null
|
785
|
+
*/
|
786
|
+
clearCluster() {
|
787
|
+
this._clearClusterInternal();
|
788
|
+
if (this._selectedClusterFeature) {
|
789
|
+
this._selectedClusterFeature[hidden] = false;
|
790
|
+
this._selectedClusterFeature = null;
|
791
|
+
this._clusterFeatureChanged.raiseEvent(this._selectedClusterFeature);
|
792
|
+
}
|
793
|
+
}
|
794
|
+
|
795
|
+
/**
|
796
|
+
* @deprecated
|
797
|
+
*/
|
798
|
+
clear() {
|
799
|
+
getLogger().deprecate(
|
800
|
+
'clear',
|
801
|
+
'Use clearSelection instead. Clear will clear the FeatureInfo collection removing all registered FeatureInfoViews in feature.',
|
802
|
+
);
|
803
|
+
this.clearSelection();
|
804
|
+
}
|
805
|
+
|
806
|
+
/**
|
807
|
+
* Clears selection by deselecting current feature and cluster and closing all related windows.
|
808
|
+
* Fires feature changed and cluster feature changed events with null.
|
809
|
+
*/
|
810
|
+
clearSelection() {
|
811
|
+
this.clearFeature();
|
812
|
+
this.clearCluster();
|
813
|
+
}
|
814
|
+
|
508
815
|
/**
|
509
816
|
* Destroys the feature info and all its events & listeners
|
510
817
|
*/
|
511
818
|
destroy() {
|
512
819
|
super.destroy();
|
513
820
|
this._clearInternal();
|
821
|
+
this._clearClusterInternal();
|
514
822
|
this._featureChanged.destroy();
|
515
823
|
this._destroyFeatureInfoTool();
|
516
824
|
if (this._scratchLayer) {
|
@@ -2,6 +2,8 @@ import {
|
|
2
2
|
AbstractInteraction,
|
3
3
|
EventType,
|
4
4
|
ModificationKeyType,
|
5
|
+
vectorClusterGroupName,
|
6
|
+
isProvidedClusterFeature,
|
5
7
|
} from '@vcmap/core';
|
6
8
|
|
7
9
|
/**
|
@@ -28,9 +30,22 @@ class FeatureInfoInteraction extends AbstractInteraction {
|
|
28
30
|
*/
|
29
31
|
async pipe(event) {
|
30
32
|
if (event.feature) {
|
31
|
-
|
33
|
+
const featureId = event.feature.getId();
|
34
|
+
const isClusterFeature = !!(
|
35
|
+
event.feature[vectorClusterGroupName] ||
|
36
|
+
event.feature[isProvidedClusterFeature]
|
37
|
+
);
|
38
|
+
if (isClusterFeature) {
|
39
|
+
if (
|
40
|
+
!this._featureInfo.selectedClusterFeature ||
|
41
|
+
featureId !== this._featureInfo.selectedClusterFeatureId
|
42
|
+
) {
|
43
|
+
event.stopPropagation = true;
|
44
|
+
await this._featureInfo.selectClusterFeature(event.feature);
|
45
|
+
}
|
46
|
+
} else if (
|
32
47
|
!this._featureInfo.selectedFeature ||
|
33
|
-
|
48
|
+
featureId !== this._featureInfo.selectedFeatureId
|
34
49
|
) {
|
35
50
|
event.stopPropagation = true;
|
36
51
|
await this._featureInfo.selectFeature(event.feature, event.position, [
|
@@ -39,7 +54,7 @@ class FeatureInfoInteraction extends AbstractInteraction {
|
|
39
54
|
]);
|
40
55
|
}
|
41
56
|
} else {
|
42
|
-
await this._featureInfo.
|
57
|
+
await this._featureInfo.clearSelection();
|
43
58
|
}
|
44
59
|
return event;
|
45
60
|
}
|
@@ -1,7 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
renderTemplate,
|
4
|
-
} from '../components/form-output/markdownHelper.js';
|
1
|
+
import { renderTemplate } from '@vcmap/core';
|
2
|
+
import { parseAndSanitizeMarkdown } from '../components/form-output/markdownHelper.js';
|
5
3
|
import BalloonFeatureInfoView from './balloonFeatureInfoView.js';
|
6
4
|
import MarkdownBalloonComponent from './MarkdownBalloonComponent.vue';
|
7
5
|
|
package/src/i18n/de.d.ts
CHANGED
@@ -73,6 +73,11 @@ declare namespace messages {
|
|
73
73
|
counter: string;
|
74
74
|
counterSize: string;
|
75
75
|
};
|
76
|
+
fileUpload: {
|
77
|
+
title: string;
|
78
|
+
divider: string;
|
79
|
+
browse: string;
|
80
|
+
};
|
76
81
|
timePicker: {
|
77
82
|
am: string;
|
78
83
|
pm: string;
|
@@ -278,6 +283,7 @@ declare namespace messages {
|
|
278
283
|
export { name_2 as name };
|
279
284
|
export let checkBoxText: string;
|
280
285
|
export let buttonTitle: string;
|
286
|
+
export let dontShowAgain: string;
|
281
287
|
}
|
282
288
|
export namespace customScreen {
|
283
289
|
let name_3: string;
|
@@ -457,14 +463,21 @@ declare namespace messages {
|
|
457
463
|
export namespace featureInfo {
|
458
464
|
let activateToolTitle: string;
|
459
465
|
let deactivateToolTitle: string;
|
466
|
+
namespace cluster {
|
467
|
+
export let headerTitle: string;
|
468
|
+
export let expand: string;
|
469
|
+
export let collapse: string;
|
470
|
+
let empty_2: string;
|
471
|
+
export { empty_2 as empty };
|
472
|
+
}
|
460
473
|
}
|
461
474
|
export namespace legend {
|
462
475
|
let title_17: string;
|
463
476
|
export { title_17 as title };
|
464
477
|
let tooltip_5: string;
|
465
478
|
export { tooltip_5 as tooltip };
|
466
|
-
let
|
467
|
-
export {
|
479
|
+
let empty_3: string;
|
480
|
+
export { empty_3 as empty };
|
468
481
|
export let openInNew: string;
|
469
482
|
export let defaultLabelText: string;
|
470
483
|
}
|
@@ -495,8 +508,8 @@ declare namespace messages {
|
|
495
508
|
export { title_21 as title };
|
496
509
|
let tooltip_7: string;
|
497
510
|
export { tooltip_7 as tooltip };
|
498
|
-
let
|
499
|
-
export {
|
511
|
+
let empty_4: string;
|
512
|
+
export { empty_4 as empty };
|
500
513
|
}
|
501
514
|
export namespace imprint {
|
502
515
|
let title_22: string;
|
package/src/i18n/de.js
CHANGED
@@ -172,6 +172,7 @@ const messages = {
|
|
172
172
|
checkBoxText:
|
173
173
|
'Bitte akzeptieren sie die [Bedingungen](https://vc.systems/) um Fortzufahren',
|
174
174
|
buttonTitle: 'Weiter',
|
175
|
+
dontShowAgain: 'Diese Nachricht nicht erneut anzeigen',
|
175
176
|
},
|
176
177
|
customScreen: {
|
177
178
|
name: 'Benutzerdefinierter Screen',
|
@@ -325,6 +326,12 @@ const messages = {
|
|
325
326
|
featureInfo: {
|
326
327
|
activateToolTitle: 'Informationen abfragen',
|
327
328
|
deactivateToolTitle: 'Informationen abfragen',
|
329
|
+
cluster: {
|
330
|
+
headerTitle: 'Gruppeninformationen',
|
331
|
+
expand: 'Informationsliste anzeigen',
|
332
|
+
collapse: 'Informationsliste minimieren',
|
333
|
+
empty: 'Keine Informationen verfügbar',
|
334
|
+
},
|
328
335
|
},
|
329
336
|
legend: {
|
330
337
|
title: 'Legende',
|