• Optimization
  • Navigation
  • Tracking
  • Maps
  • Places

API - Distance Matrix

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 Distance Matrix API.

The Distance Matrix API takes several locations as the origins and the destinations, and returns the distances between each other. You can set various options, such as traveling modes, for a more accurate distance result.

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

There are detailed instructions in the references of Distance Matrix.

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 </style>
17 </head>
18 <body>

Have Questions ?