The following instructions show how to use the Google Cloud Console to create, customize, publish, and manage your maps at any time using Map IDs and Map Styles.
To create or manage any Map IDs or Map Styles in your Google Cloud project, you must have the Project Owner or Project Editor IAM role.
Creating Map IDs
A Map ID is a unique identifier that represents a single instance of a Google Map. You can create Map IDs and update a style associated with a Map ID at any time in the Google Cloud Console without changing embedded JSON styling in your application code.
To create a Map ID:
In the Cloud Console, go to the Maps Management page.
Click Create New Map ID, to display the Create New Map ID form.
In the form, do the following:
- Specify a map name.
- Specify a map type or platform.
- Enter a description of the map.
- Click Next to display the new Map ID.
Using Map IDs in your application code
To add a Map ID to a new or existing Map that uses the Maps Static API, append
map_id URL parameter and set it to your Map ID.
<img src="https://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318&markers=color:red%7Clabel:C%7C40.718217,-73.998284&key=AIzaSyA3kg7YWugGl1lTXmAmaBGPNhDW9pEh5bo&map_id=8f348d1b5a61d4bb" />
Removing styles from map options
If you are using cloud-based map styling with an existing map that is customized with the
style parameter, make sure to remove them to avoid potential conflict with future functionality.
Creating Map Styles
A Map Style is a unique identifier for a set of customizations that can be associated with any Map ID.
To create a new style:
In the Google Cloud Console, go to the Map Styles page.
Click Create New Map Style to open the New Map Style page.
In the New Map Style page, choose one of the following options:
- Select a Map Style from one of the available style variations.
- Import JSON styling code by pasting your JSON code into the text box on the Import JSON tab.
- Select a Map Style customized to emphasize the goals of a specific industry, such as Travel, Logistics, Real Estate, and Retail.
You can specify additional customizations to map features by clicking Customize in Style Editor.
Customizations you add to your map style will always take priority over any updates Google may make to your map style.
To name your Map Style and save your changes, click Save.
Customizing at different zoom levels
You can customize the style of existing elements at different zoom levels when creating map styles with the style editor in Google Cloud Console.
For example, you can customize the color of water from pink at zoom level 0 to purple at zoom level 10, and associate other customizations with the level of detail you see at the specified zoom. To try out this feature in a sample app, see Map ID with styling.
To make style customizations at different zoom levels:
- Open the style editor in Cloud Console. To do this, visit the Map Styles page, and either create a Map Style or update an existing Map Style.
- Select a feature in the Feature type submenu to open up the Element type submenu, and select an element you would like to customize.
Check the Customize across zooms checkbox to make customizations at the current zoom level appear in the style editor.
Once you select the Customize across zooms checkbox, you should see the following:
- An Add stop: z checkbox that indicates your current zoom level and attaches customizations to the indicated zoom level.
- A zoom slider bar to modify and select your zoom level. You can adjust zoom levels with map boolean zoom controls, mousewheel, or arrow keys on your keyboard.
When you make customizations in the Stylers submenu, the style editor automatically selects the Add stop: z checkbox, displays a blue dot above the slider, and overrides any inherited styles.
The blue dot above your slider indicates that changes were made at the selected zoom level. To prevent changes from being saved at a particular zoom level, clear the Add stop: z checkbox (the blue dot turns gray to indicate that changes will not be saved at that level). After clearing the checkbox, the element returns to its inherited style.
Any customizations you make at a zoom level will update the customizations at the indicated zoom levels and above. For example, customizations at zoom level 10 affect all customizations at zoom levels 10, 11, 12 and so on. The customizations override any inherited styles.
To save your changes, click Save. To make your changes public on the map IDs associated with your map style, click Publish.
Updating style details
On the Map Styles page, you can select a map style to complete the following actions:
Continue customizing or view style details in the Style Editor by clicking Customize style.
In the Style Editor, if you associate a Map ID with your Map Style, saving and publishing will make the style changes public for the associated maps. Saving style customizations without publishing in the Style Editor will not make the changes publicly visible.
Rename or edit a description for the style by clicking Edit.
Duplicate the style by clicking Duplicate.
Delete the style by clicking Delete.
View Map IDs associated with the style.
Styles created before September 15, 2020 will not display Google Maps enhanced natural features. To use Google Maps enhanced natural features support for your map styling, you must create a Map Style.