javascript - How do I link to google maps print directions using Html5 geolocation? -


i'm developing site uses html5 geolocation location of user , display route on map, far good. now, i'd have 3 buttons ( walking, driving, transport) link google maps print directions (ie. https://maps.google.com/maps?saddr=san+francisco&daddr=los+angeles&z=7&pw=2 ) depending on location of user , kind of transport.

any ideas on how implement this?

thanks.

the relevant google maps url paramaters are:

saddr     source address     urlencoded address, or lat/lng pair formatted        58+41.881n+152+31.324w  daddr     destination address (same saddr)  dirflg     transportation directions type flag     (character, optional)         'r' = public transit         'w' = walking         'b' = bike         defaults car if omitted 

Comments