N-Ways
Developer docsMoving from Google

Moving from Google Maps Platform

The same model of projects, restricted keys and quotas, with maps, addresses and routes made for West Africa. What maps to what, and how to move one API at a time.

On this page

If your app already uses Google Maps Platform, most of what you know carries over: N-Ways uses the same model of projects, restricted keys, per-API quotas and error reasons. This guide maps each piece to its N-Ways counterpart and shows what changes in your code. You can move one API at a time.

Note:

N-Ways isn’t affiliated with Google. Google Maps Platform is named here only to help you move; its products are described in our own words. Check Google’s own documentation for how they work.

Why move

  • Addresses people use here: NIPOST postcodes to the building, GhanaPost GPS codes, landmarks and nicknames.
  • How people travel here: okada, keke and danfo routes that respect ban areas, boats, trains, border crossings, and fares in naira, cedis, F CFA, Liberian dollars, Guinean francs, leones and Cape Verdean escudos.
  • A lower bill: a free allowance for every API each month, and prices a fraction of the global platforms’, invoiced in local money.
  • Open map technology: maps are MapLibre and vector tiles, so you can restyle them and show N-Ways data on any map, with the credit.

Concepts

Google Maps PlatformN-WaysWhat’s different
Cloud project with billingProjectOne project per app or customer; no separate billing account. Prepaid credit or an invoice.
Enabling each APIThe project’s planNo step to enable: a project may call the APIs in its plan, and each key can be narrowed further.
API keyAPI key (nw_…)Sent as key= or the X-NWays-Api-Key header.
Application restrictionsApplication restrictionsThe same four kinds: websites (with wildcards), Android package and SHA-1, iOS bundle ID, IP addresses. One kind per key.
API restrictionsAPI restrictionsTick the APIs a key may call.
Quotas and capsRate limits and daily capsPer key and API, and optionally for the whole project. Quotas and limits
Field masksfields=Choose the fields you need; for Places and Routes it also sets the price tier.
Monthly free usageFree calls for each APICounted per API, not a shared credit.
Session tokens for autocompleteSession tokensSame idea: one token per search, ended by the pick.

APIs

If you useUse on N-WaysStatus
Maps JavaScript APIMaps SDK for the web (@nways/maps, on MapLibre GL JS)Available
Maps SDK for Android / iOSN-Ways Maps for Android and for iOS (on MapLibre Native)Available
Map Tiles APITiles API (vector tiles, PMTiles)Available
Maps Static APIStatic mapsSee its page
Geocoding APIGeocoding and reverse geocodingAvailable
Places API: nearby, text search, detailsPlacesAvailable
Places AutocompleteAutocompleteSee its page
Address Validation APIAddress validationSee its page
Routes API: compute routesRoutesAvailable
Routes API: route matrixRoute matrixSee its page
Route Optimization APIRoute optimisationSee its page
Fleet and last-mile delivery solutionsFleet tracking and webhooksSee its page
Traffic layerTraffic (GeoJSON) and the traffic feedAvailable
Street View, Elevation, Roads, Air Quality, Solar, PollenNo equivalentKeep them where they are

N-Ways has APIs with no Google counterpart too: fare estimates for taxis, okadas, kekes, buses and boats, NIPOST and GhanaPost postcode lookups, and routes that keep to okada and keke bans.

A map on a web page

N-Ways maps are MapLibre GL JS maps. The main differences from the Google JavaScript map:

  • Coordinates are [longitude, latitude] in MapLibre (GeoJSON order), not { lat, lng }. This is the change that catches everyone: swap them.
  • Zoom levels match closely; MapLibre allows fractional zoom.
  • Markers: new maplibregl.Marker().setLngLat([lng, lat]).addTo(map). Info windows are maplibregl.Popup.
  • Shapes (polylines, polygons, circles) are GeoJSON sources with line or fill layers, drawn on the GPU, so thousands of them stay smooth.
  • Events: map.on('click', (e) => e.lngLat); the map is ready on map.on('load').
index.html
<link rel="stylesheet" href="https://nways.ng/sdk/v1/maplibre-gl.css" />
<div id="map" style="height: 480px"></div>
<script type="module">
  import { createMap, maplibregl } from 'https://nways.ng/sdk/v1/nways-maps.standalone.js'

  // Lagos, Allen Avenue. Note the order: longitude first.
  const map = createMap({ container: 'map', key: 'YOUR_API_KEY', center: [3.3515, 6.6018], zoom: 15 })
  new maplibregl.Marker({ color: '#0b7a3e' })
    .setLngLat([3.3515, 6.6018])
    .setPopup(new maplibregl.Popup().setText('Pickup'))
    .addTo(map)
</script>

Web services

  • Errors are HTTP errors: a refused key answers 401 or 403 with a reason (API_KEY_HTTP_REFERRER_BLOCKED, API_KEY_SERVICE_BLOCKED…), never 200 with a status word. Many reasons have the same names as Google’s. Errors
  • Points in requests are { "lat": …, "lng": … } or lat,lng in a query; lines in answers are GeoJSON [lng, lat] pairs, not encoded polylines, so they go straight onto a map.
  • Distances and times are plain numbers: distanceM in metres, durationS in seconds.
  • Languages: lang=en or lang=fr.
  • IDs are strings you may store for good (osm:n501540907, ghanapost:GA-183-8164); they aren’t Google place IDs, so look places up again once by name or position.

Plan the move

  1. Get a project and keys, one per website, app and server, restricted the same way as your Google keys. Get started
  2. Start with the server side: geocoding and routes are easiest to switch and compare, behind your own backend.
  3. Run both for a week: send a share of requests to N-Ways and compare answers, ETAs and what your riders say.
  4. Switch the maps in your web and mobile apps, keeping the credit visible. Attribution
  5. Re-key stored data: replace Google place IDs with N-Ways IDs as customers come back, or in one batch by position.
  6. Set caps on each key so a bug can’t run up a bill, then turn off the Google keys you no longer use.

Help moving

Tell us which APIs you use and your monthly volumes at hello@nways.ng: we’ll help you plan the move and estimate your bill.