Expand description
Line-placed symbols: a port of the line parts of MapLibre GL JS’s symbol pipeline.
merge_linessymbol/merge_lines.tsclip_linesymbol/clip_line.ts (clipLine)get_anchorssymbol/get_anchors.ts (+ check_max_angle.ts)place_glyph_along_line,place_glyphs_along_linesymbol/projection.ts (label plane = screen pixels; no pitch, so projection is affine)collision_paththe projected path used by placeCollisionCircles
All geometry here is in MapLibre’s 8192-unit tile space unless noted.
Structs§
- Anchor
- Line
Feature - A line-placed feature during layout: its (possibly merged) geometry.
- Path
Interpolator - PathInterpolator.
- Placed
Glyph - Projected
Line - A line symbol projected to screen pixels.
- Projection
Cache
Enums§
- Glyphs
Placement - Result of placeGlyphsAlongLine for drawing.
- Writing
Mode - The writing mode of a symbol placed along a line (placedSymbol.writingMode).
Functions§
- check_
max_ angle - clip_
line - collision_
path - The projected path placeCollisionCircles builds from the first and last glyph (flip = false, rotateToLine = false), or None if they don’t fit.
- get_
anchors - getAnchors.
label_lenis the shaped label length (max of text and icon) in glyph units;has_textenables the angle window. - get_
center_ anchor - getCenterAnchor (symbol-placement: line-center).
- merge_
lines - mergeLines: join features whose first lines share an endpoint and text.
- place_
glyph_ along_ line - placeGlyphAlongLine.
- place_
glyphs_ for_ render - updateLineLabels for one symbol: place all glyphs (glyph offsets are in
glyph units;
font_scale= size / 24), flipping for keep-upright.