Use JSON with cloud-based maps styling

Experimental: Features marked with the science icon areexperimental.

This document explains how to use JSON to create, edit, and export map styles.For information on what you can style using JSON, see theJSON reference for cloud-based maps styling.

Import a JSON map style

To create a map style using JSON, perform the following steps:

  1. In the Google Cloud console,go toMap styles, and select a project, if needed.

  2. InMap styles, clickCreate style.

  3. In the dialog, select theJSON tab.

  4. There are two ways to import your JSON style:

    • Paste your valid JSON styling code into the field, or
    • ClickUpload JSON File and choose a local JSON file to use. The JSON styling code appears in the field.
    Note: When importing legacy JSON, a warning appears and the style is convertedto the latest JSON format. The conversion is approximate but sets you up for aricher and more customizable experience. To only use legacy JSON, seeUse embedded JSON style declarations.
  5. 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 blueCustomize button is available.
  6. ClickCustomize to create a new map style.

  7. In your new map style, select map features and review or change their styleas needed. Map features with custom styles have a solid blue dot next tothem.

    Note: Not all styles appear at all zoom levels.
  8. ClickSave.

  9. In theSave and publish map style box, enter a name for your style andoptionally a description, and clickSave.

The style is automatically published, and you see your new style'smain page.

To add your map style to a map ID, seeAssociate your style to a map ID.

Edit a map style with JSON

Experimental: This feature is experimental.

You can edit map styles using the JSON tab in the style editor.

To edit a map style using JSON, see the following steps:

  1. In the Google Cloud console,go toMap styles, and select a project, if needed.

  2. InMap styles, select an existing style from the style list.

  3. In the style's main page, selectCustomize.

  4. Select theJSON tab to open the JSON style editor.

  5. Make your changes in the editor. You can also upload a JSON file.

  6. ClickCommit to update the style panel and preview map.

    Note: When you change a map feature in the style panel, it updates the JSON code automatically.
  7. Once you're done with all of your changes, clickSave. If you'recreating a new style, the changes go live automatically. If you're makingchanges to an existing style, the changes save as a draft and you must clickPublish to have your changes go live for any map IDs using that mapstyle.

Export a map style as JSON

Experimental: This feature is experimental.

To export a map style as a JSON file, see the following steps:

  1. In the Google Cloud console,go toMap styles, and select a project, if needed.

  2. InMap styles, select an existing style from the style list.

  3. In the style's main page, selectCustomize.

  4. Select theJSON tab to open the JSON style editor.

  5. SelectExport.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-01 UTC.