Variable symbol placement state not flushed when map restyled
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**mapbox-gl-js version**: 2.3.1
**browser**: MacOS FF
### Steps to Trigger Behavior
1. Create a symbol layer with text-variable-anchor ['left','top'] and text-radial-offset 1, such that a preferred placement (left) is generally not used and `top` is.
2. Increase text-radial-offset to 3.
Expectation: anchors recalculated so that `left` is generally used now.
Actually: `top` is still used everywhere, just further away.
You can force it to recalculate only by modifying `text-variable-anchor` so that the previous anchor (`top`) is not possible anymore.

The result after the 4th image is what I expect to see in the 2nd image.
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
Reproduce the issue in mapbox-gl-js 2.3.1 using a symbol layer with text-variable-anchor and text-radial-offset, then trace the symbol placement and restyling entry points. Done means changing the radial offset causes anchors to be recalculated, with the preferred placement selected as described; the payload names no source file or test to start from.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100