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 must associate 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
- In the Google Cloud Console, go to the Map Styles page.
- Click Create Style, and choose the Google Map radio button.
- Click Save.
- In the Save and Publish Map dialog, enter a map name and optional description, and click Save.
The style is automatically published, and you are taken to your new style's main page.
Duplicate an existing style
- In the Google Cloud Console, go to the Map Styles page.
- Select one of your existing styles, and go to Duplicate.
- In the Duplicate Map Style dialog, enter a new map name and, if desired, a description.
- Click Save.
The style is automatically published, and you are taken to your new style's main page.
Duplicate a style version
- In the Google Cloud Console, go to the Map Styles page.
- Select one of your existing styles, and click Customize Style.
- Select Settings > Version History.
- Select a style version, and click Duplicate at the bottom of the Version History pane.
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
- In the Google Cloud Console, go to the Map Styles page.
- Click Create style.
- Under Create your own style, select the Import JSON radio button.
- 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 blue SAVE button is available.
- Select SAVE.
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.
- In the Google Cloud Console, go to the Map Styles page.
- Select the style you want, and click Customize Style.
- Select Settings > Version History.
- Select the version you want to restore, and click Restore at the bottom of the Version History pane. The restored style becomes the most recent draft of the style.
- Close the "Version History" pane, and click Publish.
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.
- Continue customizing or view style details by selecting Customize style.
- To edit feature and element styles, see the Map Style editor overview.
- Rename or edit a description for the style by selecting Edit.
- Duplicate the style by selecting Duplicate.
- Delete the style by selecting Delete.
- 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.
- On the Map Styles page, select a style.
- Select either the Add Map IDs button (for styles with no associated map IDs) or the pencil icon (for styles that already have at least one associated map ID.) This opens the Add / Edit Map IDs pane.
- Check the box next to a map ID to associate with this style, or uncheck a checked box to remove the association.
- Select Save.
To use your Cloud-based map style, add the map ID to your app.