Styling your map

This page shows how to customize your map and change the visual display of elements such as roads, parks, and buildings. Customize your map using the following tools:

  • Cloud-based maps styling: Use Google Cloud Console to create and manage map styles, and link them to your maps using Map IDs. You can create new styles by using the styling tool or import existing style definitions. Each time you update a style, your webpage will be automatically updated with the changes.

  • JSON style declarations: For every customization change to your map, use embedded JSON style declarations to manually define map styles. Changing these style declarations requires updating client-side code that uses the end user's device to perform operations and update your webpage.

Using Cloud-based maps styling

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:

  1. In the Cloud Console, go to the Maps Management page.

    Go to the Maps Management page

  2. Click Create New Map ID, to display the Create New Map ID form.

    Create New Map ID

    In the form, do the following:

    • Specify a map name.
    • Specify a map type or platform.
    • Choose raster or vector image type.
    • Enter a description of the map.
    • Click Next to display the new Map ID.

Using Map IDs in your application code

To create a map with a Map ID in your application code:

  1. If you are currently customizing your map with embedded JSON code, remove the styles property from your MapOptions object; otherwise, skip this step.

  2. Add a Map ID to the map using the mapId property. For example:

    map = new google.maps.Map(document.getElementById('map'), {
      center: {lat: -34.397, lng: 150.644},
      zoom: 8,
      mapId: 'MAP_ID'

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:

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

    Go to Map Styles

  2. Click Create New Map Style to open the New Map Style page.

  3. In the New Map Style page, choose one of the following options:

    1. Select a Map Style from one of the available style variations.
    2. Import JSON styling code by pasting your JSON code into the text box on the Import JSON tab.
    3. 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. For more information, see Using the style editor.

  4. To name your Map Style and save your changes, click Save.

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. For more information, see Using the style editor.

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


The following is a basic example of loading a custom styled map using a Map ID. In this case, the Maps JavaScript references Map ID 8e0a97af9386fef when the Map is loaded, and automatically applies the Map Style currently associated with that Map ID.


function initMap(): void {
  new google.maps.Map(
    document.getElementById("map") as HTMLElement,
      mapId: "8e0a97af9386fef",
      center: { lat: 48.85, lng: 2.35 },
      zoom: 12,
    } as google.maps.MapOptions


function initMap() {
  new google.maps.Map(document.getElementById("map"), {
    mapId: "8e0a97af9386fef",
    center: { lat: 48.85, lng: 2.35 },
    zoom: 12,
View example
function initMap() { new google.maps.Map(document.getElementById("map"), { mapId: "8e0a97af9386fef", center: { lat: 48.85, lng: 2.35 }, zoom: 12, }); }
/* Always set the map height explicitly to define the size of the div * element that contains the map. */ #map { height: 100%; } /* Optional: Makes the sample page fill the window. */ html, body { height: 100%; margin: 0; padding: 0; }
<!DOCTYPE html> <html> <head> <title>Using a Map Id</title> <script src=""></script> <!-- jsFiddle will insert css and js --> </head> <body> <div id="map"></div> <!-- Async script executes immediately and must be after any DOM elements used in callback. --> <script src="" async ></script> </body> </html>

Try Sample

Using embedded JSON style declarations

You can apply customized styling through an embedded JSON style declarations to the following:

  • Default map.
  • Map types that a user can switch between within a single map frame.

Specifying styles to features

To apply styles to different features and elements in a map, create an array of MapTypeStyle objects that define how the map should be styled.

The array takes the following form:

var stylesArray = [
    featureType: '',
    elementType: '',
    stylers: [
      {color: ''},
      {visibility: ''},
      // Add any stylers you need.
    featureType: '',
    // Add the stylers you need.

For a list of all available values for featureType, elementType, and stylers, see the JSON style reference.

Maps Platform Styling Wizard

Use the Maps Platform Styling Wizard as a quick way to generate a JSON styling object.

Applying styles to a default map

The following shows an example default map styled using light-colored text and icons on a dark background (i.e. dark mode). To see the code sample, go to Styled Maps - Night Mode code sample.

To modify the styles of the default map, set the map's styles property in the MapOptions object to your style array when:

  • Creating your map.
  • Or, when calling the Map.setOptions method.

Changes to labels and roads affect all map types including terrain, satellite, hybrid, and default roadmap types.

Apply styles to a map type

The following shows an added map type called Styled Map in the control at the top left of the map. To see the code sample, go to Styled Map Types.

To create a styled map type, set the style array to a StyledMapType object. Creating a new styled map type does not affect the style of the default map types.

What's next