Samples
Whole, working examples you can copy into your app and change.
On this page
Each sample is a whole program for a real job in a delivery or ride app, using the N-Ways APIs the way we recommend: keys restricted, errors handled, the map credit shown. Copy one, put in your key, and change it to fit your app.
Delivery tracking pageThe rider on the map, the road to the door and the arrival time, for your customer.
Rider pickupFrom a postcode or address to the right entrance, by okada around the ban areas, with the fare.
Dispatch matrixGive each order to the rider who gets there first, by real travel time.
What they use
| Sample | Runs | APIs |
|---|---|---|
| Delivery tracking page | A web page and a small server | Fleet tracking, Maps SDK |
| Rider pickup | A web page (works in a phone’s browser or a web view) | Autocomplete, Geocoding, Routes with fares, Maps SDK |
| Dispatch matrix | Node.js or Python, on your server | Route matrix |
Before you start
- Keys. Web pages need a key restricted to your website; servers need another, restricted to their IP addresses. API keys
- Points. The APIs take points as
{ "lat": …, "lng": … }and answer with GeoJSON, where coordinates are[longitude, latitude], the order maps use. - Credit. Wherever N-Ways data shows, show “N-Ways · © OpenStreetMap contributors”. The Maps SDK does it on maps. Attribution