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

Concurrent shields overlap at either end of divided highway #923

Open
1ec5 opened this issue Sep 14, 2023 · 2 comments
Open

Concurrent shields overlap at either end of divided highway #923

1ec5 opened this issue Sep 14, 2023 · 2 comments
Labels
bug Something isn't working shields

Comments

@1ec5
Copy link
Collaborator

1ec5 commented Sep 14, 2023

Shields in a route concurrency overlap each other wherever the road transitions from being undivided to being divided (dual carriageway).

US-270/US-281/SH-3 with overlapping SH-51 and SH-33 shields

Zooming in, it’s apparent that this is caused by one-way LineString features getting merged together despite going in opposite directions.

US-270/US-281/SH-3 with an overlapping SH-33 shield

While this merging isn’t ideal, there’s a straightforward workaround at the style level. Currently, the highway shield layer specifies a text-max-angle of 180 degrees, which is enough to allow the label to double back on itself. We give road name labels a much less generous text-max-angle of 20 degrees. I think a similar value should be applied to the highway shield layer for consistency.

@1ec5 1ec5 added bug Something isn't working shields labels Sep 14, 2023
@jleedev
Copy link
Collaborator

jleedev commented Sep 14, 2023

It's actually four separate lines in the tile. Does the frontend merge these? Never mind, I'm not looking at transportation_name here.

Screenshot_20230914-185316~2

@1ec5
Copy link
Collaborator Author

1ec5 commented Sep 14, 2023

It's actually four separate lines in the tile. Does the frontend merge these? Never mind, I'm not looking at transportation_name here.

Hm, you do have a point though. GL JS doesn’t merge linestrings in general, but it does merge them for the purpose of label placement, as long as the text-field is equivalent. (Not even icon-image keeps them from merging: mapbox/mapbox-gl-js#3645.) Regardless, I think a smaller text-max-angle would prevent the label from doubling back on itself, even if it’s a single feature in OSM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working shields
Projects
None yet
Development

No branches or pull requests

2 participants