Simply get route form this url and do next ...
Origin ---> starting point latitude & longitude
Destination---> ending point latitude & longitude
here i have put origin as Delhi latitude and longitude & destination as chandigarh latitude longitude
https://maps.googleapis.com/maps/api/directions/json?origin=28.704060,77.102493&destination=30.733315,76.779419&sensor=false&key="PUT YOUR MAP API KEY"