Ok, here is the quick high level solution:
- Use geolocation api to get the user location on success callback.
- Create a new google map using the gmaps api, when making pass the user coords as center of the map. If this is a mobile type web app I recommend using the accuracy radius value you get back also and draw the circle... like the iphone map app.
- There is a api call that google offers or you can created your own to get the route from user latlng, destination, travel method etc. .
- Once the callback fires rebind the map to allow the user to see there position and the destination.
- The directions object will also comeback with all sorts of data pertaining to the routes and legs.... decide how much of this you want to display and redraw map.
Note when you make the call to the api for directions you can specify what type travel mode to use among a few other things.
Also you should setup a method to track the user with geolocation and update the map center based on data coming back so the user can track their movements. I've done it with a setTimeOut and then animated the marker to the new location(Not sure if setTimeout is the cleanest solution).
Google Maps API with geolocation is fun!