mapbox / mapbox/mapbox-gl-js

text-allow-overlap partially ignored for symbol layer

Open
#10,089 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**mapbox-gl-js version**: v1.12.0

**browser**: MacOS Chrome, but behavior doesn't seem to be browser-dependent.

### Steps to Trigger Behavior

1. Starting with the example at https://docs.mapbox.com/mapbox-gl-js/example/filter-markers-by-input/, modify the layer layout properties to have:
`
'icon-allow-overlap': true,
'text-allow-overlap': false,
'text-optional': true,
`
2. Zoom out so the icons + layers start to collide

### Link to Demonstration

https://jsbin.com/mowatuj/

### Expected Behavior

Per the options, I'd expect the icons to be allowed to overlap, but not the text. The text should disappear when it starts to overlap other text or icons.

### Actual Behavior

Some of the text is removed as expected; other text is allowed to overlap the icons. Here, the bottom-right MUSIC label is correctly removed, but BICYCLE sticks around and is drawn atop the theatre icon.

![image](https://user-images.githubusercontent.com/743030/98751786-a1585a80-2375-11eb-9efb-742a414bece6.png)

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 using the filter-markers-by-input example and the linked jsbin, with icon-allow-overlap true, text-allow-overlap false, and text-optional true. Zoom out until symbols collide and trace the collision behavior for the symbol layer. Done means overlapping text is consistently hidden when it collides with icons or other text while icons remain visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.