mapbox / mapbox/mapbox-gl-js

Negative `icon-padding` usecases

Open
#12,807 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature :green_apple:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

## Motivation

Icons might have shadows or have other reasons where 'partial overlap' is okay, whilst 'full on stacking' is not okay. A negative icon-padding would allow some control over the 'amount of stacking' that happens.

Bad stacking:

![image](https://github.com/mapbox/mapbox-gl-js/assets/20395438/b5cbb8a0-b9b8-4aae-b476-620230177a99)

Good stacking:

![image](https://github.com/mapbox/mapbox-gl-js/assets/20395438/96e91730-f76e-40eb-b056-c1acb5dffe03)

## Design Alternatives

Best I can reason *technically* negative `icon-padding` would just work out of the box if the validation wouldn't block it. If that's the case then I would like to ask for the constraint to be removed.

I might be able to get the same behavior using a carefully calibrated point clustering implementation (that's what I am going to do for now), but just wanted to give the feedback that there are many valid usecases for a negative `icon-padding`

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

No source files, tests, or entry points are named in the issue. Start by locating the validation for icon-padding and the existing tests for that property; confirm whether accepting negative values enables partial overlap without breaking current stacking behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.