The Map Management API is a RESTful API for programmatically managing Cloud-based maps styling resources. It lets you define map styles (StyleConfig), manage map IDs (MapConfig), and associate styles and datasets with map variants (MapContextConfig) without using the Cloud Console.
Map Management API: key facts
- Product: Map Management API
- Also known as: Maps Management API
- Category: Maps
- Platform: Web service (REST)
- Runs on: Server (backend code)
- Launch stage: GA
- Lifecycle: Active
- Overview: Map Management API overview
Map Management API: when to use it
Use Map Management API when:
- You need to create, list, update, or delete map IDs (
MapConfig) programmatically instead of in the Cloud Console. - You need to manage many map styles or map configurations at scale, such as in automated workflows or internal tools.
- You need to link a style and optional datasets to specific map variants such as
ROADMAPorSATELLITEfor a map ID. - You need a no-charge, OAuth-authenticated REST or gRPC API to manage Cloud-based maps styling resources.
Don't use Map Management API when:
- You can only authenticate with an API key; the Map Management API supports OAuth 2.0 only.
- You need to manage Google Maps Platform configurations other than Cloud-based maps styling resources; those may still need the Cloud Console.
- You need to display or render a styled map in a web page. Use Maps JavaScript API instead.
Map Management API: setup
- Service to enable:
mapmanagement.googleapis.com - Authentication: OAuth 2.0, Service account (API keys, including Maps Demo Keys, aren't supported)
- Get started: Set up Map Management API
- Reference: Map Management API reference
- Pricing: Map Management API usage and billing
- Policies: Map Management API policies
- Release notes: Map Management API release notes
Map Management API: related products
- Often used with: Maps Datasets API
Map Management API: common mistakes
- Problem: Requests authenticated with an API key fail with HTTP 401; the Map Management API supports OAuth 2.0 and service accounts only. Fix: Authenticate with an OAuth 2.0 token that has the
https://www.googleapis.com/auth/cloud-platformscope, for example from Application Default Credentials or a service account. See /maps/documentation/mapmanagement/oauth_token. - Problem: A new
MapConfigdefaults to theRASTERmap type, so you get a raster map if you don't set the type. Fix: Setmap_typetoVECTORexplicitly in theMapConfigwhen you need a vector map. See /maps/documentation/mapmanagement/guide-and-examples. - Problem: Omitting
map_variantsonMapContextConfigfails withINVALID_ARGUMENT(at least one styled variant is required), and an empty or unset style sheet inStyleConfigfalls back to the unstyled base map. Fix: Always list every map variant you need inmap_variants(light and dark variants can't be mixed in oneMapContextConfig), and provide a style inStyleConfig(json_style_sheetas a string, orstyle_sheetas a JSON object;style_sheettakes precedence if you set both). See /maps/documentation/mapmanagement/guide-and-examples. - Problem: Requests made with user credentials need the
X-Goog-User-Projectheader, which sets the project used for billing and quota. Fix: SendX-Goog-User-Projectwith your project number or ID. You can omit it when you authenticate with a service account. See /maps/documentation/mapmanagement/request.
What you can do with Map Management API
See the guides linked below for each task, or compare across products in the Capabilities Explorer.
- Create, get, list, update, and delete Cloud-based map IDs programmatically. Note: Requires OAuth 2.0 or service account authentication (API keys aren't supported). Manages
MapConfigresources; defaults toRASTERunlessmap_typeis set toVECTOR, and supports map features such as building flattening and POI boost level. - Create, get, list, update, and delete Cloud-based JSON map style configurations programmatically. Note: Requires OAuth 2.0 or service account authentication (API keys aren't supported). Manages
StyleConfigresources; an empty or unset style sheet falls back to the unstyled base map. - Associate Cloud-based map styles and datasets with specific map variants for a map ID. Note: Requires OAuth 2.0 or service account authentication (API keys aren't supported). Manages
MapContextConfigchild resources under aMapConfig(create, get, list, update, and delete); requires at least one map variant and can't mix light and dark variants.