Expand description
Rasterize SVG icons and build MapLibre-compatible sprite assets.
Use render_icon to produce RGBA pixels for one icon, or combine rendered
icons with build_sprite_sheet and serialize its index with
index_to_json. The API accepts SVG text and returns in-memory image and
index data, so applications can choose how to read and store their assets.
Structs§
- Build
Options - Options controlling sprite sheet construction.
- Rendered
Icon - A rasterized icon with straight-alpha RGBA pixels.
- Sprite
Index Entry - A MapLibre sprite index entry.
- Sprite
Sheet - A PNG sprite sheet and its MapLibre index.
Enums§
- Error
- An error produced while rendering an icon or building a sprite sheet.
Functions§
- build_
sprite_ sheet - Builds a MapLibre PNG sprite sheet from rasterized icons.
- index_
to_ json - Serializes a MapLibre sprite index as pretty JSON.
- render_
icon - Rasterizes one SVG icon at the requested pixel ratio.