Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Shortcode Gmap

Security covered Under active development 23 sites

Part of the Shortcode ecosystem · 4 projects

This module allows you to easily embed Google Maps or links to Google Maps within your Drupal content. It uses shortcodes to specify map details like address, zoom level, and map type.

This module provides the simplest way to get a Google Map, or a link to a Google Map, displayed with your content — by address, lat,lng, or a Google Maps URL copied straight from your browser's address bar.

Requirements

  • Shortcode contrib project (3.0.x)
  • PHP 8.3+, Drupal 11.1+ or 12.x
  • Configure your input format to allow the gmap shortcode macro

Configuration

If your input format has "Convert URLs into links" enabled, it must run AFTER the
Shortcodes filter, not before. If it runs first it rewrites the address/URL you pasted before the gmap shortcode ever sees it, which can break a pasted Google Maps URL and produce a blank or wrong embedded map.

Usage

Additional parameters

Allowed parameters listed there with the default values.

  • include_map (TRUE)
  • include_link (FALSE)
  • include_text (FALSE)
  • width (100%)
  • height (300) – In pixel.
  • address ('') – ignored if the shortcode has enclosed text; the enclosed text is used
  • as the address instead.
  • zoom (19) – value from 1 (minimal) to 20 (maximal). Overrides any zoom derived from a
  • pasted Google Maps URL, see below.
  • information_bubble (TRUE)
  • link_text (t('View larger map'))
  • address_text ('') – see below for how this is derived when the address is a Google
  • Maps URL.
  • map_type (m) – The map type can be "k" or "satellite", "h" or "hybrid", "p" or
  • "terrain" and "m" as standard
  • langcode ('')
  • url_suffix ('')

Pasting a Google Maps URL

Copying the URL from your browser's address bar while viewing a place on Google Maps and pasting it as the shortcode's content is supported directly, e.g.:

[gmap]https://www.google.com/maps/place/Some+Place/@46.0659034,18.3201822,104m/data=!3m1!1e3!...[/gmap]

The raw URL is never sent to Google's map embed as-is (Google can't render its
data=!3m1!... blob, and shows "Some customised on-map content could not be displayed" if you try).

Instead the module extracts:

  • the @lat,lng pair, used as the map location
  • the place name (e.g. "Some Place"), used for address_text/the map's title when no explicit address_text is given; left blank if the URL has no place name
  • the zoom/altitude segment, converted to an approximate zoom level (a best-effort conversion, since Google doesn't document this relationship); an explicit zoom attribute always overrides it

Not supported: shortened share links (maps.app.goo.gl/..., goo.gl/maps/...) — expand the link in your browser first and copy the full address-bar URL instead. Also not supported: the

HTML generated by Google Maps' own "Share > Embed a map" feature — use the address-bar URL, not that embed code.

Credits

This module was inspired and based on the Simple Google Maps module by Jennifer Hodgdon.
Drupal 11 · not 10

Ask your assistant about Shortcode Gmap

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Sep 2026
Latest release
1 month ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
3.0.1 Stable 11 Sep 18, 2026
3.0.0 Stable Sep 17, 2026
3.0.x-dev Dev Sep 16, 2026