Repository navigation
Serve the basemap from our own tile server, with CARTO's Dark Matter style - #516
Merged
Merged
Conversation
added 5 commits
November 25, 2026 16:53
CARTO now refuses osirisai.live both through the tile proxy (403) and in the browser (no CORS header), and the proxy's year-long cached style still pointed at a tile version CARTO has retired, so the MAP view went blank. - Load OpenFreeMap's keyless Dark Matter style straight from the browser - Remove the CARTO proxy-or-direct loader, which nothing uses any more - Use Noto Sans for OSIRIS's own map labels; OpenFreeMap serves no Open Sans and no combined font stacks - Keep clouds and rain under the place names rather than the first label, since OpenFreeMap draws water names below its roads and borders - Credit OpenFreeMap instead of CARTO on the privacy page
CARTO refuses osirisai.live, so the basemap now comes from a Martin tile server on a private network, holding the Protomaps OpenStreetMap world map that CARTO's own vector tiles are built from. - Add /api/basemap: the style, tiles, merged label fonts and icon sheet, relayed from BASEMAP_URL with year-long caching for versioned tiles and no Next fetch cache - Ship a copy of CARTO's current Dark Matter style (Protomaps schema), with Noto fallbacks for Arabic, Hebrew, Indic and other scripts - Build the style's URLs from the Host header only, so a forged forwarded header cannot end up in the edge-cached style - Fall back to OpenFreeMap's Dark Matter when no tile server is configured - Document BASEMAP_URL and BASEMAP_TILESET in .env.example
Past the deepest zoom the tile server has, the map now enlarges those tiles instead of asking for ones that don't exist, which showed as 404s and a blank map when zoomed into a city.
…'t deliver Basemap tiles load through a MapLibre protocol that asks /api/basemap first and, if it errors, can't be reached, stalls past 5 s or cuts off, asks the CARTO tile proxy for the same tile of CARTO's Dark Matter. CARTO's tiles use the same Protomaps schema, so they draw in the same style; only copies the proxy's caches still hold can answer.
next build on 16.4.3 stops with a known-vulnerability check, which blocks every production build.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Nov 25, 2026
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
CARTO now refuses osirisai.live both through the tile proxy (403) and in the browser (no CORS header). The proxy's long-cached style also points at a tile version CARTO has retired. The result is a blank or patchy MAP view and a stream of tile errors in the console.
This serves the basemap from our own tile server instead. It uses the Protomaps OpenStreetMap world map, which is the same schema CARTO's own vector tiles have used since 21 October, drawn with a copy of CARTO's Dark Matter style, so the map looks the same as before. Tiles that our tile server can't deliver fall back to CARTO copies still held in the tile proxy's caches.
It also updates Next.js to 16.4.6. On 16.4.3,
next buildstops on a known-vulnerability check, which blocks every production build.Changes
/api/basemap: serves the style and relays tiles, label fonts and the icon sheet from the tile server set inBASEMAP_URL(tileset named byBASEMAP_TILESET).immutable). Fonts and icons are cached for 30 days, the style for an hour at the edge.Hostheader only, so a forged forwarding header can't end up in the edge-cached style.BASEMAP_URL, the style redirects to OpenFreeMap's Dark Matter, so self-hosted copies keep a working map with nothing to set up.src/lib/basemap/dark-matter.jsonis a copy of CARTO's current Dark Matter (Protomaps schema), which CARTO's basemap-styles README allows hosting. Its font stacks add Noto fallbacks for Arabic, Hebrew, Indic and other scripts. Attribution credits OpenStreetMap, CARTO and Protomaps.src/lib/basemap/tile-backup.ts, a MapLibre protocol. If our tile server errors, can't be reached, takes more than 5 s to start answering or cuts off, it requests the same tile of CARTO's Dark Matter through/api/proxy-tiles. That tile uses the same schema and draws in the same style. Only copies already in the proxy's caches can answer.src/lib/carto-fallback.ts, which the new loader replaces..env.exampledocumentsBASEMAP_URLandBASEMAP_TILESET.nextandeslint-config-next16.4.3 → 16.4.6.Deployment
Set on each app server, pointing at a Martin tile server on the private network that holds a Protomaps
.pmtilesworld map, the label fonts and the icon sheet:The existing Cloudflare cache rule for
/api/*covers the new route. RemovingBASEMAP_URLand restarting the app returns the map to OpenFreeMap without a rebuild.Testing
npx vitest run: 179 files and 1,820 tests pass (27 skipped, as on master), including 22 new route tests and 10 new fallback tests.npx tsc --noEmit: no errors. ESLint: no new findings in changed files.next buildon 16.4.6: completes with exit code 0.🤖 Generated with SIMPLIFAI