For the complete documentation index, see llms.txt. This page is also available as Markdown.

CARTO Basemap

The CARTO Basemap is the default Basemap and it is included in all CARTO accounts. Outside a CARTO account, the same basemaps are available with a free API key. It uses the Open Source project Maplibre GL JS and CARTO base maps API.

API keys. Basemaps used inside the CARTO platform — Builder and Workflows — need no extra setup. Calling the basemap endpoints at basemaps.cartocdn.com directly requires an API key, available at carto.com/basemaps/apikey: free for non-commercial use up to 5 million tile requests a month and for commercial use up to 1 million; above that, a Basemaps Commercial plan (see pricing). CARTO customers need to buy nothing: basemaps are included in every CARTO plan. See the basemaps FAQ.

At the Basemaps section of CARTO for deck.gl you can find further information about how to use it. CARTO also provides a set of Basemaps Styles to easily adapt to multiple visualization contexts (dark, light, and voyager).

A code example is available in the guide Build a public application.

Further style customization

If you don't need to change a style, use its URL directly with your key, for example https://basemaps.cartocdn.com/gl/positron-gl-style/style.json?key=YOUR_KEY. You can also host a copy of it as is, but its tile, glyphs and sprite URLs (under /v/<release>/) are dynamic and change, so a hosted copy can break at any time; to stay current, use our style URL with ?key=.

If the Basemaps Styles provided by CARTO are not enough and you need to go further to customize those styles you can do the following:

  1. Download the style json as a reference, to compare and see how we build it. https://basemaps.cartocdn.com/gl/positron-gl-style/style.json

  2. Modify the styles to match your requirements. Your style uses your own glyphs (fonts) and sprite (icons); only its vector source points to our TileJSON, which always serves the current tiles: "url": "https://tiles.basemaps.cartocdn.com/vector/carto.streets/v2/tiles.json?key=YOUR_KEY". Don't keep the tile, glyphs and sprite URLs of the downloaded file: they are dynamic and change.

  3. Put it in a public url.

  4. Pass to deck.gl the mapStyle you want to use:

 const deckgl = new deck.DeckGL({
  ...
  map: maplibregl,
  mapStyle: '<your styles json url>',
 });

If you need a UI to modify the styles, take a look at Maputnik (A free and open visual editor tool for editing Basemaps styles).

Last updated

Was this helpful?