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

Every tile response includes Hive provenance headers:

HeaderDescription
X-Hive-WorkerWorker public key or tile-proxy
X-Hive-CellH3 cell of the computation
X-Hive-EpochGNS 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)

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.