Skip to main content

Tile Rendering

Map tile rendering is the second compute type on Hive. The tile service is MapLibre GL JS and flutter_map compatible — swap one URL and any mapping application runs on Hive tiles.

Tile API

GET /v1/tiles/{h3_cell}/{zoom}/{style}.{format}

Examples

# OSM bright style, Rome, zoom 15
curl -o tile.png https://gns-browser-production.up.railway.app/v1/tiles/871e9a0ecffffff/15/osm-bright.png

# Dark mode
curl -o dark.png https://gns-browser-production.up.railway.app/v1/tiles/871e9a0ecffffff/15/dark.png

# Satellite imagery
curl -o sat.png https://gns-browser-production.up.railway.app/v1/tiles/871e9a0ecffffff/14/satellite.png

Available styles

StyleSourceAPI Key Required
osm-brightOpenStreetMapNo
osm-standardOpenStreetMapNo
darkCartoDB Dark MatterNo
terrainStadia/StamenNo
satelliteESRI World ImageryNo

Response headers — the on-the-wire audit chain

Every tile response includes Hive provenance headers, exposed via CORS so any browser or dapp can read them without server-side cooperation:

HeaderDescription
X-Hive-WorkerWorker public key or tile-proxy
X-Hive-CellH3 cell of the computation
X-Hive-EpochMobyDB epoch number
X-Hive-ProofSHA-256 hash of the tile data
X-Hive-CacheHIT or MISS
X-Hive-CostCost in GNS (0.00001 hit, 0.0001 miss)

The X-Hive-Epoch and X-Hive-Proof headers are the on-the-wire view of the MobyDB audit chain. A regulator, auditor, or any third party can verify that a tile was produced within a specific epoch and that its proof matches the epoch's Merkle root, without trusting any operator.

$ curl -I https://gns-browser-production.up.railway.app/v1/tiles/861e8050fffffff/8/satellite.png
HTTP/2 200
content-type: image/jpeg
cache-control: public, max-age=3600
x-hive-cell: 861e8050fffffff
x-hive-epoch: 3253
x-hive-proof: 394fb61956f409e7bb4bb06d607f7c60289fef5bcdddcb653c1cafca29931ea9
x-hive-worker: tile-proxy
x-hive-cost: 0.0001
x-hive-cache: MISS

Cache strategy

MobyDB is the cache. The composite key (H3 Cell, Epoch, Style, Zoom) IS the cache key.

  • Cache hit: serve from memory, <1ms, 0.00001 GNS
  • Cache miss: proxy from upstream, cache locally, serve to requester, 0.0001 GNS
  • Epoch invalidation: tiles refresh when the epoch advances and source data has changed

MapLibre GL JS integration

const map = new maplibregl.Map({
container: 'map',
style: {
version: 8,
sources: {
'hive-tiles': {
type: 'raster',
tiles: ['https://gns-browser-production.up.railway.app/v1/tiles/871e9a0ecffffff/{z}/osm-bright.png'],
tileSize: 256,
}
},
layers: [{
id: 'hive-layer',
type: 'raster',
source: 'hive-tiles',
}]
}
});

flutter_map integration

TileLayer(
urlTemplate: 'https://gns-browser-production.up.railway.app/v1/tiles/871e9a0ecffffff/{z}/osm-bright.png',
)

Compound jobs with tiles

Tiles can be part of a compound compute job. The inference step finds locations; the tile step renders the map:

{
"steps": [
{"id": "think", "type": "inference", "messages": [...]},
{"id": "show", "type": "tile_render", "depends_on": "think",
"center_cell": "871e9a0ecffffff", "zoom": 15, "style": "osm-bright"}
]
}

The tile step reads locations from the inference output and generates annotation metadata.

Competitive pricing

ProviderCost per 1,000 tilesProvenanceData Sovereignty
Mapbox$0.60–$5.00NoneNo
Google Maps$7.00NoneNo
Hive Maps$0.10Merkle proof per tileYes (H3 cell binding)

Tile grid endpoint

GET /v1/tiles/grid/{cell}/{zoom}/{style}?rings=1

Returns a JSON array of tile URLs covering the cell and surrounding rings.

Tile stats

GET /v1/tiles/stats?hours=24

Returns hourly aggregated tile serving statistics.