Repository navigation
Map: stop the CARTO "API KEY REQUIRED" watermark (key support + keyless OSM fallback) - #22
Merged
Merged
Conversation
…ess OSM fallback CARTO began enforcing API keys on basemaps.cartocdn.com in late August 2026; anonymous tile requests still render but carry a repeated "API KEY REQUIRED" watermark, which is what roastmap.ca/map has been showing. The roaster pins were never affected — only the basemap. New src/components/mapTiles.js picks the tile layer: - VITE_CARTO_API_KEY set → the existing theme-matched CARTO light/dark styles with ?key= appended (free key, 5M tiles/month, requested by email at carto.com/basemaps/apikey — no account needed). - unset → OpenStreetMap's keyless standard tiles. They only come in a light style, so dark mode tags the layer with .map-tiles--inverted and a CSS invert + hue-rotate keeps the dark canvas. Attribution drops the CARTO credit on this path. LeafletMap keys the TileLayer on provider + theme so a swap remounts the layer (react-leaflet ignores a mutated url prop). Pure module, unit tested; the Leaflet chunk is unchanged in size. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WQPoqZvpFtcjR76PFyVv99
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jameshiggins
marked this pull request as ready for review
September 24, 2026 20:05
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the "API KEY REQUIRED" watermark covering the basemap on
roastmap.ca/map.Root cause: CARTO began enforcing API keys on
basemaps.cartocdn.comin late August 2026. Anonymous tile requests still render but are watermarked. The roaster pins were never affected —/api/roastersis fine — only the basemap tiles.Change
New
src/components/mapTiles.jsselects the tile layer (pure module, unit-tested, no Leaflet import):VITE_CARTO_API_KEYlight_all/dark_all(unchanged styles) with?key=appended.map-tiles--inverted→ CSS invert + hue-rotateLeafletMapkeys theTileLayeron provider + theme so a swap remounts the layer (react-leaflet ignores a mutatedurlprop). Attribution drops the CARTO credit on the OSM path.index.htmlgains adns-prefetchfor the OSM host;.env.exampleand the README document the variable.After merge — action needed
VITE_CARTO_API_KEYin the Vercel project env and redeploy.Until the key is in place the map serves keyless OSM tiles, so the watermark is gone immediately on merge — the key just restores the theme-matched CARTO styling.
Verification
npm run lint(0 errors),npm run typecheck,npm test(332 passing, +6 new),npm run buildall clean. Leaflet chunk size unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01WQPoqZvpFtcjR76PFyVv99
Generated by Claude Code