Support negative icon-padding/text-padding values
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: v0.44.1
Steps to Trigger Behavior
Set icon-padding to -2 on a style layer.
Expected Behavior
Calculate an allowed overlap between icons of -2px. Red "X"'s are icons that are blocked by the padding rule while black "X"'s are rendered:

This would be useful to create higher density maps where a little overlap helps in order to communicate that density, but a lot of overlap would look sloppy and unintentional.
Actual Behavior
See "-2 is less than the minimum value 0" error.
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
Start by locating the style-layer validation and rendering paths for icon-padding and text-padding. Reproduce the error with a negative value, then verify that negative padding is accepted and affects allowed icon overlap as described, while existing non-negative behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100