Using Google Map directions in HTML pages
This demonstration uses the DirectionsService JavaScript API of Google Map version 3 to request for the directions. It uses DirectionsRenderer to display the results instead of handling them ourselves manually. This demonstration does not use WayPoints.
See the DirectionsService documentation for information and options.