Adding direction arrow to a line with line-offset
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
I need to add an arrow to a Line that has an offset (line-offset=2) to display the direction of it.
However, it seems that icon does not support offsetting!

https://jsfiddle.net/9eo4py7x/
PS: I took the jsfiddle from [this](https://stackoverflow.com/questions/46102553/showing-direction-arrow-on-line-in-mapboxgl) topic and added line-offset property to the line->paint.
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 with the linked JSFiddle and compare the line's line-offset paint property with the direction-arrow icon behavior. Trace the relevant line and symbol rendering entry points in mapbox-gl-js, then verify that an arrow can follow the offset line; the issue is done when the direction indicator renders on the offset geometry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100