Generate: Shortcodes: Google Map

The Google Map shortcode inserts a Google Road Map, Satellite Map, Driving Directions or Street View into the content, depending on the shortcode’s parameters.

To understand whether you need to define a Google Maps API key in the Plugin’s Settings and setup billing, refer to the below table:

Map Type Requires API Key Requires Billing Setup on Google
Road Map No No
Satellite Map No No
Directions Yes Yes (see: https://developers.google.com/maps/documentation/embed/usage-and-billing#pricing-for-the-maps-embed-api, section “SKU: Embed Advanced”)
Street View Yes Yes (see: https://developers.google.com/maps/documentation/embed/usage-and-billing#pricing-for-the-maps-embed-api, section “SKU: Embed Advanced”)

To add a Google Map:

  • Click the Google Map marker icon in the Visual Editor toolbar:
    Page Generator Pro: Generate: Shortcodes: TinyMCE Toolbar Button
  • Choose the Map Type from the dropdown in the modal window:
    Page Generator Pro: Shortcodes: Google Maps

Depending on the Map Type chosen, the following options are available.

Road Map

  • Location: Enter the city and country (or keyword, if you have one that has keyword data comprising of cities and/or countries).
  • Term: Optional. If specified, will plot matching businesses in the given location.  For example, to display Restaurants, you would enter Restaurants as the Term.
  • Height: The height of the Google Map, in pixels.
  • Zoom Level: Choose a zoom level for the Map.  A higher number means the map will be more zoomed in.

A shortcode will then appear within the content:
[page-generator-pro-google-map maptype="roadmap" location="{city}, UK" term="{service}" height="250" zoom="14"]

Parameter Accepted Value Description
maptype roadmap The map type to display
location string or keyword The location to display the marker on the map.  This should include a country, for example {city}, UK
term string or keyword Optional service to plot on the map. For example, restaurant would display a marker showing the nearest restaurant to the given location.
height integer The height of the map, in pixels.  Width is always 100%
zoom 0 to 21 The zoom level of the map.  A higher number means more detail

Satellite

  • Location: Enter the city and country (or keyword, if you have one that has keyword data comprising of cities and/or countries).
  • Term: Optional. If specified, will plot matching businesses in the given location.  For example, to display Restaurants, you would enter Restaurants as the Term.
  • Height: The height of the Google Map, in pixels.
  • Zoom Level: Choose a zoom level for the Map.  A higher number means the map will be more zoomed in.

A shortcode will then appear within the content:
[page-generator-pro-google-map maptype="satellite" location="{city}, UK" term="{service}" height="250" zoom="14"]

Parameter Accepted Value Description
maptype satellite The map type to display
location string or keyword The location to display the marker on the map.  This should include a country, for example {city}, UK
term string or keyword Optional service to plot on the map. For example, restaurant would display a marker showing the nearest restaurant to the given location.
height integer The height of the map, in pixels.  Width is always 100%
zoom 0 to 21 The zoom level of the map.  A higher number means more detail

Driving Directions

  • Location: Enter the starting zip code or city (or keyword, if you have one that has keyword data comprising of zip codes and/or cities).
  • Destination: Enter the destination zip code or city.
  • Height: The height of the Google Map, in pixels.
  • Zoom Level: Choose a zoom level for the Map.  A higher number means the map will be more zoomed in.

A shortcode will then appear within the content:
[page-generator-pro-google-map maptype="directions" location="{city}, UK" destination="B1 2JB" height="250" zoom="14"]

Parameter Accepted Value Description
maptype roadmap The map type to display
location string or keyword The location to display the marker on the map.  This should include a country, for example {city}, UK
destination string or keyword The destination
height integer The height of the map, in pixels.  Width is always 100%
zoom 0 to 21 The zoom level of the map.  A higher number means more detail

Street View

  • Location: Enter the zip code and/or address (or keyword, if you have one that has keyword data comprising of zip codes and/or addresses).
  • Country: Select the country the Location above belongs to.
  • Height: The height of the Google Map, in pixels.
  • Zoom Level: Choose a zoom level for the Map.  A higher number means the map will be more zoomed in.

A shortcode will then appear within the content:
[page-generator-pro-google-map maptype="streetview" location="{city}" country_code="GB" height="250" zoom="14"]

Parameter Accepted Value Description
maptype streetview The map type to display
location string or keyword The street view location. Either a zip code or address.
country_code string or keyword The two character country code for the location above.
height integer The height of the map, in pixels.  Width is always 100%
zoom 0 to 21 The zoom level of the map.  A higher number means more detail
Shortcode not working? Your location might need to comprise of both a city / town and country.