Try Routes API to compute directions

Use this demo to try the Routes API. The demo lets you specify an origin and destination as a latitude/longitude coordinates pair or as a place ID. Click a location on the map to copy the latitude/longitude coordinates to the clipboard, and then paste the location into the form.

If you have an encoded polyline or a GeoJSON linestring, and you'd like to view the polyline on map, go toInteractive polyline decoder utility.

After you selectGet directions,the demo displays the response from the computeRoutesmethod as a route on the map.