[ Web Proxy ]
URL:
Viewing: https://developers.google.com/maps/documentation/javascript/cloud-customization/tut [Back]  [Original]

Tutorial - Highlight a road network  |  Maps JavaScript API  |  Google for Developers Skip to main content
Send feedback

Tutorial - Highlight a road network Stay organized with collections Save and categorize content based on your preferences.

Select platform: Android iOS JavaScript Web Service

Features in this document marked with the science icon are in Preview (Pre-GA).

This tutorial walks you through the steps to create and use a light mode map style that highlights the road network:

  1. Create and publish a map style so it's available to use.

  2. Create and connect a map ID that lets you use your style in apps and websites.

  3. Add the map ID to your apps and websites so your apps use your map style.

Step 1: Create and publish a map style

Open cloud-based maps styling

  1. Go to the Google Cloud console, and select Map Styles. Select or create a project, if needed.

  2. Select Create Style.

  3. Select Light.

  4. At the bottom of the dialog, select Customize.

Style the Road network

  1. Under Map Features, expand Infrastructure, then select Road network.

  2. In the Road network style panel, under Polyline, then Fill color, select the color box.

  3. Choose a bright color. Changing the color automatically checks the Fill color box.

    Note: A solid dot appears next to the map feature to indicate it has a custom style.
  4. Under Stroke width, set the stroke width to 5px.

  5. On the map, zoom in and out to see the effect of your changes. Because you selected a map feature that is relatively high in the hierarchy, all road types underneath it have inherited your changes.

    Map style showing road network fill color changes [Map style showing road network fill color changes]

Save and publish your map style

  1. At the top right, select Save.

  2. In Save and publish map style, enter a name and, optionally, a description for your map style.

  3. Select Save. Your map style is saved and published.

    Save and publish page [Save and publish page]

Note: The first time you save a map style, it is published automatically since it's the first version. When you subsequently update a map style, you can save changes as drafts as you go, and then publish when you're finished and want the style updated.

Step 2: Create and connect a map ID

A map ID lets you use your map style on apps and websites. If you make changes to the map style associated with a map ID, your style changes go live when you publish, so no software or app updates are needed.

Create a map ID

  1. In the Google Cloud console, select Map Management.

  2. At the top, select Create map ID.

    Create map ID button [Create map ID button]

  3. Add a name for your map ID, and optionally, a description.

  4. Select the map type for the map ID, depending on where you want to use your map style.

    Select a map type on the map ID page [Select a map type on the map ID page]

    Note: If you want to use your map style for different types of applications or websites, create a new map ID for each type, and then connect them all to the same map style.
  5. At the bottom of the page, select Save. Your map ID is created.

Connect the map ID to your map style

  1. Under Map styles, select Change Light mode style for Light mode.

    Select map styles for your map ID [Select map styles for your map ID]

  2. Under Change light style, choose what map style to use for light mode in your apps, and select Done.

    Select a map style for light mode [Select a map style for light mode]

    Note: To assign a custom dark mode map style, first you must create a new style and select Dark or make a copy. If you don't select a dark style, or have not created any dark mode map styles, your app uses the Google default dark map style.
  3. Select Save. Your map ID is now associated with your map styles.

Step 3: Add the map ID to your apps or websites

Now that you have a map ID that is associated with a published map style, you can add it to your apps or websites and test to make sure it functions as expected.

For more information about adding a map ID, see Add the map ID to your map.

What's next

Here are some things you can try next:

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-25 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-25 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page