Tiles API
The vector tiles behind every N-Ways map, for your own map styles: roads, buildings, water, land, places and points of interest across Nigeria, Ghana, Benin, Togo, Gabon, Côte d’Ivoire, Liberia, Guinea, Sierra Leone, Guinea-Bissau, Senegal, Cameroon, Burkina Faso, Cabo Verde and The Gambia.
How N-Ways serves tiles
N-Ways map data comes as vector tiles, two ways: one tile at a time (.mvt, for any map library), or as a PMTiles archive read a piece at a time with HTTP range requests (MapLibre with the pmtiles library’s protocol), which caches well on phones and at the edge.
| Hosted styles | https://nways.ng/maps/v1/styles/streets-light.json, streets-dark.json (?lang=fr for French names; ?format=pmtiles to read the archive) |
| One tile | https://nways.ng/maps/v1/tiles/base/{z}/{x}/{y}.mvt (every country in one tileset) |
| Archives | One per country, such as https://tiles.nways.ng/maps/v1/tiles/nigeria.pmtiles (the CDN, no key), or https://nways.ng/maps/v1/tiles/nigeria.pmtiles (keyed). Every country’s archives are listed in countries.json, in the same folder. |
| Fonts | https://tiles.nways.ng/maps/v1/fonts/{fontstack}/{range}.pbf (free, no key) |
| Other tilesets | detail (lanes, markings, every building, zoom 12 to 16) and transit (rail, stations, boats, roadworks, zoom 5 to 15), one tile at a time; as archives, nigeria-detail.pmtiles and nigeria-transit.pmtiles |
| Format | Mapbox Vector Tiles (MVT) in a PMTiles v3 archive |
| Zooms | 0 to 15 (drawn larger above 15) |
| Coverage | Nigeria, Ghana, Benin, Togo, Gabon, Côte d’Ivoire, Liberia, Guinea, Sierra Leone, Guinea-Bissau, Senegal, Cameroon, Burkina Faso, Cabo Verde and The Gambia; each country’s box and outline are in countries.json |
| Status | Live |
A tile of base, detail or transit comes from the archive of the country it lies in, so one tile URL covers all fifteen countries; read an archive yourself and you get one country. With ?format=pmtiles, a hosted style has one source per country. A hosted style read is one map load: that’s where your key is checked. Hosted styles read the archives and fonts from the CDN tiles.nways.ng, a public copy where reads need no key and aren’t counted. On the API, each tile, or each archive session from a site, is one tiles call. Fonts are never charged. The earlier addresses (https://nways.ng/tiles/…, /fonts/…) keep working.
Use them in a style
import * as maplibregl from 'maplibre-gl'
import { Protocol } from 'pmtiles'
maplibregl.addProtocol('pmtiles', new Protocol().tile)
new maplibregl.Map({
container: 'map',
center: [3.3792, 6.5244],
zoom: 12,
style: {
version: 8,
glyphs: 'https://tiles.nways.ng/maps/v1/fonts/{fontstack}/{range}.pbf',
sources: {
nways: {
type: 'vector',
// One country's archive (countries.json lists them all).
url: 'pmtiles://https://tiles.nways.ng/maps/v1/tiles/nigeria.pmtiles',
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors · N-Ways',
},
},
layers: [
{ id: 'land', type: 'background', paint: { 'background-color': '#eef0e6' } },
{ id: 'water', type: 'fill', source: 'nways', 'source-layer': 'water', paint: { 'fill-color': '#9cc7e4' } },
{ id: 'roads', type: 'line', source: 'nways', 'source-layer': 'roads', paint: { 'line-color': '#ffffff', 'line-width': 1.5 } },
],
},
})The Maps SDK does all this for you, with a full style.
Layers
The tiles follow the Protomaps basemap layers. Every feature has a kind; named ones have name (the local name), and often name:en and name:fr.
| Layer | What’s in it | Useful fields |
|---|---|---|
earth | Land | kind |
water | Sea, lagoons, rivers, lakes | kind, name |
landcover | Forest, grass, farmland, scrub | kind |
landuse | Parks, markets, hospitals, schools, residential areas | kind |
roads | Roads and paths | kind (highway, major_road, minor_road, path, other), kind_detail, name, ref, oneway, is_bridge, is_tunnel |
buildings | Building footprints | height, min_height, addr_housenumber |
boundaries | Country and state borders | kind, kind_detail, disputed |
places | Countries, states, cities, towns, neighbourhoods | kind, name, population, capital, min_zoom |
pois | Points of interest | kind, name, min_zoom |
Fonts
Map labels use Inter. The font stacks are Inter-Regular, Inter-Medium, Inter-SemiBold, Inter-Bold and Inter-Italic; use one at a time, like "text-font": ["Inter-Medium"].
Caching
Browsers and MapLibre cache tiles for you. Don’t download whole archives or crawl every tile to store them: for maps without a network, use offline packs. What you may store