mapbox / mapbox/mapbox-gl-js

Support negative icon-padding/text-padding values

Open
#6,370 9 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cross-platform :tv: feature :green_apple:
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:

screen shot 2018-03-20 at 6 05 54 pm

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.