Map design and styles
You can use Mapbox to control many aspects of the map design process, including uploading custom data, tweaking your map's styling, adding fonts, creating data-driven visualizations, and more.
In this guide, you'll learn about the basic principles of making a map with Mapbox tools as well as more advanced concepts for in-depth customization.
How do I make a map?
There are multiple ways to make a map that makes your data shine: You can use Mapbox Standard style, our Mapbox classic style templates, or build a custom style completely from scratch.
Mapbox Standard
Mapbox Standard is our latest 3D mapping experience featuring dynamic lighting capabilities, landmark 3D buildings, and more. Beyond introducing a high-quality visual experience, Standard also reduces the technical burden and cartographic ability needed to maintain a map and allows Mapbox to deliver the latest data and design updates to your base map style without a manual upgrade that risks breaking changes.
Key features
Mapbox classic style templates and custom styles
The 5 Mapbox classic style templates are tailormade for different use cases.
Mapbox also offers the option to use classic style templates to make a map, or you can build a custom map style completely from scratch using the Mapbox Studio style editor. Starting from classic style templates or a custom style if you have experience with map design or would like to invest more in learning about it.
Continue to the section What is a style to learn about the concepts required to work with custom styles.
Tools for making a map
Whether you use Mapbox Standard, classic style templates or a custom style, there are two approaches to customizing the look of the map:
- Update map features dynamically at runtime using the Maps SDK. Lighten or darken the map based on the time of day, personalize icons and map colors based on your users’ activity, switch languages dynamically, or increase the size of labels based on user preferences to improve legibility.
- Create a map style with Mapbox Studio. Upload data, build styles from scratch, and style groups of layers together using style components. Publish your custom style and load it into your application. If you update the underlying data or you edit and publish updates to the style in Mapbox Studio, those changes will be reflected in your application.
These approaches are not mutually exclusive. You can load a custom style and update map features from that custom style in your application at runtime.
If you prefer working in a visual interface, or if you want to add custom tilesets to the style, consider using the Mapbox Studio style editor to maintain your style. If you intend to make small visual changes and if you need to add your data dynamically at runtime, consider changing features dynamically at runtime.
What is a style?
A Mapbox style is a JSON object that defines exactly how a map should be drawn. It defines almost everything related to a map's appearance.
These four custom map styles feature line traces, weather data, custom fonts, and 3D terrain. Learn more about popular use cases for custom map styles on our maps page.
A style document must contain the following:
-
References to sources containing geospatial data. For example, a style might use a URL for a GeoJSON source or a tileset ID for a tileset source. Except for raster tiles or georeferenced images and videos, sources are pure data with no inherent visual appearance.
-
Style layers give sources a visual appearance by specifying which
layout
andpaint
properties Mapbox GL should apply. These properties include colors, fonts, line widths, layer order, and more.
It may also include glyphs and sprite properties. These properties work automatically when you create a style with the Mapbox Studio style editor. In most cases you do not need to change them. The glyphs
property tells the Mapbox map where to fetch fonts. The sprite
property tells the Mapbox Map where to look for icons.
Every map depends on a style, so when you change a map style, any map that uses that style will be affected by your changes upon its next load.
Continue reading to see an example of a style document and learn how styles work.
What is a map?
A Mapbox map is a program you can add to a webpage or mobile app. It comes with many powerful functions and configurable options that you can use to use to make each map instance look and behave exactly as you want. A Mapbox map's style is one of its many configurable options, but is the one that will have the greatest impact on how your users perceive your map.
Besides having a visual appearance, every Mapbox map also has powerful built-in functions that you can use to add interactive features to your maps or create data-driven visualizations.
For example, you can use a map's functionality to change its style from 'Light'
to 'Dark'
after sunset in a user's location; you can color election precinct polygons according to vote totals from a live data API; or you can enable users to show or hide map layers to visualize air quality data or weather information.
You can learn more about building interactive maps in our web applications and mobile applications getting started guides.
Example of a style and map
Below is a complete style JSON for a custom map style, and a map rendered using that style:
Inside the style JSON, you can see many layer definitions, including a background
layer with a beige color property, a fill
layer for national parks, and a line
layer for waterways.
On the map, you can see the visual rendering of these layers. You can also interact with the map using pan, zoom, and tilt actions that are handled by the map object, not the style.
How styles work
A Mapbox style must conform to the Mapbox Style Specification, an open source standard that enables Mapbox GL to give consistent rendering instructions to many different clients, like web browsers, mobile or embedded devices, or third party libraries or applications designed to read Mapbox styles.
Tools like Mapbox GL JS and the Mapbox Maps SDKs for Android and iOS use Mapbox GL to combine style rules and data sources to render the resulting map completely on the computer or mobile device that has requested it.
Because styles are designed to work with GL-based renderers, you can change your style programmatically after the map has been loaded. This ability, known as runtime styling, gives you the ability to build highly controlled map interfaces, visualizations, and experiences using Mapbox.
You can learn more about Mapbox technology in our Introduction to Mapbox getting started guide.
How to create a custom style
Anyone can create a custom Mapbox style. This section describes two approaches for this task: using Mapbox Studio, or writing a style manually.
You can use the Mapbox Studio style editor to create and edit custom styles. Learn more about this web-based application in the Mapbox Studio manual.