Skip to main content


Style Specification

A style is a document that defines the visual appearance of a map: what data to draw, the order to draw it in, and how to style the data when drawing it. A style document is a JSON object with specific root level and nested properties. This specification defines and describes these properties. It is intended for developers using style-related features of the JavaScript Maps SDK.

Modifying the styles that ship with the SDK is not recommended. These styles contain references to graphics and other assets that may change from time to time. Creating local styles that reference these same assets could create errors in your application or make upgrading your SDK to a new version more challenging. You can, however, create and use your own styles that leverage your own data and graphics.

Style document structure

A style consists of a set of root properties, some of which describe a single global property, and some of which contain nested properties. Some root properties, like version, name, and metadata, don’t have any influence over the appearance or behavior of your map, but provide important descriptive information related to your map. Others, like layers and sources, are critical and determine which map features will appear on your map and what they will look like. Some properties, like center, zoom, pitch, and bearing, provide the map renderer with a set of defaults to be used when initially displaying the map.

Last updated November 23, 2021.