Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fallback for getting feature id #1566

Merged
merged 2 commits into from
Feb 26, 2025
Merged

Conversation

silvester-pari
Copy link
Collaborator

@silvester-pari silvester-pari commented Feb 26, 2025

Implemented changes

This PR introduces a small fix for getting the feature id correctly when rendering the feature list. Previously, feature.getId() wouldn't return an id correctly, since it can only be retrieved for features where setId() was executed on. By providing the fallback feature.get("id") we cover both cases (set("id", <id>) and setId(<id>)).

Checklist before requesting a review

Copy link

netlify bot commented Feb 26, 2025

Deploy Preview for eoxelements ready!

Name Link
🔨 Latest commit efa5c37
🔍 Latest deploy log https://app.netlify.com/sites/eoxelements/deploys/67bef2c817458300089f86ae
😎 Deploy Preview https://deploy-preview-1566--eoxelements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@silvester-pari silvester-pari marked this pull request as ready for review February 26, 2025 08:01
Copy link
Collaborator

@A-Behairi A-Behairi left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏾

@silvester-pari
Copy link
Collaborator Author

Hmm.. this actually does not work for the "regions" click example, as those features don't have an "id" property

@silvester-pari silvester-pari marked this pull request as draft February 26, 2025 10:16
@A-Behairi
Copy link
Collaborator

hmmm, shouldn't it have a unique identifier from ol in any case ?

@silvester-pari
Copy link
Collaborator Author

I now changed it to use the getId helper from eoxMap, which checks idProperty, id, getId and ol_uid.

@silvester-pari
Copy link
Collaborator Author

silvester-pari commented Feb 26, 2025

Also had to fix some other issues that were introduced with the projection transformation (zooming of feature to wrong projection), I directly added that to this PR. Now it works again as it did in the past :-)

Screencast_00008.mp4

@silvester-pari silvester-pari marked this pull request as ready for review February 26, 2025 11:03
@silvester-pari silvester-pari merged commit 76f9445 into main Feb 26, 2025
8 checks passed
@silvester-pari silvester-pari deleted the drawtools/fix/feature-id branch February 26, 2025 11:04
@github-actions github-actions bot mentioned this pull request Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants