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

update glyph placement to verify all glyphs are valid #5118

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ragnarok56
Copy link

@ragnarok56 ragnarok56 commented Nov 26, 2024

Resolves #1224

Addresses an issue with glyphs where first/last glyphs are assumed to be sufficient to place all remaining glyphs using placeGlyphAlongLine which can return a null value and throws an exception later in placeGlyphsAlongLine.

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 91.81%. Comparing base (30ab703) to head (14b9de2).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/symbol/projection.ts 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5118   +/-   ##
=======================================
  Coverage   91.81%   91.81%           
=======================================
  Files         279      279           
  Lines       38340    38344    +4     
  Branches     6698     6699    +1     
=======================================
+ Hits        35200    35204    +4     
  Misses       3007     3007           
  Partials      133      133           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HarelM
Copy link
Collaborator

HarelM commented Nov 26, 2024

Thanks for taking the time to solve this!
It would be great if you could create a test for this.
Hopefully a render test to showcase the issue and the solution.
Let me know if you need help with wiring the test.

@ragnarok56
Copy link
Author

Trying to come up with a render test that can recreate it, but having some issues identifying the exact scenario that causes it to fail. I don't have access to the environment this is was occurring in right now. I'm also not certain if it 100% happens on just rendering or if it was being triggered from zooming in/out of the area and maybe that is part of the calculus involved, if so then a render test may not be sufficient by itself?

Also not at all familiar with how placeGlyphAlongLine works and how to trigger the error case where one of the symbols fails to be placed along a line after the first/last check is done.

@HarelM
Copy link
Collaborator

HarelM commented Nov 29, 2024

If you can't create a test to reproduce it, it will be impossible in the future to make sure this won't break again...
Also it will make testing that this actually fixes the issue harder...

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

Successfully merging this pull request may close these issues.

Certain lat/lngs, zoom and styles throws error: Cannot read properties of null (reading 'point')
2 participants