0

I tried to embed Google map to a Sharepoint page by using the Incorporation Web Part, I past the code in the text zone, but the map doesn't work. I get an error that the content can not be displayed in a frame, when i click on "Open in a new tab", it gives me this message: "The Google Maps Embed API must be used in an iframe."

Here's the code generated by google maps : <iframe src="https://www.google.com/maps/embed?pb=!1m10!1m8!1m3!1d13291.921825883793!2d-7.549490730224608!3d33.60581155000001!3m2!1i1024!2i768!4f13.1!5e0!3m2!1sfr!2sma!4v1533914178152" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>

I'm using Sharepoint Online

1

If you are using SharePoint Modern page, please use Embed Code web part:

enter image description here

And then paste the code into the textbox right side:

enter image description here

0

I have added the same iframe code in a Script Editor Webpart and it seems to be working as expected. Can you please tr the same. To embed the script editor :

  1. Edit the page where you want to Embed the above mentioned code.
  2. Insert a Webpart from Top and Select Script Editor from the section Media and Content.
  3. Edit the web part and click on Edit Snippet.
  4. Paste the needed iframe code and click on Insert.
  5. Save the changes.

You can take the reference from below answer in order to insert Script Editor

Insert JavaScript into Web-Part

Note : You might need to activate Publishing feature in order to use it if not already activated before.

I hope this helps.

  • I can't find the Script Editor, or the section Media and Content... i didn't mention that I'm using SharePoint Online – Amine Aug 10 '18 at 16:18
  • - Click the settings cog in the upper right corner, and choose Edit Page – DanJ Aug 10 '18 at 16:32
  • Updated the answer. Please check. – Ravi Aug 10 '18 at 17:15
0

In SharePoint online, specifically in the Modern Page, the best option that used to hold IFrame is Embed web part

To add Embed web part

  • Click Edit at the top right of the page.
  • Below an existing web part or under the title region, click Circled plus sign used to add a modern web part to a page, and then select the Embed web part.
  • In the toolbox on the right, add your code

    <iframe src="https://www.google.com/maps/embed?pb=!1m10!1m8!1m3!1d13291.921825883793!2d-7.549490730224608!3d33.60581155000001!3m2!1i1024!2i768!4f13.1!5e0!3m2!1sfr!2sma!4v1533914178152" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
    

Note:

  • The embed code must be iframe-based
  • Only secure web sites can be embedded
  • Not all websites allow their pages to be embedded, even when they are secure and use iframe-based embed code. so check with the website to see if they allow embedding.
  • Site collection administrators can control whether users can embed content from external websites.

  • No need to activate the publishing features! and before you do that for any other reason, I prefer to check this article first MISSING “SAVE SITE AS A TEMPLATE” IN SHAREPOINT

For more details, check Use the Embed web part

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.