BBcode GoogleMap

Get help developing custom BBCodes or request one.
Mirrabeau
Registered User
Posts: 17
Joined: Tue Oct 05, 2021 2:27 pm

BBcode GoogleMap

Post by Mirrabeau »

A very simple way to embed GoogleMaps in posts via bbcode:

The TEXT surrounded by the code can be a very simple "place name, city" or "address, city"
(you can add the ",country" also to ensure a more accurate result)

Structure:

Code: Select all

[gmap]{TEXT}[/gmap]

Code:

Code: Select all

<iframe
  width="600"
  height="450"
  style="border:0;box-shadow:10px 10px 12px;"
  loading="lazy"
  referrerpolicy="origin"
  allowfullscreen
  src="https://www.google.com/maps/embed/v1/place?key=AIzaSyAEebWj_kc56BzDL24REvMpvPrz16BKKSA
    &q={TEXT}">
</iframe><br/><br/>
<noframes><a href="https://google.com/maps/search/{TEXT}">{TEXT}</a></noframes>
Note: Some browser or security settings do not allow frames so I added the old <noframes> option displaying a link to google maps.

Help:

Code: Select all

Select the most precise address possible: 'Name, City, Country'
Or a sufficiently unique place name
Icon:
gmap.png
(not the best quality, feel free to improve and share :) )

Result:
Capture d’écran 2025-04-12 à 09.11.32.png
Enjoy.
You do not have the required permissions to view the files attached to this post.
User avatar
Gumboots
Registered User
Posts: 968
Joined: Fri Oct 11, 2019 1:59 am

Re: BBcode GoogleMap

Post by Gumboots »

Nice one. There are a couple of things I'd probably do:
1/ Leave the border and box-shadow out of the tag, and let styles handle that in their CSS.
2/ Add max-width: 100%; to prevent the iframe overflowing the post on phones.
🇺🇦 Слава Україні! 🇺🇦 Героям слава! 🇺🇦

Return to “Custom BBCode Development and Requests”