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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With