This document explains how to use JSON to create, edit, and export map styles. For information on what you can style using JSON, see the JSON reference for cloud-based maps styling .
Import a JSON map style
To create a map style using JSON, perform the following steps:
-
In the Google Cloud console, go to Map styles , and select a project, if needed.
-
In Map styles, click Create style.
-
In the dialog, select the JSONtab.
-
There are two ways to import your JSON style:
- Paste your valid JSON styling code into the field, or
- Click Upload JSON Fileand choose a local JSON file to use. The JSON styling code appears in the field.
-
Check whether your JSON has errors.
- If your JSON has errors, the warning "Your JSON contains N errors" appears and you can expand the warning to learn more.
- If your JSON is valid, the map preview shows your custom style and the blue Customizebutton is available.
-
Click Customizeto create a new map style.
-
In your new map style, select map features and review or change their style as needed. Map features with custom styles have a solid blue dot next to them.
-
Click Save.
-
In the Save and publish map stylebox, enter a name for your style and optionally a description, and click Save.
The style is automatically published, and you see your new style's main page.
To add your map style to a map ID, see Associate your style to a map ID .
Edit a map style with JSON
You can edit map styles using the JSON tab in the style editor.
To edit a map style using JSON, see the following steps:
-
In the Google Cloud console, go to Map styles , and select a project, if needed.
-
In Map styles, select an existing style from the style list.
-
In the style's main page, select Customize.
-
Select the JSONtab to open the JSON style editor.
-
Make your changes in the editor. You can also upload a JSON file.
-
Click Committo update the style panel and preview map.
-
Once you're done with all of your changes, click Save. If you're creating a new style, the changes go live automatically. If you're making changes to an existing style, the changes save as a draft and you must click Publishto have your changes go live for any map IDs using that map style.
Export a map style as JSON
To export a map style as a JSON file, see the following steps:
-
In the Google Cloud console, go to Map styles , and select a project, if needed.
-
In Map styles, select an existing style from the style list.
-
In the style's main page, select Customize.
-
Select the JSONtab to open the JSON style editor.
-
Select Export.

