text-size interpolation by zoom "symbol-placement": "line-center" is inconsistent
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
There are two separate issues I would like to bring up.
The **first** one is that if a text-size is interpolated (linear) by zoom level, inactive zoom levels change the results. What I mean is this style with a map on a **zoom level 2**:
`[
"interpolate",
[
"linear"
],
[
"zoom"
],
2,
[
"interpolate",
[
"linear"
],
[
"get",
"d"
],
1500,
8,
3500,
30
]
]`
gives a different result on zoom level 2 with another stop (which shouldn't matter because zoom level is 2):
`[
"interpolate",
[
"linear"
],
[
"zoom"
],
2,
[
"interpolate",
[
"linear"
],
[
"get",
"d"
],
1500,
8,
3500,
30
],
9,
[
"interpolate",
[
"linear"
],
[
"get",
"d"
],
1500,
80,
3500,
300
]
]`
Why is that?
The **second** issue is that the text-size interpolation by zoom level (and a property variable) has changed between versions without clear mention in the docs.
https://chronas.org uses **mapbox-gl 0.47.0** for country labels (which use this settings: https://raw.githubusercontent.com/Chronasorg/chronas/master/src/components/map/mapStyles/map-style-basic-v8.json ("id": "area-labels")), when bumping to **mapbox-gl 0.52.0**, none of the labels are displayed anymore, only when changing the number settings some labels show up with unfurtonately not the same result.
Can you explain what parameters could have changed and how I can adapt my settings accordingly?
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
Begin with the linked Chronas map-style-basic-v8.json and its area-labels layer, then reproduce both expression examples with mapbox-gl 0.47.0 and 0.52.0 at zoom 2. Done means explaining the inactive-stop behavior and documenting which parameter or style changes account for the label differences.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100