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 mapfeatures may affect other styles on the map. There are several layers thatoverlap:
The base map: When you start creating a map style, the initialyou see is the style of the base map; that is, the default map. Any mapfeatures you don't customize retain the base map styling.
Map styles: Custom styles override the styles on the base map layer.In this image, the custom map style overrides the urban areas as aquaand roads as dark blue.
Style elements: Each map feature has one or more style elements thatyou can customize. In this image, the urban areas map feature polygonfill color is styled as aqua, and the road network fill coloris styled as blue.
Map feature hierarchy
Within a map style, map features are organized hierarchically, with 4 broadmap features at the top, and all other map features arranged beneath them ina logical hierarchy. By default, a map feature inherits the element stylesfor the map feature above it in the hierarchy (its parent); however, youcan override the top level style by setting one or more of the style elementsfor map features underneath it (child map features). For details on the mapfeature hierarchy, seeWhat you can style on a map.
Each map feature has one or more elements, or parts of the map feature, thatyou can style. For example, the fill color for the polygon (the map featureshape) is an element, as is the stroke color for the text label. You styleeach element separately, and any element you don't style retains the defaultstyle. Since elements are separate, you can style the fill color for labeltext, and leave the stroke (outline) color as the default (or inheritingfrom a parent style).
Here are some helpful guidelines in understanding how style hierarchy andinheritance work.
Default child styles inherit from the parent: To have allchild map features inherit a style, set the style for the parent map feature,and leave the child style as the default.
Custom child styles override the parent: To override the parent style,set a custom style on the child feature.
Style elements are independent: The style elements you can set for amap feature (for example, the polygon, the label icon, and the label textfill and stroke) are independent from each other. If you set the polygoncolor, but leave the icon alone, the polygon style overrides the parentstyle, but the icon inherits the parent or default style.
Turn off Visibility to hide map features: If you want to see only onething on your map, you have to turn off visibility for everything else.
Note: When you hide map features or make them semi-transparent, you may exposeboundary inaccuracies. Map feature boundaries are not always precise, but areadjusted to look correct when all layers are visible. For more details, seeManage styles that overlap.
Hierarchy and Inheritance Example
Here is an example of how inheritance and hierarchy works.
Select the top-level map feature ofNatural, and set thePolygon Fill color to yellow. This styles all polygons for mapfeatures underNatural to be yellow:
You wantLand cover, which is underNatural, to also be yellow,so you leave it unstyled, and it inherits the style fromNatural.
You want forests to be green, so underLand cover, you openForest,and color its polygon green. This custom child style overrides thestyles forLand cover andNatural.
You want ice to be shown a pale aqua, so also underLand cover, youopenIce, and color its polygon pale aqua.
And last, you want water to be aqua, so you selectNatural>Water, andcolor its polygon aqua. Setting the child styleWater overrides the parentstyle forNatural.
Follow a similar process to highlight the map features for your needs.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-01 UTC.