Style JSON
A style JSON is the document that turns a tileset into a map you can look at. Tiles carry vector data but no colors, so the style is where the cartography lives: which features appear, at which zoom levels, in what color, with which labels.
It is plain JSON, so it can be version-controlled, generated by a script, or edited by hand.
What is in a style JSON
A style has a few top-level keys:
| Key | Purpose |
|---|---|
version |
The style specification version, currently 8 |
sources |
Where the data comes from, one entry per tileset |
layers |
An ordered list of drawing instructions |
glyphs |
A URL template for the font glyph ranges used by labels |
sprite |
A URL for the packed icon image and its index |
Each entry in layers is one style layer, and their order is the draw order. The first entry is painted first and everything after it draws on top, which is why a style usually starts with landcover and ends with labels.
JSON styles in practice
Because the format is a published specification rather than one product’s config file, a style written for one renderer generally works in another, and the open styles built on the OpenMapTiles schema can be forked and edited freely.
You can edit a style by hand, but a visual editor such as Maputnik or MapTiler map designer tool is faster for color work, and it writes the same JSON back out.