ihorko
ihorko

Reputation: 6945

How to embed google map with short url

I have a table of short google urls for different places like,

ID|URL
------
1|http://goo.gl/maps/7nps
2|http://goo.gl/maps/wZlPp

depends on param in URL I need to show embedded map of that place in browser.

So, to embed second map I use iframe html script that google gives me:

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/?ie=UTF8&amp;t=h&amp;ll=40.408791,-3.692586&amp;spn=0.002859,0.00456&amp;z=17&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/?ie=UTF8&amp;t=h&amp;ll=40.408791,-3.692586&amp;spn=0.002859,0.00456&amp;z=17&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>

and it works, but it uses long url: http://maps.google.com/?ie=UTF8&t=h&ll=40.408791,-3.692586&spn=0.002859,0.00456&z=17&output=embed

When I try to replace it with shorter link, it doesn't work:

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://goo.gl/maps/wZlPp"></iframe><br />

How is it possible to use short link there?

Upvotes: 2

Views: 6296

Answers (1)

jgillich
jgillich

Reputation: 76219

When you take a look at the developer console, you get something like this:

Load denied by X-Frame-Options: https://maps.google.com/?ie=UTF8&ll=48.858151,2.293611&spn=0.00648,0.021973&t=h&z=16 does not permit cross-origin framing.

So the problem is the same origin policy. It is not possible to use a short link in this case.

Upvotes: 1

Related Questions