XF 2.0 How to embed a google map

AndreaMarucci

Well-known member
Searched the forum but I've not found a solution.

It seems that there's a BBCode that support google map but if I paste a Map url or an Embed url in the media add, I always get the same error "The specified URL cannot be embedded as media." so I'm asking here if someone has ever embedded a Map in a post and how.

Thanks!
 
i just make a BBcode with Google MAP and work :
 
You can make your own Bbcode. Go to

/admin.php?bb-codes/

And create a New Bbcode with this settings:

189397

And in the HTML Replacement you paste this:

HTML:
<div align="center" style="margin: 5px 5px 5px 5px;">
     <table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%">
          <tr>
               <td class="thead" style="text-align:center"><iframe width="100%" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q={text}&output=embed"></iframe></td>
          </tr>
     </table>
</div>

For this GOOGLEMAP Bbcode you need also a GoogleMaps API key wich you can get in the Google Developer Tools.
 
1: Add new BBcode ( Tag: map Title: Google Map)
2: add this en html replacement

Code:
<div class="map">
{option}
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d78331.21700858096!2d2.112822484705789!3d41.399267142731354!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x12a49816718e30e5%3A0x44b0fb3d4f47660a!2sBarcelona!5e0!3m2!1sen!2ses!4v1543527954048" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>   
    </div>

<style>.map{text-align: center; width: 100%;}
.map iframe{width: 100%;}</style>

3: Save

4: Go to post where you want to use the Map and just call [MAP]Barcelona Map[/MAP]
 
just call [MAP]Barcelona Map[/MAP]
Ok just got it what you meant but it's not what I need sorry. What I'd like is to paste a map embed url or a map url like this

https://www.google.it/maps/place/Four+Points+by+Sheraton+Milan+Center/@45.484962,9.1960823,17z/data=!4m6!3m5!1s0x4786c6ce188a5b8f:0xeee4d6ca75b1c355!4b1!8m2!3d45.484962!4d9.198271

and have it rendered as a map on the message... The link can change obviously
 
Add this iframe for "Four Points by Sheraton Milan Center"

Code:
<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d2797.2474275521736!2d9.1960823!3d45.484962!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4786c6ce188a5b8f%3A0xeee4d6ca75b1c355!2sFour+Points+by+Sheraton+Milan+Center!5e0!3m2!1ses!2ses!4v1543529763215" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
 
Check the place you tell me showing as a map:

 
Sorry for my bad english adnanbcn. I don't want to create a BBCode that hold just a single place but a BBCode that show a map using the parameters in the url pasted in a message.
 
Top Bottom