Skip to content

Switch CARTO basemaps from raster to vector - #284

Merged
t-kramer merged 1 commit into
developmentfrom
carto-raster-to-vector
Oct 26, 2026
Merged

t-kramer merged 1 commit into
developmentfrom
carto-raster-to-vector

Conversation

@t-kramer

Copy link
Copy Markdown
Contributor

We're on pace for ~6.4M CARTO tile requests a month, above the 5M free allowance. CARTO has given us 10M temporarily, until 18 Nov 2026, and offered 20M a month if we move to vector basemaps and show the CARTO logo linked to carto.com. Vector maps also need well under half the requests of raster for the same map.

What changed

  • Keyed vector style: new route /basemap/positron.json serves CARTO's Positron vector style with our API key added to every tile, sprite and glyph URL. CARTO requires the key on all of these, but the published style doesn't include it. The key is still read only from AppConfig.CARTO_API_KEY (Secret Manager → Cloud Run), and the style is cached for 1 day.
  • Select page: the raster TileLayer is replaced by a MapLibre vector layer inside Leaflet (assets/carto_basemap.js, which loads MapLibre only on this page). The map now has minZoom=2 and maxBounds, so we stop loading tiles for repeated world copies.
  • Summary page: scatter_mapbox → scatter_map (MapLibre), pointing at the same style. This needs plotly 5.18.0 → 5.24.1; the lockfile change touches only that package.
  • CARTO logo linked to carto.com on both maps (carto_logo_badge() in pages/lib/utils.py). The OSM/CARTO attribution is unchanged.
  • Tests: unit tests for the style rewriting (tests/test_basemap.py), and pytest.ini so pages can be imported when running from tests/.

@t-kramer t-kramer self-assigned this Oct 22, 2026
@t-kramer t-kramer added the enhancement New feature or request label Oct 22, 2026
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: acc6eca1-d575-4d46-abff-2eeea31fde14

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@t-kramer
t-kramer force-pushed the carto-raster-to-vector branch from 774a838 to 682484b Compare October 26, 2026 19:20
@t-kramer
t-kramer merged commit f4e4b63 into development Oct 26, 2026
2 checks passed
@t-kramer
t-kramer deleted the carto-raster-to-vector branch October 26, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant