Shortcode: [cspm_route_map]


This shortcode will connect multiple posts with a route.

When used with less than 23 post, the map will use the first post in the attribute post_ids as the route starting point and will use the last post as the end of the route. The other posts in between will be used as waypoints. In this case, the map will attempt to re-order the supplied intermediate waypoints to minimize overall cost of the route.

Because of Google Maps usage limits and when supplying more that 23 posts, the map will display the route between a post and the one that follows it respecting the order in the shortcode attribute post_ids. The overall cost of the route will not be minimized!

The settings of this map can be set from the menus (Progress Map / Default map settings), (Progress Map / Default map style settings) & (Progress Map / Default infobox settings)!

The shortcode [cspm_route_map] was introduced in version 3.6 and it supports the following parameters:


post_ids (required)

At least two post IDs.

Example 1: [cspm_route_map post_ids="1,5"]

Example 2: [cspm_route_map post_ids="1,2,3,4,5"]


travel_mode (optional)

Type of routing requested. Possible values are DRIVING, BICYCLING, TRANSIT & WALKING. Default to DRIVING.

Example: [cspm_route_map post_ids="1,5" travel_mode="BICYCLING"]


center_at (optional)

The center point of the map. Enter the Latitude & Longitude of the center point or enter the ID of the post on which the map will be centered.

If multiple post ids were passed to the attribute post_ids and center_at is not defined, the plugin will center the map on the position of the first post in the attribute post_ids.

Example 1: [cspm_route_map center_at="51.510879,-0.117813"]

Example 2: [cspm_route_map post_ids="1,2,3,4,5" center_at="1"]


zoom (optional)

Define the zoom of the map (from 0 to 19).

Example: [cspm_route_map zoom="13"]


show_overlay (optional)

Show/Hide the marker overlays (infoboxes). Possible values are yes (show) and no (hide).

Example: [cspm_route_map show_overlay="no"]


width (optional)

The width of the map in pixels or in %.

Example 1: [cspm_route_map width="100%"]

Example 2: [cspm_route_map width="500px"]


height (optional)

The height of the map in pixels or in %.

Example 1: [cspm_route_map height="100%"]

Example 2: [cspm_route_map height="500px"]


show_secondary (optional)

Show/Hide the secondary markers added to a post. Possible values ar, yes or no. Defaults to yes.

Example: [cspm_route_map show_secondary="yes"]


map_style (optional)

The skin of the map. To get the style name, follow these steps:

  1. Click on the menu “Progress Map”. Wait for the page to load!
  2. Click on the menu “Default Map style settings”
  3. Click the link “Demo” next to the style you like. A new page/window will open, the URL of that page/window holds the style name as the last attribute. So if the URL looks like http://snazzymaps.com/style/42/apple-maps-esque, the style name will be apple-maps-esque.

Example: [cspm_route_map map_style="apple-maps-esque"]


initial_map_style (optional)

The initial style of the map. Possible values are ROADMAP, SATELLITETERRAINHYBRIDcustom_style.

Example: [cspm_route_map initial_map_style="TERRAIN"]


infobox_type (optional)

Override the default infobox type. Possible values are, square_bubblerounded_bubble, cspm_type1, cspm_type2cspm_type3 and cspm_type4.

Example: [cspm_route_map infobox_type="cspm_type1"]


window_resize (optional)

Detect browser window resize and recenter the map. Possible values are yes and no.

Example: [cspm_route_map window_resize="no"]


hide_empty

Whether to hide the map when the post to display on it doesn’t have coordinates or to show an empty map. Possible values are yes or no. Defaults to yes.

Example: [cspm_route_map hide_empty="no"]


infobox_link_target

Specify where to open the infobox link. Possible values are same_windownew_window, popup or disable.

Example: [cspm_route_map infobox_link_target="disable"]


route_color

Provide a hex color to change the route color (e.g. “#ff0000”).

Example: [cspm_route_map route_color="#ff0000"]


route_weight

Change the weight of the route.

Example: [cspm_route_map route_weight="10"]


route_opacity

change the opacity of the route. Possible values are “0”, “0.1”, “0.2”, …, “0.9” and “1”.

Example: [cspm_route_map route_opacity="0.8"]


In the same context