Learn

What Is a Map Style Specification?

A map style specification is a structured, machine-readable description of which data sources and layers to draw, in what order, and with which visual rules.

Geobble
intermediateexplainerWeb Maps Tiles & Performance

Explain declarative web-map styles, the relationship between sources and layers, zoom/data-driven styling, sprites/glyphs, portability limits, and why a style is not the source data itself.

What Is a Map Style Specification?

A map style specification is a structured description of how a map renderer should draw data.

Rather than hard-coding every cartographic decision in application code, a style document can define sources, layers, drawing order, colours, line widths, labels, icons, zoom ranges, filters, and data-driven expressions.

The MapLibre Style Specification is a prominent example. It represents a style as JSON and defines root properties, sources, layers, sprites, glyphs, and rendering rules.

Sources describe where data come from

A style can reference sources such as:

  • vector tiles;

  • raster tiles;

  • GeoJSON;

  • raster-dem/terrain sources;

  • images or other supported source types.

The source describes data availability, but it does not necessarily say how the data should look.

Layers describe how source data are drawn

A style layer takes data from a source and renders it using a layer type such as fill, line, symbol, circle, raster, or another supported representation.

Several style layers can draw different aspects of the same source. For example, one road source layer can be rendered first as a thick casing line and again as a thinner coloured centre line, while a place source can be filtered into city, town, and village label layers with different text sizes.

This separation is what makes a declarative style much more expressive than a simple “colour field”.

Drawing order is part of the map

Layer order determines which symbols appear above or below others.

Water polygons may sit beneath roads, road casings beneath road fills, and labels above both. A poor layer order can hide important features even when every individual style rule is correct.

A style specification therefore encodes visual hierarchy, not only colours.

Styles can depend on zoom and data

A style can change properties based on zoom level or feature attributes.

Examples include:

  • show buildings only after zoom 14;

  • make roads wider as the user zooms in;

  • colour polygons by category;

  • size points by a numeric attribute;

  • display labels only for features above a threshold.

This is one reason vector tiles pair well with client-side style specifications: the renderer can make cartographic decisions from the attributes delivered in each tile.

Glyphs and sprites are external resources

Text rendering may depend on glyph resources, while icons and patterns can come from sprite sheets or equivalent assets. Copying only the style JSON is therefore not always enough to reproduce the map, because the referenced tile sources, fonts/glyphs, sprites, and URLs also need to remain available.

A style is not the dataset

A style can hide a layer or filter out most features without changing the source data.

Conversely, if an attribute needed by the style was removed during tile generation, the style cannot recover it.

This distinction matters when debugging: a missing feature may be absent from the source, absent from the tile, filtered out by the style, hidden at the current zoom, or obscured by drawing order.

Specifications have dialects and implementation differences

MapLibre and Mapbox style ecosystems share historical roots but evolve separately, and individual renderers can support different extensions or properties.

A style document that validates against one implementation's current specification should not automatically be assumed to reproduce perfectly in every other renderer.

For long-lived maps, record the style/specification environment and test portability where it matters.

References

  1. MapLibre Style Specification. Defines a JSON style document, including sources, layers, and rendering properties.

  2. MapLibre Style Spec — Root Properties. Documents root-level style fields and the current required style version.

Related content

What Is a Map Style Specification? | Geobble