Offline packs
Maps that keep working where the network drops: download a city or a delivery zone ahead, on Wi-Fi.
Riders lose the network under bridges, in markets and on the way out of town. An offline pack is a region’s map and routing data, downloaded ahead (on Wi-Fi, at the depot), so your rider app keeps showing the map and planning routes without a connection.
Offline packs come with fleet tracking (plan by agreement). Reference
What’s in a pack
| File | What it is | Open it with |
|---|---|---|
map.pmtiles | The region’s vector map to zoom 15, the same tiles the Maps SDKs draw | MapLibre Native (pmtiles:// on a local file), or the Android and iOS SDKs |
routing.tar | The region’s road graph for on-device routing | An on-device routing engine that reads Valhalla tiles |
A pack is rebuilt when the map or the road graph changes: its version changes, and each file has its size and SHA-256, so your app downloads only what changed.
Download a pack
GET /maps/v1/fleet/offline/regionslists the ready-made regions (Lagos, Abuja, Ibadan, Port Harcourt, Kano, Accra, Kumasi, Cotonou, Lomé, Libreville, Abidjan, Monrovia, Conakry, Freetown, Bissau, Dakar, Douala, Yaoundé, Ouagadougou, Bobo-Dioulasso, Praia, Mindelo and more) with their boxes. For your own delivery zone, ask for the regioncustom-<minLng>_<minLat>_<maxLng>_<maxLat>: up to 0.6° across, on a 0.05° grid.GET /maps/v1/fleet/offline/packs/{region}gives the manifest. A202means it’s being built: ask again afterRetry-Afterseconds.- Download each file from its
urlwith your key. Downloads can be resumed with HTTPRange, and theETagis the file’s hash.
curl "https://nways.ng/maps/v1/fleet/offline/packs/lagos" -H "X-NWays-Api-Key: YOUR_APP_KEY"Show it on the map
Point the style’s vector source at the downloaded file. With the N-Ways SDKs, download the hosted style once too and replace its tile address with the local file:
// The pack's map, saved in the app's files.
val local = "pmtiles://file://" + File(filesDir, "packs/lagos/map.pmtiles").absolutePath
val style = savedStyleJson.replace(Regex("pmtiles://https://[^\"]+"), local)
map.setStyle(Style.Builder().fromJson(style))Keep in mind
- Packs are for your own apps’ users, not for redistribution. The OpenStreetMap credit still shows on the map.
- Search and fares need the network; plan around it (cache the day’s addresses before leaving).
- Refresh packs weekly: roads, bans and one-ways change.