openstreetmap-americana icon indicating copy to clipboard operation
openstreetmap-americana copied to clipboard

Bannered shields cause neighboring shields to move too far down

Open claysmalley opened this issue 3 years ago • 3 comments

With shields along concurrent routes where one shield has more banners than another, the shield with fewer banners displays farther down on the screen than expected:

Screenshot from 2022-05-21 12-03-13

@ZeLonewolf:

It would require a change to maplibre to adjust the baseline for shields, or some other pixel gymnastics that I haven't thought of yet.

claysmalley avatar May 21 '22 16:05 claysmalley

The issue is that shields are drawn with a common baseline for the entire string, and drawn vertically aligned to the bottom of the baseline, like so:

image

ZeLonewolf avatar May 21 '22 16:05 ZeLonewolf

Yeah this is a pretty fundamental issue with the way we are handling banners. The banners are part of the shield graphic and MapLibre aligns the shield graphics in a concurrency to the baseline because they are being used as glyphs in a text string. I'm guessing a fix for this issue would require changes to MapLibre.

zekefarwell avatar May 21 '22 18:05 zekefarwell

Each string or image expression in a format expression can be followed optionally by an style override options object. This would call for an option similar to the vertical-align CSS property.

1ec5 avatar May 21 '22 22:05 1ec5