Skip to main content

Raster basemap

The Adventure basemap is a vector style: the phone, the desktop client and every MapLibre page draw it themselves from /tiles/basemap/{region}/style.json. A few surfaces cannot draw a vector style: the Cesium globes (the StoryMap, the 3D replay player, the internal /grass_runner and /catalogue tools). For those the same basemap exists as raster tiles, rendered on our own server from our own style and cached.

EndpointReturns
GET /tiles/basemap/{z}/{x}/{y}.pngone 256 px PNG tile, or 404 outside the extent / beyond the zoom window, or 503 while the renderer is off
GET /tiles/basemap/raster.jsonTileJSON: the tile template, the extent, the zoom window and the credit

Both are public and send Access-Control-Allow-Origin: *, like the vector tiles, so a globe on another origin (a published StoryMap) can use them.

Read raster.json first​

The extent is the Europe archive's bounds, not the world. A client that asks for tiles over the Pacific gets 404 for each one; a client that reads raster.json and gives its imagery layer that bounds rectangle never asks. The zoom window is 0–18: zooms 0–14 come from the archive and 15–18 are over-zoomed by the renderer (the data gets no finer, the drawing does), which is as close as a globe camera needs; beyond that Cesium upsamples the z18 tile.

{
"tiles": ["https://api.fastgis.eu/tiles/basemap/{z}/{x}/{y}.png"],
"minzoom": 0, "maxzoom": 18,
"bounds": [-74.23, 10.65, 61.74, 83.74],
"attribution": "© OpenStreetMap contributors, Elevation © DLR/ESA Copernicus DEM GLO-30",
"version": "ed034a822f"
}

version is the archive's bake token. It changes when the Europe archive is rebuilt, and so does the server-side cache tree; the tile URL itself does not change.

Credit​

Every tile answers with X-Attribution (ASCII-folded, so a UTF-8 header reader never trips on ©), and the TileJSON carries the HTML form. Show it. The globes in this repository put it in Cesium's credit container; a client of your own must do the equivalent, because the data is OpenStreetMap under the ODbL and the relief is the Copernicus GLO-30 DEM.

How a tile is made​

The basemap-renderer service (tileserver-gl, MapLibre Native in tile mode) loads the API's own style over the stack network and renders what MapLibre would draw, hillshade and contours included, with labels running unbroken across tile edges. The API asks it with an identifying User-Agent, at most a handful of renders at a time, and renders a tile once: two browsers asking for the same cold tile share one render, and the result is cached on disk under the archive's bake token. A cold tile takes roughly 100–400 ms; a cached one is a disk read. Cache-Control: public, max-age=86400 lets browsers keep a tile for a day.

A renderer failure is a 503 and is never cached; a tile the renderer has nothing for is a 404 remembered for a day. The worker prunes the cache daily: trees of retired bakes are deleted and the current tree is kept under BASEMAP_RASTER_CACHE_GB, oldest tiles first.