Links: Platform API documentation / Engine API documentation

If you want to display the route results on your own map, you can query our API to also return polyline data. You can use the polyline data to draw the route lines on any mapping service (e.g. Google Maps, Mapbox, Leaflet, etc).

Use the parameter "polylines: true" in the options object to get the polylines for each route. They will be in an encoded format, and you can use something like this to decode it. After it is decoded, you will have an array of lat/lng pairs, which you can then draw on your map.

NOTE: the encoded polyline string may include backslashes, so make sure you don't escape them, otherwise the polylines may end up all over the place! See Stack Overflow for more info.

ANOTHER NOTE: if you are seeing that your coordinates are off by a decimal point, try using a different "precision" value.


More API Guides:
Overview of the Routific API
Add a Route Optimization Button to Your Own Dashboard
Create a Project in the Routific Web Interface via API
Manual Changes and Updated ETAs Throughout the Day
Dispatch New Orders into Existing Routes

Did this answer your question?