Legacy (OIder) Layout (v9)
Map Features

Shortcodes

18min

Overview

This section covers how to display maps on the front end, using shortcodes instead of Gutenberg blocks. Shortcodes can be used to displayed maps as configured in the Map editor, or addional parameters can be included to modify certain aspects of how the maps are displayed

Prerequisites

The Following Plugin/s need to be installed and active

  • WP Go Maps
  • WP Go Maps Pro add-on

Sections

Default Shortcode

To add your Map to a page on your website, you will need to add the Map shortcode to your WordPress Post or Page. To find the Map shortcode, please see the shortcode listed against the corresponding map record on the maps page.

WP Go Maps -> Maps

Locating your map shortcode
Locating your map shortcode
๏ปฟ

You can copy and paste the shortcode shown to the far right in the list of your Maps on the Post or Page where you want to display your Map. The shortcode framed in redย wpgmza id="1"ย displays the Map with ID โ€œ1โ€.

Text
๏ปฟ

Map Mashup

Aย Map Mashupย allows you to join multiple maps into one map. Your shortcode for aย Map Mashupย will look something like this:

Text
๏ปฟ

You will need to use the shortcode parameters below to create yourย Map Mashup:

  • ID:ย The ID parameter is the ID of the Main Map (This MUST be the same as theย parent_idย โ€“ so in the example above โ€œ2โ€
  • Mashup:ย Set as true to indicate you that you would like this map to be a mashup.
  • Mashup IDs:ย Include the IDs of all Maps you want to โ€œmashupโ€ in a comma-separated list.
  • Parent ID:ย The parent_id identifies the specific map from which the map settings will be drawn for the Map Mashup. In this case, whatever color or size is set forย Map ID 2ย will be used for the Mashup Map.
Mashup example
Mashup example
๏ปฟ

Category Usage

Suppose you only want to show a certain marker category on your map. You need to make sure that the Category exists and that the Category ID is correct. See:

WP Go Maps -> Categories

Restricting categories
Restricting categories
๏ปฟ

To restrict your map to only the Europe category, add theย Category IDย (6 in this example above) ย to your shortcode as follows:

Text
๏ปฟ

ย Only the markers that have the Europe category will be displayed on the Map.

Focus on a Specific Marker (at a Specific Zoom Level)

This can be achievedย by adding the following parameters to your Map shortcode:

Marker

Accepts the Marker ID (number) you want to reference. You can find the Marker ID in your Marker Listing

WP Go Maps -> Maps (edit your chosen map) -> Markers (scroll to the bottom of the page where existing markers are listed)

Zoom

The zoom level you want for the Map. This is a number between 1 and 21.

For example:ย 

Text
๏ปฟ
Marker and Zoom arugments
Marker and Zoom arugments
๏ปฟ

Enable/Disable Directions

Suppose youโ€ve enabled directions for a Map using the WP Go Maps Dashboard interface, but need to use the Map without directions on a specific Post or Page. Simply include the enable_directions parameter in your shortcode. enable_directions="1" will enable and enable_directions="0" will disable directions.

Text
๏ปฟ

Enable/Disable the Category Filter

Suppose youโ€™ve enabled a Category filter for a Map using the WP Go Maps Dashboard interface, but need to use the Map without the filter on a specific Post or Page. Simply include the enable_category parameter in your shortcode. enable_category="1" will enable and enable_category="0" will disable the category filters.

Text
๏ปฟ

Override โ€˜Opening InfoWindow Links in a New Tabโ€™ Setting

If youโ€ve enabled opening InfoWindow links for a Map in a new tab/window using the WP Go Maps Dashboard interface, but need to change that setting on a specific Post or Page, you can simply include the new_window_link parameter in your shortcode. new_window_link="yes" will enable and new_window_link="no" will disable the link opening in a new window.

Text
๏ปฟ

Separate Visitor-Generated Markers Form from Map

If youโ€d like to have your Visitor-Generated Marker form appear on a separate page from your Map, you can use the wpgmza_vgm_form link_to_map="1" shortcode. Please note, however, that his shortcode requires the Visitor Generated Markers Addon.๏ปฟ

Paste the following shortcode on the page where you want the VGM form:

Text
๏ปฟ

wpgmza_vgm_form link_to_map โ€“ The map ID youโ€d like your markers to be added to. (Required) redirect_toย โ€“ The url of the page where the visitor will be redirected to, after adding the marker. (Optional)

Inserting the VGM form
Inserting the VGM form
๏ปฟ

If theย redirect_toย attribute directs to the map where the marker was added, remove the VGM form on that page by adding the following attribute to the map shortcode disable_vgm_form="1"

Text
๏ปฟ