Liam
Liam

Reputation: 9855

Google maps not working in an iFrame

I'm trying to place an iframe on my page that contains a google map.

The code is generate using jQuery on the fly and is output as so...

<iframe src="http://maps.google.com/maps?saddr=runcorn&daddr=widnes&ouput=embed" style="border:none; width:100%;" border="0"></iframe>

For some reason however this doesn't render a map, can anybody advise me on why this may be?

Upvotes: 0

Views: 9135

Answers (2)

Dessus
Dessus

Reputation: 2177

I am using chrome and get the following error. I imagine this holds the key to solving your problem as well as mine.

Refused to display 'http://blah.blah' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

It seems the documentation here is helpful:

Upvotes: 0

Chris Berlin
Chris Berlin

Reputation: 1087

Try to create the Iframe with a generator like this:

http://www.siteway.de/maps-generator/

<iframe width="600" height="300" src="http://maps.google.de/maps?hl=de&q=Pariser Platz, 10117 Berlin+(Brandenburger Tor)&ie=UTF8&t=&z=17&iwloc=B&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"><a href="http://www.siteway.de/maps-generator/" title="Google Maps für Ihre Homepage">(c) Homepage Google Maps Generator</a></iframe>

Upvotes: 2

Related Questions