mapbox / mapbox/mapbox-gl-js

Road name label density badly calculated based on text-size

Open
#6,464 9 comments 1 reaction 1 assignee View on GitHub

@ChrisLoer is already working on this.

Since Apr 6, 2018.

bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

v0.44.1 @ Chrome 65 @ Windows 10:

### Steps to Trigger Behavior

1. I have created custom map data and style in Casablanca, and as road name labels in Mapbox examples look bad in that area it can most likely be reproduced with your data also.
2. I have excluded mostly every other layer for this to be more obvious.
3. I keep everything as a constant, only thing that changes is text-size : stops for label layer.

### Expected Behavior
![image](https://user-images.githubusercontent.com/2914274/38420078-ef6515b6-39a2-11e8-8588-fddbe33a1383.png)
with:
```
"text-size": {
"stops": [
[ 12, 10 ],
[ 19, 10 ],
[ 20, 16 ]
]
}
```
### Actual Behavior
Now i only change this:

```
"text-size": {
"stops": [
[ 12, 10 ],
[ 14, 10 ],
[ 20, 16 ]
]
}
```

And result is this:

![image](https://user-images.githubusercontent.com/2914274/38420576-87ddc6a2-39a4-11e8-866e-9d822a035022.png)

How is this possible on zoom level 12, especially with stop [ 14, 10 ]?
And even better how does stop [ 19, 10 ], fixes this problem?
This is simplified example but this effect destroys map quality in certain areas of the globe where there are less POIs and other labels.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.