text-offset
on line-placed symbol layer causes gaps or bunching
#2170
Labels
text-offset
on line-placed symbol layer causes gaps or bunching
#2170
maplibre-gl-js version: 3.0.0-pre.4 (but this issue has been reported since at least 2016)
browser: Any
Steps to Trigger Behavior
text-field
andsymbol-placement
set toline
.text-offset
to a value other than 0.Link to Demonstration
In this test case, there are five labels that say “Lorem ipsum dolor sit amet”. Each is rendered by a symbol layer that is identical except for a different
text-offset
:https://jsbin.com/kafefin/edit?js,output
showCollisionBoxes
is enabled, though this demo disables collision to show that it isn’t a collision issue.Expected Behavior
In each label, “IP” should be right next to “SUM” without any overlap and without any gap, even though there is an angle in the linestring geometry at that point.
Actual Behavior
In the labels above the dotted line (with a negative y-offset), “IP” overlaps with “SUM”.
In the labels below the dotted line (with a positive y-offset), there is an unsightly gap betwen “IP” and “SUM”.
Impact
Style authors y-offset labels for various purposes, most notably:
This issue makes such labels look visually unattractive and difficult to read. For a practical example in a real, deployed style, see osm-americana/openstreetmap-americana#753 (comment).
This issue was previously reported and confirmed in mapbox/mapbox-gl-js#3718.
The text was updated successfully, but these errors were encountered: