@vcmap/ui 5.1.8 → 5.2.1
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/config/www.config.json +16 -0
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.45041e.js → core.a8552c.js} +4160 -4041
- package/dist/assets/core.js +1 -1
- package/dist/assets/index-8783569c.js +1 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/{ui.74ba2a.css → ui.aebd62.css} +2 -2
- package/dist/assets/{ui.74ba2a.js → ui.aebd62.js} +8031 -6985
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.72ace9.js → vuetify.c8459d.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -1
- package/index.d.ts +22 -2
- package/index.js +29 -1
- 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/plugins/package.json +7 -3
- package/src/actions/actionHelper.js +1 -1
- 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/IframeComponent.vue +55 -0
- package/src/featureInfo/IframeComponent.vue.d.ts +25 -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 +15 -0
- package/src/featureInfo/iframeFeatureInfoView.js +1 -20
- package/src/featureInfo/iframeWmsFeatureInfoView.d.ts +41 -0
- package/src/featureInfo/iframeWmsFeatureInfoView.js +73 -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/manager/window/windowManager.js +4 -0
- 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 +23 -1
- package/dist/assets/index-3cd5a3f3.js +0 -1
- /package/dist/assets/{cesium.035e3a.js → cesium.1b488a.js} +0 -0
- /package/dist/assets/{ol.eb3bee.js → ol.7488a7.js} +0 -0
- /package/dist/assets/{vue.17a8fa.js → vue.df3538.js} +0 -0
- /package/dist/assets/{vuetify.72ace9.css → vuetify.c8459d.css} +0 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
<template>
|
2
|
+
<BalloonComponent v-bind="{ ...$attrs }">
|
3
|
+
<div class="pa-2" v-html="html" />
|
4
|
+
</BalloonComponent>
|
5
|
+
</template>
|
6
|
+
<script>
|
7
|
+
import BalloonComponent from './BalloonComponent.vue';
|
8
|
+
|
9
|
+
/**
|
10
|
+
* @description A balloon showing markdown content
|
11
|
+
*/
|
12
|
+
export default {
|
13
|
+
name: 'MarkdownBalloonComponent',
|
14
|
+
props: {
|
15
|
+
html: {
|
16
|
+
type: String,
|
17
|
+
required: true,
|
18
|
+
},
|
19
|
+
},
|
20
|
+
components: {
|
21
|
+
BalloonComponent,
|
22
|
+
},
|
23
|
+
};
|
24
|
+
</script>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
2
|
+
html: {
|
3
|
+
type: StringConstructor;
|
4
|
+
required: true;
|
5
|
+
};
|
6
|
+
}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
7
|
+
html: {
|
8
|
+
type: StringConstructor;
|
9
|
+
required: true;
|
10
|
+
};
|
11
|
+
}>>, {}>;
|
12
|
+
export default _default;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { VcsObject } from '@vcmap/core';
|
2
2
|
import { WindowSlot } from '../manager/window/windowManager.js';
|
3
3
|
import { defaultTagOptions } from '../components/tables/VcsTable.vue';
|
4
|
+
import { replaceAttributes } from '../application/markdownHelper.js';
|
4
5
|
|
5
6
|
/**
|
6
7
|
* @typedef {Object} FeatureInfoProps
|
@@ -29,7 +30,7 @@ import { defaultTagOptions } from '../components/tables/VcsTable.vue';
|
|
29
30
|
* @property {Object<string,string>} [keyMapping] - object providing text replacements or i18n strings for attribute keys
|
30
31
|
* @property {Object<string, string|Object<string,string>>} [valueMapping] - object providing text replacements or i18n strings for attribute values
|
31
32
|
* @property {Object<string,HTMLTagOptions>} [tags] - object with keys rendered as special html element. Value contains html options
|
32
|
-
* @property {import("../manager/window/windowManager.js").WindowComponentOptions} [window] - state, slot, position can be set. Other options are predefined.
|
33
|
+
* @property {import("../manager/window/windowManager.js").WindowComponentOptions} [window] - state, slot, position can be set. Other options are predefined. headerTitle of window state can be a template string, e.g. "{{myAttribute}}" or ["{{layerName}}", " - ", "{{myAttribute}}"]
|
33
34
|
*/
|
34
35
|
|
35
36
|
/**
|
@@ -125,22 +126,24 @@ export function applyKeyMapping(attributes, mapping) {
|
|
125
126
|
return 0;
|
126
127
|
})
|
127
128
|
.forEach((mappingKey) => {
|
128
|
-
if (
|
129
|
-
attributes
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
129
|
+
if (mappingKey !== mapping[mappingKey]) {
|
130
|
+
if (Object.hasOwn(attributes, mappingKey)) {
|
131
|
+
attributes[mapping[mappingKey]] = attributes[mappingKey];
|
132
|
+
delete attributes[mappingKey];
|
133
|
+
} else {
|
134
|
+
const mappingKeys = mappingKey.split('.');
|
135
|
+
mappingKeys.reduce((obj, key, index) => {
|
136
|
+
if (
|
137
|
+
obj &&
|
138
|
+
Object.hasOwn(obj, key) &&
|
139
|
+
index === mappingKeys.length - 1
|
140
|
+
) {
|
141
|
+
attributes[mapping[mappingKey]] = obj[key];
|
142
|
+
delete obj[key];
|
143
|
+
}
|
144
|
+
return obj?.[key];
|
145
|
+
}, attributes);
|
146
|
+
}
|
144
147
|
}
|
145
148
|
});
|
146
149
|
}
|
@@ -226,6 +229,7 @@ export function applyOlcsAttributeFilter(attributes, keys = []) {
|
|
226
229
|
export function applyEmptyAttributesFilter(attributes) {
|
227
230
|
return Object.keys(attributes).reduce((obj, key) => {
|
228
231
|
if (
|
232
|
+
attributes[key] !== null &&
|
229
233
|
typeof attributes[key] === 'object' &&
|
230
234
|
Object.keys(attributes[key]).length === 0
|
231
235
|
) {
|
@@ -236,6 +240,32 @@ export function applyEmptyAttributesFilter(attributes) {
|
|
236
240
|
}, {});
|
237
241
|
}
|
238
242
|
|
243
|
+
/**
|
244
|
+
*
|
245
|
+
* @param {import("../vcsUiApp.js").default} app
|
246
|
+
* @param {import("../manager/window/windowManager.js").WindowState} state
|
247
|
+
* @param {Object} attributes
|
248
|
+
* @returns {import("../manager/window/windowManager.js").WindowState}
|
249
|
+
*/
|
250
|
+
function getWindowState(app, state, attributes) {
|
251
|
+
let headerTitle = state?.headerTitle;
|
252
|
+
if (headerTitle) {
|
253
|
+
if (Array.isArray(headerTitle)) {
|
254
|
+
headerTitle = headerTitle.map((item) =>
|
255
|
+
replaceAttributes(item, attributes),
|
256
|
+
);
|
257
|
+
} else {
|
258
|
+
headerTitle = replaceAttributes(headerTitle, attributes);
|
259
|
+
}
|
260
|
+
}
|
261
|
+
return {
|
262
|
+
headerIcon: '$vcsInfo',
|
263
|
+
infoUrl: app.getHelpUrlCallback('/tools/infoTool.html'),
|
264
|
+
...state,
|
265
|
+
headerTitle: headerTitle || attributes.layerName,
|
266
|
+
};
|
267
|
+
}
|
268
|
+
|
239
269
|
/**
|
240
270
|
* Abstract class to be extended by FeatureInfoView classes
|
241
271
|
* Subclasses must always provide a component and may overwrite class methods.
|
@@ -393,11 +423,10 @@ class AbstractFeatureInfoView extends VcsObject {
|
|
393
423
|
*/
|
394
424
|
getWindowComponentOptions(app, featureInfo, layer) {
|
395
425
|
return {
|
396
|
-
state: this.window.state
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
},
|
426
|
+
state: getWindowState(app, this.window.state, {
|
427
|
+
...this.getAttributes(featureInfo.feature),
|
428
|
+
layerName: layer.properties?.title || layer.name,
|
429
|
+
}),
|
401
430
|
slot: this.window.slot ?? WindowSlot.DYNAMIC_RIGHT,
|
402
431
|
component: this.component,
|
403
432
|
position: this.window.position,
|
@@ -419,6 +448,9 @@ class AbstractFeatureInfoView extends VcsObject {
|
|
419
448
|
if (this.valueMapping) {
|
420
449
|
config.valueMapping = JSON.parse(JSON.stringify(this.valueMapping));
|
421
450
|
}
|
451
|
+
if (this.tags) {
|
452
|
+
config.tags = JSON.parse(JSON.stringify(this.tags));
|
453
|
+
}
|
422
454
|
if (Object.keys(this._window).length > 0) {
|
423
455
|
config.window = { ...this._window };
|
424
456
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export default AddressBalloonFeatureInfoView;
|
2
|
-
export type AddressBalloonFeatureInfoViewOptions = import("./
|
2
|
+
export type AddressBalloonFeatureInfoViewOptions = import("./balloonFeatureInfoView.js").BalloonFeatureInfoViewOptions & {
|
3
3
|
addressName?: string | null;
|
4
4
|
street?: string | null;
|
5
5
|
number?: string | null;
|
@@ -8,7 +8,7 @@ export type AddressBalloonFeatureInfoViewOptions = import("./abstractFeatureInfo
|
|
8
8
|
country?: string | null;
|
9
9
|
};
|
10
10
|
/**
|
11
|
-
* @typedef {import("./
|
11
|
+
* @typedef {import("./balloonFeatureInfoView.js").BalloonFeatureInfoViewOptions & {
|
12
12
|
* addressName?: string|null,
|
13
13
|
* street?: string|null,
|
14
14
|
* number?: string|null,
|
@@ -4,7 +4,7 @@ import BalloonFeatureInfoView, {
|
|
4
4
|
import AddressBalloonComponent from './AddressBalloonComponent.vue';
|
5
5
|
|
6
6
|
/**
|
7
|
-
* @typedef {import("./
|
7
|
+
* @typedef {import("./balloonFeatureInfoView.js").BalloonFeatureInfoViewOptions & {
|
8
8
|
* addressName?: string|null,
|
9
9
|
* street?: string|null,
|
10
10
|
* number?: string|null,
|
@@ -115,7 +115,7 @@ class BalloonFeatureInfoView extends AbstractFeatureInfoView {
|
|
115
115
|
properties.attributes,
|
116
116
|
this.balloonTitle,
|
117
117
|
)
|
118
|
-
: properties.layerProperties.title,
|
118
|
+
: properties.layerProperties.title || layer.name,
|
119
119
|
balloonSubtitle:
|
120
120
|
this.balloonSubtitle != null
|
121
121
|
? extractNestedKey(
|
@@ -78,17 +78,24 @@ export function setBalloonPosition(windowManager, id, windowPosition, target) {
|
|
78
78
|
if (!windowPosition) {
|
79
79
|
return;
|
80
80
|
}
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
),
|
88
|
-
target,
|
89
|
-
WindowAlignment.BOTTOM_LEFT,
|
81
|
+
|
82
|
+
const { width, height, maxWidth, maxHeight } = windowManager.get(id).position;
|
83
|
+
const mapWindowPosition = getWindowPositionOptionsFromMapEvent(
|
84
|
+
new Cartesian2(
|
85
|
+
windowPosition.x - balloonOffset.x,
|
86
|
+
windowPosition.y - balloonOffset.y,
|
90
87
|
),
|
88
|
+
target,
|
89
|
+
WindowAlignment.BOTTOM_LEFT,
|
91
90
|
);
|
91
|
+
|
92
|
+
windowManager.setWindowPositionOptions(id, {
|
93
|
+
width,
|
94
|
+
height,
|
95
|
+
maxWidth,
|
96
|
+
maxHeight,
|
97
|
+
...mapWindowPosition,
|
98
|
+
});
|
92
99
|
}
|
93
100
|
|
94
101
|
/**
|
@@ -30,8 +30,11 @@ import TableFeatureInfoView from './tableFeatureInfoView.js';
|
|
30
30
|
import IframeFeatureInfoView from './iframeFeatureInfoView.js';
|
31
31
|
import AddressBalloonFeatureInfoView from './addressBalloonFeatureInfoView.js';
|
32
32
|
import BalloonFeatureInfoView from './balloonFeatureInfoView.js';
|
33
|
+
import MarkdownFeatureInfoView from './markdownFeatureInfoView.js';
|
33
34
|
import { getDefaultPrimaryColor } from '../vuePlugins/vuetify.js';
|
34
35
|
import { ToolboxType } from '../manager/toolbox/toolboxManager.js';
|
36
|
+
import MarkdownBalloonFeatureInfoView from './markdownBalloonFeatureInfoView.js';
|
37
|
+
import IframeWmsFeatureInfoView from './iframeWmsFeatureInfoView.js';
|
35
38
|
|
36
39
|
/** @typedef {import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature|import("@vcmap-cesium/engine").Entity} FeatureType */
|
37
40
|
|
@@ -510,6 +513,10 @@ featureInfoClassRegistry.registerClass(
|
|
510
513
|
IframeFeatureInfoView.className,
|
511
514
|
IframeFeatureInfoView,
|
512
515
|
);
|
516
|
+
featureInfoClassRegistry.registerClass(
|
517
|
+
IframeWmsFeatureInfoView.className,
|
518
|
+
IframeWmsFeatureInfoView,
|
519
|
+
);
|
513
520
|
featureInfoClassRegistry.registerClass(
|
514
521
|
BalloonFeatureInfoView.className,
|
515
522
|
BalloonFeatureInfoView,
|
@@ -518,3 +525,11 @@ featureInfoClassRegistry.registerClass(
|
|
518
525
|
AddressBalloonFeatureInfoView.className,
|
519
526
|
AddressBalloonFeatureInfoView,
|
520
527
|
);
|
528
|
+
featureInfoClassRegistry.registerClass(
|
529
|
+
MarkdownBalloonFeatureInfoView.className,
|
530
|
+
MarkdownBalloonFeatureInfoView,
|
531
|
+
);
|
532
|
+
featureInfoClassRegistry.registerClass(
|
533
|
+
MarkdownFeatureInfoView.className,
|
534
|
+
MarkdownFeatureInfoView,
|
535
|
+
);
|
@@ -1,24 +1,5 @@
|
|
1
1
|
import AbstractFeatureInfoView from './abstractFeatureInfoView.js';
|
2
|
-
|
3
|
-
/**
|
4
|
-
* @description An iframe component
|
5
|
-
* @vue-prop {string} src - Specifies the address of the document to embed in the <iframe>
|
6
|
-
* @vue-prop {string} [title] - optional title for the <iframe>
|
7
|
-
*/
|
8
|
-
const IframeComponent = {
|
9
|
-
name: 'IframeComponent',
|
10
|
-
props: {
|
11
|
-
src: {
|
12
|
-
type: String,
|
13
|
-
required: true,
|
14
|
-
},
|
15
|
-
title: {
|
16
|
-
type: String,
|
17
|
-
default: undefined,
|
18
|
-
},
|
19
|
-
},
|
20
|
-
template: '<iframe :src="src" :title="title" />',
|
21
|
-
};
|
2
|
+
import IframeComponent from './IframeComponent.vue';
|
22
3
|
|
23
4
|
/**
|
24
5
|
* @typedef {import("./abstractFeatureInfoView.js").FeatureInfoViewOptions & { src: string, title?: string }} IframeFeatureInfoViewOptions
|
@@ -0,0 +1,41 @@
|
|
1
|
+
export default IframeWmsFeatureInfoView;
|
2
|
+
export type IframeWmsFeatureInfoViewOptions = import("./abstractFeatureInfoView.js").FeatureInfoViewOptions & {
|
3
|
+
infoFormat: string;
|
4
|
+
title?: string;
|
5
|
+
};
|
6
|
+
/**
|
7
|
+
* @typedef {import("./abstractFeatureInfoView.js").FeatureInfoViewOptions & { infoFormat: string, title?: string }} IframeWmsFeatureInfoViewOptions
|
8
|
+
* @property {string} infoFormat - Specifies the response format of WMS GetFeatureInfo
|
9
|
+
* @property {string} [title] - optional title for the <iframe>
|
10
|
+
*/
|
11
|
+
/**
|
12
|
+
* @class
|
13
|
+
* @description An iframe view.
|
14
|
+
* @extends {AbstractFeatureInfoView}
|
15
|
+
*/
|
16
|
+
declare class IframeWmsFeatureInfoView extends AbstractFeatureInfoView {
|
17
|
+
/**
|
18
|
+
* @param {IframeWmsFeatureInfoViewOptions} options
|
19
|
+
*/
|
20
|
+
constructor(options: IframeWmsFeatureInfoViewOptions);
|
21
|
+
/**
|
22
|
+
* @type {string}
|
23
|
+
*/
|
24
|
+
infoFormat: string;
|
25
|
+
/**
|
26
|
+
* @type {string|undefined}
|
27
|
+
*/
|
28
|
+
title: string | undefined;
|
29
|
+
/**
|
30
|
+
* Gets feature info from WMS GetFeatureInfo in html/text format
|
31
|
+
* @param {import("./featureInfo.js").FeatureInfoEvent} featureInfo
|
32
|
+
* @param {import("@vcmap/core").WMSLayer} layer
|
33
|
+
* @returns {import("./iframeFeatureInfoView.js").IframeFeatureInfoViewProps}
|
34
|
+
*/
|
35
|
+
getProperties(featureInfo: import("./featureInfo.js").FeatureInfoEvent, layer: import("@vcmap/core").WMSLayer): import("./iframeFeatureInfoView.js").IframeFeatureInfoViewProps;
|
36
|
+
/**
|
37
|
+
* @returns {IframeWmsFeatureInfoViewOptions}
|
38
|
+
*/
|
39
|
+
toJSON(): IframeWmsFeatureInfoViewOptions;
|
40
|
+
}
|
41
|
+
import AbstractFeatureInfoView from './abstractFeatureInfoView.js';
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import { get as getOlProj } from 'ol/proj.js';
|
2
|
+
import AbstractFeatureInfoView from './abstractFeatureInfoView.js';
|
3
|
+
import IframeComponent from './IframeComponent.vue';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @typedef {import("./abstractFeatureInfoView.js").FeatureInfoViewOptions & { infoFormat: string, title?: string }} IframeWmsFeatureInfoViewOptions
|
7
|
+
* @property {string} infoFormat - Specifies the response format of WMS GetFeatureInfo
|
8
|
+
* @property {string} [title] - optional title for the <iframe>
|
9
|
+
*/
|
10
|
+
|
11
|
+
/**
|
12
|
+
* @class
|
13
|
+
* @description An iframe view.
|
14
|
+
* @extends {AbstractFeatureInfoView}
|
15
|
+
*/
|
16
|
+
class IframeWmsFeatureInfoView extends AbstractFeatureInfoView {
|
17
|
+
/**
|
18
|
+
* @type {string}
|
19
|
+
*/
|
20
|
+
static get className() {
|
21
|
+
return 'IframeWmsFeatureInfoView';
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* @param {IframeWmsFeatureInfoViewOptions} options
|
26
|
+
*/
|
27
|
+
constructor(options) {
|
28
|
+
super(options, IframeComponent);
|
29
|
+
|
30
|
+
/**
|
31
|
+
* @type {string}
|
32
|
+
*/
|
33
|
+
this.infoFormat = options.infoFormat || 'text/html';
|
34
|
+
/**
|
35
|
+
* @type {string|undefined}
|
36
|
+
*/
|
37
|
+
this.title = options.title || undefined;
|
38
|
+
}
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Gets feature info from WMS GetFeatureInfo in html/text format
|
42
|
+
* @param {import("./featureInfo.js").FeatureInfoEvent} featureInfo
|
43
|
+
* @param {import("@vcmap/core").WMSLayer} layer
|
44
|
+
* @returns {import("./iframeFeatureInfoView.js").IframeFeatureInfoViewProps}
|
45
|
+
*/
|
46
|
+
getProperties(featureInfo, layer) {
|
47
|
+
return {
|
48
|
+
src: layer.featureProvider.wmsSource.getFeatureInfoUrl(
|
49
|
+
featureInfo.position,
|
50
|
+
1,
|
51
|
+
getOlProj('EPSG:3857'),
|
52
|
+
{ INFO_FORMAT: this.infoFormat },
|
53
|
+
),
|
54
|
+
title: this.title,
|
55
|
+
};
|
56
|
+
}
|
57
|
+
|
58
|
+
/**
|
59
|
+
* @returns {IframeWmsFeatureInfoViewOptions}
|
60
|
+
*/
|
61
|
+
toJSON() {
|
62
|
+
const config = super.toJSON();
|
63
|
+
if (this.infoFormat) {
|
64
|
+
config.infoFormat = this.infoFormat;
|
65
|
+
}
|
66
|
+
if (this.title) {
|
67
|
+
config.title = this.title;
|
68
|
+
}
|
69
|
+
return config;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
export default IframeWmsFeatureInfoView;
|
@@ -0,0 +1,47 @@
|
|
1
|
+
export default MarkdownBalloonFeatureInfoView;
|
2
|
+
export type MarkdownBalloonFeatureInfoViewOptions = import("./balloonFeatureInfoView.js").BalloonFeatureInfoViewOptions & {
|
3
|
+
template: string | string[];
|
4
|
+
};
|
5
|
+
export type MarkdownBalloonFeatureInfoViewProps = import("./balloonFeatureInfoView.js").BalloonFeatureInfoViewProps & {
|
6
|
+
html: string;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* @typedef {import("./balloonFeatureInfoView.js").BalloonFeatureInfoViewOptions & { template: string | string[] }} MarkdownBalloonFeatureInfoViewOptions
|
10
|
+
* @property {string | string[]} template - a string or an array of strings which will be concatenated using \n
|
11
|
+
*/
|
12
|
+
/**
|
13
|
+
* @typedef {import("./balloonFeatureInfoView.js").BalloonFeatureInfoViewProps & { html: string }} MarkdownBalloonFeatureInfoViewProps
|
14
|
+
*/
|
15
|
+
/**
|
16
|
+
* @class
|
17
|
+
* @description A markdown Balloon Featureinfo
|
18
|
+
* @extends {BalloonFeatureInfoView}
|
19
|
+
*/
|
20
|
+
declare class MarkdownBalloonFeatureInfoView extends BalloonFeatureInfoView {
|
21
|
+
/**
|
22
|
+
* @param {MarkdownBalloonFeatureInfoViewOptions} options
|
23
|
+
*/
|
24
|
+
constructor(options: MarkdownBalloonFeatureInfoViewOptions);
|
25
|
+
/**
|
26
|
+
* @type {string | string[]}
|
27
|
+
*/
|
28
|
+
template: string | string[];
|
29
|
+
/**
|
30
|
+
* @param {Record<string, unknown>} attributes
|
31
|
+
* @protected
|
32
|
+
* @returns {string}
|
33
|
+
*/
|
34
|
+
protected _renderTemplate(attributes: Record<string, unknown>): string;
|
35
|
+
/**
|
36
|
+
* Variables wrapped in `${}` within `src` are replaced by their values, e.g. `${featureId}` or `${attributes.gml:name}`
|
37
|
+
* @param {import("./featureInfo.js").FeatureInfoEvent} featureInfo
|
38
|
+
* @param {import("@vcmap/core").Layer} layer
|
39
|
+
* @returns {MarkdownBalloonFeatureInfoViewProps}
|
40
|
+
*/
|
41
|
+
getProperties(featureInfo: import("./featureInfo.js").FeatureInfoEvent, layer: import("@vcmap/core").Layer): MarkdownBalloonFeatureInfoViewProps;
|
42
|
+
/**
|
43
|
+
* @returns {MarkdownBalloonFeatureInfoViewOptions}
|
44
|
+
*/
|
45
|
+
toJSON(): MarkdownBalloonFeatureInfoViewOptions;
|
46
|
+
}
|
47
|
+
import BalloonFeatureInfoView from './balloonFeatureInfoView.js';
|
@@ -0,0 +1,81 @@
|
|
1
|
+
import {
|
2
|
+
parseAndSanitizeMarkdown,
|
3
|
+
replaceAttributes,
|
4
|
+
} from '../application/markdownHelper.js';
|
5
|
+
import BalloonFeatureInfoView from './balloonFeatureInfoView.js';
|
6
|
+
import MarkdownBalloonComponent from './MarkdownBalloonComponent.vue';
|
7
|
+
|
8
|
+
/**
|
9
|
+
* @typedef {import("./balloonFeatureInfoView.js").BalloonFeatureInfoViewOptions & { template: string | string[] }} MarkdownBalloonFeatureInfoViewOptions
|
10
|
+
* @property {string | string[]} template - a string or an array of strings which will be concatenated using \n
|
11
|
+
*/
|
12
|
+
|
13
|
+
/**
|
14
|
+
* @typedef {import("./balloonFeatureInfoView.js").BalloonFeatureInfoViewProps & { html: string }} MarkdownBalloonFeatureInfoViewProps
|
15
|
+
*/
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @class
|
19
|
+
* @description A markdown Balloon Featureinfo
|
20
|
+
* @extends {BalloonFeatureInfoView}
|
21
|
+
*/
|
22
|
+
class MarkdownBalloonFeatureInfoView extends BalloonFeatureInfoView {
|
23
|
+
/**
|
24
|
+
* @type {string}
|
25
|
+
*/
|
26
|
+
static get className() {
|
27
|
+
return 'MarkdownBalloonFeatureInfoView';
|
28
|
+
}
|
29
|
+
|
30
|
+
/**
|
31
|
+
* @param {MarkdownBalloonFeatureInfoViewOptions} options
|
32
|
+
*/
|
33
|
+
constructor(options) {
|
34
|
+
super(options, MarkdownBalloonComponent);
|
35
|
+
|
36
|
+
/**
|
37
|
+
* @type {string | string[]}
|
38
|
+
*/
|
39
|
+
this.template = Array.isArray(options.template)
|
40
|
+
? options.template.slice()
|
41
|
+
: options.template;
|
42
|
+
}
|
43
|
+
|
44
|
+
/**
|
45
|
+
* @param {Record<string, unknown>} attributes
|
46
|
+
* @protected
|
47
|
+
* @returns {string}
|
48
|
+
*/
|
49
|
+
_renderTemplate(attributes) {
|
50
|
+
return replaceAttributes(this.template, attributes);
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Variables wrapped in `${}` within `src` are replaced by their values, e.g. `${featureId}` or `${attributes.gml:name}`
|
55
|
+
* @param {import("./featureInfo.js").FeatureInfoEvent} featureInfo
|
56
|
+
* @param {import("@vcmap/core").Layer} layer
|
57
|
+
* @returns {MarkdownBalloonFeatureInfoViewProps}
|
58
|
+
*/
|
59
|
+
getProperties(featureInfo, layer) {
|
60
|
+
const properties = super.getProperties(featureInfo, layer);
|
61
|
+
return {
|
62
|
+
...properties,
|
63
|
+
html: parseAndSanitizeMarkdown(
|
64
|
+
this._renderTemplate({ ...properties, ...properties.attributes }),
|
65
|
+
),
|
66
|
+
};
|
67
|
+
}
|
68
|
+
|
69
|
+
/**
|
70
|
+
* @returns {MarkdownBalloonFeatureInfoViewOptions}
|
71
|
+
*/
|
72
|
+
toJSON() {
|
73
|
+
const config = super.toJSON();
|
74
|
+
config.template = Array.isArray(this.template)
|
75
|
+
? this.template.slice()
|
76
|
+
: this.template;
|
77
|
+
return config;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
export default MarkdownBalloonFeatureInfoView;
|
@@ -0,0 +1,47 @@
|
|
1
|
+
export default MarkdownFeatureInfoView;
|
2
|
+
export type MarkdownFeatureInfoViewOptions = import("./abstractFeatureInfoView.js").FeatureInfoViewOptions & {
|
3
|
+
template: string | string[];
|
4
|
+
};
|
5
|
+
export type MarkdownFeatureInfoViewProps = import("./abstractFeatureInfoView.js").FeatureInfoProps & {
|
6
|
+
html: string;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* @typedef {import("./abstractFeatureInfoView.js").FeatureInfoViewOptions & { template: string | string[] }} MarkdownFeatureInfoViewOptions
|
10
|
+
* @property {string | string[]} template - a string or an array of strings which will be concatenated using \n
|
11
|
+
*/
|
12
|
+
/**
|
13
|
+
* @typedef {import("./abstractFeatureInfoView.js").FeatureInfoProps & { html: string }} MarkdownFeatureInfoViewProps
|
14
|
+
*/
|
15
|
+
/**
|
16
|
+
* @class
|
17
|
+
* @description A simple markdown feature info view. will render feature attributes into the markdown and replace {{}}
|
18
|
+
* @extends {AbstractFeatureInfoView}
|
19
|
+
*/
|
20
|
+
declare class MarkdownFeatureInfoView extends AbstractFeatureInfoView {
|
21
|
+
/**
|
22
|
+
* @param {MarkdownFeatureInfoViewOptions} options
|
23
|
+
*/
|
24
|
+
constructor(options: MarkdownFeatureInfoViewOptions);
|
25
|
+
/**
|
26
|
+
* @type {string | string[]}
|
27
|
+
*/
|
28
|
+
template: string | string[];
|
29
|
+
/**
|
30
|
+
* @param {Record<string, unknown>} attributes
|
31
|
+
* @protected
|
32
|
+
* @returns {string}
|
33
|
+
*/
|
34
|
+
protected _renderTemplate(attributes: Record<string, unknown>): string;
|
35
|
+
/**
|
36
|
+
* Variables wrapped in `${}` within `src` are replaced by their values, e.g. `${featureId}` or `${attributes.gml:name}`
|
37
|
+
* @param {import("./featureInfo.js").FeatureInfoEvent} featureInfo
|
38
|
+
* @param {import("@vcmap/core").Layer} layer
|
39
|
+
* @returns {MarkdownFeatureInfoViewProps}
|
40
|
+
*/
|
41
|
+
getProperties(featureInfo: import("./featureInfo.js").FeatureInfoEvent, layer: import("@vcmap/core").Layer): MarkdownFeatureInfoViewProps;
|
42
|
+
/**
|
43
|
+
* @returns {MarkdownFeatureInfoViewOptions}
|
44
|
+
*/
|
45
|
+
toJSON(): MarkdownFeatureInfoViewOptions;
|
46
|
+
}
|
47
|
+
import AbstractFeatureInfoView from './abstractFeatureInfoView.js';
|