A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/maps/documentation/javascript/style-reference below:

Style Reference for Maps JavaScript API

Skip to main content Style Reference for Maps JavaScript API

Stay organized with collections Save and categorize content based on your preferences.

With style options you can customize the presentation of the standard Google map styles, changing the visual display of features like roads, parks, businesses, and other points of interest. As well as changing the style of these features, you can hide features entirely. This means that you can emphasize particular components of the map or make the map complement the style of the surrounding page.

If you want to update the same style across multiple apps, look into cloud customization, which is available in the Google Cloud console and requires a map ID. To avoid potential conflicts, do not combine cloud customization and hardcoded styling in the same app. Examples

The following JSON style declaration turns all map features to gray, then colors arterial road geometry in blue, and hides landscape labels completely:

[
  {
    "featureType": "all",
    "stylers": [
      { "color": "#C0C0C0" }
    ]
  },{
    "featureType": "road.arterial",
    "elementType": "geometry",
    "stylers": [
      { "color": "#CCFFFF" }
    ]
  },{
    "featureType": "landscape",
    "elementType": "labels",
    "stylers": [
      { "visibility": "off" }
    ]
  }
]
The JSON object

A JSON style declaration consists of the following elements:

To specify a style, you must combine a set of featureType and elementType selectors and your stylers into a style array. You can target any combination of features in a single array. However, the number of styles that you can apply at once is limited. If your style array exceeds the maximum number of characters then no style is applied.

The rest of this page has more information about features, elements and stylers.

featureType

The following JSON snippet selects all roads on the map:

{
  "featureType": "road"
}

Features, or feature types, are geographic characteristics on the map, including roads, parks, bodies of water, businesses, and more.

The features form a category tree, with all as the root. If you don't specify a feature, all features are selected. Specifying a feature of all has the same effect.

Some features contain child features you specify using a dot notation. For example, landscape.natural or road.local. If you specify only the parent feature, such as road, the styles you specify for the parent apply to all its children, such as road.local and road.highway.

Note that parent features may include some elements that are not included in all of their child features.

The following features are available:

elementType

The following JSON snippet selects the labels for all local roads:

{
  "featureType": "road.local",
  "elementType": "labels"
}

Elements are subdivisions of a feature. A road, for example, consists of the graphical line (the geometry) on the map, and also the text denoting its name (a label).

The following elements are available, but note that a specific feature may support none, some, or all, of the elements:

Label text fill and stroke colors change based on the zoom level. To make the experience consistenent across zoom levels, always define both fill and stroke.

stylers

Stylers are formatting options that you can apply to map features and elements.

The following JSON snippet displays a feature as bright green, using an RGB value:

"stylers": [
  { "color": "#99FF33" }
]

This snippet removes all intensity from the color of a feature, regardless of its starting color. The effect is to render the feature grayscale:

"stylers": [
  { "saturation": -100 }
]

This snippet hides a feature completely:

    "stylers": [
      { "visibility": "off" }
    ]

The following style options are supported:

Style rules are applied in the order that you specify. Do not combine multiple operations into a single style operation. Instead, define each operation as a separate entry in the style array.

Note: Order is important, as some operations are not commutative. Features and/or elements that are modified through style operations (usually) already have existing styles. The operations act on those existing styles, if present.

The hue, saturation, lightness model Note: The effect of the hue, saturation, lightness, and gamma settings is relative to the style of the base map. If Google makes any changes to the base map style, the changes affect your map's features styled with these options. It's better to use the absolute color styler if you can.

Styled maps use the hue, saturation, lightness (HSL) model to denote color within the styler operations. Hue indicates the basic color, saturation indicates the intensity of that color, and lightness indicates the relative amount of white or black in the constituent color.

Gamma correction modifies the lightness over the color space, generally to increase or decrease contrast. Additionally, the HSL model defines color within a coordinate space where hue indicates the orientation within a color wheel, while saturation and lightness indicate amplitudes along different axes. Hues are measured within an RGB color space, which is similar to most RGB color spaces, except that shades of white and black are absent.

While hue takes an HTML hex color value, it only uses this value to determine the basic color - that is, its orientation around the color wheel, not its saturation or lightness, which are indicated separately as percentage changes.

For example, you can define the hue for pure green as hue:0x00ff00 or hue:0x000100. Both hues are identical. Both values point to pure green in the HSL color model.

An RGB Color Wheel

RGB hue values which consist of equal parts red, green and blue do not indicate a hue, because none of those values indicate an orientation in the HSL coordinate space. Examples are "#000000" (black), "#FFFFFF" (white), and all the pure shades of gray. To indicate black, white or gray, you must remove all saturation (set the value to -100) and adjust lightness instead.

Additionally, when modifying existing features which already have a color scheme, changing a value such as hue does not change its existing saturation or lightness.

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 2025-07-09 UTC.

[[["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 2025-07-09 UTC."],[[["Google Maps can be customized using JSON style declarations to change the appearance of map features like roads and parks."],["Style declarations target specific map features using `featureType` and `elementType`, then apply style rules like `color`, `visibility`, and `weight` within `stylers`."],["For consistent color results, use the `color` styler with an RGB hex code instead of relying on `hue`, `saturation`, `lightness`, or `gamma`."],["Hue values in Google Maps styles represent the base color on an HSL color wheel, independent of saturation and lightness."],["Cloud customization through the Google Cloud console offers a centralized way to manage map styles across multiple applications."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4