@vcmap/ui 6.0.0-rc.2 → 6.0.0-rc.5
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/build.js +40 -60
- package/build/buildHelpers.js +62 -19
- package/build/bundle.js +1 -1
- package/build/info/conf.json +1 -1
- package/build/info/publish.js +25 -31
- package/build/lintTypes.js +5 -0
- package/config/base.config.json +2 -1
- package/config/dev.config.json +7 -1
- package/config/projects.config.json +2 -1
- package/config/splashscreen.config.json +45 -0
- package/config/www.config.json +25 -22
- package/dist/.htaccess +7 -0
- package/dist/assets/@mdi/font/README.md +25 -0
- package/dist/assets/@mdi/font/css/materialdesignicons.min-680621ca.css +3 -0
- package/dist/assets/@mdi/font/css/materialdesignicons.min.css.map +16 -0
- package/dist/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
- package/dist/assets/{cesium.0b750d.js → cesium-126f111a.js} +272 -385
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.cbf44a.js → core-1c8b8674.js} +2015 -2019
- package/dist/assets/core.js +1 -1
- package/dist/assets/{ol.86e93c.js → ol-27f9b3f3.js} +42521 -44394
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui-7214428e.css +1 -0
- package/dist/assets/{ui.7c276c.js → ui-7214428e.js} +13968 -13907
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue-c78a5f76.js +6083 -0
- package/dist/assets/vue.js +1 -1
- package/dist/assets/{vuetify.4d18fe.css → vuetify-88a2fabe.css} +2 -2
- package/dist/assets/{vuetify.4d18fe.js → vuetify-88a2fabe.js} +7793 -7940
- package/dist/assets/vuetify.js +1 -1
- package/dist/index.html +11 -10
- package/index.d.ts +11 -11
- package/index.html +5 -5
- package/index.js +9 -7
- package/lib/olLib.js +84 -23
- package/package.json +19 -19
- package/plugins/@vcmap-show-case/flight-component-example/src/FlightExample.vue +41 -1
- package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +71 -32
- package/plugins/@vcmap-show-case/form-inputs-example/src/exampleActions.js +7 -11
- package/plugins/@vcmap-show-case/form-inputs-example/src/index.js +2 -2
- package/plugins/@vcmap-show-case/list-example/src/ListExample.vue +21 -8
- package/plugins/@vcmap-show-case/project-selector/src/ModulesListComponent.vue +18 -11
- package/plugins/@vcmap-show-case/search-example/src/index.js +1 -0
- package/plugins/@vcmap-show-case/search-example/src/searchImpl.js +35 -5
- package/plugins/@vcmap-show-case/style-input-example/src/StyleExample.vue +29 -90
- package/plugins/@vcmap-show-case/toolbox-example/src/index.js +2 -1
- package/plugins/package.json +3 -23
- package/public/assets/@mdi/font/README.md +25 -0
- package/public/assets/@mdi/font/css/materialdesignicons.min.css +2 -2
- package/public/assets/@mdi/font/css/materialdesignicons.min.css.map +16 -0
- package/public/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
- package/src/actions/StyleSelector.vue +1 -1
- package/src/actions/actionHelper.js +33 -22
- package/src/actions/flightActions.js +5 -5
- package/src/actions/listActions.d.ts +4 -11
- package/src/actions/listActions.js +6 -22
- package/src/actions/stateRefAction.js +2 -2
- package/src/application/VcsApp.vue +147 -57
- package/src/application/VcsApp.vue.d.ts +298 -4
- package/src/application/VcsAttributions.vue +2 -13
- package/src/application/VcsAttributionsFooter.vue +10 -11
- package/src/application/VcsContainer.vue +26 -9
- package/src/application/VcsContainer.vue.d.ts +237 -0
- package/src/application/VcsMainMap.vue +7 -7
- package/src/application/VcsMainMap.vue.d.ts +2 -2
- package/src/application/VcsNavbar.vue +5 -1
- package/src/application/VcsPositionDisplay.vue +8 -23
- package/src/application/VcsPositionDisplay.vue.d.ts +0 -1
- package/src/application/VcsSettings.vue +10 -17
- package/src/application/VcsSplashScreen.vue +21 -40
- package/src/application/VcsSplashScreen.vue.d.ts +0 -2
- package/src/application/VcsTextPage.vue +12 -43
- package/src/application/VcsTextPage.vue.d.ts +4 -8
- package/src/application/VcsTextPageFooter.vue +23 -40
- package/src/components/buttons/VcsActionButtonList.vue +59 -3
- package/src/components/buttons/VcsActionButtonList.vue.d.ts +28 -0
- package/src/components/extent/VcsExtentEditor.vue +1 -1
- package/src/components/flight/VcsFlightAnchorsComponent.vue +63 -36
- package/src/components/flight/VcsFlightComponent.vue +16 -21
- package/src/components/flight/VcsFlightPlayer.vue +27 -5
- package/src/components/form-inputs-controls/VcsCheckbox.vue +9 -5
- package/src/components/form-inputs-controls/VcsChipArrayInput.vue +15 -13
- package/src/components/form-inputs-controls/VcsChipArrayInput.vue.d.ts +3 -4
- package/src/components/form-inputs-controls/VcsCoordinate.vue +17 -4
- package/src/components/form-inputs-controls/VcsCoordinate.vue.d.ts +5 -2
- package/src/components/form-inputs-controls/VcsDatePicker.vue +34 -60
- package/src/components/form-inputs-controls/VcsDatePicker.vue.d.ts +1 -63
- package/src/components/form-inputs-controls/VcsFileInput.vue +17 -18
- package/src/components/form-inputs-controls/VcsFileInput.vue.d.ts +1 -0
- package/src/components/form-inputs-controls/VcsLabel.vue +1 -1
- package/src/components/form-inputs-controls/VcsRadio.vue +17 -3
- package/src/components/form-inputs-controls/VcsRadio.vue.d.ts +1 -0
- package/src/components/form-inputs-controls/VcsSelect.vue +40 -31
- package/src/components/form-inputs-controls/VcsSelect.vue.d.ts +5 -2
- package/src/components/form-inputs-controls/VcsSlider.vue +13 -1
- package/src/components/form-inputs-controls/VcsSlider.vue.d.ts +1 -0
- package/src/components/form-inputs-controls/VcsTextArea.vue +27 -26
- package/src/components/form-inputs-controls/VcsTextArea.vue.d.ts +1 -0
- package/src/components/form-inputs-controls/VcsTextField.vue +20 -4
- package/src/components/form-inputs-controls/VcsTextField.vue.d.ts +9 -0
- package/src/components/form-inputs-controls/VcsWizardStep.vue +3 -6
- package/src/components/form-inputs-controls/vcsTextField.scss +9 -12
- package/src/components/form-output/VcsFormattedNumber.vue +21 -5
- package/src/components/form-output/VcsFormattedNumber.vue.d.ts +9 -0
- package/src/components/form-output/VcsMarkdown.vue +15 -12
- package/src/components/form-output/VcsMarkdown.vue.d.ts +1 -0
- package/src/components/form-output/markdownHelper.d.ts +30 -0
- package/src/components/form-output/markdownHelper.js +398 -0
- package/src/components/import/VcsFileDrop.vue +8 -5
- package/src/components/import/VcsImportComponent.vue +4 -3
- package/src/components/import/VcsImportComponent.vue.d.ts +1 -2
- package/src/components/lists/VcsActionList.vue +11 -7
- package/src/components/lists/VcsList.vue +30 -52
- package/src/components/lists/VcsList.vue.d.ts +14 -59
- package/src/components/lists/{VcsListItem.vue → VcsListItemComponent.vue} +68 -22
- package/src/components/lists/VcsListItemComponent.vue.d.ts +69 -0
- package/src/components/lists/VcsTreeview.vue +43 -16
- package/src/components/lists/VcsTreeview.vue.d.ts +14 -3
- package/src/components/lists/VcsTreeviewLeaf.vue +15 -6
- package/src/components/lists/VcsTreeviewSearchbar.vue +2 -2
- package/src/components/notification/VcsHelp.vue +1 -1
- package/src/components/notification/VcsHelp.vue.d.ts +3 -2
- package/src/components/section/VcsExpansionPanel.vue +101 -0
- package/src/components/section/VcsExpansionPanel.vue.d.ts +19 -0
- package/src/components/{form-inputs-controls → section}/VcsFormSection.vue +10 -4
- package/src/components/{form-inputs-controls → section}/VcsFormSection.vue.d.ts +1 -2
- package/src/components/style/MenuWrapper.vue +24 -26
- package/src/components/style/MenuWrapper.vue.d.ts +4 -4
- package/src/components/style/VcsFillMenu.vue +9 -16
- package/src/components/style/VcsFillMenu.vue.d.ts +0 -18
- package/src/components/style/VcsFillSelector.vue +13 -16
- package/src/components/style/VcsImageMenu.vue +8 -25
- package/src/components/style/VcsImageMenu.vue.d.ts +0 -27
- package/src/components/style/VcsImageSelector.vue +102 -167
- package/src/components/style/VcsImageSelector.vue.d.ts +15 -15
- package/src/components/style/VcsStrokeMenu.vue +8 -15
- package/src/components/style/VcsStrokeMenu.vue.d.ts +0 -18
- package/src/components/style/VcsStrokeSelector.vue +11 -18
- package/src/components/style/VcsTextMenu.vue +9 -12
- package/src/components/style/VcsTextMenu.vue.d.ts +0 -9
- package/src/components/style/VcsTextSelector.vue +79 -95
- package/src/components/style/VcsTextSelector.vue.d.ts +20 -22
- package/src/components/style/VcsVectorStyleComponent.vue +8 -19
- package/src/components/style/VcsVectorStyleComponent.vue.d.ts +1 -1
- package/src/components/style/composables.d.ts +0 -14
- package/src/components/style/composables.js +0 -49
- package/src/components/tables/VcsDataTable.vue +28 -22
- package/src/components/tables/VcsTable.vue +45 -62
- package/src/components/tables/VcsTable.vue.d.ts +30 -17
- package/src/components/tables/VcsTableCell.vue +72 -0
- package/src/components/tables/VcsTableCell.vue.d.ts +13 -0
- package/src/components/vector-properties/VcsFeatureEditingWindow.vue +43 -9
- package/src/components/vector-properties/VcsFeatureTransforms.vue +5 -0
- package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +1 -1
- package/src/components/viewpoint/VcsViewpointComponent.vue +23 -10
- package/src/components/viewpoint/VcsViewpointEditor.vue +2 -1
- package/src/contentTree/LayerTree.vue +9 -27
- package/src/contentTree/LayerTree.vue.d.ts +1 -1
- package/src/contentTree/contentTreeCollection.d.ts +1 -0
- package/src/contentTree/contentTreeCollection.js +45 -11
- package/src/contentTree/contentTreeItem.d.ts +2 -2
- package/src/contentTree/contentTreeItem.js +7 -7
- package/src/featureInfo/BalloonComponent.vue +14 -15
- package/src/featureInfo/MarkdownBalloonComponent.vue +4 -2
- package/src/featureInfo/MarkdownBalloonComponent.vue.d.ts +2 -2
- package/src/featureInfo/abstractFeatureInfoView.d.ts +6 -0
- package/src/featureInfo/abstractFeatureInfoView.js +15 -7
- package/src/featureInfo/featureInfo.d.ts +5 -5
- package/src/featureInfo/featureInfo.js +59 -41
- package/src/featureInfo/iframeFeatureInfoView.d.ts +8 -2
- package/src/featureInfo/iframeFeatureInfoView.js +15 -5
- package/src/featureInfo/markdownBalloonFeatureInfoView.d.ts +1 -1
- package/src/featureInfo/markdownBalloonFeatureInfoView.js +5 -5
- package/src/featureInfo/markdownFeatureInfoView.d.ts +1 -1
- package/src/featureInfo/markdownFeatureInfoView.js +9 -11
- package/src/featureInfo/tableFeatureInfoView.js +13 -4
- package/src/init.d.ts +5 -38
- package/src/init.js +19 -18
- package/src/legend/StyleLegendItem.vue +4 -9
- package/src/legend/VcsLegend.vue +28 -54
- package/src/manager/buttonManager.js +4 -4
- package/src/manager/collectionManager/CollectionComponent.vue +17 -42
- package/src/manager/collectionManager/CollectionComponent.vue.d.ts +4 -2
- package/src/manager/collectionManager/CollectionComponentContent.vue +7 -6
- package/src/manager/collectionManager/CollectionComponentContent.vue.d.ts +3 -1
- package/src/manager/collectionManager/CollectionComponentList.vue +11 -9
- package/src/manager/collectionManager/CollectionComponentList.vue.d.ts +6 -4
- package/src/manager/collectionManager/CollectionComponentProvider.vue +1 -1
- package/src/manager/collectionManager/CollectionComponentStandalone.vue +3 -2
- package/src/manager/collectionManager/CollectionManager.vue +1 -1
- package/src/manager/collectionManager/collectionComponentClass.d.ts +1 -1
- package/src/manager/collectionManager/collectionComponentClass.js +7 -10
- package/src/manager/collectionManager/collectionManager.js +10 -10
- package/src/manager/collectionManager/editorCollectionComponentClass.js +6 -5
- package/src/manager/contextMenu/contextMenuManager.js +2 -2
- package/src/manager/navbarManager.js +2 -2
- package/src/manager/panel/PanelComponent.vue +2 -9
- package/src/manager/panel/PanelManagerComponent.vue +7 -3
- package/src/manager/panel/panelHelper.js +3 -3
- package/src/manager/panel/panelManager.d.ts +9 -1
- package/src/manager/panel/panelManager.js +18 -6
- package/src/manager/toolbox/GroupToolboxComponent.vue +8 -4
- package/src/manager/toolbox/GroupToolboxComponent.vue.d.ts +1 -0
- package/src/manager/toolbox/SelectToolboxComponent.vue +7 -4
- package/src/manager/toolbox/SelectToolboxComponent.vue.d.ts +1 -0
- package/src/manager/toolbox/ToolboxManager.vue +9 -6
- package/src/manager/toolbox/ToolboxManager.vue.d.ts +1 -0
- package/src/manager/toolbox/toolboxManager.js +10 -10
- package/src/manager/window/WindowComponent.vue +12 -8
- package/src/manager/window/WindowComponentHeader.vue +29 -8
- package/src/manager/window/WindowComponentHeader.vue.d.ts +2 -0
- package/src/manager/window/WindowManager.vue +2 -2
- package/src/manager/window/windowManager.d.ts +2 -2
- package/src/manager/window/windowManager.js +4 -4
- package/src/navigation/MapNavigation.vue +20 -0
- package/src/navigation/locatorHelper.js +1 -1
- package/src/navigation/overviewMap.js +1 -1
- package/src/notifier/NotifierComponent.vue +18 -15
- package/src/search/ResultItem.vue +18 -6
- package/src/search/ResultsComponent.vue +31 -20
- package/src/search/ResultsComponent.vue.d.ts +2 -1
- package/src/search/SearchComponent.vue +8 -14
- package/src/search/SearchComponent.vue.d.ts +1 -0
- package/src/search/search.js +2 -2
- package/src/siteConfig.js +9 -9
- package/src/state.js +4 -4
- package/src/styles/_typography.scss +0 -2
- package/src/styles/main.scss +0 -4
- package/src/uiConfig.d.ts +300 -5
- package/src/uiConfig.js +28 -16
- package/src/vcsUiApp.d.ts +21 -17
- package/src/vcsUiApp.js +11 -10
- package/src/vuePlugins/vuetify.d.ts +2 -0
- package/src/vuePlugins/vuetify.js +14 -0
- package/dist/assets/@mdi/font/css/materialdesignicons.css.map +0 -16
- package/dist/assets/@mdi/font/css/materialdesignicons.min.e3f476.css +0 -3
- package/dist/assets/index-8eGauqjA.js +0 -1
- package/dist/assets/ui.7c276c.css +0 -1
- package/dist/assets/vue.a3cd64.js +0 -6096
- package/public/assets/@mdi/font/css/materialdesignicons.css.map +0 -16
- package/src/application/VcsCustomScreen.vue +0 -45
- package/src/application/VcsCustomScreen.vue.d.ts +0 -15
- package/src/application/markdownHelper.d.ts +0 -12
- package/src/application/markdownHelper.js +0 -70
- package/src/components/lists/VcsListItem.vue.d.ts +0 -21
- package/src/components/notification/VcsTooltip.vue +0 -156
- package/src/components/notification/VcsTooltip.vue.d.ts +0 -27
- package/src/featureInfo/MarkdownComponent.vue +0 -16
- package/src/featureInfo/MarkdownComponent.vue.d.ts +0 -7
- package/src/styles/_theming.scss +0 -73
- package/src/styles/settings.scss +0 -6
- package/src/styles/shades.scss +0 -4
- package/src/styles/variables.scss +0 -140
- package/src/styles/vcsFont.scss +0 -2
- package/src/styles/vcsGrid.scss +0 -3
- /package/dist/assets/{favicon-128.4c4ce5.png → favicon-128-4c4ce5df.png} +0 -0
- /package/dist/assets/{favicon-180.5b99c0.png → favicon-180-4c4ce5df.png} +0 -0
- /package/dist/assets/{favicon-192.0e205e.png → favicon-192-4c4ce5df.png} +0 -0
- /package/dist/assets/{favicon-32.6b9add.png → favicon-32-4c4ce5df.png} +0 -0
- /package/dist/assets/{favicon.d5ec97.svg → favicon-4c4ce5df.svg} +0 -0
- /package/dist/assets/font/{TitilliumWeb-Regular.9ca076.woff2 → TitilliumWeb-Regular-9ca076be.woff2} +0 -0
- /package/dist/assets/style/{icon-marker.70960f.png → icon-marker-70960f05.png} +0 -0
- /package/dist/assets/style/{icon-marker-blue.534e37.png → icon-marker-blue-534e374b.png} +0 -0
- /package/dist/assets/style/{icon-marker-green.0b6a92.png → icon-marker-green-0b6a92bc.png} +0 -0
- /package/dist/assets/style/{icon-marker-o.036477.png → icon-marker-o-036477fa.png} +0 -0
- /package/dist/assets/style/{icon-marker-o-blue.7b6d62.png → icon-marker-o-blue-7b6d6279.png} +0 -0
- /package/dist/assets/style/{icon-marker-o-green.c863c0.png → icon-marker-o-green-c863c0fa.png} +0 -0
- /package/dist/assets/style/{icon-marker-o-red.93ff58.png → icon-marker-o-red-93ff58df.png} +0 -0
- /package/dist/assets/style/{icon-marker-red.313d03.png → icon-marker-red-313d03e8.png} +0 -0
- /package/dist/assets/style/{icon-pin.b7ce77.png → icon-pin-b7ce771e.png} +0 -0
- /package/dist/assets/style/{icon-pin-blue.7be369.png → icon-pin-blue-7be369a3.png} +0 -0
- /package/dist/assets/style/{icon-pin-green.cbb935.png → icon-pin-green-cbb935fe.png} +0 -0
- /package/dist/assets/style/{icon-pin-red.3f25b2.png → icon-pin-red-3f25b245.png} +0 -0
- /package/public/assets/{favicon-128.png → favicon-128-4c4ce5df.png} +0 -0
- /package/public/assets/{favicon-180.png → favicon-180-4c4ce5df.png} +0 -0
- /package/public/assets/{favicon-192.png → favicon-192-4c4ce5df.png} +0 -0
- /package/public/assets/{favicon-32.png → favicon-32-4c4ce5df.png} +0 -0
- /package/public/assets/{favicon.svg → favicon-4c4ce5df.svg} +0 -0
@@ -53,6 +53,24 @@ class ContentTreeCollection extends IndexedCollection {
|
|
53
53
|
*/
|
54
54
|
this._weightListeners = new Map();
|
55
55
|
|
56
|
+
const uiConfigChanged = () => {
|
57
|
+
this.subTreeViewItems.value.forEach((subTree) => {
|
58
|
+
if (
|
59
|
+
!this._app.uiConfig.config.hideContentTree &&
|
60
|
+
!this._subTreeListeners.has(subTree.name)
|
61
|
+
) {
|
62
|
+
this._subTreeListeners.get(subTree.name)?.();
|
63
|
+
this._subTreeListeners.set(
|
64
|
+
subTree.name,
|
65
|
+
this._createSubtreeActionButton(subTree),
|
66
|
+
);
|
67
|
+
} else if (this._app.uiConfig.config.hideContentTree) {
|
68
|
+
this._subTreeListeners.get(subTree.name)?.();
|
69
|
+
this._subTreeListeners.delete(subTree.name);
|
70
|
+
}
|
71
|
+
});
|
72
|
+
};
|
73
|
+
|
56
74
|
/**
|
57
75
|
* @type {Array<function():void>}
|
58
76
|
* @private
|
@@ -78,6 +96,8 @@ class ContentTreeCollection extends IndexedCollection {
|
|
78
96
|
}
|
79
97
|
}),
|
80
98
|
this.moved.addEventListener(() => recreateTree(true)),
|
99
|
+
app.uiConfig.added.addEventListener(uiConfigChanged),
|
100
|
+
app.uiConfig.removed.addEventListener(uiConfigChanged),
|
81
101
|
];
|
82
102
|
/**
|
83
103
|
* This is the default content tree.
|
@@ -113,11 +133,19 @@ class ContentTreeCollection extends IndexedCollection {
|
|
113
133
|
|
114
134
|
/**
|
115
135
|
* @private
|
136
|
+
* @param {Array<string>} exclude
|
116
137
|
*/
|
117
|
-
_clearSubTrees() {
|
118
|
-
this._subTreeViewItems.value.
|
119
|
-
|
120
|
-
|
138
|
+
_clearSubTrees(exclude = []) {
|
139
|
+
this._subTreeViewItems.value.forEach((tree, key) => {
|
140
|
+
if (!exclude.includes(key)) {
|
141
|
+
this._subTreeViewItems.value.delete(key);
|
142
|
+
}
|
143
|
+
});
|
144
|
+
this._subTreeListeners.forEach((cb, key) => {
|
145
|
+
if (!exclude.includes(key)) {
|
146
|
+
cb();
|
147
|
+
this._subTreeListeners.delete(key);
|
148
|
+
}
|
121
149
|
});
|
122
150
|
}
|
123
151
|
|
@@ -159,7 +187,6 @@ class ContentTreeCollection extends IndexedCollection {
|
|
159
187
|
vcsAppSymbol,
|
160
188
|
ButtonLocation.CONTENT,
|
161
189
|
);
|
162
|
-
this._subTreeViewItems.value.set(id, subTreeViewItem);
|
163
190
|
return () => {
|
164
191
|
app.windowManager.remove(id);
|
165
192
|
app.navbarManager.remove(id);
|
@@ -228,14 +255,21 @@ class ContentTreeCollection extends IndexedCollection {
|
|
228
255
|
defaultSubTreeViewItem,
|
229
256
|
...topLevelItems.filter((i) => i[subTreeSymbol]),
|
230
257
|
];
|
231
|
-
|
258
|
+
this._clearSubTrees(
|
259
|
+
subTrees.map((tree) => {
|
260
|
+
return tree.name;
|
261
|
+
}),
|
262
|
+
);
|
232
263
|
subTrees.forEach((subTree) => {
|
233
264
|
if (!this._app.navbarManager.has(subTree.name) || resetSubtreeButtons) {
|
234
|
-
this.
|
235
|
-
this.
|
236
|
-
subTree.name
|
237
|
-
this.
|
238
|
-
|
265
|
+
this._subTreeViewItems.value.set(subTree.name, subTree);
|
266
|
+
if (!this._app.uiConfig.config.hideContentTree) {
|
267
|
+
this._subTreeListeners.get(subTree.name)?.();
|
268
|
+
this._subTreeListeners.set(
|
269
|
+
subTree.name,
|
270
|
+
this._createSubtreeActionButton(subTree),
|
271
|
+
);
|
272
|
+
}
|
239
273
|
} else {
|
240
274
|
const buttonComponent = this._app.navbarManager.get(subTree.name);
|
241
275
|
if (buttonComponent.weight !== subTree[subTreeItemWeight]) {
|
@@ -272,11 +272,11 @@ declare class ContentTreeItem {
|
|
272
272
|
/**
|
273
273
|
* @param {(string|HTMLCanvasElement|HTMLImageElement)=} icon
|
274
274
|
*/
|
275
|
-
set icon(icon: string |
|
275
|
+
set icon(icon: string | HTMLImageElement | HTMLCanvasElement | undefined);
|
276
276
|
/**
|
277
277
|
* @type {string|HTMLCanvasElement|HTMLImageElement|undefined}
|
278
278
|
*/
|
279
|
-
get icon(): string |
|
279
|
+
get icon(): string | HTMLImageElement | HTMLCanvasElement | undefined;
|
280
280
|
/**
|
281
281
|
* @param {number} weight
|
282
282
|
*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ref, reactive, computed, shallowRef } from 'vue';
|
2
|
-
import { check,
|
2
|
+
import { check, maybe, ofEnum, oneOf } from '@vcsuite/check';
|
3
3
|
import { parseBoolean, parseNumber } from '@vcsuite/parsers';
|
4
4
|
import { ClassRegistry, VcsEvent } from '@vcmap/core';
|
5
5
|
import { createLinkAction } from '../actions/actionHelper.js';
|
@@ -258,7 +258,7 @@ class ContentTreeItem {
|
|
258
258
|
* @param {StateActionState} state
|
259
259
|
*/
|
260
260
|
set state(state) {
|
261
|
-
check(state,
|
261
|
+
check(state, ofEnum(StateActionState));
|
262
262
|
|
263
263
|
if (this._state.value !== state) {
|
264
264
|
this._state.value = state;
|
@@ -277,7 +277,7 @@ class ContentTreeItem {
|
|
277
277
|
* @param {string} url
|
278
278
|
*/
|
279
279
|
set infoUrl(url) {
|
280
|
-
|
280
|
+
check(url, maybe(String));
|
281
281
|
|
282
282
|
if (this._infoUrl !== url) {
|
283
283
|
this._infoUrl = url;
|
@@ -309,7 +309,7 @@ class ContentTreeItem {
|
|
309
309
|
* @param {string|undefined} title
|
310
310
|
*/
|
311
311
|
set title(title) {
|
312
|
-
|
312
|
+
check(title, maybe(String));
|
313
313
|
|
314
314
|
this._title.value = title;
|
315
315
|
}
|
@@ -325,7 +325,7 @@ class ContentTreeItem {
|
|
325
325
|
* @param {string|undefined} tooltip
|
326
326
|
*/
|
327
327
|
set tooltip(tooltip) {
|
328
|
-
|
328
|
+
check(tooltip, maybe(String));
|
329
329
|
|
330
330
|
this._tooltip.value = tooltip;
|
331
331
|
}
|
@@ -341,7 +341,7 @@ class ContentTreeItem {
|
|
341
341
|
* @param {(string|HTMLCanvasElement|HTMLImageElement)=} icon
|
342
342
|
*/
|
343
343
|
set icon(icon) {
|
344
|
-
|
344
|
+
check(icon, maybe(oneOf(String, HTMLElement)));
|
345
345
|
|
346
346
|
this._icon.value = icon;
|
347
347
|
}
|
@@ -411,7 +411,7 @@ class ContentTreeItem {
|
|
411
411
|
*/
|
412
412
|
addAction(action, weight = 11) {
|
413
413
|
check(action.name, String);
|
414
|
-
|
414
|
+
check(weight, maybe(Number));
|
415
415
|
|
416
416
|
const index = this._getActionIndex(action.name);
|
417
417
|
if (index > -1) {
|
@@ -1,9 +1,11 @@
|
|
1
1
|
<template>
|
2
2
|
<v-card class="mx-auto elevation-0" v-if="position">
|
3
3
|
<slot name="balloon-header" :attrs="{ ...$props, ...$attrs }">
|
4
|
-
<v-list-item class="px-
|
4
|
+
<v-list-item class="px-1">
|
5
5
|
<template #prepend>
|
6
|
-
<
|
6
|
+
<div class="pl-1 pr-2">
|
7
|
+
<v-icon color="primary" size="16"> $vcsInfo </v-icon>
|
8
|
+
</div>
|
7
9
|
</template>
|
8
10
|
<v-list-item-title>
|
9
11
|
<h3 class="font-weight-bold">
|
@@ -13,12 +15,14 @@
|
|
13
15
|
<v-list-item-subtitle v-if="balloonSubtitle">
|
14
16
|
{{ $st(balloonSubtitle) }}
|
15
17
|
</v-list-item-subtitle>
|
16
|
-
<
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
<template #append>
|
19
|
+
<VcsButton
|
20
|
+
@click.stop="close"
|
21
|
+
icon="mdi-close-thick"
|
22
|
+
tooltip="components.close"
|
23
|
+
class="px-1"
|
24
|
+
/>
|
25
|
+
</template>
|
22
26
|
</v-list-item>
|
23
27
|
</slot>
|
24
28
|
|
@@ -194,8 +198,6 @@
|
|
194
198
|
</script>
|
195
199
|
|
196
200
|
<style lang="scss">
|
197
|
-
@import '../styles/shades.scss';
|
198
|
-
|
199
201
|
.balloon {
|
200
202
|
z-index: 0 !important;
|
201
203
|
}
|
@@ -213,11 +215,8 @@
|
|
213
215
|
width: 0;
|
214
216
|
filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.3));
|
215
217
|
}
|
216
|
-
.
|
217
|
-
border-color:
|
218
|
-
}
|
219
|
-
.theme--dark .balloon:after {
|
220
|
-
border-color: map-get($shades, 'black') transparent;
|
218
|
+
.balloon:after {
|
219
|
+
border-color: rgb(var(--v-theme-surface-light)) transparent;
|
221
220
|
}
|
222
221
|
.balloon .v-list-item .v-list-item__title,
|
223
222
|
.balloon .v-list-item .v-list-item__subtitle {
|
@@ -1,10 +1,11 @@
|
|
1
1
|
<template>
|
2
2
|
<BalloonComponent v-bind="{ ...$attrs }">
|
3
|
-
<
|
3
|
+
<VcsMarkdown :content="content" />
|
4
4
|
</BalloonComponent>
|
5
5
|
</template>
|
6
6
|
<script>
|
7
7
|
import BalloonComponent from './BalloonComponent.vue';
|
8
|
+
import VcsMarkdown from '../components/form-output/VcsMarkdown.vue';
|
8
9
|
|
9
10
|
/**
|
10
11
|
* @description A balloon showing markdown content
|
@@ -12,12 +13,13 @@
|
|
12
13
|
export default {
|
13
14
|
name: 'MarkdownBalloonComponent',
|
14
15
|
props: {
|
15
|
-
|
16
|
+
content: {
|
16
17
|
type: String,
|
17
18
|
required: true,
|
18
19
|
},
|
19
20
|
},
|
20
21
|
components: {
|
22
|
+
VcsMarkdown,
|
21
23
|
BalloonComponent,
|
22
24
|
},
|
23
25
|
};
|
@@ -1,10 +1,10 @@
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
2
|
-
|
2
|
+
content: {
|
3
3
|
type: StringConstructor;
|
4
4
|
required: true;
|
5
5
|
};
|
6
6
|
}, any, any, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
7
|
-
|
7
|
+
content: {
|
8
8
|
type: StringConstructor;
|
9
9
|
required: true;
|
10
10
|
};
|
@@ -164,6 +164,12 @@ declare class AbstractFeatureInfoView extends VcsObject {
|
|
164
164
|
* @type {import("vue").Component<FeatureInfoProps, unknown, unknown>|undefined}
|
165
165
|
*/
|
166
166
|
get component(): import("vue").Component<FeatureInfoProps, unknown, unknown, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | undefined;
|
167
|
+
/**
|
168
|
+
* @param {undefined|import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature} feature
|
169
|
+
* @returns {Object}
|
170
|
+
* @protected
|
171
|
+
*/
|
172
|
+
protected _getAttributesFromFeature(feature: undefined | import("ol").Feature | import("@vcmap-cesium/engine").Cesium3DTileFeature | import("@vcmap-cesium/engine").Cesium3DTilePointFeature): Object;
|
167
173
|
/**
|
168
174
|
* This method returns all relevant attributes for this view.
|
169
175
|
* Called by `getProperties()` to pass attributes as props object to the VueComponent of this view.
|
@@ -1,7 +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 {
|
4
|
+
import { renderTemplate } from '../components/form-output/markdownHelper.js';
|
5
5
|
|
6
6
|
/**
|
7
7
|
* @typedef {Object} FeatureInfoProps
|
@@ -251,11 +251,9 @@ function getWindowState(app, state, attributes) {
|
|
251
251
|
let headerTitle = state?.headerTitle;
|
252
252
|
if (headerTitle) {
|
253
253
|
if (Array.isArray(headerTitle)) {
|
254
|
-
headerTitle = headerTitle.map((item) =>
|
255
|
-
replaceAttributes(item, attributes),
|
256
|
-
);
|
254
|
+
headerTitle = headerTitle.map((item) => renderTemplate(item, attributes));
|
257
255
|
} else {
|
258
|
-
headerTitle =
|
256
|
+
headerTitle = renderTemplate(headerTitle, attributes);
|
259
257
|
}
|
260
258
|
}
|
261
259
|
return {
|
@@ -343,6 +341,16 @@ class AbstractFeatureInfoView extends VcsObject {
|
|
343
341
|
return this._component;
|
344
342
|
}
|
345
343
|
|
344
|
+
/**
|
345
|
+
* @param {undefined|import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature} feature
|
346
|
+
* @returns {Object}
|
347
|
+
* @protected
|
348
|
+
*/
|
349
|
+
// eslint-disable-next-line class-methods-use-this
|
350
|
+
_getAttributesFromFeature(feature) {
|
351
|
+
return feature?.getProperty('attributes') || {};
|
352
|
+
}
|
353
|
+
|
346
354
|
/**
|
347
355
|
* This method returns all relevant attributes for this view.
|
348
356
|
* Called by `getProperties()` to pass attributes as props object to the VueComponent of this view.
|
@@ -352,7 +360,7 @@ class AbstractFeatureInfoView extends VcsObject {
|
|
352
360
|
* @returns {Object}
|
353
361
|
*/
|
354
362
|
getAttributes(feature) {
|
355
|
-
let attributes =
|
363
|
+
let attributes = this._getAttributesFromFeature(feature);
|
356
364
|
if (this.attributeKeys.length > 0) {
|
357
365
|
attributes = applyAttributeFilter(attributes, this.attributeKeys);
|
358
366
|
}
|
@@ -375,7 +383,7 @@ class AbstractFeatureInfoView extends VcsObject {
|
|
375
383
|
*/
|
376
384
|
getTags(feature) {
|
377
385
|
if (this.tags) {
|
378
|
-
const attributes =
|
386
|
+
const attributes = this._getAttributesFromFeature(feature);
|
379
387
|
const tags = Object.keys(this.tags)
|
380
388
|
.filter(
|
381
389
|
(key) =>
|
@@ -10,11 +10,6 @@ export function getHighlightStyle(feature: FeatureType, layer: import("@vcmap/co
|
|
10
10
|
* @returns {FeatureInfoSession}
|
11
11
|
*/
|
12
12
|
export function createFeatureInfoSession(app: import("../vcsUiApp.js").default): FeatureInfoSession;
|
13
|
-
/**
|
14
|
-
* @typedef {Object} FeatureInfoSession
|
15
|
-
* @property {VcsEvent<void>} stopped
|
16
|
-
* @property {function():void} stop
|
17
|
-
*/
|
18
13
|
/**
|
19
14
|
* @type {ClassRegistry<import("@vcmap/core").Ctor<typeof AbstractFeatureInfoView>>}
|
20
15
|
*/
|
@@ -43,6 +38,11 @@ export type FeatureInfoSession = {
|
|
43
38
|
};
|
44
39
|
import { ClassRegistry } from '@vcmap/core';
|
45
40
|
import AbstractFeatureInfoView from './abstractFeatureInfoView.js';
|
41
|
+
/**
|
42
|
+
* @typedef {Object} FeatureInfoSession
|
43
|
+
* @property {VcsEvent<void>} stopped
|
44
|
+
* @property {function():void} stop
|
45
|
+
*/
|
46
46
|
/**
|
47
47
|
* @class FeatureInfo
|
48
48
|
* @description Provides registration of featureInfoClasses and stores featureInfoView instances.
|
@@ -21,8 +21,9 @@ import {
|
|
21
21
|
Entity,
|
22
22
|
} from '@vcmap-cesium/engine';
|
23
23
|
import { Feature } from 'ol';
|
24
|
-
import { check,
|
24
|
+
import { check, maybe, oneOf } from '@vcsuite/check';
|
25
25
|
|
26
|
+
import { reactive } from 'vue';
|
26
27
|
import { vcsAppSymbol } from '../pluginHelper.js';
|
27
28
|
import FeatureInfoInteraction from './featureInfoInteraction.js';
|
28
29
|
import AbstractFeatureInfoView from './abstractFeatureInfoView.js';
|
@@ -52,6 +53,17 @@ function getLogger() {
|
|
52
53
|
return getLoggerByName('featureInfo');
|
53
54
|
}
|
54
55
|
|
56
|
+
/**
|
57
|
+
* @type {ClassRegistry<import("@vcmap/core").Ctor<typeof AbstractFeatureInfoView>>}
|
58
|
+
*/
|
59
|
+
export const featureInfoClassRegistry = new ClassRegistry();
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Symbol added to features to overwrite the layers predefined feature info
|
63
|
+
* @type {symbol}
|
64
|
+
*/
|
65
|
+
export const featureInfoViewSymbol = Symbol('featureInfoView');
|
66
|
+
|
55
67
|
/**
|
56
68
|
* @param {FeatureType} feature
|
57
69
|
* @param {import("@vcmap/core").Layer} layer
|
@@ -133,7 +145,7 @@ function setupFeatureInfoTool(app) {
|
|
133
145
|
/** @type {FeatureInfoSession|null} */
|
134
146
|
let session = null;
|
135
147
|
|
136
|
-
const action = {
|
148
|
+
const action = reactive({
|
137
149
|
name: 'featureInfoToggle',
|
138
150
|
title: 'featureInfo.activateToolTitle',
|
139
151
|
icon: '$vcsInfo',
|
@@ -144,46 +156,65 @@ function setupFeatureInfoTool(app) {
|
|
144
156
|
} else {
|
145
157
|
session = createFeatureInfoSession(app);
|
146
158
|
session.stopped.addEventListener(() => {
|
147
|
-
|
159
|
+
action.active = false;
|
148
160
|
session = null;
|
149
161
|
app.featureInfo.clear();
|
150
|
-
|
162
|
+
action.title = 'featureInfo.activateToolTitle';
|
151
163
|
});
|
152
164
|
this.active = true;
|
153
|
-
|
165
|
+
action.title = 'featureInfo.deactivateToolTitle';
|
154
166
|
}
|
155
167
|
},
|
156
|
-
};
|
168
|
+
});
|
157
169
|
|
158
170
|
function addFeatureInfoButton() {
|
159
171
|
if (app.uiConfig.getByKey('startingFeatureInfo')?.value !== false) {
|
160
172
|
action.callback();
|
161
173
|
}
|
162
|
-
app.toolboxManager.
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
174
|
+
if (!app.toolboxManager.has('featureInfo')) {
|
175
|
+
app.toolboxManager.add(
|
176
|
+
{
|
177
|
+
id: 'featureInfo',
|
178
|
+
type: ToolboxType.SINGLE,
|
179
|
+
action,
|
180
|
+
},
|
181
|
+
vcsAppSymbol,
|
182
|
+
);
|
183
|
+
}
|
170
184
|
}
|
171
185
|
|
172
|
-
if (
|
186
|
+
if (
|
187
|
+
[...app.layers].some((l) => l.properties?.featureInfo) ||
|
188
|
+
app.search.resultLayer.getFeatures().some((f) => !!f[featureInfoViewSymbol])
|
189
|
+
) {
|
173
190
|
addFeatureInfoButton();
|
174
191
|
}
|
175
192
|
|
176
193
|
const listeners = [
|
177
194
|
app.layers.added.addEventListener((layer) => {
|
178
|
-
if (
|
179
|
-
layer?.properties?.featureInfo &&
|
180
|
-
!app.toolboxManager.has('featureInfo')
|
181
|
-
) {
|
195
|
+
if (layer?.properties?.featureInfo) {
|
182
196
|
addFeatureInfoButton();
|
183
197
|
}
|
184
198
|
}),
|
185
199
|
app.layers.removed.addEventListener(() => {
|
186
200
|
if (
|
201
|
+
![...app.layers].some((l) => l.properties?.featureInfo) &&
|
202
|
+
!app.search.resultLayer
|
203
|
+
.getFeatures()
|
204
|
+
.some((f) => !!f[featureInfoViewSymbol]) &&
|
205
|
+
app.toolboxManager.has('featureInfo')
|
206
|
+
) {
|
207
|
+
app.toolboxManager.remove('featureInfo');
|
208
|
+
}
|
209
|
+
}),
|
210
|
+
app.search.resultsChanged.addEventListener(() => {
|
211
|
+
if (
|
212
|
+
app.search.resultLayer
|
213
|
+
.getFeatures()
|
214
|
+
.some((f) => !!f[featureInfoViewSymbol])
|
215
|
+
) {
|
216
|
+
addFeatureInfoButton();
|
217
|
+
} else if (
|
187
218
|
![...app.layers].some((l) => l.properties?.featureInfo) &&
|
188
219
|
app.toolboxManager.has('featureInfo')
|
189
220
|
) {
|
@@ -207,17 +238,6 @@ function setupFeatureInfoTool(app) {
|
|
207
238
|
* @property {function():void} stop
|
208
239
|
*/
|
209
240
|
|
210
|
-
/**
|
211
|
-
* @type {ClassRegistry<import("@vcmap/core").Ctor<typeof AbstractFeatureInfoView>>}
|
212
|
-
*/
|
213
|
-
export const featureInfoClassRegistry = new ClassRegistry();
|
214
|
-
|
215
|
-
/**
|
216
|
-
* Symbol added to features to overwrite the layers predefined feature info
|
217
|
-
* @type {symbol}
|
218
|
-
*/
|
219
|
-
export const featureInfoViewSymbol = Symbol('featureInfoView');
|
220
|
-
|
221
241
|
/**
|
222
242
|
* @class FeatureInfo
|
223
243
|
* @description Provides registration of featureInfoClasses and stores featureInfoView instances.
|
@@ -390,15 +410,13 @@ class FeatureInfo extends Collection {
|
|
390
410
|
* @returns {Promise<void>}
|
391
411
|
*/
|
392
412
|
async selectFeature(feature, position, windowPosition, featureInfoView) {
|
393
|
-
check(
|
394
|
-
|
395
|
-
Entity,
|
396
|
-
|
397
|
-
|
398
|
-
]);
|
399
|
-
|
400
|
-
checkMaybe(windowPosition, [Number]);
|
401
|
-
checkMaybe(featureInfoView, AbstractFeatureInfoView);
|
413
|
+
check(
|
414
|
+
feature,
|
415
|
+
oneOf(Feature, Entity, Cesium3DTileFeature, Cesium3DTilePointFeature),
|
416
|
+
);
|
417
|
+
check(position, maybe([Number]));
|
418
|
+
check(windowPosition, maybe([Number]));
|
419
|
+
check(featureInfoView, maybe(AbstractFeatureInfoView));
|
402
420
|
|
403
421
|
const usedFeatureInfoView =
|
404
422
|
feature[featureInfoViewSymbol] ??
|
@@ -416,7 +434,7 @@ class FeatureInfo extends Collection {
|
|
416
434
|
[featureId]: getHighlightStyle(
|
417
435
|
feature,
|
418
436
|
layer,
|
419
|
-
this._app.uiConfig.config.
|
437
|
+
this._app.uiConfig.config.primaryColor ??
|
420
438
|
getDefaultPrimaryColor(this._app),
|
421
439
|
),
|
422
440
|
});
|
@@ -428,7 +446,7 @@ class FeatureInfo extends Collection {
|
|
428
446
|
[featureId]: getHighlightStyle(
|
429
447
|
feature,
|
430
448
|
layer,
|
431
|
-
this._app.uiConfig.config.
|
449
|
+
this._app.uiConfig.config.primaryColor ??
|
432
450
|
getDefaultPrimaryColor(this._app),
|
433
451
|
),
|
434
452
|
});
|
@@ -9,7 +9,7 @@ export type IframeFeatureInfoViewProps = any & {
|
|
9
9
|
};
|
10
10
|
/**
|
11
11
|
* @typedef {import("./abstractFeatureInfoView.js").FeatureInfoViewOptions & { src: string, title?: string }} IframeFeatureInfoViewOptions
|
12
|
-
* @property {string} src - Specifies the address of the document to embed in the <iframe>. Variables wrapped in `${}` are replaced by their values, e.g. `${featureId}` or `${
|
12
|
+
* @property {string} src - Specifies the address of the document to embed in the <iframe>. Variables wrapped in `${}` are replaced by their values, e.g. `${featureId}` or `${gml:name}`
|
13
13
|
* @property {string} [title] - optional title for the <iframe>
|
14
14
|
*/
|
15
15
|
/**
|
@@ -34,7 +34,13 @@ declare class IframeFeatureInfoView extends AbstractFeatureInfoView {
|
|
34
34
|
*/
|
35
35
|
title: string | undefined;
|
36
36
|
/**
|
37
|
-
*
|
37
|
+
* @param {Record<string, unknown>} attributes
|
38
|
+
* @protected
|
39
|
+
* @returns {string}
|
40
|
+
*/
|
41
|
+
protected _renderTemplate(attributes: Record<string, unknown>): string;
|
42
|
+
/**
|
43
|
+
* Supports markdown templates (e.g. {{someProperty}}) and style expressions to derive a URL
|
38
44
|
* @param {import("./featureInfo.js").FeatureInfoEvent} featureInfo
|
39
45
|
* @param {import("@vcmap/core").Layer} layer
|
40
46
|
* @returns {IframeFeatureInfoViewProps}
|
@@ -1,9 +1,10 @@
|
|
1
|
+
import { renderTemplate } from '../components/form-output/markdownHelper.js';
|
1
2
|
import AbstractFeatureInfoView from './abstractFeatureInfoView.js';
|
2
3
|
import IframeComponent from './IframeComponent.vue';
|
3
4
|
|
4
5
|
/**
|
5
6
|
* @typedef {import("./abstractFeatureInfoView.js").FeatureInfoViewOptions & { src: string, title?: string }} IframeFeatureInfoViewOptions
|
6
|
-
* @property {string} src - Specifies the address of the document to embed in the <iframe>. Variables wrapped in `${}` are replaced by their values, e.g. `${featureId}` or `${
|
7
|
+
* @property {string} src - Specifies the address of the document to embed in the <iframe>. Variables wrapped in `${}` are replaced by their values, e.g. `${featureId}` or `${gml:name}`
|
7
8
|
* @property {string} [title] - optional title for the <iframe>
|
8
9
|
*/
|
9
10
|
|
@@ -41,7 +42,16 @@ class IframeFeatureInfoView extends AbstractFeatureInfoView {
|
|
41
42
|
}
|
42
43
|
|
43
44
|
/**
|
44
|
-
*
|
45
|
+
* @param {Record<string, unknown>} attributes
|
46
|
+
* @protected
|
47
|
+
* @returns {string}
|
48
|
+
*/
|
49
|
+
_renderTemplate(attributes) {
|
50
|
+
return renderTemplate(this.src, attributes);
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Supports markdown templates (e.g. {{someProperty}}) and style expressions to derive a URL
|
45
55
|
* @param {import("./featureInfo.js").FeatureInfoEvent} featureInfo
|
46
56
|
* @param {import("@vcmap/core").Layer} layer
|
47
57
|
* @returns {IframeFeatureInfoViewProps}
|
@@ -50,9 +60,9 @@ class IframeFeatureInfoView extends AbstractFeatureInfoView {
|
|
50
60
|
const properties = super.getProperties(featureInfo, layer);
|
51
61
|
return {
|
52
62
|
...properties,
|
53
|
-
src: this.
|
54
|
-
|
55
|
-
|
63
|
+
src: this._renderTemplate({
|
64
|
+
...properties,
|
65
|
+
...properties.attributes,
|
56
66
|
}),
|
57
67
|
title: this.title,
|
58
68
|
};
|
@@ -33,7 +33,7 @@ declare class MarkdownBalloonFeatureInfoView extends BalloonFeatureInfoView {
|
|
33
33
|
*/
|
34
34
|
protected _renderTemplate(attributes: Record<string, unknown>): string;
|
35
35
|
/**
|
36
|
-
*
|
36
|
+
* Supports markdown templates (e.g. {{someProperty}}) and style expressions to derive markdown rendering
|
37
37
|
* @param {import("./featureInfo.js").FeatureInfoEvent} featureInfo
|
38
38
|
* @param {import("@vcmap/core").Layer} layer
|
39
39
|
* @returns {MarkdownBalloonFeatureInfoViewProps}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import {
|
2
2
|
parseAndSanitizeMarkdown,
|
3
|
-
|
4
|
-
} from '../
|
3
|
+
renderTemplate,
|
4
|
+
} from '../components/form-output/markdownHelper.js';
|
5
5
|
import BalloonFeatureInfoView from './balloonFeatureInfoView.js';
|
6
6
|
import MarkdownBalloonComponent from './MarkdownBalloonComponent.vue';
|
7
7
|
|
@@ -47,11 +47,11 @@ class MarkdownBalloonFeatureInfoView extends BalloonFeatureInfoView {
|
|
47
47
|
* @returns {string}
|
48
48
|
*/
|
49
49
|
_renderTemplate(attributes) {
|
50
|
-
return
|
50
|
+
return renderTemplate(this.template, attributes);
|
51
51
|
}
|
52
52
|
|
53
53
|
/**
|
54
|
-
*
|
54
|
+
* Supports markdown templates (e.g. {{someProperty}}) and style expressions to derive markdown rendering
|
55
55
|
* @param {import("./featureInfo.js").FeatureInfoEvent} featureInfo
|
56
56
|
* @param {import("@vcmap/core").Layer} layer
|
57
57
|
* @returns {MarkdownBalloonFeatureInfoViewProps}
|
@@ -60,7 +60,7 @@ class MarkdownBalloonFeatureInfoView extends BalloonFeatureInfoView {
|
|
60
60
|
const properties = super.getProperties(featureInfo, layer);
|
61
61
|
return {
|
62
62
|
...properties,
|
63
|
-
|
63
|
+
content: parseAndSanitizeMarkdown(
|
64
64
|
this._renderTemplate({ ...properties, ...properties.attributes }),
|
65
65
|
),
|
66
66
|
};
|
@@ -33,7 +33,7 @@ declare class MarkdownFeatureInfoView extends AbstractFeatureInfoView {
|
|
33
33
|
*/
|
34
34
|
protected _renderTemplate(attributes: Record<string, unknown>): string;
|
35
35
|
/**
|
36
|
-
*
|
36
|
+
* Supports markdown templates (e.g. {{someProperty}}) and style expressions to derive a markdown rendering
|
37
37
|
* @param {import("./featureInfo.js").FeatureInfoEvent} featureInfo
|
38
38
|
* @param {import("@vcmap/core").Layer} layer
|
39
39
|
* @returns {MarkdownFeatureInfoViewProps}
|