Symbol Placement Style Options Line start and Line end#13638
Open
JoshuaJMoore wants to merge 1 commit intomapbox:mainfrom
Open
Symbol Placement Style Options Line start and Line end#13638JoshuaJMoore wants to merge 1 commit intomapbox:mainfrom
JoshuaJMoore wants to merge 1 commit intomapbox:mainfrom
Conversation
|
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:
Please respond to any review comments on this PR. For more details, see CONTRIBUTING.md. |
Author
|
@mapbox/map-design-team @mapbox/static-apis |
Author
|
Thoughts on this one? @ibesora |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Launch Checklist
@mapbox/map-design-team@mapbox/static-apisif this PR includes style spec API or visual changes.@mapbox/gl-nativeif this PR includes shader changes or needs a native port.@mapbox/gl-nativeif this PR disables any test because it also needs to be disabled on their side.gl-nativeto 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.