Map Management API quick reference

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 ROADMAP or SATELLITE for 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

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-platform scope, for example from Application Default Credentials or a service account. See /maps/documentation/mapmanagement/oauth_token.
  • Problem: A new MapConfig defaults to the RASTER map type, so you get a raster map if you don't set the type. Fix: Set map_type to VECTOR explicitly in the MapConfig when you need a vector map. See /maps/documentation/mapmanagement/guide-and-examples.
  • Problem: Omitting map_variants on MapContextConfig fails with INVALID_ARGUMENT (at least one styled variant is required), and an empty or unset style sheet in StyleConfig falls back to the unstyled base map. Fix: Always list every map variant you need in map_variants (light and dark variants can't be mixed in one MapContextConfig), and provide a style in StyleConfig (json_style_sheet as a string, or style_sheet as a JSON object; style_sheet takes precedence if you set both). See /maps/documentation/mapmanagement/guide-and-examples.
  • Problem: Requests made with user credentials need the X-Goog-User-Project header, which sets the project used for billing and quota. Fix: Send X-Goog-User-Project with 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.