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/cloud-customization/map-hier-leg below:

Understand map style inheritance and hierarchy | Maps JavaScript API

Skip to main content Understand map style inheritance and hierarchy

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

When you customize a map style, it helps to understand how styling different map features may affect other styles on the map. There are several layers that overlap:

Map feature hierarchy

Within a map style, map features are organized hierarchically, with 4 broad map features at the top, and all other map features arranged beneath them in a logical hierarchy. By default, a map feature inherits the element styles for the map feature above it in the hierarchy (its parent); however, you can override the top level style by setting one or more of the style elements for map features underneath it (child map features). For details on the map feature hierarchy, see What you can style on a map.

Each map feature has one or more elements, or parts of the map feature, that you can style. For example, the fill color for the polygon (the map feature shape) is an element, as is the stroke color for the text label. You style each element separately, and any element you don't style retains the default style. Since elements are separate, you can style the fill color for label text, and leave the stroke (outline) color as the default (or inheriting from a parent style).

Here are some helpful guidelines in understanding how style hierarchy and inheritance work.

Hierarchy and Inheritance Example

Here is an example of how inheritance and hierarchy works.

  1. Select the top-level map feature of Natural, and set the Polygon Fill color to yellow. This styles all polygons for map features under Natural to be yellow:

  2. You want Land cover, which is under Natural, to also be yellow, so you leave it unstyled, and it inherits the style from Natural.

  3. You want forests to be green, so under Land cover, you open Forest, and color its polygon green. This custom child style overrides the styles for Land cover and Natural.

  4. You want ice to be shown a pale aqua, so also under Land cover, you open Ice, and color its polygon pale aqua.

  5. And last, you want water to be aqua, so you select Natural>Water, and color its polygon aqua. Setting the child style Water overrides the parent style for Natural.

Follow a similar process to highlight the map features for your needs.

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-18 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-18 UTC."],[[["Map features are organized hierarchically, inheriting styles from parent features unless overridden."],["Custom styles applied to child features override the inherited styles from their parent features."],["Individual style elements within a feature (like fill color, stroke color, etc.) are independent and can be styled separately."],["To hide specific map features, turn off their visibility."],["You can customize your map by setting styles on parent features for broad changes and on child features for specific overrides."]]],[]]


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