Create and use map styles (Preview)

A map style is a set of visual customizations to map features that you associate with a map ID. You then reference the map ID in your application code to display the customized map.

You can create a map style before you have a map ID; however, to use the style, you must associate the style with a map ID. To use a map style, you must take all of these steps:

  1. Create and publish a map Style. For details, see Create a style.

  2. Create a map ID For details, see Create a map ID.

  3. Associate the map style with a map ID. For details, see Associate a map ID to a map style.

  4. Add the map ID to your app to display your style. For details, see Add the map ID to your map.

Create a map style

Create a map style using one of these methods:

  • Create a new style, either using a default Google map style or a suggested template.

  • Duplicate and modify an existing standard or customized style.

Create a new style

  1. In the Google Cloud Console, go to Map Styles.

  2. Select Create Style, and under Create your own style, select Google styles.

  3. Select OPT IN to select the preview cloud styling.

  4. At the bottom, select OPEN IN STYLE EDITOR.

  5. Select map features and change their style to create the map style you want.

  6. Select Save.

  7. In the Save and publish map style box, enter a name for your style and optionally a description, and select Save.

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

Duplicate a style

  1. In the Google Cloud Console, go to Map Styles.

  2. Select one of your existing styles.

  3. On the style page, select Duplicate.

  4. In the Duplicate Map Style box, enter a new map name and optionally a description.

  5. Select Save.

    The style is automatically published, and you can see your new style's main page.

  6. If you want to modify the style, select Customize style, make changes, and select Save.

Duplicate a style version

  1. In the Google Cloud Console, go to the Map Styles page.
  2. Select one of your existing styles, and click Customize Style.
  3. Select Settings > Version History.
  4. Select a style version, and then at the bottom of the Version History pane, select Duplicate.

The duplicated style is automatically published and you get a link to open the new style in a new tab.

Publish a style

When you first create a new map style, which includes duplicating an existing style or importing a JSON style, that first instance of the new map style is automatically published. After that, you can save changes as a draft and then publish when you're happy with the changes.

  1. Make the changes to the map style or duplicated map style you want to publish. For details, see Update a style.

  2. While you're still making changes, select Save.

  3. When you're ready to publish and have your changes go live for any map IDs using that map style, select Save, and then select Publish.

Published versus Draft map styles

Published: A published map style is live. Any maps that use the map style display the published version of it.

Draft: Draft versions of a map style are works in progress and aren't displayed in maps until you publish them.

Restore a style version

If you want to use a previous version of a style, you can restore it. For example, if you created a branded map style to support a special event, when the event is finished you can restore the standard version of the map style.

  1. In the Google Cloud Console, go to Map Styles.

  2. Select the style you want, and select Customize Style.

  3. Select Settings > Version History.

  4. Select the version you want to restore, and at the bottom of the Version History pane, select Restore. The restored style becomes the most recent draft of the style.

  5. Close the Version History pane, and select Publish.

Update a style

If you want to make changes to your map style, you can make the changes right in the style editor. You have a couple of choices when you update a style:

  • If you want changes to go live as soon as you're ready: Select Customize style and make your changes. Select Save to save your changes as a draft, and then select Publish when you are ready.

  • If you want to test your changes in a test environment first: Instead of making changes directly in the map style, duplicate the style first. For details, see Duplicate a style and Test map style updates.

Modify a style

Once you've created a map style, you can make changes to it on the style's main page in any of the following ways:

  • Edit: Select Customize style.

  • Duplicate: For details, see Duplicate a style.

  • Rename: Rename the map style.

  • Delete: Delete the map style.

  • Add map IDs: Associate map IDs with the style

A screenshot of the main page for a single map style, showing the name of the map, the controls to customize or rename or duplicate or delete a style, a picture showing the style applied to a mapped area, and a notice saying that there are no map IDs associated with this style and a button labeled 'Add Map IDs'.

Associate or remove map IDs on your style

You can associate styles with multiple map IDs, since the same style can be applied across multiple Google Maps apps. However, you can associate a map ID with only one style.

  1. On the Map Styles page, select a style.

  2. Select either Add Map IDs or Edit Map IDs.

  3. In Edit Map IDs, check the box next to map IDs to associate them with this style. To remove a map ID, clear the box to remove the association.

  4. Select Save.

To use your Cloud-based map style, add the map ID to your app.