Map Shortcode Parameters

This article covers version settings and creating and publishing your first map with WP Google Maps (Basic) and WP Google Maps Pro Add-on. This documentation is current for WP Google Maps version 6.

 

 

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, see WordPress Dashboard → Maps.

 

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="2" displays the Map with ID “2”.

 

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:

wpgmza id="2" mashup=true mashup_ids="2,3" parent_id="2"

 

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.

 

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 WordPress Dashboard → Maps → Categories.

 

To restrict your map to only the Wildlife Refuges category, add the Category ID (1 in this example above)  to your shortcode as follows: wpgmza id=’1′ cat=’1’. Only the markers that have the Wildlife Refuges 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 (MapsEdit → Scroll down to your Marker Listing).

Zoom

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

 

For example: wpgmza id='1' marker='5' zoom='13'

 

Enable/Disable Directions

Suppose you’ve enabled directions for a Map using the WP Google 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.

 

wpgmza id=’1’ enable_directions=’1’

 

Enable/Disable the Category Filter

Suppose you’ve enabled a Category filter for a Map using the WP Google 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.

 

wpgmza id=’1’ enable_category=’1’

 

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 Google 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.

wpgzma id='1' new_window_link='yes'

 

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:

 

wpgmza_vgm_form link_to_map="Page ID" redirect_to="Page Link"

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)

 

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"

 

 


 

This article covered Map Shortcode Parameters for the  WP Google Maps plugin. If you need further assistance, feel free to post on our Support Forums or visit our Support Desk.

 

Was this article helpful to you?