Skip to content

feat(gfi): migrate plugin - #447

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

feat(gfi): migrate plugin#447
oeninghe-dataport wants to merge 252 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-10 15:32 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>
@dopenguin

Copy link
Copy Markdown
Member

@oeninghe-dataport pls @ me once you've tackled all the things!

@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

@warm-coolguy warm-coolguy Sep 9, 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.

It is probably broken on main as the implementation is the same

tongue-out

All three points should be solved w/ 7642fa3

Point 2 "No feature is visibly selected (features are selected without clusterDistance)" mostly stands, but something changed: Now selection isn't visible without clusterDistance, either. (When selecting point geometries; polygon geometries work fine.)

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.

03a265a makes feature selection visible again. Highlighting the clustered features (instead of the cluster feature) might be unexpected, however, depending on the use case, it also might be the expected behaviour. You decide.

Comment thread src/plugins/gfi/types.ts

@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.

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.

looksWrong

unwindow.patch

Mostly works, but markers still make the features selectable. When I remove the markers, the features stay passive (i.e. they're not visible in gfi.window) the way they are supposed to.

I see that this is quite the edge case we never considered before, and I don't know if it'll ever occur. Do you consider this fixable or should we document on window that false doesn't work together with markers yet? I'm undecided.

Comment thread src/plugins/gfi/utils/requestGfiWms.ts
Comment thread src/plugins/gfi/store.ts
Comment thread src/plugins/gfi/components/GfiUI.ce.vue

@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

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.

Note to self: I'll make a bug issue regarding that because, differing from OL default, we're also panning while making a zoombox.

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.

Note to others that read note to self: #965 The issue has been created.

@warm-coolguy warm-coolguy Sep 9, 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.

Selected features without markers are no longer highlighted, but that's the same as in #447 (comment), so we may as well handle that there.

It occured to me that holding Strg while dragging the selection box/circle has an issue in that there's an awful lot of features selected.

loadsa.patch

Screenshot 2026-09-09 092808

In this image, I've drawn about the same circle again for the screenshot. It's in Northern Hamburg, which is a nice test region due to average feature density.

It is unclear to me where they come from, or why they were invisible, or if there's instead a too-huge bbox in the request, or ...

I've checked the filters, but that's not the issue.

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.

Oh, looks like changing to isSelectable: (feature) => true, will show the other features. Do you have appropriate styles for all the different layers? Maybe that changes the selection issue, too.

Comment thread src/plugins/gfi/types.ts
Comment thread src/plugins/gfi/types.ts
Comment thread src/plugins/gfi/stores/list.ts

@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

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.

Using the GfiFeatureList does not work on polygons. I've made a configuration where markers are not used: unmarked.patch

It will still fiddle with the marker store:

Image

I also tried to fill in the isSelectable (and added directSelect here) to no avail:

unmarked_but_selectable.patch

Also, I can change the behaviour on this case by clicking really hard, i.e. twice, on an entry. Details will be shown, but I guess the bugsplosion blasted me to another dimension. Closing the feature in this scenario also takes two clicks.

Image

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.

Switching features in the featureList started to be jumpy recently.

Image

It looks rather odd and does not align with prior behaviour.

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 shall now proceed and perform a magic trick where I select 15864 of 6949 features.

Image

magic.patch

⋆。🪄𖦹°⭒🔮˚。⋆

@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.

Another one.

Comment thread src/plugins/gfi/types.ts
* @example
* ```ts
* {
* geometry: 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.

I don't think this is currently working as expected. I can highlight the kielPolygon geometry, but on selecting markers or the features without markers configured, no dots appear despite the features being selected. I vaguely remember that yellow dots popped up last week. Do you share this memory?

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