Skip to main content

Zig API

The engine is a Zig package named tile57 (v0.3.0, requires Zig 0.16). Add it as a dependency and @import("tile57") for the curated public surface (src/tile57.zig). The C ABI is a thin shim over this same API, and both share the same shape: bake, then compose (or bake, then render) — source charts bake once to per-chart archives, and every output is produced from baked archives. These pages are grouped the same way as the C API.

note

Add it as a path dependency on a local clone (submodules initialised) — zig fetch by URL/hash is currently broken because the package's declared .paths omit vendor/ and include/. See Installation.

Sections

PageWhat it covers
Errors & lifecyclethe error-union model, handle lifetime + threading, tile57.warmup, tile57.freeBytes, the version string
Baketile57.bake — charts → per-chart PMTiles archives
Renderthe Chart — open modes, the render surfaces (pixel / surface callbacks / GPU scene / ASCII), the cursor pick, and metadata
Composetile57.compose — the ComposeSource stitching many charts into one
Portrayal assetstile57.sprite — the sprite + area-fill pattern atlases
MapLibre styletile57.style + tile57.Mariner — a concrete style JSON, colour tables, line styles
Low-level modulesZig-only packages with no C ABI equivalent: tiling/encoding and the raw tile57.formats parsers