Open osvodef opened 1 year ago
@karimnaaji looks like this was introduced in #11015 — maybe you have insight into what's going on here?
I have a similar type of issue, for me the symbols don't disappear but the Features do. The problem for me manifest only if zoom >=6. This is my ugly workaround at the moment:
<MapGL
projection={zoom < 6 ? "globe": "mercator"} //TODO: fix me
initialViewState={mapSettings.defaults}
...
/>
Edit: it was fixed with an update, now all good!
Could be related to https://github.com/mapbox/mapbox-gl-js/issues/12100
mapbox-gl-js version: 2.13.0
browser: Chrome 111
Description
Symbols of these types:
text-variable-anchor
andicon-text-fit
setare not rendered in globe projection between
GLOBE_ZOOM_THRESHOLD_MIN
andGLOBE_ZOOM_THRESHOLD_MAX
.Steps to Trigger Behavior
Link to Demonstration
https://codepen.io/osvodef/pen/povExxg
Expected Behavior
All labels stay visible while crossing zoom levels 5–6
Actual Behavior
3 labels disappear, 1 stays
Additional info
I did a bit of detective work myself on this issue, hope this helps.
I tracked the bug down to symbol vertex shaders and
u_zoom_transition
uniform. Forcing its value to 0 makes the labels appear, but on wrong positions on the screen, as if no globe→mercator transition is happening.In the shaders, I found this line that hides the labels when
u_zoom_transition > 0
:However, just removing this line doesn’t fix the issue since the screen coordinates calculated by the shader are also wrong when
u_zoom_transition > 0
, usually putting the symbol completely off-screen.The
projection_transition_fade
line suggests that this was done intentionally, however, I couldn’t find any relevant discussion in PRs/issues here so I decided to report it anyway.