Manage legacy map styles

A map Style is a set of customizations that can be associated with a map ID, which is referenced in app code to display the customized map.

While it isn't required to have a map ID before creating a style, you mustassociate it with a map ID and add the map ID to your app before you can use your style. This is the only point in the map style lifecycle where anyone needs to interact with the application code.

Published versus Draft styles

A published style is "live." Any maps that use the style display the published version of it. Draft versions of a style are works in progress and aren't displayed publicly in maps until they are published.

When you first create a new style, which includes duplicating an existing style or style version, or importing a JSON style, that first instance of the new style is automatically published.

Create a style

Create a map style using one of these methods:

  • Creating a new style, either using default Google Map styles or based off of a suggested template.
  • Duplicating an existing style.
  • Duplicating a previous version of one of your existing styles.
  • Importing JSON styling.

Create a new style

  1. In the Google Cloud Console,go to theMap Stylespage.
  2. ClickCreate Style,and choose theGoogle Mapradio button.
  3. ClickSave.
  4. In theSave and Publish Mapdialog, enter a map name and optional description, and clickSave.

The style is automatically published, and you are taken to your new style's main page.

Duplicate an existing style

  1. In the Google Cloud Console,go to theMap Stylespage.
  2. Select one of your existing styles, and go toDuplicate.
  3. In theDuplicate Map Styledialog, enter a new map name and, if desired, a description.
  4. ClickSave.

The style is automatically published, and you are taken to your new style's main page.

Duplicate a style version

  1. In the Google Cloud Console,go to theMap Stylespage.
  2. Select one of your existing styles, and clickCustomize Style.
  3. SelectSettings > Version History.
  4. Select a style version, and clickDuplicateat the bottom of theVersion Historypane.

The duplicated style is automatically published. At the bottom of the page is a small notification telling you that the style was duplicated and providing a link to open the newly duplicated style in a new tab.

The first style on your map is the original style version. Unlike other dated Draft or Published versions, it does not have any selectable child styles. To revert to this style or duplicate this style, select the dated heading.

Import JSON styling

  1. In the Google Cloud Console,go to theMap Stylespage.
  2. ClickCreate style.
  3. UnderCreate your own style,select theImport JSONradio button.
  4. Paste your valid JSON styling code into the field.
    • If your JSON is invalid, you see a notice in capital letters just below the JSON field.
    • If your JSON is valid, you see a preview of the pasted style, and the blueSAVEbutton is available.
  5. SelectSAVE.

The style is automatically published, and you are taken to your new style's main page.

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 theMap Stylespage.
  2. Select the style you want, and clickCustomize Style.
  3. SelectSettings > Version History.
  4. Select the version you want to restore, and clickRestoreat the bottom of theVersion Historypane. The restored style becomes the most recent draft of the style.
  5. Close the "Version History" pane, and clickPublish.

Update style details

Once you've created a map style, you can edit, duplicate, rename, delete, or add map IDs to it using the options at the top of the style's main page.

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'.

  • Continue customizing or view style details by selectingCustomize style.
  • Rename or edit a description for the style by selectingEdit.
  • Duplicate the style by selectingDuplicate.
  • Delete the style by selectingDelete.
  • Add or view map IDs associated with the style.

Associate or remove map IDs on your style

Styles can be associated with multiple map IDs, since the same style can be applied across multiple Google Maps apps. However, each map ID may be associated with only one style.

  1. On theMap Stylespage, select a style.
  2. Select either theAdd Map IDsbutton (for styles with no associated map IDs) or the pencil icon (for styles that already have at least one associated map ID.) This opens theAdd / Edit Map IDspane.
  3. Check the box next to a map ID to associate with this style, or uncheck a checked box to remove the association.
  4. SelectSave.

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