• Optimization
  • Navigation
  • Tracking
  • Maps
  • Places

API - Snap To Roads

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 Snap To Roads API.

The Snap To Roads API takes a series of locations along a route, and returns the new locations on this route that are snapped to the best matched roads where the trip took place. You can set various parameters, such as timestamps or radiuses, to optimize the 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 Snap To Roads.

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 #req-snap-to-road {
17 position: absolute;
18 top: 20px;

Have Questions ?