• Optimization
  • Navigation
  • Tracking
  • Maps
  • Places

API - Directions

A newer version of Maps for web SDK is available
A newer version of the SDK is available and is recommended for all users. Learn about the latest version, V2.0, in the Maps for web v2.0 documentation

With NextBillion.ai Maps API, you can access all kinds of services from the map data to support your business, with just a few lines of code.

In this section, we'll introduce the Directions API.

The Directions API takes 2 locations as the origin and the destination, and returns the directions between them. You can set various traveling modes for a more accurate directions result.

You can use the SDK's built-in methods to request and render the result. Also, it's your freedom to manually process and visualize the data when needed.

There are detailed instructions in the references of Directions.

1<!DOCTYPE html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8" />
5 <title>NBMap Basic Example</title>
6 <link href="https://maps-gl.nextbillion.io/maps/api/css" rel="stylesheet" />
7 <style>
8 * {
9 margin: 0;
10 padding: 0;
11 }
12 #map {
13 width: 100vw;
14 height: 100vh;
15 }
16 #add-route {
17 position: absolute;
18 top: 20px;

Have Questions ?