Skip to main content

Module symbol_line

Module symbol_line 

Source
Expand description

Line-placed symbols: a port of the line parts of MapLibre GL JS’s symbol pipeline.

  • merge_lines symbol/merge_lines.ts
  • clip_line symbol/clip_line.ts (clipLine)
  • get_anchors symbol/get_anchors.ts (+ check_max_angle.ts)
  • place_glyph_along_line, place_glyphs_along_line symbol/projection.ts (label plane = screen pixels; no pitch, so projection is affine)
  • collision_path the projected path used by placeCollisionCircles

All geometry here is in MapLibre’s 8192-unit tile space unless noted.

Structs§

Anchor
LineFeature
A line-placed feature during layout: its (possibly merged) geometry.
PathInterpolator
PathInterpolator.
PlacedGlyph
ProjectedLine
A line symbol projected to screen pixels.
ProjectionCache

Enums§

GlyphsPlacement
Result of placeGlyphsAlongLine for drawing.
WritingMode
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_len is the shaped label length (max of text and icon) in glyph units; has_text enables 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.

Type Aliases§

P