Lack of documentation on how mapbox-gl merges lines for label placement purposes
@mourner is already working on this.
Since Jul 9, 2021.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
We've come across an issue where gl-js seems to (from our perspective erroneously) merge lines before placing labels. This results in labels for feature A being placed along feature B, given both have `symbol-placement: line` and identical `text-field` values.
The screenshot below illustrates the situation. The label on the left belongs to the feature on the right (color is being set via `feature-state`, using the features' `id`s). The two linestrings meet exactly at the point where the building in the middle is placed:

I have found [this comment](https://github.com/mapbox/mapbox-gl-js/issues/3645#issuecomment-262414642) which seems to indicate the heuristic for merging is based on data-driven properties(?) but I've failed to find any further documentation on how exactly this works.
**mapbox-gl-js version**: `1.13.0`
**browser**: Chrome 90.0.4430.212 (macOS 11.1)
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.
Assessment
This issue has not been assessed yet.