Руководство: как выделить сеть дорог

Выберите платформу: Android iOS JavaScript Веб-сервис

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.

Шаг 1: Создайте и опубликуйте стиль карты.

Открытая облачная стилизация карт

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

  2. Выберите «Создать стиль» .

  3. Выберите «Свет» .

  4. В нижней части диалогового окна выберите «Настроить» .

Сеть Style the Road

  1. В разделе «Объекты карты» разверните «Инфраструктура» , затем выберите «Дорожная сеть» .

  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.

  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

Сохраните и опубликуйте свой стиль карты.

  1. В правом верхнем углу выберите «Сохранить» .

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

  3. Выберите «Сохранить» . Ваш стиль карты будет сохранен и опубликован.

    Сохраните и опубликуйте страницу

Шаг 2: Создайте и подключите идентификатор карты.

Идентификатор карты позволяет использовать ваш стиль карты в приложениях и на веб-сайтах. Если вы вносите изменения в стиль карты, связанный с идентификатором карты, эти изменения вступают в силу при публикации, поэтому никаких обновлений программного обеспечения или приложений не требуется.

Создать идентификатор карты

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

  2. Вверху выберите «Создать идентификатор карты» .

    Кнопка «Создать ID карты»

  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.

    Выберите тип карты на странице идентификатора карты.

  5. Внизу страницы выберите «Сохранить» . Ваш идентификатор карты будет создан.

Свяжите идентификатор карты с вашим стилем карты.

  1. В разделе «Стили карты» выберите Изменить стиль режима освещения» для параметра «Режим освещения» .

    Выберите стили карты для вашего идентификатора карты.

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

    Выберите стиль карты для светлого режима.

  3. Выберите «Сохранить» . Теперь идентификатор вашей карты связан со стилями вашей карты.

Шаг 3: Добавьте идентификатор карты в свои приложения или веб-сайты.

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 .

Что дальше?

Вот несколько вещей, которые вы можете попробовать в дальнейшем:

  • Обновить стиль . Чтобы внести изменения в стиль карты и опубликовать её, см. раздел «Изменение стиля» .

  • Поймите, как ваш стиль применяется к различным типам карт . Для получения дополнительной информации см. раздел «Узнайте о режимах и типах карт» .

  • Проверьте обновления стиля карты . Если вы хотите проверить изменения стиля перед их публикацией, см. раздел «Проверка обновлений стиля карты» .

  • Make styles that for specific zoom levels . For example, you can customize what specific map features look like when you are zoomed out compared to when you zoom in to the map. For more information, see Style zoom levels .

  • Use the map feature hierarchy to efficiently get the styles you want . For example, you can style the high-level map feature Natural>Land , and all of the land map features under it inherit the styling. You can then do custom styling on just the child map features that you want to be different. For more information, see Understand map style inheritance and hierarchy .