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
travel_mode
center_at
zoom
show_overlay
width
height
show_secondary
map_style
initial_map_style
infobox_type
infobox_link_target
route_color
route_weight
route_opacity
hide_empty
window_resize
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"]
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"]
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"]
Define the zoom of the map (from 0
to 19
).
Example: [cspm_route_map zoom="13"]
Show/Hide the marker overlays (infoboxes). Possible values are yes
(show) and no
(hide).
Example: [cspm_route_map show_overlay="no"]
The width of the map in pixels or in %.
Example 1: [cspm_route_map width="100%"]
Example 2: [cspm_route_map width="500px"]
The height of the map in pixels or in %.
Example 1: [cspm_route_map height="100%"]
Example 2: [cspm_route_map height="500px"]
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"]
The skin of the map. To get the style name, follow these steps:
- Click on the menu “Progress Map”. Wait for the page to load!
- Click on the menu “Default Map style settings”
- 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 beapple-maps-esque
.
Example: [cspm_route_map map_style="apple-maps-esque"]
The initial style of the map. Possible values are ROADMAP
, SATELLITE
, TERRAIN
, HYBRID
, custom_style
.
Example: [cspm_route_map initial_map_style="TERRAIN"]
Override the default infobox type. Possible values are, square_bubble
, rounded_bubble
, cspm_type1
, cspm_type2
, cspm_type3
and cspm_type4
.
Example: [cspm_route_map infobox_type="cspm_type1"]
Detect browser window resize and recenter the map. Possible values are yes
and no
.
Example: [cspm_route_map window_resize="no"]
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"]
Specify where to open the infobox link. Possible values are same_window
, new_window
, popup
or disable
.
Example: [cspm_route_map infobox_link_target="disable"]
Provide a hex color to change the route color (e.g. “#ff0000”).
Example: [cspm_route_map route_color="#ff0000"]
Change the weight of the route.
Example: [cspm_route_map route_weight="10"]
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"]