Skip to main content

Module vector

Module vector 

Source
Expand description

In-house CPU vector-tile renderer: MVT decode, MapLibre style evaluation, and tiny-skia rasterisation. Targets pixel parity with MapLibre GL JS (measured by tests/golden.rs).

Modules§

expr
MapLibre style-spec values: colors, property functions, expressions, and filters (both legacy and expression syntax).
fonts
Fonts for editable SVG text: MapLibre font names resolved to font files (user folders, a local cache, then Google Fonts for open fonts), the characters each font draws, and @font-face rules embedding them (subset to those characters, or whole).
geojson
GeoJSON sources, tiled as MapLibre does with geojson-vt: features are projected to the unit Mercator square and simplified once (Douglas-Peucker importance per vertex), world copies wrap at ±180°, and each tile is the features clipped to the tile plus its buffer, with vertices kept where their importance exceeds the tile zoom’s tolerance, rounded to tile coordinates. Tiles are encoded as MVT (one layer, _geojsonTileLayer, as MapLibre’s GeoJSONWrapper names it) so the vector pipeline renders them like any other source.
gl
A software model of the parts of MapLibre GL JS’s WebGL pipeline used to draw fills, lines and circles, so CPU renders match it pixel-for-pixel.
hillshade
hillshade layers over raster-dem sources: a CPU port of MapLibre GL JS’s two-pass hillshading.
mvt
Mapbox Vector Tile (MVT 2.1) decoding.
render
Render decoded vector tiles with a MapLibre style, modelling MapLibre GL JS’s WebGL pipeline in software (see gl.rs).
rtl
Right-to-left text, as MapLibre GL JS draws it with the @mapbox/mapbox-gl-rtl-text plugin (0.3.0, ICU compiled to WebAssembly):
svg
Helpers for SVG output: number/colour formatting, path data, contour tracing of SDF bitmaps (glyph and SDF-icon outlines), and embedded images.
symbol
Point text labels: a port of MapLibre GL JS’s symbol pipeline.
symbol_line
Line-placed symbols: a port of the line parts of MapLibre GL JS’s symbol pipeline.
vertical
Vertical text, as MapLibre GL JS lays it out (util/script_detection.ts, util/verticalize_punctuation.ts, shaping.ts isLineVertical).