Vector Recipe
Current version: 1
A vector recipe is a JSON document containing configuration options that tell Mapbox Tiling Service (MTS) how to turn tileset source data into vector tiles.
Recipes must be constructed according to the rules in this recipe reference.
Recipe top-level fields
A recipe is a JSON object that must contain the following top-level fields:
Required fields | Description | Data type |
---|---|---|
version | The version of the Mapbox Tiling Service recipe reference that the recipe uses. | Integer |
layers | The names of the layers and their configuration options. | Object<String, LayerObject> |
The recipe can contain the following top-level optional field:
Optional fields | Description | Data type |
---|---|---|
fillzoom | The zoom level from which to generate overzoomed tiles, if there are no tiles at the maximum zoom level. | Integer |
{
"version": 1,
"fillzoom": 7,
"layers": { layername: LayerObject, ... }
}
Recipe version
The recipe version
indicates the version of the Mapbox Tiling Service recipe reference that the recipe uses. The current version is 1
. Using any version
other than the current version or a previous version will result in an error.
Fillzoom
Fillzoom defines a level from which to generate overzoomed tiles. Normally, MTS generates overzoomed tiles from tiles at the maximum zoom level. If you specify fillzoom
and MTS cannot find tiles at the maximum zoom level, it generates overzoomed tiles from the fillzoom
level.
For example, in a recipe with a maximum zoom level 10
and fillzoom level 7
specified, a request for a z11
tile will use z10
parent tiles to generate the new, overzoomed z11
tile. If there are no tiles at z10
, a request for a z11
tile will use the z7
tiles instead.
maxzoom
attribute in the tileset source determining the highest zoom level at which the feature can appear, it will not appear at zoom levels higher than the maxzoom
. But, if fillzoom
is specified in the recipe, the feature may still appear at higher zoom levels if the tile it belongs to contains no other features. This is a rare but expected case. For an example of using a maximum zoom filter, see the Feature filters section.Layers
The recipe layers
object contains key-value pairs associating the names of tile layers with their configuration. For each key-value pair, the key is the name of the layer, and the value is a LayerObject
containing the configuration and options for the layer.
Each layer must have a name (for example "trees", "parks", and "paths" in the example below). This is the unique identifier for the layer of data in your final tileset. In any tileset, each layer name must be unique. The layer name must be a string with only underscores (_
) and alphanumeric characters.
The corresponding LayerObject
for each layer name describes how that vector tile layer should be created. It specifies where to retrieve source data, the precision of the data through zoom levels, and how to transform features and render them into tiles.