Expand description
Render decoded vector tiles with a MapLibre style, modelling MapLibre GL
JS’s WebGL pipeline in software (see gl.rs).
The view is centred on the bbox centre at MapLibre’s scale zoom (512 px tiles), exactly as MapLibre’s transform places it. Layers are drawn in style order; fill and line fragments are clipped to their tile’s square (MapLibre’s stencil test). Circles are not clipped; points outside the tile are dropped, as MapLibre’s CircleBucket does.
Structs§
- Raster
Tiles - Raster tiles of one source at the zoom MapLibre covers the view with.
- Render
Output - Source
Tiles - Tiles for every tile source a style’s layers use, keyed by source id.
Vector tiles carry their world-copy wrap (see
covering_tiles). - SvgParts
- One style rendered as SVG fragments (ids prefixed so several styles can share one document).
Constants§
- TILE_PX
- MapLibre vector tiles are laid out on a 512 px grid.
Functions§
- covering_
tiles - Tiles covering
bboxat tile zoomz, as (canonical tile, wrap). Columns past ±180° belong to a wrapped world copy: wrap -1 is the copy to the west, +1 to the east (MapLibre’s renderWorldCopies). - device_
px - Device pixels for
cssCSS pixels atratio(MapLibre’s drawing buffer is the canvas size times devicePixelRatio). - render
- Render
tiles(raw MVT bytes) withstyleoverbboxatwidth × height.assetsholds glyphs and sprite images for symbol layers (may be empty). Each tile carries its world-copywrap(seecovering_tiles).widthandheightare CSS pixels; the image isratiotimes larger (MapLibre’s devicePixelRatio: same view and layout, drawn denser). - render_
svg - Render
tileswithstyleas vector SVG: the same view, tile clipping, evaluated style values and label placement asrender, written as paths instead of pixels. Labels are glyph outlines traced from the style’s SDF glyphs at the shader’s edge threshold. - scale_
zoom - MapLibre’s scale zoom for a bbox drawn
widthpixels wide. - tile_
zoom - Tile zoom MapLibre would request for a vector source at this view.