How to compute shortest route between two points in google map that user selects and provide all routes from source to destination in Transport system?
[GIS] Computing Shortest Distance using Google Map v3 and Openlayers
google mapsgoogle-maps-apiopenlayers-2routing
Best Answer
you can achieve this with Google Maps JavaScript API v3 - Directions Service. There is a doc here. and you can see stand-alone google example here.
and in this doc. you can get information about Travel Modes.
the Directions Service code:
The above code was taken from google api, i added some code there for you which you should have use used for your app.. main code for you is here:
i hope it helps you