text-allow-overlap partially ignored for symbol layer
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**: 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.

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 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