Skip to content

viz: Carto basemaps now require an API key (raster since 2026-09-25); add an opt-in key and track viz smart's keyless use #5059

Open

Description

@jqnatividad

Background

Since #5033 (qsv 29.0.0), viz maps render inside sandboxed iframes such as CKAN's Webpage view. One gap is left. In an opaque sandbox (no allow-same-origin), Firefox sends no Referer, and tile.openstreetmap.org answers every tile with its "Access blocked" image. That affects the default open-street-map style of viz map and viz choropleth --map. Chrome isn't affected. The points and regions still draw.

The ckanext-webpageviewplus project tested --style carto-positron on qsv 29.0.0, both in a sandboxed iframe and on a page served with a CSP sandbox header. Carto's tiles loaded in Firefox and Chrome. viz smart (Data Schematics) already uses Carto, so it's unaffected. Changing the default style to Carto would fix sandboxed Firefox, but Carto's terms changed recently.

Carto basemap terms (last updated 2026-09-29)

From https://carto.com/legal/basemap-terms/ and https://docs.carto.com/faqs/carto-basemaps:

  • The free service is for a Customer "who requests and uses a CARTO-issued API key" (§3.b).
  • Raster tiles have required a key since 2026-09-25. The FAQ says vector styles, which are what Plotly's carto-* styles use, still load without one, and that the requirement may be extended to them.
  • Requests without a key may be watermarked (§3.d). Access may be rate-limited or suspended without notice (§3.c).
  • Free tier: 5M tile requests a month for non-commercial use (§12.c). From 2026-12-01, commercial use is capped at 1M a month (§12.d). Above that, a paid plan is needed.
  • Attribution to both OpenStreetMap and Carto is required (§13).
  • Keys can't be shared: using an API key other than your own is not permitted (§8.c). So qsv can't ship a key, and each deployment needs its own.

Proposal

  1. Keep open-street-map as the default --style. Switching the default to Carto would put every default map on a keyless, revocable service.
  2. Add an opt-in Carto key, for example a QSV_VIZ_CARTO_KEY env var and/or a --carto-key option. When it's set, append ?key=<key> to the Carto style URLs for viz map, viz choropleth --map and viz smart. Document it next to --style, with the sandboxed-Firefox use case.
  3. Track viz smart's keyless Carto use. If Carto extends the key requirement to vector styles, Data Schematic maps would show a watermark or a blank basemap. Consider falling back to OSM when no key is set, or adding a test or doc note that names the dependency.
  4. Check attribution. Confirm that the Plotly map attribution shown for the carto-* styles meets §13 ("© OpenStreetMap contributors, © CARTO").

Workaround today

For sandboxed views, viz map … --style carto-positron (or carto-voyager, carto-darkmatter, or the -nolabels variants) loads tiles in Firefox, subject to Carto's terms above. ckanext-webpageviewplus's README now recommends this.

Note for whoever changes the default tile source: let the ckanext-webpageviewplus project know, since its docs describe the current behavior.

Activity

  1. added
    enhancement
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions