mapbox / mapbox/mapbox-gl-js

Using text-translate in symbol paint doesn't update collision boxes

Open
#10,852 1 comment 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

When adding a `text-translate` property to a layer the collision boxes won't move together with the labels. Also click and hovers are registered on the original place of the label before the translate.

Screenshot 2021-07-14 at 10 47 03

**mapbox-gl-js version**: 2.3.1

**browser**: Chrome 91

### Steps to Trigger Behavior

1. Add a symbol layer
2. Provide a `text-translate` on the paint property of a layer

### Link to Demonstration

See: https://codepen.io/timsluis/pen/LYyxmdB

### Expected Behavior

Collision boxes are updated.

### Actual Behavior

Collision boxes are not updated and labels flow over each other.

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

Start with the linked CodePen reproduction and inspect the symbol-layer collision and interaction handling involved in text-translate. The issue is done when collision boxes, label overlap behavior, clicks, and hovers all follow the translated label position.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-dev
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.