Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps API Send Email With Directions

I used the Google Maps API to create a map with a custom input field that displays directions to a fixed address after the user submits the starting point in the form. Now I would like the user to be able to email herself or another person a link to google maps with the directions already plugged in. This functionality already exists on regular google maps but I don't believe there's anything built into the API for reproducing this. Does anyone have any ideas or thoughts?

PS, sorry I can't include a link to the site because it has not launched yet and I don't think my client would want everyone looking at their new site before it's finished :). However, I'll try to clarify as much as needed if anyone is confused. Thanks.

like image 513
Bret Avatar asked Feb 23 '11 01:02

Bret


1 Answers

Seth is right, you can generate the right url to Google Map service knowing the correct parameters. This ressource lists several url formats.

My personal favorite is :

https://www.google.com/maps/dir/<start-location>/<other-location>

You can use it with an address or latitude/longitude, like :

 https://www.google.com/maps/dir/48.856614,2.352222/52.520007,13.404954
like image 117
Gabriel Glenn Avatar answered Oct 21 '22 01:10

Gabriel Glenn