Skip to content

Use CARTO rastertiles URL and warn when basemap key is missing - #13

Merged
viniciusoike merged 1 commit into
mainfrom
fix/carto-basemap-key
Sep 26, 2026
Merged

viniciusoike merged 1 commit into
mainfrom
fix/carto-basemap-key

Conversation

@viniciusoike

Copy link
Copy Markdown
Owner

The map showed CARTO's "API key required" watermark. The deployed app requests tiles without ?key= because CARTO_BASEMAP_SHINY isn't set on Connect Cloud.

Changes

  • Switched tiles to CARTO's documented keyed URL, https://basemaps.cartocdn.com/rastertiles/<style>/{z}/{x}/{y}{r}.png?key=…, and dropped the a–d subdomains.
  • Added a cli::cli_warn() at startup when CARTO_BASEMAP_SHINY is empty.

Deploy step

Set CARTO_BASEMAP_SHINY as a secret in the Connect Cloud app settings. The key is limited to viniciusoike-metrosp-explorer.share.connect.posit.cloud, so it returns 403 on localhost.

Testing

Ran the app locally with an unrestricted key. All tiles on the Mapa tab loaded without the watermark.

🤖 Generated with Claude Code

The deployed app showed watermarked tiles because CARTO_BASEMAP_SHINY
was not set on Connect Cloud. Tiles now use the URL format CARTO
documents for keyed requests, and startup warns when the key is empty
so the problem shows up in the logs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@viniciusoike
viniciusoike merged commit b8d54ad into main Sep 26, 2026
1 check passed
@viniciusoike
viniciusoike deleted the fix/carto-basemap-key branch October 4, 2026 04:10
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