mapbox / mapbox/mapbox-gl-js

Icon placement along a line doesn't account for icon-size properly

Open
#7,705 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**mapbox-gl-js version**:

### Question
I am using the 'symbol' layer + 'symbol-placement' = 'line' to display arrows on a line. The example can be found in https://jsfiddle.net/waynexiao/mfzv8dsL/11/

The arrows show at zoom level 12, but not zoom level 11 and less. The zoom level can be set at the line 24.

I am wondering how mapbox decides to show or hide the arrow icon. At zoom 11, the length of the line is more 130px and the size of the arrow is about 12 x 12px. There seems to be enough space to show arrows.

Is it possible to make the arrow to show at zoom level <= 11?

### Links to related documentation

https://jsfiddle.net/waynexiao/mfzv8dsL/11/

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 behavior using the linked JSFiddle with a symbol layer and symbol-placement set to line, comparing zoom levels 11 and 12. Trace how icon size and line length determine whether the arrow is placed; done means the icon placement accounts for its size and the arrow appears at zoom 11 when sufficient space exists.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
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.