Page 1 of 1

Using Google maps in iFrame

Posted: Mon Sep 12, 2016 7:24 am
by chs
Hi everyone

We would like to embed a Google maps window into our Profound UI rich application.

On the left side, we have 3 addresses resp. a route from address 1 to address 2 to address 3.
On the right side, we have an iFrame using Google maps.

Showing a route in Google maps from address 1 (Erlenwiesenstrasse 2 in Volketswil, Switzerland) to address 2 (Seestrasse 5 in Uster, Switzerland) works fine with the following code in iFrame URL (using the keywords &saddr and &daddr):

https://maps.google.ch/maps?output=embe ... r,+Schweiz

According to the Google maps parameter documentation, there are other keywords such as &mrad and &via to show additional destinations:
http://asnsblues.blogspot.ch/2011/11/go ... eters.html

If we use the keywords &mrad or &via, only the start and destination addresses are shown in Google maps (in iFrame) but not all 3 addresses:

https://maps.google.ch/maps?output=embe ... r,+Schweiz

Our questions:

1. Why are the keywords &mrad and &via not working ?
2. How does the syntax look like to show the route from address 1 to address 2 to address 3 with Google maps?
3. Is there another way to solve this issue?

Thank you for your answer in advance.

Christoph

Re: Using Google maps in iFrame

Posted: Mon Sep 12, 2016 10:02 am
by Glenn
Christoph,

I couldn't seem to get the "mrad" parameter to work either. Obviously, the Google Maps API isn't controlled by us, but I have found a work around for you if you'd like to try it.

The "daddr" has an additional 'flag' that you can use to embed multiple addresses. It's done using '+to:'. I found it here: https://webbuilders.wordpress.com/category/google-api/

Below is your sample URL modified to use it.

Code: Select all

https://maps.google.ch/maps?output=embed&hl=enl&q=?&saddr=Erlenwiesenstrasse+2,+Volketswil,+Schweiz&daddr=Talweg+3,+Uster,+Schweiz+to:Seestrasse+5,+Uster,+Schweiz
Notice that I moved your "mrad" parameter to the end and replaced the "&mrad" charcaters with "+to:". You might need to reverse the order to get the routing the way you want it.

Glenn

Re: Using Google maps in iFrame

Posted: Mon Sep 12, 2016 11:02 am
by chs
Glenn,

I have tried it and it worked, also when using +to several times at the end for more stops or addresses.

Thanks a lot.

Christoph