Forums | Mahara Community

Pedagogy /
Allowed iframe sources


16 May 2014, 4:51

Hello Jim,

I have read on the forum that embeding google's stuff is often an issue, because Google is continuously changing its sharing protocol.

I also read that, at mahara.org, there is a plan to get a rid of the Google Block and only use the "allowed iframes" Mahara's feature. The change should be done for Mahara 1.9, as long as I remember having read that somewhere.

I am not really helping here, sorry.

-dajan

Aaron Wells's profile picture
Posts: 896

22 May 2014, 15:09

Hi Jim,

What version of Mahara are you using? I just tested this myself, and I was able to embed a Google Maps iframe in a page here on mahara.org, using the "Google Apps" block. We did have to update all the Google URLs a few months back because Google had changed their API, so if you're using an older Mahara release that may be the problem.

The Google Apps block is still present in Mahara 1.9. We would like to change over to something a little bit easier to use, but there's no specific timeline on that at the moment.

Cheers,

Aaron

Dirk Meyer's profile picture
Posts: 425

22 May 2014, 17:48

Hi Aaron,

I am unable to embedd the google maps code below on mahara.org and another 1.9 using the the Google Apps block. Playing with the allowed iframe does not solve the issue either. Does Google have different URL structure for various locations maybe or it works differently in countries around the globe?

<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m12!1m3!1d20010.295562287632!2d-115.5683895!3d51.176933999999996!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!5e0!3m2!1sen!2sca!4v1400737313821" width="600" height="450" frameborder="0" style="border:0"></iframe>

anonymous profile picture
Account deleted
Posts: 14

23 May 2014, 19:34

Hi Dirk,

I reviewed a number of embedded maps on my students' accounts and in every case, the iframe URL starts with "https://maps.google.com...). I note that your URL starts with: "https://www.google.com/maps...".

When I tested your URL, I could not open anythng. So, I tried to retrieve the coordinates from the URL and came up with a location in Banff(?).

I don't know if this is the issue, but here is the map test I did. Make sure you have added not only google.com to your allowed iframes but also maps.google.com.

http://eportfolio.cisweb.hct.ac.ae//view/view.php?id=1715

Let me know if this helps!

Paul

Aaron Wells's profile picture
Posts: 896

27 May 2014, 18:26

Okay, I tried three things:

  1. Went to maps.google.com, clicked the sharing button, got an embed iframe, and pasted that into a Google Apps block: Success
  2. Went to maps.google.com, clicked the sharing button, copied the sharing URL, and pasted that into a Google Apps block: Failure
  3. Pasted Dirk's iframe into a Google Apps block: Failure

Here's the page: https://mahara.org/user/aaronw/google-maps-iframe-test

So there does seem to be a problem there. Like Paul, the sharing URL and iframe URL I get from Google maps is at the domain "maps.google.com", rather than "www.google.com". This suggests that Dirk's URL may be from an earlier form of the Google Maps API. Still, our code should be backwards compatible with older URLs, and it should definitely work with a freshly obtained URL from Google Maps. So, I've filed a bug: https://bugs.launchpad.net/mahara/+bug/1323495

Cheers,

Aaron

Dirk Meyer's profile picture
Posts: 425

28 May 2014, 14:30

Thank you Paul and Aaron!

Paul, yes it is Banff and the code from your block works on my site.

When I go to google maps, I get a  'Meet the new Google Maps' popup window. https://maps.google.com redirects me to https://www.google.com/maps

Aaron Wells's profile picture
Posts: 896

28 May 2014, 17:22

Ah, that'd be the difference then. When I go to www.google.com/maps instead of maps.google.com, all the URLs I get are www.google.com/maps URLs. So that is a new URL format after all.

17 results