-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Street labels overlapping at high zooms with pitched views #5112
Comments
It took me a while looking at that to visually figure out what was going on -- looks like the labels basically start doubling back on themselves at the midpoint. Could be a bug in the /cc @ansis |
Wow I had a tough time figuring this one out... It turns out that if you're zoomed in far enough to a highly pitched tile, the bottom edge of the tile can come behind the camera, and our projection only works for points in front of the camera (there's a discontinuity as points cross the plane of the camera, then they flip orientation as their w values go negative). The flipping effect that shows up in the screenshot @asheemmamoowala posted comes because the first half of the label is oriented from the anchor (which is within the viewport and projected just fine) to the top vertex of the line segment (which is in the distance and projected just fine). The second half of the label is oriented from the anchor to the bottom vertex of the line segment -- whose x value will get projected more or less correctly, but whose y value will be flipped so it's past the top of the viewport. Narrowing the field-of-view of the camera to ten degrees moves the camera back and fixes the problem, but of course changes the way pitched views look... I'm not sure what the best solution is here. We might have to check vertices to see if they cross the plane of the camera -- and if so, instead of using that vertex, we take a unit vector from tile space, project it, and then extend it to the edge of the viewport. |
Adds special handling for (rare) case that line geometry projects to a point behind the plane of the camera.
Adds special handling for (rare) case that line geometry projects to a point behind the plane of the camera.
Without the fix: - The "viewport-overzoomed" test would show "Figueroa St." jumbled in the lower half of the screen - The "viewport-overzoomed-single-glyph" test would show the letter "C" upside down
Adds special handling for (rare) case that line geometry projects to a point behind the plane of the camera.
Without the fix: - The "viewport-overzoomed" test would show "Figueroa St." jumbled in the lower half of the screen - The "viewport-overzoomed-single-glyph" test would show the letter "C" upside down
Adds special handling for (rare) case that line geometry projects to a point behind the plane of the camera.
Without the fix: - The "viewport-overzoomed" test would show "Figueroa St." jumbled in the lower half of the screen - The "viewport-overzoomed-single-glyph" test would show the letter "C" upside down
Fixed in #5120 |
https://api.mapbox.com/styles/v1/mapbox/navigation-guidance-day-v2.html?access_token=<ACCESS_TOKEN>#19.63/33.86818/-118.28172/-176/45
mapbox-gl-js version: 0.39.1
Expected Behavior
Street label text does not overlap
Actual Behavior
The text was updated successfully, but these errors were encountered: