JSON reference for cloud-based maps styling Stay organized with collections Save and categorize content based on your preferences.
This product or feature is Experimental (pre-GA). Pre-GA products and features might have limited support, and changes to pre-GA products and features might not be compatible with other pre-GA versions. Pre-GA Offerings are covered by theGoogle Maps Platform Service Specific Terms. For more information, see thelaunch stage descriptions.
The JSON schema for cloud-based maps styling lets you use JSON tocustomize maps just as you would through the style editor interface. Thisdocument describes the JSON schema and how to make JSON style declarations.
To learn how to edit a map style using JSON within the style editor, or toimport and export a map style, seeUse JSON with cloud-based maps styling.
See an example JSON style declaration
The following JSON style declaration sets a background color, and then definesstyles for points of interest, parks, water features, and hides labels for foodand drink locations.
{"variant":"light","styles":[{"id":"natural.land","geometry":{"fillColor":"#f7e3f7"}},{"id":"natural.water","geometry":{"fillColor":"#d4b2ff"},"label":{"textFillColor":"#3d2163","textStrokeColor":"#f0e1ff"}},{"id":"pointOfInterest","label":{"pinFillColor":"#e0349a","textFillColor":"#a11e6e","textStrokeColor":"#ffd9f0"}},{"id":"pointOfInterest.emergency.hospital","geometry":{"fillColor":"#ffe3e3"}},{"id":"pointOfInterest.foodAndDrink","label":{"visible":false}},{"id":"pointOfInterest.recreation.park","geometry":{"fillColor":"#f9b9d2"}}]}The JSON object
A JSON style declaration consists of a top-level object and an array of stylerules.
- Top-level settings (optional) - Global style settings like
backgroundColorandvariant. styles- An array of style rule objects, which can consist of the following:id- The map feature to select for this style modification(e.g.,pointOfInterest.recreation.park).geometry(optional) - The geometric elements of the map featureand the style rules to apply (e.g.,fillColor).label(optional) - The text or pin label of the map feature andthe style rules to apply (e.g.,textStrokeColor).
Top-level settings
The properties in the following table apply to the entire map style.
| Property | Type | Description | Example |
|---|---|---|---|
| String | Customize the background color of the map app using a #RRGGBB hex string. This setting does not support changes to the opacity. | "#002211" |
| "light"|"dark" | Specify light or dark mode. If unspecified, the default is "light". | "light" |
| boolean | To enable monochrome, usetrue for a gray version of the map. |
|
Style rule objects
This section describes the properties that define the style rule objects in thestyles array to customize map features. Each style rule object must consistof the following:
idproperty.geometryorlabelelement with the associated styler properties defined.
id (map feature)
Theid property specifies the map feature to style. The property names arecamelcase versions of the map feature names in the style editor.
The map features form a category tree. If you specify a parent feature type,such aspointOfInterest, the styles you specify for the parent apply to allits children, such aspointOfInterest.retail andpointOfInterest.lodging.For details, seeMap feature hierarchy.
List of availableid properties
The availableid properties are as follows:
pointOfInterestpointOfInterest.emergencypointOfInterest.emergency.firepointOfInterest.emergency.hospitalpointOfInterest.emergency.pharmacypointOfInterest.emergency.policepointOfInterest.entertainmentpointOfInterest.entertainment.artspointOfInterest.entertainment.casinopointOfInterest.entertainment.cinemapointOfInterest.entertainment.historicpointOfInterest.entertainment.museumpointOfInterest.entertainment.themeParkpointOfInterest.entertainment.touristAttractionpointOfInterest.foodAndDrinkpointOfInterest.foodAndDrink.barpointOfInterest.foodAndDrink.cafepointOfInterest.foodAndDrink.restaurantpointOfInterest.foodAndDrink.winerypointOfInterest.landmarkpointOfInterest.lodgingpointOfInterest.recreationpointOfInterest.recreation.beachpointOfInterest.recreation.boatingpointOfInterest.recreation.fishingpointOfInterest.recreation.golfCoursepointOfInterest.recreation.hotSpringpointOfInterest.recreation.natureReservepointOfInterest.recreation.parkpointOfInterest.recreation.peakpointOfInterest.recreation.sportsComplexpointOfInterest.recreation.sportsFieldpointOfInterest.recreation.trailheadpointOfInterest.recreation.zoopointOfInterest.retailpointOfInterest.retail.grocerypointOfInterest.retail.shoppingpointOfInterest.servicepointOfInterest.service.atmpointOfInterest.service.bankpointOfInterest.service.carRentalpointOfInterest.service.evChargingpointOfInterest.service.gasStationpointOfInterest.service.parkingLotpointOfInterest.service.postOfficepointOfInterest.service.restStoppointOfInterest.service.restroompointOfInterest.transitpointOfInterest.transit.airportpointOfInterest.otherpointOfInterest.other.bridgepointOfInterest.other.cemeterypointOfInterest.other.governmentpointOfInterest.other.librarypointOfInterest.other.militarypointOfInterest.other.placeOfWorshippointOfInterest.other.schoolpointOfInterest.other.townSquarepoliticalpolitical.countryOrRegionpolitical.borderpolitical.reservationpolitical.stateOrProvincepolitical.citypolitical.sublocalitypolitical.neighborhoodpolitical.landParcelinfrastructureinfrastructure.buildinginfrastructure.building.commercialinfrastructure.businessCorridorinfrastructure.roadNetworkinfrastructure.roadNetwork.noTrafficinfrastructure.roadNetwork.noTraffic.pedestrianMallinfrastructure.roadNetwork.noTraffic.trailinfrastructure.roadNetwork.noTraffic.trail.pavedinfrastructure.roadNetwork.noTraffic.trail.unpavedinfrastructure.roadNetwork.parkingAisleinfrastructure.roadNetwork.rampinfrastructure.roadNetwork.roadinfrastructure.roadNetwork.road.arterialinfrastructure.roadNetwork.road.highwayinfrastructure.roadNetwork.road.localinfrastructure.roadNetwork.road.noOutletinfrastructure.roadNetwork.roadShieldinfrastructure.roadNetwork.roadSigninfrastructure.roadNetwork.roadDetailinfrastructure.roadNetwork.roadDetail.surfaceinfrastructure.roadNetwork.roadDetail.crosswalkinfrastructure.roadNetwork.roadDetail.sidewalkinfrastructure.roadNetwork.roadDetail.intersectioninfrastructure.railwayTrackinfrastructure.railwayTrack.commercialinfrastructure.railwayTrack.commuterinfrastructure.transitStationinfrastructure.transitStation.bicycleShareinfrastructure.transitStation.busStationinfrastructure.transitStation.ferryTerminalinfrastructure.transitStation.funicularStationinfrastructure.transitStation.gondolaStationinfrastructure.transitStation.monorailinfrastructure.transitStation.railStationinfrastructure.transitStation.railStation.subwayStationinfrastructure.transitStation.railStation.tramStationinfrastructure.urbanAreanaturalnatural.continentnatural.archipelagonatural.islandnatural.landnatural.land.landCovernatural.land.landCover.cropsnatural.land.landCover.dryCropsnatural.land.landCover.forestnatural.land.landCover.icenatural.land.landCover.sandnatural.land.landCover.shrubnatural.land.landCover.tundranatural.waternatural.water.oceannatural.water.lakenatural.water.rivernatural.water.othernatural.base
Elements
Elements are subdivisions of a map feature. For example, a roadconsists of the graphical line (thegeometry) on the map, and also the textdenoting its name (thelabel).
The following elements are available, but note that a specific map feature maysupport none, some, or all, of the elements:
geometry: Selects all the geometric elements (e.g., polygon, polyline) ofthe specified map feature.label: Selects all the label elements (e.g., text, pin) of the specifiedmap feature.
Stylers
Stylers are how you define your style rules for each element of a mapfeature.
For example, for a building footprint you can style each element as follows:
Examplegeometry stylers for a building | Examplelabel stylers for a building |
|---|---|
| Whether to hide or show the building footprint polygon on the map. | Whether to hide or show the building label. |
| Polygon fill color and opacity. | Text fill color and opacity. |
| Border color, opacity, and width. | Text stroke color and opacity. |
This section describes the different style options available for thegeometry andlabel elements.
geometry stylers
The following table lists all the available geometric stylers.
Note: Not all stylers are available for all map features.| Styler | Type | Description |
|---|---|---|
| boolean | To hide the polygon or polyline of a map feature, set tofalse. |
| string | Customize the color of the polygon or polyline with an RGB hexstring. |
| float | Customize the opacity of the polygon or polyline, where 0 istransparent and 1 is opaque. |
| string | Customize the color of the outline with an RGB hex string. |
| float | Customize the opacity of the outline, where 0 is transparent and 1 isopaque. |
| float | Customize the thickness of the outline from a range of 0 to 8. |
For more information, seePolygons and Polylines.
label stylers
The following table lists all the available label stylers.
Note: Not all stylers are available for all map features.| Styler | Type | Description |
|---|---|---|
| boolean | To hide the label of a map feature, set tofalse. |
| string | Customize the color of the text label with an RGB hex string. |
| float | Customize the opacity of the text label, where 0 is transparent and 1is opaque. |
| string | Customize the color of the outline with an RGB hex string. |
| float | Customize the opacity of the outline, where 0 is transparent and 1 isopaque. |
| float | Customize the thickness of the outline from a range of 0 to 8. |
| string | Customize the pin color with an RGB hex string. |
For more information, seeIcons and text labels.
Keyzooms
You can set a single style for a feature for all keyzoom levels or specifydifferent styles for different keyzoom levels. If you only provide one style, itwill be used for all keyzoom levels starting from z0. If you provide styles fordifferent keyzoom levels, the style will apply from that zoom level until thenext one you've defined.
To set a keyzoom level for a style, in the styler property, define the keyzoomlevel from z0 to z22 and then the styler customization.
In the following example, the color of water is black from keyzoom levels 0-5,dark gray from keyzoom levels 6-11, and light gray starting from keyzoom level12.
{"id":"natural.water","geometry":{"fillColor":{"z0":"#000000","z6":"#666666","z12":"#cccccc"}}}For more information, seeStyle zoom levels.
Limitations
You can use JSON to style almost everything in the Google Cloud console,except for the following features from theMap Settings menu:
- Control the density of Points of interest.
- Change the style of buildings.
- Change the style of landmarks.
For these features, you must select your preference in theMap Settings menu.
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-11-21 UTC.