You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shields in a route concurrency overlap each other wherever the road transitions from being undivided to being divided (dual carriageway).
Zooming in, it’s apparent that this is caused by one-way LineString features getting merged together despite going in opposite directions.
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.
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.
Shields in a route concurrency overlap each other wherever the road transitions from being undivided to being divided (dual carriageway).
Zooming in, it’s apparent that this is caused by one-way LineString features getting merged together despite going in opposite directions.
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 generoustext-max-angle
of 20 degrees. I think a similar value should be applied to the highway shield layer for consistency.openstreetmap-americana/src/layer/highway_shield.js
Line 60 in 0a0c9fa
openstreetmap-americana/src/layer/road_label.js
Line 8 in 0a0c9fa
The text was updated successfully, but these errors were encountered: