mapbox / mapbox/mapbox-gl-js

Add line-start and line-end to the symbol-placement options

Open
#9,937 4 comments 10 reactions 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

There are currently three [symbol placement](https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#layout-symbol-symbol-placement) options: `point`, `line`, and `line-center`.

It would be helpful to also have `line-start` and `line-end` as symbol-placement options. This could allow a user to style either end of a linestring with a symbol. For example, a specific symbol to mark the entrance of a tunnel and a different symbol to mark the departure from a tunnel.

## Design Alternatives

The first point of the geometry is the start point, so a user can use point placement with a symbol layer that points to a source with line geometry. However, this only allows a user to style with the line-start, not the line-end.

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 with the symbol-placement specification linked in the issue and compare the existing point, line, and line-center behavior. Trace how symbol placement is implemented and tested, then confirm that line-start and line-end can style the two endpoints of a line geometry with distinct symbols.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.