Style definition blocks
Last updated
Was this helpful?
A style in its most basic form contains a version definition but it can be extended to define how we want geometry and labels to show on the map, how the legend should look like, what information is shown in popups and the formatting used when displaying feature properties.
The table below describes which properties can be used in the style definition.
version
Mandatory. Defines which version this style adheres to. The current version is "2.3.1".
type
config
Optional. A block that contains some configuration options to be used across the style. Learn more.
paint
Optional. An object (or array of objects) that defines how the data will be drawn. Learn more.
label
Optional. An object that defines how the labels will be drawn. Learn more.
legend
Optional. Defines how this layer will be shown on the layer panel. Learn more.
popup
Optional. Defines how the popup is shown and what’s included. Learn more.
attributes
Optional. Defines how attributes are shown both in the popup and the table. Learn more.
filters
Optional. A data filter definition that defines which data will be rendered. Learn more.
All of these keys are siblings at the top level of the object — none are nested inside another:
{
"version": "2.3.1",
"type": "simple",
"config": {},
"paint": {},
"label": {},
"legend": {},
"popup": {}
}The block that controls how geometry and raster pixels are drawn is named paint. (Some earlier drafts of this guide referred to it as style.)
Last updated
Was this helpful?
Was this helpful?