Skip to content

feat(maps): support a CARTO basemaps API key - #80

Merged
streambinder merged 1 commit into
masterfrom
feat/carto-api-key
Sep 5, 2026
Merged

feat(maps): support a CARTO basemaps API key#80
streambinder merged 1 commit into
masterfrom
feat/carto-api-key

Conversation

@streambinder

Copy link
Copy Markdown
Owner

CARTO started watermarking keyless raster tiles with API KEY REQUIRED in late August 2026, so the Leaflet maps on the site now render with that overlay.

This change reads a publishable CARTO basemaps API key from the CARTO_API_KEY environment variable and exposes it to the map scripts through a carto-api-key meta tag. The tile URL builder appends ?key= when the tag is present and falls back to the exact previous keyless URL when it is not, so behavior is unchanged when the variable is unset. No CSP change is needed since *.basemaps.cartocdn.com is already allowed.

Includes a focused unit test for the empty/set key handling and documents the new variable in docs/installation.md.

Keeps keyless tiles when CARTO_API_KEY is unset, and appends the key to tile requests when set.
@streambinder
streambinder merged commit 0676b52 into master Sep 5, 2026
8 checks passed
@streambinder
streambinder deleted the feat/carto-api-key branch September 5, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant