Implement `max-curvature` property for labels
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
With https://github.com/mapbox/mapbox-gl-js/pull/4781, labels can now do a good job of following roads with arbitrary geometry. 🙌
However, following a road as long as you can ends up looking pretty weird, especially in the distance, as road labels can start bending back on themselves (see Ocean Park Blvd in the screenshot).

We already have [text-max-angle](https://www.mapbox.com/mapbox-gl-js/style-spec/#layout-symbol-text-max-angle), but that only controls the maximum curvature of any _single_ angle in the line, so it doesn't prevent a label from flipping back on itself through a series of smaller angles.
Instead of making this a style property, it might also make sense to find a good value to hardwire (maybe something a little less than 180 degrees?).
/cc @nickidlugash @ansis
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing PR 4781 and the existing text-max-angle style-spec behavior. Determine whether max-curvature should be a style property or a hardwired value, then verify that road labels no longer bend back on themselves through a series of smaller angles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100