Currently, I display the duration of travel using the Google Maps Plugin on my web app, I thought it would be cool if this also linked to the Google Maps page using dynamic data so the user can visualise the journey and enjoy the extended features/info that Google offers.
When the page loads I would want the inputs to use the dynamic data from my web app. (Users postcode as origin, location of job as destination)
This is actually rather straightforward thanks to Google’s clever URL Parameter’s all that you need to do to dynamically link to Google maps is the following link:
https://www.google.com/maps/dir/<address 1>/<address 2>/
You can input a postcode or a full address and it is pretty consistent at figuring out what you are looking to show.
In my case the link looks something like this:
https://www.google.com/maps/dir/sk92gp/AlphaSights, Thames Court, 1 Queenhithe, London EC4V 3DX/
With the origin as the users postcode and the destination as the location of the company.
This results in the following be displayed:
Exactly the result I wanted!
Hope this helps anyone else trying to do something similar.
I have made this, but I want this embed, so the user don’t have to login on his mobile again after going back…
Is that possible?
thanks a lot!