mapbox / mapbox/mapbox-gl-js

Variable symbol placement state not flushed when map restyled

Open
#10,891 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle:
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.

Screenshot 2021-07-22 at 2 29 34 PM
Screenshot 2021-07-22 at 2 30 07 PM
Screenshot 2021-07-22 at 2 30 25 PM
Screenshot 2021-07-22 at 2 30 37 PM

The result after the 4th image is what I expect to see in the 2nd image.

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.