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

overrideByName causes legend to omit shields #1165 #1180

Merged
merged 6 commits into from
Jan 1, 2025

Conversation

joshuamanivinod
Copy link
Contributor

Hi @1ec5

I have implemented a fix for this issue. The updated logic ensures that shields appear correctly in the legend even when a network uses overrideByName. Specifically, the getSortedImages function now accounts for overrideByName alongside existing overrides, ensuring no blank spaces are shown.

Let me know if this solution meets your expectations or if further adjustments are needed.

Screenshot 2024-12-16 at 3 30 17 PM

@claysmalley claysmalley added the bug Something isn't working label Dec 16, 2024
@1ec5 1ec5 linked an issue Dec 16, 2024 that may be closed by this pull request
@ZeLonewolf
Copy link
Member

Thanks @joshuamanivinod for the contribution. Do we know why the shield is shifted to the right compared to the others?

@joshuamanivinod
Copy link
Contributor Author

It looks like two images are being displayed side by side, which is causing the image to appear slightly shifted. I'm trying to determine the reason for this issue.

Screenshot 2024-12-17 at 6 35 46 PM

@joshuamanivinod
Copy link
Contributor Author

Handle overrideByName causing legend to omit shields

  • Updated logic in getSortedImages to conditionally include images.noRef
    based on the presence of overridesByName.
  • Ensures that the legend properly displays shields when overridesByName
    is present and noRef is not required.

Screenshot 2024-12-31 at 2 15 11 PM

Copy link
Member

@ZeLonewolf ZeLonewolf left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! Please remove the extra comment and this is good to go.

src/js/legend_control.js Outdated Show resolved Hide resolved
@ZeLonewolf ZeLonewolf dismissed their stale review January 1, 2025 22:45

Resolved

Copy link
Member

@ZeLonewolf ZeLonewolf left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@ZeLonewolf ZeLonewolf merged commit 563b8b1 into osm-americana:main Jan 1, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

overrideByName causes legend to omit shields
3 participants