-
-
Notifications
You must be signed in to change notification settings - Fork 757
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
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. |
Thanks for taking the time to solve this! |
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 |
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... |
Commenting on this as our users hit this from time to time and would love if this could get merged. Were you guys able to work out how to test this? |
I haven't seen any updates regarding a test to showcase this issue and the relevant fix... |
backgroundFor more context on where I've run into this issue, we're running maplibre inside of deck.gl as a static basemap layer. We use osm vector tiles and osm bright style. The error is reliably reproduced only when transitioning between zoom levels and certain features with multiline text labels. We mitigated the issue by just removing the newline, so this doesn't actually occur for us (that we're aware of) anymore, see my initial comment on #1224. When we load the same style and map data using tileserver-gl and zoom in/out over the same features that cause the problem it works fine. My theory is that there is some condition where deck.gl managed zoom transitions with maplibre-gl end up triggering the condition exhibited by the issue, but maplibre-gl itself doesn't cause the scenario (at least reliably) what this pr is addressingI was unable to create an integration render test that could replicate the error case. That isn't to say that there isn't an issue, there is still a logic flaw in the code that this PR is addressing by adding a guard clause that mimics other scenarios
every other invocation of this function has a guard check to see if it returned null, and ends up returning a
where it ends up throwing an exception later where
Perhaps this is where a unit test is needed instead of an integration render test? I don't understand enough of the internals to craft the test data that can force |
Sure, if a render/integration test is something we have s hard time creating, a unit test will be enough, but a test is still needed to prevent this from happening in the future. |
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 anull
value and throws an exception later inplaceGlyphsAlongLine
.Launch Checklist
CHANGELOG.md
under the## main
section.