Skip to content

Symbol Placement Style Options Line start and Line end#13638

Open
JoshuaJMoore wants to merge 1 commit intomapbox:mainfrom
JoshuaJMoore:additional-symbol-placement-options
Open

Symbol Placement Style Options Line start and Line end#13638
JoshuaJMoore wants to merge 1 commit intomapbox:mainfrom
JoshuaJMoore:additional-symbol-placement-options

Conversation

@JoshuaJMoore
Copy link

@JoshuaJMoore JoshuaJMoore commented Mar 17, 2026

line-start / line-end symbol placement

Adds two new values for symbol-placement:
line-start and line-end, which place a single symbol at the first or last point of a line geometry respectively.

How it works
Anchor selection:
getStartAnchor uses line[0], getEndAnchor uses line[last], with the angle oriented along the line direction.
Text offset shifting:
Glyph offsets are shifted so they all extend inward along the line (positive for line-start, negative for line-end), since glyphs can only be laid out in one direction from an endpoint.
No line clipping:
Unlike line placement which clips geometry to the tile boundary (creating artificial endpoints), line-start/line-end operate on the raw feature geometry to preserve true endpoints.
Vector tile deduplication:
Lines in vector tiles include buffer geometry that extends into neighboring tiles. To prevent duplicate icons, anchors outside the tile's [0, EXTENT) coordinate range are rejected. Since only the tile that owns the true start/end point will have it within bounds, exactly one icon is rendered per line endpoint, no cross-tile coordination needed.

Example Image:
symbol-placement: line start for ferry routes using data from mapbox://styles/mapbox/streets-v12
image

Launch Checklist

  • Make sure the PR title is descriptive and preferably reflects the change from the user's perspective.
  • Add additional detail and context in the PR description (with screenshots/videos if there are visual changes).
  • Manually test the debug page.
  • Write tests for all new functionality and make sure the CI checks pass.
  • Document any changes to public APIs.
  • Post benchmark scores if the change could affect performance.
  • Tag @mapbox/map-design-team @mapbox/static-apis if this PR includes style spec API or visual changes.
  • Tag @mapbox/gl-native if this PR includes shader changes or needs a native port.
  • Tag @mapbox/gl-native if this PR disables any test because it also needs to be disabled on their side.
  • Create a ticket for gl-native to groom in the MAPSNAT JIRA queue if this PR includes shader changes or features not present in the native side or if it disables a test that's not disabled there.

@JoshuaJMoore JoshuaJMoore requested a review from a team as a code owner March 17, 2026 14:45
@JoshuaJMoore JoshuaJMoore requested review from underoot and removed request for a team March 17, 2026 14:45
@github-actions
Copy link

Hey, @JoshuaJMoore 👋 Thanks for your contribution to Mapbox GL JS!

Important: This repository does not accept direct merges. All changes go through our internal review process.

What happens next:

  1. A team member will review your PR here first
  2. If it looks good, they will import it to our internal repository for further review
  3. If approved, changes will be synced back here via our release process

Please respond to any review comments on this PR. For more details, see CONTRIBUTING.md.

@JoshuaJMoore
Copy link
Author

@mapbox/map-design-team @mapbox/static-apis

@JoshuaJMoore
Copy link
Author

Thoughts on this one? @ibesora

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant