0

I am having a problem with the embedded custom google maps with iframe. It gives the error as below.

does not permit cross-origin framing.

And I want to change the content of the iframe to a "map cannot be displayed" picture. Or is there a built in trigger for the api, to send an error, not a blank iframe?

My event handling looks like this:

if ($("#mapframe>iframe").contents().find('body').html().length == 0) {
   $(this).contents().find('body').html('<h1>Üres</h1>');
}
geocodezip
  • 158,664
  • 13
  • 220
  • 245
SJWimmer87
  • 73
  • 3
  • 7
  • 3
    You cannot access DOM of iframes which are not in the exaclty same domain of your page for security measures, this is why you get `cross-origin` error., you should change your approach – Luizgrs Oct 27 '15 at 10:31
  • The original problem you're trying to get around appears to be related to your logged-in state on the browser. https://productforums.google.com/forum/#!topic/maps-engine/4emg5D1Gwuo/discussion – paulmorriss Nov 18 '15 at 12:23

1 Answers1

0

There is some restriction with origin policy. It is not possible to use a short link in this case.

The error tell you that URL that you pass is not suitable as a source for iframe. Here is example URL:

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.

Does not permit cross-origin framing iframe follow it also.

Community
  • 1
  • 1
Govinda Rajbhar
  • 2,926
  • 6
  • 37
  • 62
  • I think the original problem is at Google's end. If they want you to embed maps, which they give you the tools to do, then they need to turn of the x-xss-protection header. – paulmorriss Nov 18 '15 at 12:19