Skip to content

feat(gfi): migrate plugin - #447

Open
oeninghe-dataport wants to merge 247 commits into
nextfrom
vue3/migrate-plugin-gfi
Open

feat(gfi): migrate plugin#447
oeninghe-dataport wants to merge 247 commits into
nextfrom
vue3/migrate-plugin-gfi

Conversation

@oeninghe-dataport

Copy link
Copy Markdown
Collaborator

Summary

Migrate the GFI plugin.

Instructions for local reproduction and review

  • Open snowbox.
  • Click on a marker.
  • See the result.

Additional hints

  • The utils requestGfi* were migrated as-is and do not need to be reviewed therefore.

Relevant tickets, issues, et cetera

Closes #368

@oeninghe-dataport oeninghe-dataport added this to the POLAR@3 milestone Jan 8, 2026
@oeninghe-dataport oeninghe-dataport self-assigned this Jan 8, 2026
@oeninghe-dataport oeninghe-dataport added the refactor Refactoring of previous code label Jan 8, 2026
@oeninghe-dataport oeninghe-dataport linked an issue Jan 12, 2026 that may be closed by this pull request
@oeninghe-dataport
oeninghe-dataport force-pushed the vue3/migrate-plugin-gfi branch 3 times, most recently from 58e73f6 to f941649 Compare January 16, 2026 13:12
@github-actions

github-actions Bot commented Jan 23, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://Dataport.github.io/polar/pr-preview/pr-447/

Built to branch gh-pages at 2026-09-04 15:36 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@oeninghe-dataport
oeninghe-dataport marked this pull request as ready for review February 17, 2026 16:02
@dopenguin
dopenguin removed the request for review from warm-coolguy February 19, 2026 09:46
# Conflicts:
#	examples/snowbox/services.js

@dopenguin dopenguin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please add an example to iceberg; this maybe should include an example with a layer where the feature list is not being used
  • There should be no horizontal scrollbar if no features are available Image
  • Some things are missing / quite different with the featureList; some parts are connections with the markers feature. This includes:
    • When hovering an element in the feature list, the feature is highlighted in the map with the hover style
    • When hovering an element in the map, the feature is highlighted in the feature list (previously green); when hovering a clustered feature, all features that are part of the cluster are highlighted
    • If I select a feature in the map, it is selected in the feature list
    • If I select a feature in the feature list, the corresponding marker gets the selected style; currently, a yellow dot is being displayed
    • If I select a feature in the feature list, the map should be centered on that feature
    • If a feature is not selectable because of the configured isSelectable function, it is not being shown in the feature list

The list may not be complete, so please take a look at Meldemichel regarding the various things mentioned above.

I'll be taking a look at the components and stores once you've tackled these things.

🏓 @oeninghe-dataport

Comment thread src/plugins/gfi/utils/requestGfiWfs.ts Outdated
Comment thread src/plugins/gfi/utils/requestGfiWfs.ts
Comment thread src/plugins/gfi/utils/requestGfiWms.ts Outdated
Comment thread src/plugins/gfi/utils/requestGfiWms.ts Outdated
Comment thread src/core/stores/main.ts Outdated
Comment thread src/plugins/geoLocation/types.ts Outdated
Comment thread examples/snowbox/index.js Outdated
Comment thread src/locales.ts Outdated
Comment thread src/locales.ts Outdated
Comment thread src/locales.ts Outdated
dopenguin and others added 5 commits February 23, 2026 19:56
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>

@warm-coolguy warm-coolguy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏓 @oeninghe-dataport

Incomplete review, but might as well.

Comment thread src/plugins/gfi/components/GfiUI.ce.vue Outdated
@@ -0,0 +1,50 @@
<template>
<PolarCard
v-if="gfiStore.features.length > 0 || gfiStore.configuration.featureList"

@warm-coolguy warm-coolguy Sep 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line will, when Gfi runs in the IconMenu, produce an error in situations where there's neither a featureList configured nor a feature chosen. It's also somewhat confusing that there's nothing to be seen.

Image

Configuration:

[
				{
					plugin: pluginGfi({
						directSelect: true,
						coordinateSources: [
							{
								plugin: 'pins',
								key: 'coordinate',
							},
						],
						layers: {
							[kielPolygon]: {
								window: true,
								geometry: true,
							},
						},
					}),
				},
			],

pls fix

@warm-coolguy warm-coolguy Sep 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've double-checked and this happens as soon as featureList is deleted. I've checked in POLAR@2, and it's the identical (wrong) behaviour there, except that there's no error flying in the old country.

I propose these possible solutions:

  • Just fix it. When there's a feature chosen, it appears normally, and when there's no feature chosen and we have the GFI window open, display an appropriate instructory text about clicking something or about "clicking something hasn't occurred yet".
  • Don't fix it. Document that, whenever the plugin is rendered as part of the IconMenu, featureList has to be used, too. Also create an issue that describes this situation; I consider it a new-found bug in POLAR@2 (that maybe is migrated over to POLAR@3 in this step), or a missing feature, depending on what side of the coin we're looking at.

Maybe there's a third solution, or I am just missing a configuration parameter?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As documenting this bug and fixing it seems to be a similar effort, therefore, here's a fix:

467a77f

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2026-09-04 100227

May fall together with some other issues.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test this with the snowbox config or the one posted here?

If the former, I cannot reproduce it.
If the latter, this is the expected behaviour, isn't it?

@warm-coolguy warm-coolguy Sep 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember. I think the issue was me not reading Does not work together with {@link MapConfiguration.markers}. on directSelect, which I falsely assumed.

clusterF.patch

I've now constructed another funny configuration that does this:

Screenshot 2026-09-04 130645

On removing clusterDistance: 40 from examples/snowbox/services.json's entry with id 6059, it works more as expected (and I don't think we'll have to further touch that behaviour at this point). But with the clusterDistance, the GFI (and GFI environment) is broken in these regards:

  1. Clustered feature still visible after zoom (it shouldn't be as the cluster is actually spread now)
  2. No feature is visibly selected (features are selected without clusterDistance)
  3. And we're showing the cluster feature instead of the clustered features

I'm not sure whether these are bugs, missing features, or just expected undefined behaviour. Depending on solution, we should maybe add/clarify that in the documentation, and maybe create issues, and maybe throw warnings in the code somewhere. I've checked @2 and it's not properly documented there.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three points should be solved w/ 7642fa3. It is probably broken on main as the implementation is the same

Comment thread src/plugins/gfi/types.ts
*
* @example `['status', 'type']`
*
* @defaultValue Display all properties

@warm-coolguy warm-coolguy Sep 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to hold with configuration:

[
				{
					plugin: pluginGfi({
						directSelect: true,
						coordinateSources: [
							{
								plugin: 'pins',
								key: 'coordinate',
							},
						],
						layers: {
							[kielPolygon]: {
								window: true,
								geometry: true,
							},
						},
					}),
				},
			],
Image

pls explain ?? fix

@oeninghe-dataport oeninghe-dataport Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls explain ??

The feature of the list of one features was not selected.

fix

1b69443

The fix is one-line, all other changes are just re-ordering.

@warm-coolguy warm-coolguy Sep 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happy_little_accident

still_nagging.patch

When configuring the denkmals, I don't get the "Es ist kein Objekt ausgewählt." back after closing the feature. If you've still got the kielPolygons configured, it's the same issue there, then there's no need for the patch.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also happens in independent mode.

Source: Just saw it on my mobile device and got the white bar stuck across the screen.

@warm-coolguy warm-coolguy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oeninghe-dataport Some more stuff.

Comment thread src/plugins/gfi/types.ts
* ```ts
* {
* geometry: true,
* window: true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the current setup, I've set this to false for reports, and nothing changed. Both reports and kielPolygon continued to be in the feature list. This looks like a bug to me, I assume only the kielPolygon features should be left in.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also seems correct to me.
Fixed w/ 39ca3a1

@warm-coolguy warm-coolguy Sep 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix breaks feature listeners. It's a common use case that, with window: false, subscribe(map, 'gfi', 'features', ... is used to fill e.g. a form on selecting a parcel or whatnot.

21180da

I've added a feature printer for our convenience. Window should be a purely in-POLAR-UI thing.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/plugins/gfi/utils/requestGfiWms.ts
Comment thread src/plugins/gfi/store.ts
@@ -0,0 +1,50 @@
<template>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure where to put this comment, but the whole thing just doesn't render with this configuration (I also removed the entry from IconMenu):

addPlugin(
	map,
	pluginGfi({
		displayComponent: true,
		layoutTag: 'MIDDLE_LEFT',
		layers: {
			[reports]: {
				window: true,
				geometry: false,
			},
		},
	})
)

Maybe this falls together with #447 (comment), but I'm very unsure. Am I missing configuration?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails as expected.
Nothing is rendered bc there is no source to select features from.

Probably, you'd expect that the markers have an effect; to achieve this, you need to configure featureList with bindWithCoreHoverSelect.

However, while testing this, I figured out that hasActiveWindowLayers was not reactive enough w.r.t. OL.
This is fixed w/ 568f49a, fe1a784

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not_selected

isItMyFaultQuestionMark.patch

Config still bad?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bug I also recognized; it is fixed w/ 8d15b9f

@warm-coolguy warm-coolguy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚚 @oeninghe-dataport here comes the fun truck, unloading a batch of riddles

Comment thread src/plugins/gfi/types.ts
*
* @defaultValue Disabled by default
*/
multiSelect?: MultiSelect

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't make this fly.

neverSayNoToPanda.patch

Trying to select babas:

Image

Trying to select kikis:

Image

If my configuration is erroneous, can you please provide the intended configuration?

Removing directSelect doesn't help. Using box yields the same behaviour.

Bonus: I held Shift instead of Strg and got this behaviour:

Image

Do you know if there's an issue about this or where this comes from? Seems to be unrelated to GFI, but e.g. on https://static.hamburg.de/kartenclient/prod/ we have the same effect without the wobbliness. I guess we wobbled up somewhere.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed w/ a063a4a, 950629c

The Shift behaviour is OL default, as seen e.g. here

Comment thread src/plugins/gfi/types.ts
* The default style as seen in the example will be used for each part that is not customized.
* An empty object will return the complete default style while e.g. for an object without a configured fill the default fill will be applied.
*/
customHighlightStyle?: CustomHighlightStyle

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like this does anything.

unfulfilling.patch

Image
issue.isThereAWorkingConfiguration(this)
  ? hendrik.provideWorkingConfiguration(this)
  : hendrik.fix({it: 'felix'})

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is none.

MasterportalAPI stealed our style.
cfb4a34

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But now there is one.

		customHighlightStyle: {
			fill: {
				color: '#FF0000',
			},
		},

Comment thread src/plugins/gfi/types.ts
* @defaultValue `Infinity`
* @example `10`
*/
maxFeatures?: number

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting this means nothing works anymore.

Image

tired.patch

return store[activeLayersRef.key]
})

const activeLayers = computed(() =>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea what exactly went wrong, but I can totally select insivisble features atm. Maybe somewhere here. I'm more or less placing this comment randomly, but the issue is real.

Image

pantsOnHead.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring of previous code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migration of GFI plugin to POLAR@3

3 participants